style(dossiers): customize table above

This commit is contained in:
Colin Darie 2024-11-12 18:14:26 +01:00
parent b2a575a460
commit 5d6e35c540
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
6 changed files with 18 additions and 15 deletions

View file

@ -3,7 +3,9 @@
class Dossiers::ExportDropdownComponent < ApplicationComponent
include ApplicationHelper
def initialize(procedure:, export_templates: nil, statut: nil, count: nil, class_btn: nil, export_url: nil, show_export_template_tab: true)
attr_reader :wrapper
def initialize(procedure:, export_templates: nil, statut: nil, count: nil, class_btn: nil, export_url: nil, show_export_template_tab: true, wrapper: :div)
@procedure = procedure
@export_templates = export_templates
@statut = statut
@ -11,6 +13,7 @@ class Dossiers::ExportDropdownComponent < ApplicationComponent
@class_btn = class_btn
@export_url = export_url
@show_export_template_tab = show_export_template_tab
@wrapper = wrapper
end
def formats

View file

@ -1,4 +1,4 @@
= render Dropdown::MenuComponent.new(wrapper: :div, button_options: { class: ['fr-btn--sm', @class_btn.present? ? @class_btn : 'fr-btn--secondary']}, menu_options: { id: @count.nil? ? "download_menu" : "download_all_menu", class: ['dropdown-export'] }) do |menu|
= render Dropdown::MenuComponent.new(wrapper:, button_options: { class: ['fr-btn--sm', @class_btn.present? ? @class_btn : 'fr-btn--secondary']}, menu_options: { id: @count.nil? ? "download_all_menu" : "download_menu", class: ['dropdown-export'] }) do |menu|
- menu.with_button_inner_html do
= @count.nil? ? t(".download_all") : t(".download", count: @count)

View file

@ -1,4 +1,4 @@
= render Dropdown::MenuComponent.new(wrapper: :div, button_options: { class: ['fr-btn--secondary', 'fr-btn--sm', 'fr-mr-1w'] }, menu_options: { id: 'filter-menu', class:['left-aligned'] }) do |menu|
= render Dropdown::MenuComponent.new(wrapper: :div, button_options: { class: ['fr-btn--secondary', 'fr-btn--sm', 'fr-mr-1w', 'fr-mb-2w'] }, menu_options: { id: 'filter-menu', class:['left-aligned'] }) do |menu|
- menu.with_button_inner_html do
= t('views.instructeurs.dossiers.filters.title')

View file

@ -62,8 +62,15 @@
.fr-ml-auto
- if @dossiers_count > 0
%span.dossiers-export
= render Dossiers::ExportDropdownComponent.new(procedure: @procedure, export_templates: current_instructeur.export_templates_for(@procedure), statut: @statut, count: @dossiers_count, class_btn: 'fr-btn--tertiary', export_url: method(:download_export_instructeur_procedure_path))
%ul.fr-btns-group.fr-btns-group--right.fr-btns-group--sm.fr-btns-group--inline-md.fr-btns-group--icon-left
= render Dossiers::ExportDropdownComponent.new(wrapper: :li, procedure: @procedure, export_templates: current_instructeur.export_templates_for(@procedure), statut: @statut, count: @dossiers_count,
class_btn: 'fr-btn--secondary fr-icon-download-line', export_url: method(:download_export_instructeur_procedure_path))
= render Dropdown::MenuComponent.new(wrapper: :li, button_options: { class: ['fr-btn--tertiary', 'fr-icon-settings-5-line'] }, menu_options: { id: 'custom-menu' }) do |menu|
- menu.with_button_inner_html do
= t('views.instructeurs.dossiers.customize')
- menu.with_form do
= render Instructeurs::ColumnPickerComponent.new(procedure: @procedure, procedure_presentation: @procedure_presentation)
- if @filtered_sorted_paginated_ids.present? || @current_filters.count > 0
= render Instructeurs::FilterButtonsComponent.new(filters: @current_filters, procedure_presentation: @procedure_presentation, statut: @statut)
@ -99,13 +106,6 @@
%th.follow-col{ scope: 'col' }
Actions
%th.fr-cell--right
= render Dropdown::MenuComponent.new(wrapper: :span, button_options: { class: ['fr-btn--sm', 'fr-btn--tertiary-no-outline', 'fr-btn--icon-right', 'fr-icon-settings-5-line'] }, menu_options: { id: 'custom-menu' }) do |menu|
- menu.with_button_inner_html do
= t('views.instructeurs.dossiers.personalize')
- menu.with_form do
= render Instructeurs::ColumnPickerComponent.new(procedure: @procedure, procedure_presentation: @procedure_presentation)
%tbody
= render Dossiers::BatchSelectMoreComponent.new(dossiers_count: @dossiers_count, filtered_sorted_ids: @filtered_sorted_ids)
@ -163,7 +163,7 @@
= link_to_if p.hidden_by_administration_at.blank?, render(Instructeurs::SVASVRDecisionBadgeComponent.new(projection_or_dossier: p, procedure: @procedure)), path
%td.follow-col
%ul.fr-btns-group.fr-btns-group--lg.fr-btns-group--inline-lg.fr-btns-group--icon-right
%ul.fr-btns-group.fr-btns-group--sm.fr-btns-group--inline.fr-btns-group--icon-right
= render partial: 'instructeurs/procedures/dossier_actions', locals: { procedure_id: @procedure.id,
dossier_id: p.dossier_id,
state: p.state,

View file

@ -409,7 +409,7 @@ en:
batch_operation:
enabled: "Add file %{dossier_id} to the selection for the bulk operation"
disabled: "Impossible to add file %{dossier_id} to the selection because it is already in a bulk operation"
personalize: Personalize
customize: Customize the table
passer_en_instruction: Switch to instruction
repasser_en_construction: Revert to submitted
show_deleted_dossiers: Show deleted files

View file

@ -413,7 +413,7 @@ fr:
enabled: "Ajouter le dossier %{dossier_id} à la sélection pour un traitement de masse"
disabled: "Impossible d'ajouter le dossier %{dossier_id} à la selection car il est déjà dans un traitement de masse"
show_deleted_dossiers: Historique des dossiers supprimés
personalize: Personnaliser
customize: Personnaliser le tableau
passer_en_instruction: Passer en instruction
repasser_en_construction: Repasser en construction
follow_file: Suivre le dossier