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