Unverified Commit eae9e01f authored by Steffen van Bergerem's avatar Steffen van Bergerem
Browse files

Add 'no posts yet' message to empty streams

parent 23d8af9e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ app.views.InfScroll = app.views.Base.extend({
    this.showLoader();
    this.bind("loadMore", this.fetchAndshowLoader, this);
    this.stream.bind("fetched", this.finishedLoading, this);
    this.stream.bind("allItemsLoaded", this.showNoPostsInfo, this);
    this.stream.bind("allItemsLoaded", this.unbindInfScroll, this);

    this.collection.bind("add", this.addPostView, this);
@@ -50,6 +51,13 @@ app.views.InfScroll = app.views.Base.extend({
    }
  },

  showNoPostsInfo: function() {
    if (this.postViews.length === 0) {
      var noPostsInfo = new app.views.NoPostsInfo();
      this.$el.append(noPostsInfo.render().el);
    }
  },

  unbindInfScroll : function() {
    $(window).unbind("scroll");
  },
+3 −0
Original line number Diff line number Diff line
app.views.NoPostsInfo = app.views.Base.extend({
  templateName: "no_posts_info"
});
+5 −0
Original line number Diff line number Diff line
@@ -189,4 +189,9 @@
  .leaflet-control-zoom {
    display: block;
  }

  .no-posts-info {
    margin-bottom: 10px;
    margin-top: 10px;
  }
}
+5 −0
Original line number Diff line number Diff line
<div class="stream_element">
  <div class="no-posts-info text-center">
    <strong>{{ t "stream.no_posts_yet" }}</strong>
  </div>
</div>
+1 −0
Original line number Diff line number Diff line
@@ -236,6 +236,7 @@ en:
      disable_post_notifications: "Disable notifications for this post"
      permalink: "Permalink"
      via: "via <%= provider %>"
      no_posts_yet: "There are no posts yet."

      likes:
        zero: "<%= count %> Likes"
Loading