Commit 77295ffc authored by Jonne Haß's avatar Jonne Haß
Browse files

Merge pull request #6487 from svbergerem/move-reshare-count

Move reshare count
parents 7f70f411 e9350a57
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ With the port to Bootstrap 3, app/views/terms/default.haml has a new structure.
* Redesign and unify error pages [#6428](https://github.com/diaspora/diaspora/pull/6428)
* Redesign and refactor report admin interface [#6378](https://github.com/diaspora/diaspora/pull/6378)
* Add permalink icon to stream elements [#6457](https://github.com/diaspora/diaspora/pull/6457)
* Move reshare count to interactions for stream elements [#6487](https://github.com/diaspora/diaspora/pull/6487)

# 0.5.4.0

+9 −3
Original line number Diff line number Diff line
@@ -5,26 +5,32 @@ app.views.LikesInfo = app.views.Base.extend({
  templateName : "likes-info",

  events : {
    "click .expand_likes" : "showAvatars"
    "click .expand-likes" : "showAvatars"
  },

  tooltipSelector : ".avatar",

  initialize : function() {
    this.model.interactions.bind('change', this.render, this);
    this.displayAvatars = false;
  },

  presenter : function() {
    return _.extend(this.defaultPresenter(), {
      likes : this.model.interactions.likes.toJSON(),
      likesCount : this.model.interactions.likesCount(),
      likes_fetched : this.model.interactions.get("fetched"),
      displayAvatars : this.model.interactions.get("fetched") && this.displayAvatars
    });
  },

  showAvatars : function(evt){
    if(evt) { evt.preventDefault() }
    this.displayAvatars = true;
    if(!this.model.interactions.get("fetched")){
      this.model.interactions.fetch();
    } else {
      this.model.interactions.trigger("change");
    }
  }
});
// @license-end
+36 −0
Original line number Diff line number Diff line
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later

app.views.ResharesInfo = app.views.Base.extend({

  templateName : "reshares-info",

  events : {
    "click .expand-reshares" : "showAvatars"
  },

  tooltipSelector : ".avatar",

  initialize : function() {
    this.model.interactions.bind("change", this.render, this);
    this.displayAvatars = false;
  },

  presenter : function() {
    return _.extend(this.defaultPresenter(), {
      reshares : this.model.interactions.reshares.toJSON(),
      resharesCount : this.model.interactions.resharesCount(),
      displayAvatars : this.model.interactions.get("fetched") && this.displayAvatars
    });
  },

  showAvatars : function(evt){
    if(evt) { evt.preventDefault() }
    this.displayAvatars = true;
    if(!this.model.interactions.get("fetched")){
      this.model.interactions.fetch();
    } else {
      this.model.interactions.trigger("change");
    }
  }
});
// @license-end
+5 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ app.views.StreamPost = app.views.Post.extend({
  subviews : {
    ".feedback" : "feedbackView",
    ".likes" : "likesInfoView",
    ".reshares" : "resharesInfoView",
    ".comments" : "commentStreamView",
    ".post-content" : "postContentView",
    ".oembed" : "oEmbedView",
@@ -55,6 +56,10 @@ app.views.StreamPost = app.views.Post.extend({
    return new app.views.LikesInfo({model : this.model});
  },

  resharesInfoView : function(){
    return new app.views.ResharesInfo({model : this.model});
  },

  feedbackView : function(){
    if(!app.currentUser.authenticated()) { return null }
    return new app.views.Feedback({model : this.model});
+34 −25
Original line number Diff line number Diff line
@@ -65,31 +65,6 @@
      font-size: $font-size-small;
      line-height: $font-size-small;
    }
    .likes {
      margin-top: 10px;
      font-size: 12px;
      line-height: 16px;
      .author-name, .bd { display: inline-block; }
      .author-name { margin-right: 3px; }
      .entypo-heart {
        display: inline-block;
        font-size: 16px;
        vertical-align: top;
        margin-top: -2px;
        margin-right: 5px;
      }
    }
    .stream_photo {
      float: left;
      margin-top: 6px;
    }
    .status-message-location {
      font-size: $font-size-small;
      color: $text-grey;
    }
    .leaflet-control-zoom {
      display: block;
    }
    .post-content p:last-of-type { margin-bottom: 0; }
    .nsfw-shield {
      color: $text-grey;
@@ -158,3 +133,37 @@
    border: 1px solid $brand-primary;
  }
}

.stream_element {
  .likes,
  .reshares {
    font-size: 12px;
    line-height: 16px;
    margin-top: 10px;

    .author-name,
    .bd {
      display: inline-block;
    }

    .author-name { margin-right: 3px; }

    .entypo-heart,
    .entypo-reshare {
      display: inline-block;
      font-size: 16px;
      line-height: $line-height-computed;
      margin-right: 5px;
      vertical-align: top;
    }
  }

  .status-message-location {
    color: $text-grey;
    font-size: $font-size-small;
  }

  .leaflet-control-zoom {
    display: block;
  }
}
Loading