Merge pull request #5389 from betagouv/fix/5287

fix/5287 - fix new admin interface regarding test links and previsualisation
This commit is contained in:
Kara Diaby 2020-07-17 11:28:40 +02:00 committed by GitHub
commit 862d0b719d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 5 deletions

View file

@ -12,6 +12,7 @@
display: flex;
flex-direction: column;
margin-bottom: 20px;
margin-right: 20px;
.card-admin-status-accept {
color: #50AA75;
@ -47,6 +48,10 @@
}
}
#test-procedure-link {
margin-right: 10px;
}
@media only screen and (max-width: 600px) {
.card-admin {
margin-left: auto;

View file

@ -2,5 +2,4 @@
.procedure-grid {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}

View file

@ -14,6 +14,11 @@ module NewAdministrateur
def show
@procedure = current_administrateur.procedures.find(params[:id])
if @procedure.brouillon?
@procedure_lien = commencer_test_url(path: @procedure.path)
else
@procedure_lien = commencer_url(path: @procedure.path)
end
end
def edit

View file

@ -2,8 +2,10 @@
locals: { steps: [link_to('Démarches', admin_procedures_path),
"#{@procedure.libelle} (crée le #{@procedure.created_at.strftime('%d/%m/%Y')})"] }
.container{ style: "text-align:right; margin-bottom: 20px" }
= button_to 'Publier la démarche', admin_procedure_publication_path(@procedure), method: :get, class: 'button primary',id: 'publish-procedure-link', disabled: @procedure.publiee? ? true : false
.container{ style: "display: flex; justify-content: flex-end; margin-bottom: 20px" }
- if @procedure.brouillon?
= link_to "Tester la démarche", sanitize_url(@procedure_lien), target: :blank, rel: :noopener, class: 'button primary', id: 'test-procedure-link'
= button_to 'Publier la démarche', admin_procedure_publication_path(@procedure), method: :get, class: 'button primary', id: 'publish-procedure-link', disabled: @procedure.publiee? ? true : false
.container
%h2.explication-libelle{ style: "font-weight: bold; font-size: 20px; margin-bottom: 20px;" } Indispensable avant publication
@ -69,8 +71,12 @@
%div
%p.card-admin-title
= feature_enabled?(:administrateur_routage) ? "Groupe Instructeurs" : "Instructeurs"
%span.badge.baseline
= @procedure.instructeurs.count
- if feature_enabled?(:administrateur_routage)
%span.badge.baseline
= @procedure.groupe_instructeurs.count
- else
%span.badge.baseline
= @procedure.instructeurs.count
%p.card-admin-subtitle Suivi des dossiers
.card-admin-action
- if feature_enabled?(:administrateur_routage)
@ -78,6 +84,17 @@
- else
= button_to 'Modifier', admin_procedure_groupe_instructeur_path(@procedure, @procedure.defaut_groupe_instructeur), method: :get, class: 'card-admin-action-btn', id: "instructeurs"
.card-admin
%div
%span.icon.preview
%p.card-admin-status-todo À visualiser
%div
%p.card-admin-title
Prévisualisation
%p.card-admin-subtitle Apperçu de la démarche
.card-admin-action
= button_to 'Voir', apercu_admin_procedure_path(@procedure), method: :get, class: 'card-admin-action-btn'
%h2.explication-libelle{ style: "font-weight: bold; font-size: 20px; margin-bottom: 20px;" } Pour aller plus loin
.procedure-grid
.card-admin