Merge pull request #10973 from demarches-simplifiees/etq-admin-bug-affichage-service
ETQ Admin: amélioration de l'affichage des services
This commit is contained in:
commit
4844696f5c
3 changed files with 22 additions and 20 deletions
|
@ -1,5 +0,0 @@
|
||||||
@import "constants";
|
|
||||||
|
|
||||||
.change {
|
|
||||||
width: 300px;
|
|
||||||
}
|
|
|
@ -5,8 +5,8 @@ module Administrateurs
|
||||||
skip_before_action :alert_for_missing_siret_service, only: :edit
|
skip_before_action :alert_for_missing_siret_service, only: :edit
|
||||||
skip_before_action :alert_for_missing_service, only: :edit
|
skip_before_action :alert_for_missing_service, only: :edit
|
||||||
def index
|
def index
|
||||||
@services = services.ordered
|
|
||||||
@procedure = procedure
|
@procedure = procedure
|
||||||
|
@services = services.ordered.sort_by { |service| service == procedure.service ? 0 : 1 }
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
#services-index.fr-container
|
#services-index.fr-container
|
||||||
%h1.fr-h2 Service
|
%h1.fr-h2 Service
|
||||||
|
|
||||||
|
= link_to "Nouveau service", new_admin_service_path(procedure_id: @procedure.id), class: "fr-btn fr-btn--primary fr-btn--icon-left fr-icon-add-circle-line mb-3"
|
||||||
|
|
||||||
.fr-table.fr-table--layout-fixed
|
.fr-table.fr-table--layout-fixed
|
||||||
%table
|
%table
|
||||||
%caption Liste des services pouvant être affectés à la démarche
|
%caption Liste des services pouvant être affectés à la démarche
|
||||||
|
@ -13,25 +15,30 @@
|
||||||
%tr
|
%tr
|
||||||
%th{ scope: "col" }
|
%th{ scope: "col" }
|
||||||
Nom
|
Nom
|
||||||
%th.change{ scope: "col" }
|
%th.fr-col-4{ scope: "col" }
|
||||||
= link_to "Nouveau service", new_admin_service_path(procedure_id: @procedure.id), class: "fr-btn fr-btn--secondary"
|
Actions
|
||||||
|
|
||||||
%tbody
|
%tbody
|
||||||
- @services.each do |service|
|
- @services.each do |service|
|
||||||
%tr
|
%tr
|
||||||
%td
|
%td
|
||||||
= service.nom
|
= service.nom
|
||||||
%td.change
|
%td.fr-col-4
|
||||||
|
.fr-container.flex.px-0
|
||||||
|
.fr-col-4.fr-col--middle
|
||||||
- if @procedure.service == service
|
- if @procedure.service == service
|
||||||
%strong.mr-2 (Assigné)
|
%p.fr-badge.fr-badge--success.fr-badge--sm
|
||||||
|
ASSIGNÉ
|
||||||
- else
|
- else
|
||||||
= button_to "Assigner", add_to_procedure_admin_services_path(procedure: { id: @procedure.id, service_id: service.id, }), method: :patch, class: 'link mr-2', form_class: 'inline'
|
= button_to "Assigner", add_to_procedure_admin_services_path(procedure: { id: @procedure.id, service_id: service.id, }), method: :patch, class: 'fr-btn fr-btn--sm fr-btn--secondary fr-btn--icon-left fr-icon-checkbox-circle-line'
|
||||||
= link_to('Modifier', edit_admin_service_path(service, procedure_id: @procedure.id), class: 'link my-2')
|
.fr-col-4
|
||||||
- if @procedure.service != service
|
= link_to('Modifier', edit_admin_service_path(service, procedure_id: @procedure.id), class: 'fr-btn fr-btn--sm fr-btn--secondary fr-btn--icon-left fr-icon-pencil-line')
|
||||||
= link_to 'Supprimer',
|
.fr-col-4
|
||||||
|
= button_to 'Supprimer',
|
||||||
admin_service_path(service, procedure_id: @procedure.id),
|
admin_service_path(service, procedure_id: @procedure.id),
|
||||||
method: :delete,
|
method: :delete,
|
||||||
data: { confirm: "Confirmez vous la suppression de #{service.nom}" },
|
data: { confirm: "Confirmez vous la suppression de #{service.nom}" },
|
||||||
class: 'btn btn-link ml-2'
|
class: 'fr-btn fr-btn--sm fr-btn--secondary fr-btn--icon-left fr-icon-delete-line',
|
||||||
|
disabled: (@procedure.service == service)
|
||||||
|
|
||||||
= render Procedure::FixedFooterComponent.new(procedure: @procedure)
|
= render Procedure::FixedFooterComponent.new(procedure: @procedure)
|
||||||
|
|
Loading…
Reference in a new issue