diff --git a/app/dashboards/procedure_dashboard.rb b/app/dashboards/procedure_dashboard.rb index 3e7199b01..4f1d13ff8 100644 --- a/app/dashboards/procedure_dashboard.rb +++ b/app/dashboards/procedure_dashboard.rb @@ -8,7 +8,7 @@ class ProcedureDashboard < Administrate::BaseDashboard # which determines how the attribute is displayed # on pages throughout the dashboard. ATTRIBUTE_TYPES = { - types_de_piece_justificative: Field::HasMany, + types_de_piece_justificative: TypesDePieceJustificativeCollectionField, types_de_champ: TypesDeChampCollectionField, dossiers: Field::HasMany, procedure_path: Field::HasOne, @@ -56,6 +56,7 @@ class ProcedureDashboard < Administrate::BaseDashboard :hidden_at, :archived_at, :types_de_champ, + :types_de_piece_justificative, :for_individual, :individual_with_siret, :auto_archive_on, diff --git a/app/fields/types_de_piece_justificative_collection_field.rb b/app/fields/types_de_piece_justificative_collection_field.rb new file mode 100644 index 000000000..a19b5249f --- /dev/null +++ b/app/fields/types_de_piece_justificative_collection_field.rb @@ -0,0 +1,7 @@ +require "administrate/field/base" + +class TypesDePieceJustificativeCollectionField < Administrate::Field::Base + def to_s + data + end +end diff --git a/app/views/fields/types_de_piece_justificative_collection_field/_form.html.haml b/app/views/fields/types_de_piece_justificative_collection_field/_form.html.haml new file mode 100644 index 000000000..9fd2d81b7 --- /dev/null +++ b/app/views/fields/types_de_piece_justificative_collection_field/_form.html.haml @@ -0,0 +1,4 @@ +.field-unit__label + = f.label field.attribute +.field-unit__field + = f.text_field field.attribute diff --git a/app/views/fields/types_de_piece_justificative_collection_field/_index.html.haml b/app/views/fields/types_de_piece_justificative_collection_field/_index.html.haml new file mode 100644 index 000000000..1249b4899 --- /dev/null +++ b/app/views/fields/types_de_piece_justificative_collection_field/_index.html.haml @@ -0,0 +1 @@ += field.to_s diff --git a/app/views/fields/types_de_piece_justificative_collection_field/_show.html.haml b/app/views/fields/types_de_piece_justificative_collection_field/_show.html.haml new file mode 100644 index 000000000..732f086c1 --- /dev/null +++ b/app/views/fields/types_de_piece_justificative_collection_field/_show.html.haml @@ -0,0 +1,12 @@ +- if field.data.any? + %table.collection-data{ "aria-labelledby": "page-title" } + %thead + %tr + %td.cell-label Libelle + %tbody + - field.data.order(:order_place).each do |f| + %tr + %td.cell-data + = f.libelle +- else + Aucun