![<%= field['name'].presence || field['title'].presence || field['type'] %>](<%= attachments_index[value].url %>)
@@ -62,9 +62,9 @@
<% end %>
<% end %>
<% elsif field['type'] == 'cells' && area['cell_w'].to_f > 0.0 %>
- <% cell_width = area['cell_w'] / area['w'] * 100 %>
+ <% cell_width = area['cell_w'].to_f / area['w'].to_f * 100 %>
- <% (0..(area['w'] / area['cell_w']).ceil).each do |index| %>
+ <% (0..(area['w'].to_f / area['cell_w'].to_f).ceil).each do |index| %>
<% if value[index] %>
<%= value[index] %>
<% end %>
@@ -83,14 +83,14 @@
<% elsif field['type'] == 'strikethrough' %>
- <% if (((1000.0 / local_assigns[:page_width]) * local_assigns[:page_height]) * area['h']) < 40 %>
+ <% if (((1000.0 / local_assigns[:page_width]) * local_assigns[:page_height]) * area['h'].to_f) < 40 %>
<% else %>
<% end %>
diff --git a/app/views/submissions/show.html.erb b/app/views/submissions/show.html.erb
index 335f1ff6..83187f47 100644
--- a/app/views/submissions/show.html.erb
+++ b/app/views/submissions/show.html.erb
@@ -131,7 +131,7 @@
<% submitters_order_index ||= (@submission.template_submitters || @submission.template.submitters).each_with_index.to_h { |s, i| [s['uuid'], i] } %>
<% submitter_index = submitters_order_index[submitter.uuid] %>
<% bg_class = bg_classes[submitter_index % bg_classes.size] %>
-
+
<%= svg_icon(SubmissionsController::FIELD_ICONS.fetch(field['type'], 'text_size'), class: 'max-h-10 w-full h-full stroke-2 opacity-50') %>
diff --git a/lib/templates.rb b/lib/templates.rb
index ad63302b..ad45a3fc 100644
--- a/lib/templates.rb
+++ b/lib/templates.rb
@@ -1,6 +1,8 @@
# frozen_string_literal: true
module Templates
+ COLOR_REGEXP = /\A(#(?:[0-9a-f]{3}|[0-9a-f]{6})|[a-z]+)\z/i
+
EXPIRATION_DURATIONS = {
one_day: 1.day,
two_days: 2.days,