Skip to content

Commit 439b11c

Browse files
authored
Merge pull request #581 from coopdevs/post_id_report
Add post ID to offers/inquiries reports
2 parents 640cd29 + 9079c42 commit 439b11c

13 files changed

+46
-52
lines changed

app/decorators/post_report_decorator.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def name(extension)
1414

1515
def headers
1616
[
17+
"",
1718
@type.model_name.human,
1819
User.model_name.human
1920
]
@@ -23,10 +24,11 @@ def rows
2324
grouped_rows = []
2425

2526
@collection.each do |category, posts|
26-
grouped_rows << [category.try(:name) || "-", ""]
27+
grouped_rows << ["", category.try(:name) || "-", ""]
2728

2829
posts.each do |post|
2930
grouped_rows << [
31+
post.id,
3032
post.title,
3133
"#{post.user} (#{post.member_uid})"
3234
]

app/views/application/_navbar.html.erb

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,31 @@
5252
<div class="row">
5353
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
5454
<ul class="nav nav-pills actions-menu">
55-
<%= render 'application/menus/user_list_link' %>
56-
<%= render 'application/menus/offers_list_link' %>
57-
<%= render 'application/menus/inquiries_list_link' %>
55+
<li class="<%= "active" if current_page?(users_path) %>">
56+
<%= link_to users_path do %>
57+
<%= glyph :user %>
58+
<%= t("users.index.members") %>
59+
<% end %>
60+
</li>
61+
<li class="<%= "active" if current_page?(offers_path) %>">
62+
<%= link_to offers_path do %>
63+
<%= glyph :offer %>
64+
<%= Offer.model_name.human(count: :many) %>
65+
<% end %>
66+
</li>
67+
<li class="<%= "active" if current_page?(inquiries_path) %>">
68+
<%= link_to inquiries_path do %>
69+
<%= glyph :inquiry %>
70+
<%= Inquiry.model_name.human(count: :many) %>
71+
<% end %>
72+
</li>
5873
<% if current_user.manages? current_organization %>
59-
<%= render 'application/menus/offers_by_tag_link' %>
74+
<li class="<%= "active" if current_page?(alpha_grouped_index_tags_path(post_type: "offer")) %>">
75+
<%= link_to alpha_grouped_index_tags_path(post_type: "offer") do %>
76+
<%= glyph :tags %>
77+
<%= t ".tags" %>
78+
<% end %>
79+
</li>
6080
<%= render 'application/menus/organization_reports_menu' %>
6181
<%= render 'application/menus/organization_statistics_menu' %>
6282
<%= render 'application/menus/organization_listings_menu' %>

app/views/application/menus/_inquiries_list_link.html.erb

Lines changed: 0 additions & 6 deletions
This file was deleted.

app/views/application/menus/_offers_by_tag_link.html.erb

Lines changed: 0 additions & 6 deletions
This file was deleted.

app/views/application/menus/_offers_list_link.html.erb

Lines changed: 0 additions & 6 deletions
This file was deleted.

app/views/application/menus/_organization_switcher.html.erb

Lines changed: 0 additions & 11 deletions
This file was deleted.

app/views/application/menus/_user_admin_menu_items.html.erb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
<% if current_user.organizations.count > 1 %>
2-
<%= render 'application/menus/organization_switcher' %>
2+
<li class="disabled">
3+
<a href="#"><%= current_organization.name %></a>
4+
</li>
5+
<% (current_user.organizations - [current_organization]).each do |org| %>
6+
<li>
7+
<%= link_to set_current_organization_path(org), method: :post do %>
8+
<%= glyph(:retweet) %>
9+
<%= org.name %>
10+
<% end %>
11+
</li>
12+
<% end %>
13+
314
<li class="divider" role="presentation"></li>
415
<% end %>
516

app/views/application/menus/_user_list_link.html.erb

Lines changed: 0 additions & 6 deletions
This file was deleted.

app/views/inquiries/index.js.erb

Lines changed: 0 additions & 2 deletions
This file was deleted.

app/views/offers/index.js.erb

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)