From 9d8ab5775f3a68325e2e37db182d3a5f7f4ac84b Mon Sep 17 00:00:00 2001 From: lachlanjc Date: Wed, 3 Jun 2015 07:59:28 -0400 Subject: [PATCH 1/3] Post list design updates --- .../components/posts/post_list.js.jsx | 24 ++++---- .../components/posts/post_list_item.js.jsx | 55 ++++++------------- .../components/posts/posts_index.js.jsx | 28 +++++----- .../components/story_timeline.js.jsx | 8 ++- .../components/ui/accordion.js.jsx | 4 +- .../javascripts/mixins/list_item_mixin.js.jsx | 4 +- app/assets/stylesheets/utilities/_type.scss | 8 +++ 7 files changed, 62 insertions(+), 69 deletions(-) diff --git a/app/assets/javascripts/components/posts/post_list.js.jsx b/app/assets/javascripts/components/posts/post_list.js.jsx index b11aa2bb3..bedf0ac94 100644 --- a/app/assets/javascripts/components/posts/post_list.js.jsx +++ b/app/assets/javascripts/components/posts/post_list.js.jsx @@ -10,10 +10,8 @@ var PostList = React.createClass({ render: function() { return ( -
-
- {this.renderPosts()} -
+
+ {this.renderPosts()}
); }, @@ -24,15 +22,15 @@ var PostList = React.createClass({ if (!posts.length) { var product = ProductStore.getProduct().name; - return [ -

- There don't seem to be any posts here -

, - -

- {"Blog posts by " + product + "'s partners will appear here just as soon as they're written."} -

- ]; + return ( +
+
+ +
+

No posts here...yet!

+

{"Blog posts by " + ProductStore.getProduct().name + "'s partners will appear here as soon as they're written."}

+
+ ); } return _.map(posts, function(post) { diff --git a/app/assets/javascripts/components/posts/post_list_item.js.jsx b/app/assets/javascripts/components/posts/post_list_item.js.jsx index 08aa335a9..03490892e 100644 --- a/app/assets/javascripts/components/posts/post_list_item.js.jsx +++ b/app/assets/javascripts/components/posts/post_list_item.js.jsx @@ -28,21 +28,31 @@ var PostListIem = React.createClass({ render: function() { var post = this.props.post; + var user = post.user; return (
-
- {this.renderTitle()} +
+ + {post.title} + +

+ written {moment(post.created_at).fromNow()} by @{user.username} +

+ {this.renderSummary()}
-
- - {this.renderComments(post.comments_count)} +
+
+
+ +
+ {this.renderComments(post.comments_count)} +
{this.renderTags(post.marks)}
- {this.renderLove(this.props.post.news_feed_item_id)} - {this.renderUser()} + {this.renderModal()}
@@ -71,40 +81,11 @@ var PostListIem = React.createClass({ if (post.summary) { return ( -
+
{post.summary}
); } - }, - - renderTitle: function() { - var post = this.props.post; - - return ( - - ); - }, - - renderUser: function() { - var post = this.props.post; - var user = post.user; - - return ( -
-
- -
- -
- @{user.username} wrote this post {moment(post.created_at).fromNow()} -
-
- ); } }); diff --git a/app/assets/javascripts/components/posts/posts_index.js.jsx b/app/assets/javascripts/components/posts/posts_index.js.jsx index 8a210128e..88922564a 100644 --- a/app/assets/javascripts/components/posts/posts_index.js.jsx +++ b/app/assets/javascripts/components/posts/posts_index.js.jsx @@ -67,11 +67,11 @@ var PostsIndex = React.createClass({
- + -
{/*Filters*/} +
{/*Filters*/} -
    +
      {this.renderFilters()}
    @@ -84,7 +84,7 @@ var PostsIndex = React.createClass({
-
+
{this.state.loading ? : }
@@ -94,23 +94,25 @@ var PostsIndex = React.createClass({ renderFilters: function() { var path = window.location.pathname; + var filterItemClasses = "block py2 px3 lh1 rounded bg-darken-1-hover"; return [ -
  • - - all posts +
  • + + all posts
  • , -
  • - - announcements +
  • + + announcements
  • , -
  • - - archived posts +
  • + + archived posts +>>>>>>> Stashed changes
  • ]; diff --git a/app/assets/javascripts/components/story_timeline.js.jsx b/app/assets/javascripts/components/story_timeline.js.jsx index 0576435bd..65b6fdd82 100644 --- a/app/assets/javascripts/components/story_timeline.js.jsx +++ b/app/assets/javascripts/components/story_timeline.js.jsx @@ -69,8 +69,12 @@ const StoryTimeline = React.createClass({
    Activity Minifeed
    -
    - No activity to show +
    +
    + +
    + +

    No activity to show yet

    ) diff --git a/app/assets/javascripts/components/ui/accordion.js.jsx b/app/assets/javascripts/components/ui/accordion.js.jsx index f096f4947..2ce8bd1bd 100644 --- a/app/assets/javascripts/components/ui/accordion.js.jsx +++ b/app/assets/javascripts/components/ui/accordion.js.jsx @@ -18,7 +18,7 @@ const Accordion = React.createClass({ chevron = null if (this.state.open) { - content =
    {this.props.children}
    + content = this.props.children } if (this.state.open) { @@ -29,7 +29,7 @@ const Accordion = React.createClass({ return (
    - +
    {chevron}
    diff --git a/app/assets/javascripts/mixins/list_item_mixin.js.jsx b/app/assets/javascripts/mixins/list_item_mixin.js.jsx index 59ecd452d..146c51e97 100644 --- a/app/assets/javascripts/mixins/list_item_mixin.js.jsx +++ b/app/assets/javascripts/mixins/list_item_mixin.js.jsx @@ -33,8 +33,8 @@ var ListItemMixin = { return tags.map(function(tag) { return ( -
    - + #{tag.name} ) }); diff --git a/app/assets/stylesheets/utilities/_type.scss b/app/assets/stylesheets/utilities/_type.scss index 18cbec78e..575962a92 100644 --- a/app/assets/stylesheets/utilities/_type.scss +++ b/app/assets/stylesheets/utilities/_type.scss @@ -37,6 +37,14 @@ font-size: 1rem; } +.light { + font-weight: 300; +} + +.lh1 { + line-height: 1rem; +} + .ellipsis { text-overflow: ellipsis; } From 8e7a7cda251e323329eb19f6d584d32719a93f92 Mon Sep 17 00:00:00 2001 From: lachlanjc Date: Wed, 3 Jun 2015 19:21:55 -0400 Subject: [PATCH 2/3] Remove git barf --- app/assets/javascripts/components/posts/posts_index.js.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/app/assets/javascripts/components/posts/posts_index.js.jsx b/app/assets/javascripts/components/posts/posts_index.js.jsx index 88922564a..5ff6e96bd 100644 --- a/app/assets/javascripts/components/posts/posts_index.js.jsx +++ b/app/assets/javascripts/components/posts/posts_index.js.jsx @@ -112,7 +112,6 @@ var PostsIndex = React.createClass({
  • archived posts ->>>>>>> Stashed changes
  • ]; From 7368260f6f43e3093d648bf4dde95ebe64e26fd3 Mon Sep 17 00:00:00 2001 From: lachlanjc Date: Wed, 3 Jun 2015 19:25:19 -0400 Subject: [PATCH 3/3] Remove renderLove function import --- app/assets/javascripts/components/posts/post_list_item.js.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/app/assets/javascripts/components/posts/post_list_item.js.jsx b/app/assets/javascripts/components/posts/post_list_item.js.jsx index 03490892e..157e6f07f 100644 --- a/app/assets/javascripts/components/posts/post_list_item.js.jsx +++ b/app/assets/javascripts/components/posts/post_list_item.js.jsx @@ -14,7 +14,6 @@ var PostListIem = React.createClass({ /** * ListItemMixin: this.onModalHidden() * this.renderComments({Number: count}) - * this.renderLove({String: news_feed_item_id}) * this.renderTags({[Object: tag]}) * this.showModal() */