diff --git a/app/assets/images/logos/logo-ds.png b/app/assets/images/logos/logo-ds.png deleted file mode 100644 index 6e197dc98..000000000 Binary files a/app/assets/images/logos/logo-ds.png and /dev/null differ diff --git a/app/assets/images/marianne.svg b/app/assets/images/marianne.svg new file mode 100644 index 000000000..586b104f7 --- /dev/null +++ b/app/assets/images/marianne.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/assets/images/marianne_small.png b/app/assets/images/marianne_small.png deleted file mode 100644 index cc77557a6..000000000 Binary files a/app/assets/images/marianne_small.png and /dev/null differ diff --git a/app/assets/stylesheets/new_design/demande.scss b/app/assets/stylesheets/new_design/demande.scss index 6b0b88451..df4fd10c4 100644 --- a/app/assets/stylesheets/new_design/demande.scss +++ b/app/assets/stylesheets/new_design/demande.scss @@ -1,7 +1,9 @@ +@import "colors"; @import "constants"; .demande { - padding-bottom: $default-padding; + padding-top: 3 * $default-padding; + padding-bottom: 3 * $default-padding; h1 { margin-bottom: $default-padding; @@ -14,4 +16,12 @@ b { font-weight: bold; } + + hr { + border: none; + height: 1px; + background-color: $grey; + margin-top: 2 * $default-padding; + margin-bottom: 2 * $default-padding; + } } diff --git a/app/controllers/admin/attestation_templates_controller.rb b/app/controllers/admin/attestation_templates_controller.rb index 403bdb9e1..eaa795d39 100644 --- a/app/controllers/admin/attestation_templates_controller.rb +++ b/app/controllers/admin/attestation_templates_controller.rb @@ -54,6 +54,26 @@ class Admin::AttestationTemplatesController < AdminController render 'admin/attestation_templates/show', formats: [:pdf] end + def delete_logo + attestation_template = @procedure.attestation_template + + attestation_template.remove_logo! + attestation_template.save + + flash.notice = 'le logo a bien été supprimée' + redirect_to edit_admin_procedure_attestation_template_path(@procedure) + end + + def delete_signature + attestation_template = @procedure.attestation_template + + attestation_template.remove_signature! + attestation_template.save + + flash.notice = 'la signature a bien été supprimée' + redirect_to edit_admin_procedure_attestation_template_path(@procedure) + end + private def activated_attestation_params diff --git a/app/controllers/admin/procedures_controller.rb b/app/controllers/admin/procedures_controller.rb index 2e4a87c1c..8b1caace0 100644 --- a/app/controllers/admin/procedures_controller.rb +++ b/app/controllers/admin/procedures_controller.rb @@ -228,6 +228,15 @@ class Admin::ProceduresController < AdminController redirect_to edit_admin_procedure_path(procedure) end + def delete_notice + procedure = Procedure.find(params[:id]) + + procedure.notice.purge_later + + flash.notice = 'la notice a bien été supprimée' + redirect_to edit_admin_procedure_path(procedure) + end + private def cloned_from_library? diff --git a/app/decorators/procedure_decorator.rb b/app/decorators/procedure_decorator.rb index 1375cfa89..c9b310fc0 100644 --- a/app/decorators/procedure_decorator.rb +++ b/app/decorators/procedure_decorator.rb @@ -13,7 +13,7 @@ class ProcedureDecorator < Draper::Decorator def logo_img if logo.blank? - h.image_url(LOGO_NAME) + h.image_url("marianne.svg") else if Flipflop.remote_storage? (RemoteDownloader.new logo.filename).url diff --git a/app/views/admin/attestation_templates/edit.html.haml b/app/views/admin/attestation_templates/edit.html.haml index 68ed19536..5dbc5b309 100644 --- a/app/views/admin/attestation_templates/edit.html.haml +++ b/app/views/admin/attestation_templates/edit.html.haml @@ -17,6 +17,8 @@ = image_tag @attestation_template.logo.url, class: 'thumbnail' .form-group = f.label :logo, "Logo de l'attestation" + - if @attestation_template.logo.present? + = link_to 'Supprimer le logo', admin_procedure_attestation_template_logo_path(@procedure), method: :delete = f.file_field :logo, accept: 'image/png, image/jpg, image/jpeg' %p.help-block Fichier accepté : JPG / JPEG / PNG @@ -52,6 +54,8 @@ = image_tag @attestation_template.signature.url, class: 'thumbnail' .form-group = f.label :signature, "Tampon de l'attestation" + - if @attestation_template.signature.present? + = link_to 'Supprimer le tampon', admin_procedure_attestation_template_signature_path(@procedure), method: :delete = f.file_field :signature, accept: 'image/png, image/jpg, image/jpeg' %p.help-block Fichier accepté : JPG / JPEG / PNG diff --git a/app/views/admin/procedures/_informations.html.haml b/app/views/admin/procedures/_informations.html.haml index 2f4876d27..f5959dd1f 100644 --- a/app/views/admin/procedures/_informations.html.haml +++ b/app/views/admin/procedures/_informations.html.haml @@ -16,7 +16,7 @@ = f.label :duree_conservation_dossiers_dans_ds, "Sur demarches-simplifiees.fr* (durée en mois après le début de l’instruction)" = f.number_field :duree_conservation_dossiers_dans_ds, class: 'form-control', placeholder: '6', required: true - = f.label :duree_conservation_dossiers_hors_ds, "Hors demarches-simplifiees.fr* (durée en mois)" + = f.label :duree_conservation_dossiers_hors_ds, "Hors demarches-simplifiees.fr* (durée en mois après la fin de l'instruction)" = f.number_field :duree_conservation_dossiers_hors_ds, class: 'form-control', placeholder: '6', required: true .form-group @@ -60,6 +60,9 @@ - else %a{ href: url_for(notice), target: '_blank' } = notice.filename.to_s + \- + = link_to 'supprimer', delete_notice_admin_procedure_path(@procedure), + method: :delete %br Modifier : = f.file_field :notice, diff --git a/app/views/administrateurs/sessions/new.html.haml b/app/views/administrateurs/sessions/new.html.haml index 1a480db6f..c24523417 100644 --- a/app/views/administrateurs/sessions/new.html.haml +++ b/app/views/administrateurs/sessions/new.html.haml @@ -1,7 +1,4 @@ #form-login - %br - = image_tag(image_url(LOGO_NAME)) - %br %h2#login_admin = t('dynamics.admin.connexion_title') diff --git a/app/views/demandes/new.html.haml b/app/views/demandes/new.html.haml index 5f94d4696..25ff04b96 100644 --- a/app/views/demandes/new.html.haml +++ b/app/views/demandes/new.html.haml @@ -1,3 +1,8 @@ +- content_for(:title, 'Demande de compte administrateur') + +- content_for :footer do + = render partial: "root/footer" + .container.demande %h1 Demande de compte administrateur @@ -5,6 +10,8 @@ %p.intro Pour obtenir un compte administrateur sur demarches-simplifiees.fr, veuillez remplir le formulaire ci-dessous et un membre de notre équipe vous contactera dès que possible. %p.intro Tous les champs sont obligatoires. + %hr + = form_tag({ controller: 'demandes', action: 'create' }, class: 'form') do = label_tag :organization_name do diff --git a/app/views/gestionnaires/passwords/edit.html.haml b/app/views/gestionnaires/passwords/edit.html.haml index 64acc3d70..f037d1041 100644 --- a/app/views/gestionnaires/passwords/edit.html.haml +++ b/app/views/gestionnaires/passwords/edit.html.haml @@ -1,8 +1,6 @@ = devise_error_messages! #form-login - = image_tag(image_url(LOGO_NAME)) - %br %h2#gestionnaire_login Changement de mot de passe %br diff --git a/app/views/gestionnaires/passwords/new.html.haml b/app/views/gestionnaires/passwords/new.html.haml index 63b9cf09c..c8a6b356c 100644 --- a/app/views/gestionnaires/passwords/new.html.haml +++ b/app/views/gestionnaires/passwords/new.html.haml @@ -2,8 +2,6 @@ %br #form-login - = image_tag(image_url(LOGO_NAME)) - %br %h2#gestionnaire_login Mot de passe oublié %br diff --git a/app/views/gestionnaires/sessions/new.html.haml b/app/views/gestionnaires/sessions/new.html.haml index f7b275a8a..13a23e2c8 100644 --- a/app/views/gestionnaires/sessions/new.html.haml +++ b/app/views/gestionnaires/sessions/new.html.haml @@ -1,7 +1,4 @@ #form-login - %br - = image_tag(image_url(LOGO_NAME)) - %br %h2#gestionnaire_login Instructeur %br diff --git a/app/views/layouts/_navbar.html.haml b/app/views/layouts/_navbar.html.haml index 666f83856..80f5a6d57 100644 --- a/app/views/layouts/_navbar.html.haml +++ b/app/views/layouts/_navbar.html.haml @@ -2,7 +2,7 @@ %a#title-navbar{ href: root_path } .row#home .col-lg-6.no-padding - = image_tag('marianne_small.png', class: 'logo') + = image_tag('marianne.svg', class: 'logo') .col-lg-6.no-padding#tps-title demarches-simplifiees.fr diff --git a/app/views/users/passwords/edit.html.haml b/app/views/users/passwords/edit.html.haml index 8b7a7a563..f037d1041 100644 --- a/app/views/users/passwords/edit.html.haml +++ b/app/views/users/passwords/edit.html.haml @@ -1,9 +1,6 @@ = devise_error_messages! #form-login - .flag - = image_tag(image_url(LOGO_NAME)) - %br %h2#gestionnaire_login Changement de mot de passe %br diff --git a/app/views/users/passwords/new.html.haml b/app/views/users/passwords/new.html.haml index 85ad6d44f..c8a6b356c 100644 --- a/app/views/users/passwords/new.html.haml +++ b/app/views/users/passwords/new.html.haml @@ -2,9 +2,6 @@ %br #form-login - .flag - = image_tag(image_url(LOGO_NAME)) - %br %h2#gestionnaire_login Mot de passe oublié %br diff --git a/app/views/users/sessions/_resume_procedure.html.haml b/app/views/users/sessions/_resume_procedure.html.haml index 56ea59e91..9df51d63b 100644 --- a/app/views/users/sessions/_resume_procedure.html.haml +++ b/app/views/users/sessions/_resume_procedure.html.haml @@ -14,7 +14,3 @@ = @dossier.procedure.libelle %p.procedure-description = h string_to_html(@dossier.procedure.description) - -- else - #logo_procedure.flag - = image_tag(image_url(LOGO_NAME), { id: 'logo_tps' }) diff --git a/app/views/users/siret/_pro.html.haml b/app/views/users/siret/_pro.html.haml index d9ac910fc..8221d00e4 100644 --- a/app/views/users/siret/_pro.html.haml +++ b/app/views/users/siret/_pro.html.haml @@ -1,7 +1,4 @@ %p.lead#pro_section - .flag - = image_tag(image_url(LOGO_NAME)) - %br %h2#titre-procedure.text-info = @procedure.libelle diff --git a/config/initializers/logos.rb b/config/initializers/logos.rb deleted file mode 100644 index 896e55adc..000000000 --- a/config/initializers/logos.rb +++ /dev/null @@ -1 +0,0 @@ -LOGO_NAME = 'logos/logo-ds.png' diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 95cb6a84b..435865431 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -113,6 +113,11 @@ fr: format: delimiter: '' activerecord: + attributes: + user: + password: 'Le mot de passe' + gestionnaire: + password: 'Le mot de passe' errors: messages: blank: "doit être rempli" @@ -138,7 +143,7 @@ fr: invalid: invalide taken: déjà utilisé password: - too_short: ': Le mot de passe est trop court' + too_short: 'est trop court' password_confirmation: confirmation: ': Les deux mots de passe ne correspondent pas' invite: @@ -151,7 +156,7 @@ fr: invalid: invalide taken: déjà utilisé password: - too_short: ': Le mot de passe est trop court' + too_short: 'est trop court' errors: messages: diff --git a/config/routes.rb b/config/routes.rb index d8c3447a0..70c7e2b0c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -194,6 +194,7 @@ Rails.application.routes.draw do member do post :hide delete :delete_deliberation + delete :delete_notice end resources :types_de_champ, only: [:destroy] @@ -231,6 +232,9 @@ Rails.application.routes.draw do post 'attestation_template/preview' => 'attestation_templates#preview' patch 'attestation_template/preview' => 'attestation_templates#preview' + + delete 'attestation_template/logo' => 'attestation_templates#delete_logo' + delete 'attestation_template/signature' => 'attestation_templates#delete_signature' end namespace :instructeurs do diff --git a/lib/tasks/dev.rake b/lib/tasks/dev.rake index ad0ff0d5a..224ddf5b6 100644 --- a/lib/tasks/dev.rake +++ b/lib/tasks/dev.rake @@ -27,6 +27,6 @@ namespace :dev do end task :console do - exec("ssh tps@sgmap_production1 -t 'source /etc/profile && cd current && bundle exec rails c production'") + exec("ssh tps@sgmap_production1 -t 'source /etc/profile && cd current && bundle exec rails c -e production'") end end diff --git a/spec/controllers/new_gestionnaire/avis_controller_spec.rb b/spec/controllers/new_gestionnaire/avis_controller_spec.rb index cb7a76d54..09de77c53 100644 --- a/spec/controllers/new_gestionnaire/avis_controller_spec.rb +++ b/spec/controllers/new_gestionnaire/avis_controller_spec.rb @@ -276,7 +276,7 @@ describe NewGestionnaire::AvisController, type: :controller do it { expect(created_gestionnaire).to be_nil } it { is_expected.to redirect_to sign_up_gestionnaire_avis_path(avis_id, invited_email) } - it { expect(flash.alert).to eq(['Password doit être rempli']) } + it { expect(flash.alert).to eq(['Le mot de passe doit être rempli']) } end end end diff --git a/spec/decorators/procedure_decorator_spec.rb b/spec/decorators/procedure_decorator_spec.rb index 6234946c4..c6bef231d 100644 --- a/spec/decorators/procedure_decorator_spec.rb +++ b/spec/decorators/procedure_decorator_spec.rb @@ -24,7 +24,7 @@ describe ProcedureDecorator do describe 'logo_img' do subject { super().logo_img } - it { is_expected.to match(/http.*#{ActionController::Base.helpers.image_url(LOGO_NAME)}/) } + it { is_expected.to match(/http.*#{ActionController::Base.helpers.image_url("marianne.svg")}/) } end describe 'geographic_information' do