From: Andy Allan Date: Wed, 20 Jan 2021 13:02:09 +0000 (+0000) Subject: Refactor diary comment form to use bootstrap X-Git-Tag: live~1805^2 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/8e02c98c3fb052803c4a70a35b14c1d1ca9c4119 Refactor diary comment form to use bootstrap --- diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 0998b94a9..e3c8ff202 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -1282,11 +1282,6 @@ tr.turn:hover { display: none; margin-bottom: $lineheight; } - #newcomment { - border-top: 1px solid $grey; - padding-top: $lineheight; - margin-top: $lineheight/2; - } .comments { max-width: 740px; } @@ -1316,13 +1311,6 @@ tr.turn:hover { float: left; } - -.diary-subscribe-buttons { - position: relative; - top: -30px; - left: 130px; -} - /* Rules for the log in page */ #login_auth_buttons { diff --git a/app/views/diary_entries/show.html.erb b/app/views/diary_entries/show.html.erb index 4468fc53e..154a7a195 100644 --- a/app/views/diary_entries/show.html.erb +++ b/app/views/diary_entries/show.html.erb @@ -13,20 +13,20 @@ <%= render :partial => "diary_comment", :collection => @comments %> -
+
+ +
<% if current_user %>

<%= t ".leave_a_comment" %>

- <%= error_messages_for "diary_comment" %> - - <%= form_for @entry.comments.new, :url => { :action => "comment" } do |f| %> - <%= richtext_area :diary_comment, :body, :cols => 80, :rows => 15 %> - <%= f.submit %> - <% end %> - <% 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 => :button %>
- <% else %> -
<%= link_to t("javascripts.changesets.show.subscribe"), diary_entry_subscribe_path(:display_name => @entry.user.display_name, :id => @entry.id), :method => :post, :class => :button %>
+ <%= 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"), :controller => "users", :action => "login", :referer => request.fullpath)) %>