A lot :)
Some checks failed
/ Run tests (push) Successful in 8m56s
/ Run system tests (push) Failing after 1h0m48s
/ Build, push and deploy image (push) Successful in 7m47s

This commit is contained in:
david 2024-09-05 22:54:38 +02:00
parent aad67af0d1
commit 63fc206c27
153 changed files with 2043 additions and 646 deletions

View file

@ -4,4 +4,16 @@ module ApplicationHelper
include Pagy::Frontend
delegate :filter_params, to: :controller
def multilang_form_field(form, attribute, as: :text_field)
col_width = as == :rich_text_area ? 12 : 12 / I18n.available_locales.count
tag.div(class: "row") do
fields = I18n.available_locales.map { _1.to_s.split("-").first }.map do |lang|
tag.div(class: "col-lg-#{col_width}") do
form.send(as, "#{attribute}_#{lang}")
end
end
safe_join(fields)
end
end
end

View file

@ -1,2 +1,4 @@
# frozen_string_literal: true
module ChecklistEntriesHelper
end

View file

@ -1,2 +1,4 @@
# frozen_string_literal: true
module ChecklistsHelper
end

View file

@ -1,2 +1,4 @@
# frozen_string_literal: true
module ChecksHelper
end

View file

@ -1,2 +1,4 @@
# frozen_string_literal: true
module ElementsHelper
end

View file

@ -1,2 +1,4 @@
# frozen_string_literal: true
module LinkCategoriesHelper
end

View file

@ -1,2 +1,4 @@
# frozen_string_literal: true
module LinksHelper
end

View file

@ -1,17 +1,19 @@
# frozen_string_literal: true
module PdfHelper
def prepare_rich_text(rich_text)
return rich_text
{ del: 'strikethrough' }.each do |tag, replacement|
{ del: "strikethrough" }.each do |tag, replacement|
rich_text = rich_text.to_s.gsub("<#{tag}", "<#{replacement}")
rich_text = rich_text.to_s.gsub("</#{tag}>", "</#{replacement}>")
end
%w[div p del blockquote pre code].each do |tag|
rich_text = rich_text.to_s.gsub(%r{<#{tag}.*?>|</#{tag}>}, '')
rich_text = rich_text.to_s.gsub(%r{<#{tag}.*?>|</#{tag}>}, "")
end
rich_text.gsub!(/<h1.*?>/, '')
rich_text.gsub!(%r{</h1>}, '<br><br>')
rich_text.gsub!(/<h1.*?>/, "")
rich_text.gsub!(%r{</h1>}, "<br><br>")
rich_text
end
end

View file

@ -1,2 +1,4 @@
# frozen_string_literal: true
module ReportsHelper
end

View file

@ -1,13 +1,15 @@
# frozen_string_literal: true
module SuccessCriteriaHelper
def success_criterion_result_icon_classes(sc)
if sc.passed?
'bi bi-check text-success'
"bi bi-check text-success"
elsif sc.failed?
'bi bi-exclamation-lg text-danger'
"bi bi-exclamation-lg text-danger"
elsif sc.not_applicable?
'bi bi-dash text-muted'
"bi bi-dash text-muted"
else
'bi bi-question text-warning'
"bi bi-question text-warning"
end
end
@ -16,13 +18,13 @@ module SuccessCriteriaHelper
if edit_mode
success_criterion
else
[:edit,
success_criterion]
[ :edit,
success_criterion ]
end
else
else
success_criterion.element
end
link_to tag.i(class: 'bi bi-pencil'),
end
link_to tag.i(class: "bi bi-pencil"),
path,
class: "btn btn-#{edit_mode ? 'link text-warning' : 'link text-secondary'}"
end