]> git.openstreetmap.org Git - rails.git/blob - app/views/browse/changeset.html.erb
Added sortable headers + search + reportable Notes
[rails.git] / app / views / browse / changeset.html.erb
1 <% set_title(t('browse.changeset.title', :id => @changeset.id)) %>
2
3 <h2>
4   <a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
5   <% if @user and @user.id != @changeset.user.id %>
6     <div class="report-button">
7       <%= link_to new_issue_url(reportable_id: @changeset.id, reportable_type: @changeset.class.name, reported_user_id: @changeset.user.id), :title => t('browse.changeset.report') do %>
8         <%= image_tag('notice.png', size: '10x10') %>
9       <% end %>
10     </div>
11   <% end %>
12   <%= t('browse.changeset.title', :id => @changeset.id) %>
13 </h2>
14
15
16
17 <div class="browse-section">
18   <h4><%= linkify(h(@changeset.tags['comment'].to_s.presence || t('browse.no_comment'))) %></h4>
19   <div class="details"><%= changeset_details(@changeset) %></div>
20
21
22   <%= render :partial => "tag_details", :object => @changeset.tags.except('comment') %>
23
24   <h4 class="comments-header"><%= t('browse.changeset.discussion') %></h4>
25   
26   <div class="buttons clearfix subscribe-buttons">
27     <form action="#" class="hide_unless_logged_in">
28       <% if @user and @changeset.subscribers.exists?(@user.id) %>
29         <input class="action-button" type="submit" name="unsubscribe" value="<%= t('javascripts.changesets.show.unsubscribe') %>" data-method="POST" data-url="<%= changeset_unsubscribe_url(@changeset) %>" />
30       <% else %>
31         <input class="action-button" type="submit" name="subscribe" value="<%= t('javascripts.changesets.show.subscribe') %>" data-method="POST" data-url="<%= changeset_subscribe_url(@changeset) %>" />
32       <% end %>
33     </form>
34   </div>
35
36   <div class="clearfix"></div>
37
38   <% if @comments.length > 0 %>
39     <div class='changeset-comments'>
40       <form action="#">
41         <ul>
42           <% @comments.each do |comment| %>
43             <% if comment.visible %>
44               <li id="c<%= comment.id %>">
45                 <small class='deemphasize'>
46                   <%= t("browse.changeset.commented_by",
47                     :when => friendly_date(comment.created_at), :exact_time => l(comment.created_at),
48                     :user => link_to(h(comment.author.display_name), {:controller => "user", :action => "view",
49                     :display_name => comment.author.display_name})).html_safe %>
50                   <% if @user and @user.moderator? %>
51                     — <span class="action-button deemphasize" data-comment-id="<%= comment.id %>" data-method="POST" data-url="<%= changeset_comment_hide_url(comment.id) %>"><%= t('javascripts.changesets.show.hide_comment') %></span>
52                   <% end %>
53                 </small>
54                 <%= comment.body.to_html %>
55               </li>
56             <% elsif @user and @user.moderator? %>
57               <li id="c<%= comment.id %>">
58                 <small class='deemphasize'>
59                   <%= t("browse.changeset.hidden_commented_by",
60                     :when => friendly_date(comment.created_at), :exact_time => l(comment.created_at),
61                     :user => link_to(h(comment.author.display_name), {:controller => "user", :action => "view",
62                     :display_name => comment.author.display_name})).html_safe %>
63                   — <span class="action-button deemphasize" data-comment-id="<%= comment.id %>" data-method="POST" data-url="<%= changeset_comment_unhide_url(comment.id) %>"><%= t('javascripts.changesets.show.unhide_comment') %></span>
64                  </small>
65                 <%= comment.body.to_html %>
66               </li>
67             <% end %>
68           <% end %>
69         </ul>
70       </form>
71     </div>
72   <% end %>
73
74   <div class="notice hide_if_logged_in">
75     <%= link_to(t("browse.changeset.join_discussion"), :controller => 'user', :action => 'login', :referer => request.fullpath) %>
76   </div>
77
78   <% unless @changeset.is_open? %>
79     <form action="#" class="hide_unless_logged_in">
80       <textarea class="comment" name="text" cols="40" rows="5"></textarea>
81       <div class="buttons clearfix">
82         <input type="submit" name="comment" value="<%= t('javascripts.changesets.show.comment') %>" data-changeset-id="<%= @changeset.id %>" data-method="POST" data-url="<%= changeset_comment_url(@changeset) %>" disabled="1"/>
83       </div>
84     </form>
85   <% end %>
86
87   <% unless @ways.empty? %>
88     <h4>
89       <%= type_and_paginated_count('way', @way_pages) %>
90       <%= render :partial => 'paging_nav', :locals => { :pages => @way_pages, :page_param => "way_page" } %>
91     </h4>
92     <ul>
93       <% @ways.each do |way| %>
94         <li><%= link_to printable_name(way, true), { :action => "way", :id => way.way_id.to_s }, :class => link_class('way', way), :title => link_title(way) %></li>
95       <% end %>
96     </ul>
97   <% end %>
98
99   <% unless @relations.empty? %>
100     <h4>
101       <%= type_and_paginated_count('relation', @relation_pages) %>
102       <%= render :partial => 'paging_nav', :locals => { :pages => @relation_pages, :page_param => "relation_page" } %>
103     </h4>
104     <ul>
105       <% @relations.each do |relation| %>
106         <li><%= link_to printable_name(relation, true), { :action => "relation", :id => relation.relation_id.to_s }, :class => link_class('relation', relation), :title => link_title(relation) %></li>
107       <% end %>
108     </ul>
109   <% end %>
110
111   <% unless @nodes.empty? %>
112     <h4>
113       <%= type_and_paginated_count('node', @node_pages) %>
114       <%= render :partial => 'paging_nav', :locals => { :pages => @node_pages, :page_param => "node_page"} %>
115     </h4>
116     <ul>
117       <% @nodes.each do |node| %>
118         <li><%= link_to printable_name(node, true), { :action => "node", :id => node.node_id.to_s }, :class => link_class('node', node), :title => link_title(node), :rel => link_follow(node) %></li>
119       <% end %>
120     </ul>
121   <% end %>
122 </div>
123
124 <% if @next_by_user || @prev_by_user %>
125   <div class='secondary-actions'>
126     <% if @prev_by_user %>
127       <%= link_to "<< #{@prev_by_user.id}", :id => @prev_by_user.id %>
128       &middot;
129     <% end %>
130     <%=
131         user = (@prev_by_user || @next_by_user).user.display_name
132         link_to content_tag(:bdi, user), :controller => "changeset", :action => "list", :display_name => user
133     %>
134     <% if @next_by_user %>
135       &middot;
136       <%= link_to "#{@next_by_user.id} >>", :id => @next_by_user.id %>
137     <% end %>
138   </div>
139 <% end %>
140
141 <div class='secondary-actions'>
142   <%= link_to(t('browse.changeset.changesetxml'), :controller => "changeset", :action => "read") %>
143   &middot;
144   <%= link_to(t('browse.changeset.osmchangexml'), :controller => "changeset", :action => "download") %>
145 </div>