Permalink
Browse files

Issue 2876 view fulfilled claims on user page

  • Loading branch information...
1 parent 856468d commit 3cb81bdfb7629b1785a6690fb7a0ae6bb82fcad1 @cesy cesy committed Jan 29, 2012
@@ -87,6 +87,9 @@ def index
elsif params[:user_id] && (@user = User.find_by_login(params[:user_id]))
if current_user == @user
@claims = @user.request_claims.order_by_date.unposted
+ if params[:posted]
+ @claims = @user.request_claims.order_by_date.posted
+ end
if params[:collection_id] && (@collection = Collection.find_by_name(params[:collection_id]))
@claims = @claims.in_collection(@collection)
end
@@ -1,13 +1,27 @@
<div class="user home">
<h2 class="heading">Your Claims<% if @collection %> In <%= link_to(@collection.title, @collection) %><% end %></h2>
+ <% unless params[:for_user] %>
+ <ul class="navigation actions" role="navigation">
+ <% if params[:posted] %>
+ <li id="unposted-link">
+ <%= link_to(ts('See currently unfulfilled claims instead?'), user_claims_path(current_user)) %>
+ </li>
+ <% else %>
+ <li id="posted-link">
+ <%= link_to(ts('See previously posted claims instead?'), user_claims_path(current_user, :posted => true)) %>
+ </li>
+ <% end %>
+ </ul>
+ <% end %>
+
<%= will_paginate @claims %>
<ol class="index group">
- <% @claims.each do |claim| %>
- <%= render "prompts/prompt_blurb", :prompt => claim.request_prompt, :suppress_claims => true, :claim => claim %>
- <% end %>
+ <% @claims.each do |claim| %>
+ <%= render "prompts/prompt_blurb", :prompt => claim.request_prompt, :claim => claim, :suppress_claims => !params[:posted] %>
+ <% end %>
</ol>
@@ -430,6 +430,7 @@ Feature: Prompt Meme Challenge
When I fulfill my claim
When I am on my user page
And I follow "Claims"
+ And I follow "See previously posted claims instead"
Then I should see "Fulfilled Story"
# TODO: should I? It's not there at all
And I should not see "Not yet posted"

0 comments on commit 3cb81bd

Please sign in to comment.