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