page service
This commit is contained in:
parent
10ac3fe693
commit
1fe59c165f
3 changed files with 46 additions and 38 deletions
|
@ -39,6 +39,6 @@
|
|||
.fr-container
|
||||
%ul.fr-btns-group.fr-btns-group--inline-md
|
||||
%li
|
||||
= f.submit "Enregistrer", class: "fr-btn"
|
||||
= link_to "Annuler et revenir à l'écran de gestion", admin_procedure_path(id: @procedure.id), class: "fr-btn fr-btn--secondary"
|
||||
%li
|
||||
= link_to "Annuler et revenir à la page de suivi", admin_procedure_path(id: @procedure.id), class: "fr-btn fr-btn--secondary"
|
||||
= f.submit "Enregistrer", class: "fr-btn"
|
||||
|
|
|
@ -5,21 +5,22 @@
|
|||
['Modifier le service']] }
|
||||
|
||||
|
||||
.container
|
||||
.fr-container
|
||||
.flex.justify-between.align-center.fr-mb-3w
|
||||
= link_to "Liste de tous les services", admin_services_path(procedure_id: @procedure.id), class: "fr-link fr-icon-arrow-left-line fr-link--icon-left"
|
||||
= link_to "+ Nouveau service", new_admin_service_path(procedure_id: @procedure.id), class: "fr-btn"
|
||||
|
||||
%h1.fr-h2
|
||||
Modifier le service
|
||||
|
||||
- other_services = @service.procedures.reject {|procedure| procedure.id == @procedure.id }
|
||||
- if other_services.count > 1
|
||||
= render Dsfr::AlertComponent.new(state: :warning, title: "Modifier ce service impactera la ou les démarches qui sont rattachée/s") do |c|
|
||||
= render Dsfr::AlertComponent.new(state: :warning, title: "Modifier ce service impactera la ou les démarches qui sont rattachée/s", extra_class_names: 'fr-mb-3w') do |c|
|
||||
- c.with_body do
|
||||
%ul
|
||||
- other_services.each do |proc|
|
||||
%li= "#{proc.libelle} (N° #{proc.id})"
|
||||
%p.mt-3 Si vous souhaitez modifier uniquement les informations pour ce service, créez un nouveau service puis associez-le à la démarche
|
||||
|
||||
%p.mt-3
|
||||
= link_to "+ Nouveau service", new_admin_service_path(procedure_id: @procedure.id), class: "fr-btn"
|
||||
|
||||
|
||||
%h1.mt-2 Modifier le service
|
||||
|
||||
= render partial: 'form',
|
||||
locals: { service: @service, procedure_id: @procedure.id }
|
||||
|
|
|
@ -1,34 +1,41 @@
|
|||
= render partial: 'administrateurs/breadcrumbs',
|
||||
locals: { steps: [['Démarches', admin_procedures_path],
|
||||
[@procedure.libelle.truncate_words(10), admin_procedure_path(@procedure)],
|
||||
['Choix du service']] }
|
||||
['Service']] }
|
||||
|
||||
#services-index.container
|
||||
%h1.fr-h1 Liste des Services
|
||||
%h2.fr-h4 La démarche “#{@procedure.libelle}” peut être affectée aux services dans la liste ci-dessous
|
||||
#services-index.fr-container
|
||||
%h1.fr-h2 Service
|
||||
|
||||
%table.fr-table.width-100.mt-3
|
||||
%thead
|
||||
%tr
|
||||
%th{ scope: "col" }
|
||||
Nom
|
||||
%th.change{ scope: "col" }
|
||||
= link_to "Nouveau service", new_admin_service_path(procedure_id: @procedure.id), class: "fr-btn fr-btn--secondary"
|
||||
|
||||
%tbody
|
||||
- @services.each do |service|
|
||||
.fr-table.fr-table--layout-fixed
|
||||
%table
|
||||
%caption Liste des services pouvant être affectés à la démarche
|
||||
%thead
|
||||
%tr
|
||||
%td
|
||||
= service.nom
|
||||
%td.change
|
||||
- if @procedure.service == service
|
||||
%strong.mr-2 (Assigné)
|
||||
- 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'
|
||||
= link_to('Modifier', edit_admin_service_path(service, procedure_id: @procedure.id), class: 'link my-2')
|
||||
- if @procedure.service != service
|
||||
= link_to 'Supprimer',
|
||||
admin_service_path(service, procedure_id: @procedure.id),
|
||||
method: :delete,
|
||||
data: { confirm: "Confirmez vous la suppression de #{service.nom}" },
|
||||
class: 'btn btn-link ml-2'
|
||||
%th{ scope: "col" }
|
||||
Nom
|
||||
%th.change{ scope: "col" }
|
||||
= link_to "Nouveau service", new_admin_service_path(procedure_id: @procedure.id), class: "fr-btn fr-btn--secondary"
|
||||
|
||||
%tbody
|
||||
- @services.each do |service|
|
||||
%tr
|
||||
%td
|
||||
= service.nom
|
||||
%td.change
|
||||
- if @procedure.service == service
|
||||
%strong.mr-2 (Assigné)
|
||||
- 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'
|
||||
= link_to('Modifier', edit_admin_service_path(service, procedure_id: @procedure.id), class: 'link my-2')
|
||||
- if @procedure.service != service
|
||||
= link_to 'Supprimer',
|
||||
admin_service_path(service, procedure_id: @procedure.id),
|
||||
method: :delete,
|
||||
data: { confirm: "Confirmez vous la suppression de #{service.nom}" },
|
||||
class: 'btn btn-link ml-2'
|
||||
|
||||
.padded-fixed-footer
|
||||
.fixed-footer.fr-pb-2w
|
||||
.fr-container
|
||||
= link_to admin_procedure_path(id: @procedure), class: 'fr-link fr-icon-arrow-left-line fr-link--icon-left' do
|
||||
Revenir à l'écran de gestion
|
||||
|
|
Loading…
Reference in a new issue