]> git.openstreetmap.org Git - rails.git/commitdiff
Converge redaction forms to use bootstrap
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 27 Jan 2021 17:04:47 +0000 (17:04 +0000)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 27 Jan 2021 17:04:47 +0000 (17:04 +0000)
app/views/redactions/edit.html.erb
app/views/redactions/new.html.erb
app/views/redactions/show.html.erb
config/locales/en.yml

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: