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