diff --git a/app/assets/stylesheets/new_design/card_admin.scss b/app/assets/stylesheets/new_design/card_admin.scss index c8b2d2fbb..db164891a 100644 --- a/app/assets/stylesheets/new_design/card_admin.scss +++ b/app/assets/stylesheets/new_design/card_admin.scss @@ -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; diff --git a/app/assets/stylesheets/new_design/procedure_grid.scss b/app/assets/stylesheets/new_design/procedure_grid.scss index 6a6eb5bf0..3527bed17 100644 --- a/app/assets/stylesheets/new_design/procedure_grid.scss +++ b/app/assets/stylesheets/new_design/procedure_grid.scss @@ -2,5 +2,4 @@ .procedure-grid { display: flex; flex-wrap: wrap; - justify-content: space-between; } diff --git a/app/controllers/new_administrateur/procedures_controller.rb b/app/controllers/new_administrateur/procedures_controller.rb index 997ab5af0..ea2500ed7 100644 --- a/app/controllers/new_administrateur/procedures_controller.rb +++ b/app/controllers/new_administrateur/procedures_controller.rb @@ -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 diff --git a/app/views/new_administrateur/procedures/show.html.haml b/app/views/new_administrateur/procedures/show.html.haml index 1e74adb63..0cef3c0be 100644 --- a/app/views/new_administrateur/procedures/show.html.haml +++ b/app/views/new_administrateur/procedures/show.html.haml @@ -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 diff --git a/yarn.lock b/yarn.lock index 61ac75fd5..987ce8348 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5597,9 +5597,9 @@ lodash.uniq@^4.5.0: integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= lodash@^4.0.0, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.5, lodash@~4.17.12: - version "4.17.15" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" - integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== + version "4.17.19" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" + integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ== loglevel@^1.6.8: version "1.6.8"