Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

admin page can now sort published by kudos

  • Loading branch information...
commit fce02e7f86a7515968b1a74845fb4d33dd818bc5 1 parent fe98d4f
@masukomi authored
View
7 app/controllers/posts_controller.rb
@@ -90,8 +90,13 @@ def admin
@placeholder_post = Post.new
#todo re-implement the paging mongoid style
all_published = nil
+ booleanify_params(params)
unless params[:tag]
- all_published = Post.where(:draft=>false, :page=>false).order_by(:posted_at=>:desc).entries
+ if (not params[:by_kudos])
+ all_published = Post.where(:draft=>false, :page=>false).order_by(:posted_at=>:desc).entries
+ else
+ all_published = Post.loved.entries
+ end
else
all_published = Post.any_in({:tags_array => [params[:tag]]}).descending(:posted_at).entries
#BUG, this will currently include static pages
View
6 app/views/posts/admin.html.haml
@@ -21,7 +21,11 @@
#published
%h1
Published
- = link_to 'Home', root_url, :class => 'button'
+ %div
+ Show
+ =link_to("the loved", '/admin/?by_kudos=true')
+ \/
+ =link_to("all", '/admin/')
.tags_list
-if @tags.size > 0
%ul.tags_list
Please sign in to comment.
Something went wrong with that request. Please try again.