Fix "see more" link for prefillable fields
This commit is contained in:
parent
d7b01255fe
commit
e1748a2666
3 changed files with 4 additions and 2 deletions
|
@ -142,7 +142,7 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def new_tab_suffix(title)
|
||||
"#{title} — #{t('utils.new_tab')}"
|
||||
"#{title} — #{I18n.t('utils.new_tab')}"
|
||||
end
|
||||
|
||||
def download_details(attachment)
|
||||
|
|
|
@ -129,6 +129,7 @@ class TypeDeChamp < ApplicationRecord
|
|||
|
||||
delegate :estimated_fill_duration, :estimated_read_duration, :tags_for_template, :libelle_for_export, to: :dynamic_type
|
||||
delegate :active_revision, to: :procedure, prefix: true
|
||||
delegate :path, to: :procedure
|
||||
|
||||
class WithIndifferentAccess
|
||||
def self.load(options)
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
class TypesDeChamp::PrefillRepetitionTypeDeChamp < TypesDeChamp::PrefillTypeDeChamp
|
||||
include ActionView::Helpers::UrlHelper
|
||||
include ApplicationHelper
|
||||
|
||||
def possible_values
|
||||
prefillable_subchamps.map do |prefill_type_de_champ|
|
||||
if prefill_type_de_champ.too_many_possible_values?
|
||||
link = link_to "Voir toutes les valeurs possibles", Rails.application.routes.url_helpers.prefill_type_de_champ_path("piece-jointe", prefill_type_de_champ)
|
||||
link = link_to I18n.t("views.prefill_descriptions.edit.possible_values.link.text"), Rails.application.routes.url_helpers.prefill_type_de_champ_path(prefill_type_de_champ.path, prefill_type_de_champ), title: ActionController::Base.helpers.sanitize(new_tab_suffix(I18n.t("views.prefill_descriptions.edit.possible_values.link.title"))), **external_link_attributes
|
||||
"#{prefill_type_de_champ.libelle}: #{link}"
|
||||
else
|
||||
"#{prefill_type_de_champ.libelle}: #{prefill_type_de_champ.possible_values_sentence}"
|
||||
|
|
Loading…
Reference in a new issue