Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

start bookmarks

  • Loading branch information...
commit 52cc3e6308c4d10420a9011f00ee8f44e7ec8223 1 parent 8c88496
@releu releu authored
View
43 app/assets/stylesheets/styles.less
@@ -703,7 +703,6 @@ div#flash {
.new-post {
input[type="text"], textarea {
font-size: 14px;
- display: block;
.border-box;
width: 100%;
border: 1px solid @gray;
@@ -744,4 +743,46 @@ div#flash {
float: left;
padding: 5px 0;
line-height: 24px;
+}
+
+.bookmarks-search {
+ input {
+ font-size: 14px;
+ .border-box;
+ width: 100%;
+ border: 1px solid @gray;
+ .rounded-corners(2px);
+ padding: 5px;
+ color: @darkgray;
+ outline: none;
+ }
+}
+
+.bookmarks-tags {
+ margin: 10px 0 20px;
+ ul {
+ padding: 0;
+ margin: 0;
+ }
+ li {
+ list-style: none;
+ display: inline-block;
+ margin: 0 10px 5px 0;
+
+ a {
+ border-bottom: 1px dashed;
+
+ &.disabled {
+ color: @text;
+ }
+ }
+ }
+}
+.bookmarks-tags-show-all {
+ a {
+ text-transform: lowercase;
+ color: @text;
+ font-weight: bold;
+ border-bottom: 1px dashed;
+ }
}
View
8 app/controllers/posts_controller.rb
@@ -23,17 +23,13 @@ def flow
end
def bookmarks
- @posts = current_user.bookmarked_posts.page(params[:page])
+ @posts = current_user.bookmarked_posts
+ @tags = Tag.first(20) # @posts.tags_by_count
end
def show
@post = Post.find_by_param params[:id]
redirect_to(@post, status: 301) if params[:id] != @post.to_param
- if can? :create, :comments
- @comment = @post.comments.build do |c|
- c.user = current_user
- end
- end
@post.update_column(:page_views, @post.page_views + 1)
end
View
35 app/views/posts/bookmarks.html.slim
@@ -1,5 +1,32 @@
- window_title 'Bookmarks'
-section class="posts"
- header class="primary"
- h1 Bookmarks
- = render :partial => 'posts/index', :locals => { :posts => @posts }
+
+= render partial: 'posts/dynamic', locals: { posts: @posts }
+
+div class="row"
+ div class="left-column"
+ = render 'shared/profile'
+ = render 'shared/follow'
+
+ div class="right-column"
+ section class="bookmarks"
+ header
+ h1 Bookmarks
+
+ - if @posts.any?
+ div class="bookmarks-search"
+ input type="search" placeholder="Search in #{@posts.size} posts" autofocus="true"
+
+ nav class="bookmarks-tags"
+ ul
+ - @tags.first(10).each do |tag|
+ li = link_to tag.name, '#'
+ - if @tags.size > 10
+ li class="bookmarks-tags-show-all"
+ = link_to '#', title: 'Show all tags' do
+ i class="icon-double-angle-right"
+ - @tags.drop(10).each do |tag|
+ li class="hidden" = link_to tag.name, '#'
+ - @posts.each do |post|
+ p = post.title
+
+ div class="clear"
Please sign in to comment.
Something went wrong with that request. Please try again.