Permalink
Please sign in to comment.
Browse files
remove story downvoting, add story hiding
stories should either be reported for spam (coming later), upvoted, or left alone rather than being downvoted for being uninteresting. since users don't like leaving uninteresting things alone, they can now hide stories from their view without affecting the story's score. hiding is implemented as a Vote with its vote set to 0 and the reason set to "H" add a /hidden url which shows all of a user's hidden stories while i'm here, simplify Vote guts and add some tests to make sure all the flip-flopping stuff works right
- Loading branch information...
Showing
with
206 additions
and 134 deletions.
- +28 −29 app/assets/javascripts/application.js.erb
- +6 −0 app/assets/stylesheets/application.css
- +26 −5 app/controllers/home_controller.rb
- +12 −9 app/controllers/stories_controller.rb
- +1 −34 app/models/story.rb
- +12 −35 app/models/vote.rb
- +6 −7 app/views/home/index.html.erb
- +13 −14 app/views/stories/_listdetail.html.erb
- +4 −1 config/routes.rb
- +98 −0 spec/models/vote_spec.rb
| @@ -1,21 +1,20 @@ | ||
| <ol class="stories list"> | ||
| <ol class="stories list <%= @cur_url == "/hidden" ? "show_hidden" : "" %>"> | ||
| <%= render :partial => "stories/listdetail", :collection => @stories, | ||
| :as => :story %> | ||
| </ol> | ||
| <div class="morelink"> | ||
| <% if @page && @page > 1 %> | ||
| <a href="<%= @tag ? "/t/#{@tag.tag}" : (@newest ? "/newest" + | ||
| (@for_user ? "/#{@for_user}" : "") : "") %><%= @page == 2 ? "/" : | ||
| "/page/#{@page - 1}" %>"><< Page <%= @page - 1 %></a> | ||
| <a href="<%= @cur_url %><%= @cur_url == "/" ? "" : "/" %><%= | ||
| @page == 2 ? "" : "page/#{@page - 1}" %>"><< Page | ||
| <%= @page - 1 %></a> | ||
| <% end %> | ||
| <% if @show_more %> | ||
| <% if @page && @page > 1 %> | ||
| | | ||
| <% end %> | ||
| <a href="<%= @tag ? "/t/#{@tag.tag}" : (@newest ? "/newest" + | ||
| (@for_user ? "/#{@for_user}" : "") : "") %>/page/<%= @page + 1 %>">Page | ||
| <%= @page + 1 %> >></a> | ||
| <a href="<%= @cur_url %><%= @cur_url == "/" ? "" : "/" %>page/<%= | ||
| @page + 1 %>">Page <%= @page + 1 %> >></a> | ||
| <% end %> | ||
| </div> |
Oops, something went wrong.
0 comments on commit
9535b05