From: Anton Khorev Date: Sun, 11 Feb 2024 23:36:06 +0000 (+0300) Subject: Add diary discussion heading and move subscribe button next to it X-Git-Tag: live~721^2~1 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/f02100b9638a03723ad820b5acc194d905969209 Add diary discussion heading and move subscribe button next to it --- diff --git a/app/views/diary_entries/show.html.erb b/app/views/diary_entries/show.html.erb index 5bfdfa17b..317c54635 100644 --- a/app/views/diary_entries/show.html.erb +++ b/app/views/diary_entries/show.html.erb @@ -13,7 +13,21 @@ <%= render @entry %>
-<%= render :partial => "diary_comment", :collection => @comments %> +
+

<%= t(".discussion") %>

+ + <% if current_user %> +
+ <% if @entry.subscribers.exists?(current_user.id) %> + <%= 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-sm btn-primary" %> + <% else %> + <%= 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-sm btn-primary" %> + <% end %> +
+ <% end %> +
+ + <%= render :partial => "diary_comment", :collection => @comments %>

@@ -25,11 +39,6 @@ <%= bootstrap_form_for @entry.comments.new, :url => { :action => "comment" } do |f| %> <%= f.richtext_field :body, :cols => 80, :rows => 20, :hide_label => true %> <%= f.primary %> - <% if @entry.subscribers.exists?(current_user.id) %> - <%= 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" %> - <% else %> - <%= 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" %> - <% end %> <% end %> <% else %>

<%= t(".login_to_leave_a_comment_html", :login_link => link_to(t(".login"), login_path(:referer => request.fullpath))) %>

diff --git a/config/locales/en.yml b/config/locales/en.yml index 6a3c880c4..3fe583d5f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -524,6 +524,7 @@ en: show: title: "%{user}'s Diary | %{title}" user_title: "%{user}'s Diary" + discussion: "Discussion" leave_a_comment: "Leave a comment" login_to_leave_a_comment_html: "%{login_link} to leave a comment" login: "Login"