Skip to content

Commit

Permalink
Added counts to submissions#index to close #135 - somebody still need…
Browse files Browse the repository at this point in the history
…s to populate expired counts
  • Loading branch information
brzaik committed Jul 13, 2012
1 parent a36be0a commit 8a41e78
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
background: $grayLightest;
height: 100%;
padding: 4px 8px;
float: left;
line-height: normal;
border-left: solid 1px $grayLight;

Expand Down
1 change: 1 addition & 0 deletions app/controllers/submissions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def index
@approved_submissions = @feed.submissions.approved
if @can_moderate_feed
@pending_submissions = @feed.submissions.pending
@denied_submissions = @feed.submissions.denied
end
#brzNote: did appears to result in a redirect when it is uncommented:
#auth!
Expand Down
35 changes: 28 additions & 7 deletions app/views/submissions/_index_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
<h1 class="default-padding" id="contentlist">
<%= link_to "All Feeds", feeds_path, :remote => true %> &gt;
<% @feed.ancestors.reverse.each do |ancestor_feed| %>
<%= link_to ancestor_feed.name, feed_submissions_path(ancestor_feed), :remote => true %> &gt;
<% end %>
<%= @feed.name %>
</h1>
<div class="viewblock-header_right">
<div class="status-block">
<label>ACTIVE</label>
<span><%= @approved_submissions.count %></span>
</div>
<div class="status-block">
<label>PENDING</label>
<span><%= @pending_submissions.count %></span>
</div>
<div class="status-block">
<label>EXPIRED</label>
<span>##</span>
</div>
<div class="status-block">
<label>DENIED</label>
<span><%= @denied_submissions.count %></span>
</div>
</div>
<div class="default-padding">
<h1 id="contentlist">
<%= link_to "All Feeds", feeds_path, :remote => true %> &gt;
<% @feed.ancestors.reverse.each do |ancestor_feed| %>
<%= link_to ancestor_feed.name, feed_submissions_path(ancestor_feed), :remote => true %> &gt;
<% end %>
<%= @feed.name %>
</h1>
</div>

0 comments on commit 8a41e78

Please sign in to comment.