From ce3755a45623799854dcbb97c30dd159289acacf Mon Sep 17 00:00:00 2001 From: Marwin Hochfelsner <50826859+hlfan@users.noreply.github.com> Date: Sun, 27 Jul 2025 00:30:14 +0200 Subject: [PATCH] Use more form helpers --- app/views/notes/new.html.erb | 4 ++-- app/views/share_panes/show.html.erb | 31 +++++++++++++---------------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/app/views/notes/new.html.erb b/app/views/notes/new.html.erb index 5be707dfe..5a4e4cbb1 100644 --- a/app/views/notes/new.html.erb +++ b/app/views/notes/new.html.erb @@ -22,10 +22,10 @@
- + <%= text_area_tag "text", "", :class => "form-control", :size => "40x10", :maxlength => "2000", :placeholder => t(".advice") %>
- " disabled="1" class="btn btn-primary"> + <%= submit_tag t(".add"), :name => "add", :disabled => 1, :class => "btn btn-primary" %>
diff --git a/app/views/share_panes/show.html.erb b/app/views/share_panes/show.html.erb index 0f06dfc33..f4912b152 100644 --- a/app/views/share_panes/show.html.erb +++ b/app/views/share_panes/show.html.erb @@ -2,8 +2,8 @@

<%= t ".link" %>

- - + <%= label_tag "link_marker", t(".include_marker"), :class => "form-check-label" %> + <%= check_box_tag "link_marker", nil, :class => "form-check-input" %>
- + <%= label_tag "mapnik_format", t(".format"), :class => "col-auto col-form-label" %>
- + <%= select_tag "mapnik_format", + options_for_select(%w[png jpeg webp svg pdf].map { |f| [f.upcase, f] }), + :class => "form-select w-auto", + :required => true %>
- + <%= label_tag "mapnik_scale", t(".scale"), :class => "col-auto col-form-label" %>
1 : - + <%= text_field_tag "mapnik_scale", nil, :class => "form-control", :autocomplete => "off" %>
- - + <%= label_tag "image_filter", t(".custom_dimensions"), :class => "form-check-label" %> + <%= check_box_tag "image_filter", nil, :class => "form-check-input" %>
<% %w[minlon minlat maxlon maxlat lat lon].each do |name| %> - + <%= hidden_field_tag "mapnik_#{name}", nil, :name => name %> <% end %> <% { :format => "mapnik", :zoom => 0, :width => 0, :height => 0 }.each do |name, value| %> - + <%= hidden_field_tag "map_#{name}", value, :name => name %> <% end %>

@@ -82,6 +79,6 @@ **%w[layer width height] .to_h { |key| [key.to_sym, content_tag(:span, "", :id => "mapnik_image_#{key}")] } %>

- " data-turbo-submits-with="<%= t ".downloading" %>" /> + <%= submit_tag t(".download"), :class => "btn btn-primary", :data => { :turbo_submits_with => t(".downloading") } %>
-- 2.39.5