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
|
end
|
||||||
|
|
||||||
def new_tab_suffix(title)
|
def new_tab_suffix(title)
|
||||||
"#{title} — #{t('utils.new_tab')}"
|
"#{title} — #{I18n.t('utils.new_tab')}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def download_details(attachment)
|
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 :estimated_fill_duration, :estimated_read_duration, :tags_for_template, :libelle_for_export, to: :dynamic_type
|
||||||
delegate :active_revision, to: :procedure, prefix: true
|
delegate :active_revision, to: :procedure, prefix: true
|
||||||
|
delegate :path, to: :procedure
|
||||||
|
|
||||||
class WithIndifferentAccess
|
class WithIndifferentAccess
|
||||||
def self.load(options)
|
def self.load(options)
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
class TypesDeChamp::PrefillRepetitionTypeDeChamp < TypesDeChamp::PrefillTypeDeChamp
|
class TypesDeChamp::PrefillRepetitionTypeDeChamp < TypesDeChamp::PrefillTypeDeChamp
|
||||||
include ActionView::Helpers::UrlHelper
|
include ActionView::Helpers::UrlHelper
|
||||||
|
include ApplicationHelper
|
||||||
|
|
||||||
def possible_values
|
def possible_values
|
||||||
prefillable_subchamps.map do |prefill_type_de_champ|
|
prefillable_subchamps.map do |prefill_type_de_champ|
|
||||||
if prefill_type_de_champ.too_many_possible_values?
|
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}"
|
"#{prefill_type_de_champ.libelle}: #{link}"
|
||||||
else
|
else
|
||||||
"#{prefill_type_de_champ.libelle}: #{prefill_type_de_champ.possible_values_sentence}"
|
"#{prefill_type_de_champ.libelle}: #{prefill_type_de_champ.possible_values_sentence}"
|
||||||
|
|
Loading…
Reference in a new issue