]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/3073'
authorTom Hughes <tom@compton.nu>
Thu, 28 Jan 2021 10:36:38 +0000 (10:36 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 28 Jan 2021 10:36:38 +0000 (10:36 +0000)
app/views/browse/note.html.erb
app/views/issues/_comments.html.erb
app/views/redactions/edit.html.erb
app/views/redactions/new.html.erb
app/views/redactions/show.html.erb
config/locales/en.yml

index d44e0bb3d86e154826cd57882c96c14c75fe1c17..1a792e873952ce3dc98b5d6b7ced79e6f27cdeb2 100644 (file)
 
   <% if @note.status == "open" %>
     <% if current_user -%>
-      <form action="#" class="standard-form">
-        <textarea class="comment" name="text" cols="40" rows="5" maxlength="2000"></textarea>
-        <div class="buttons clearfix">
+      <form action="#">
+        <div class="form-group">
+          <textarea class="form-control" name="text" cols="40" rows="5" maxlength="2000"></textarea>
+        </div>
+        <div>
           <% if current_user.moderator? -%>
-            <input type="submit" name="hide" value="<%= t("javascripts.notes.show.hide") %>" class="deemphasize" data-note-id="<%= @note.id %>" data-method="DELETE" data-url="<%= note_url(@note, "json") %>">
+            <input type="submit" name="hide" value="<%= t("javascripts.notes.show.hide") %>" class="btn btn-light" data-note-id="<%= @note.id %>" data-method="DELETE" data-url="<%= note_url(@note, "json") %>">
           <% end -%>
-          <input type="submit" name="close" value="<%= t("javascripts.notes.show.resolve") %>" data-note-id="<%= @note.id %>" data-method="POST" data-url="<%= close_note_url(@note, "json") %>">
-          <input type="submit" name="comment" value="<%= t("javascripts.notes.show.comment") %>" data-note-id="<%= @note.id %>" data-method="POST" data-url="<%= comment_note_url(@note, "json") %>" disabled="1">
+          <input type="submit" name="close" value="<%= t("javascripts.notes.show.resolve") %>" class="btn btn-primary" data-note-id="<%= @note.id %>" data-method="POST" data-url="<%= close_note_url(@note, "json") %>">
+          <input type="submit" name="comment" value="<%= t("javascripts.notes.show.comment") %>" class="btn btn-primary" data-note-id="<%= @note.id %>" data-method="POST" data-url="<%= comment_note_url(@note, "json") %>" disabled="1">
         </div>
       </form>
     <% end -%>
   <% else %>
-    <form action="#" class="standard-form">
+    <form action="#">
       <input type="hidden" name="text" value="">
-      <div class="buttons clearfix">
+      <div>
         <% if current_user and current_user.moderator? -%>
-          <input type="submit" name="hide" value="<%= t("javascripts.notes.show.hide") %>" class="deemphasize" data-note-id="<%= @note.id %>" data-method="DELETE" data-url="<%= note_url(@note, "json") %>">
+          <input type="submit" name="hide" value="<%= t("javascripts.notes.show.hide") %>" class="btn btn-light" data-note-id="<%= @note.id %>" data-method="DELETE" data-url="<%= note_url(@note, "json") %>">
         <% end -%>
         <% if current_user -%>
-          <input type="submit" name="reopen" value="<%= t("javascripts.notes.show.reactivate") %>" data-note-id="<%= @note.id %>" data-method="POST" data-url="<%= reopen_note_url(@note, "json") %>">
+          <input type="submit" name="reopen" value="<%= t("javascripts.notes.show.reactivate") %>" class="btn btn-primary" data-note-id="<%= @note.id %>" data-method="POST" data-url="<%= reopen_note_url(@note, "json") %>">
         <% end -%>
       </div>
     </form>
index a0402230421ad894ee674fd4758bb4baf18b68ce..6a90dbbff49c0bf1841c93e6848155f31b22d573 100644 (file)
@@ -1,4 +1,4 @@
-<div class="issue-comments">
+<div>
   <% comments.each do |comment| %>
     <div class="comment">
       <div class="float-left">
     <hr>
   <% end %>
 </div>
-<br />
-<div class="comment standard-form">
-  <%= form_for @new_comment, :url => issue_comments_path(@issue) do |f| %>
-  <%= richtext_area :issue_comment, :body, :cols => 10, :rows => 8, :required => true %>
-  <%= label_tag :reassign, t(".reassign_param") %> <%= check_box_tag :reassign, true %>
-  <br />
-  <br />
-  <%= f.submit %>
+
+<div>
+  <%= bootstrap_form_for @new_comment, :url => issue_comments_path(@issue) do |f| %>
+    <%= f.richtext_field :body, :cols => 80, :rows => 20, :hide_label => true %>
+    <%= f.form_group do %>
+      <%= f.check_box :reassign, { :label => t(".reassign_param"), :id => "reassign", :name => "reassign", :checked => false }, true, false %>
+    <% end %>
+    <%= f.primary %>
   <% end %>
 </div>
index aff2af919936fd119ebbf14f7f4e01f3075349bf..e9b5beaacde0f636b7a68a1d561147ef02aec6d3 100644 (file)
@@ -4,18 +4,8 @@
   <h1><%= t ".heading" %></h1>
 <% end %>
 
-<%= form_for(@redaction, :html => { :class => "standard-form" }) do |f| %>
-  <%= f.error_messages %>
-
-  <p>
-    <%= f.label :title, t(".title") %><br />
-    <%= f.text_field :title %>
-  </p>
-  <p>
-    <%= f.label :description, t(".description") %><br />
-    <%= richtext_area :redaction, :description, :cols => 80, :rows => 20, :format => @redaction.description_format %>
-  </p>
-  <p>
-    <%= f.submit %>
-  </p>
+<%= bootstrap_form_for(@redaction) do |f| %>
+  <%= f.text_field :title %>
+  <%= f.richtext_field :description, :cols => 80, :rows => 20, :format => @redaction.description_format %>
+  <%= f.primary %>
 <% end %>
index 02e729b3570d5f3a7118e6c933fb41c5b78addb5..64089b2b09270bf2b12dfc1e29f86eec1e8711c0 100644 (file)
@@ -3,18 +3,8 @@
   <h1><%= t ".heading" %></h1>
 <% end %>
 
-<%= form_for(@redaction, :html => { :class => "standard-form" }) do |f| %>
-  <%= f.error_messages %>
-
-  <p>
-    <%= f.label :title, t(".title") %><br />
-    <%= f.text_field :title %>
-  </p>
-  <p>
-    <%= f.label :description, t(".description") %><br />
-    <%= richtext_area :redaction, :description, :cols => 80, :rows => 20, :format => @redaction.description_format %>
-  </p>
-  <p>
-    <%= f.submit %>
-  </p>
+<%= bootstrap_form_for(@redaction) do |f| %>
+  <%= f.text_field :title %>
+  <%= f.richtext_field :description, :cols => 80, :rows => 20, :format => @redaction.description_format %>
+  <%= f.primary %>
 <% end %>
index cf5116edebe36aca4ef3d923454804f3d4af4099..22d17cd5d5c3ad503e17be5cc3724456f2e834e5 100644 (file)
 </div>
 
 <% if can?(:edit, Redaction) || can?(:destroy, Redaction) %>
-<div class="buttons">
+<div>
   <% if can?(:edit, Redaction) %>
-    <%= button_to t(".edit"), edit_redaction_path(@redaction), :method => :get %></td>
+    <%= link_to t(".edit"), edit_redaction_path(@redaction), :class => "btn btn-outline-primary" %>
   <% end %>
   <% if can?(:destroy, Redaction) %>
-    <%= button_to t(".destroy"), @redaction, :method => "delete", :remote => true, :data => { :confirm => t(".confirm") } %>
+    <%= link_to t(".destroy"), @redaction, :method => "delete", :class => "btn btn-outline-danger", :remote => true, :data => { :confirm => t(".confirm") } %>
   <% end %>
 </div>
 <% end %>
index ea24854c66db2c3d51c5cf8e4719243fac079c52..f2f5616a821f6c190745cc6a5018d0e1069c4caf 100644 (file)
@@ -116,6 +116,9 @@ en:
         title: "Subject"
         body: "Body"
         recipient: "Recipient"
+      redaction:
+        title: Title
+        description: Description
       report:
         category: Select a reason for your report
         details: Please provide some more details about the problem (required).
@@ -2841,7 +2844,6 @@ en:
       centre_map: Centre map here
   redactions:
     edit:
-      description: "Description"
       heading: "Edit redaction"
       title: "Edit redaction"
     index:
@@ -2849,7 +2851,6 @@ en:
       heading: "List of redactions"
       title: "List of redactions"
     new:
-      description: "Description"
       heading: "Enter information for new redaction"
       title: "Creating new redaction"
     show: