]> git.openstreetmap.org Git - rails.git/blob - app/views/diary_entries/show.html.erb
Merge pull request #4150 from AntonKhorev/note-table-bootstrap-highlight
[rails.git] / app / views / diary_entries / show.html.erb
1 <% content_for :heading do %>
2   <div class="row">
3     <div class="col-sm-auto">
4       <%= user_image @entry.user %>
5     </div>
6     <div class="col">
7       <h1><%= link_to t(".user_title", :user => @entry.user.display_name), :action => :index %></h1>
8       <p><%= rss_link_to :action => :rss, :display_name => @entry.user.display_name %></p>
9     </div>
10   </div>
11 <% end %>
12
13 <%= render @entry %>
14
15 <div id="comments" class="comments">
16 <%= render :partial => "diary_comment", :collection => @comments %>
17 </div>
18
19 <hr>
20
21 <div>
22   <% if current_user %>
23     <h3 id="newcomment"><%= t ".leave_a_comment" %></h3>
24
25     <%= bootstrap_form_for @entry.comments.new, :url => { :action => "comment" } do |f| %>
26       <%= f.richtext_field :body, :cols => 80, :rows => 20, :hide_label => true %>
27       <%= f.primary %>
28       <% if @entry.subscribers.exists?(current_user.id) %>
29         <%= link_to t("javascripts.changesets.show.unsubscribe"), diary_entry_unsubscribe_path(:display_name => @entry.user.display_name, :id => @entry.id), :method => :post, :class => "btn btn-light" %>
30       <% else %>
31         <%= link_to t("javascripts.changesets.show.subscribe"), diary_entry_subscribe_path(:display_name => @entry.user.display_name, :id => @entry.id), :method => :post, :class => "btn btn-light" %>
32       <% end %>
33     <% end %>
34   <% else %>
35     <h3 id="newcomment"><%= t(".login_to_leave_a_comment_html", :login_link => link_to(t(".login"), login_path(:referer => request.fullpath))) %></h3>
36   <% end %>
37 </div>
38
39 <% content_for :auto_discovery_link_tag do -%>
40 <%= auto_discovery_link_tag :rss, :action => :rss, :display_name => @entry.user.display_name %>
41 <% end -%>