diff --git a/.ruby-version b/.ruby-version index cd57a8b95..2bf1c1ccf 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.1.5 +2.3.1 diff --git a/Gemfile b/Gemfile index 026ba7955..b92fc4cbe 100644 --- a/Gemfile +++ b/Gemfile @@ -104,9 +104,9 @@ group :test do gem 'simplecov', require: false gem 'poltergeist' gem 'timecop' - gem 'guard' - gem 'guard-rspec', require: false - gem 'guard-livereload', '~> 2.4', require: false + # gem 'guard' + # gem 'guard-rspec', require: false + # gem 'guard-livereload', '~> 2.4', require: false gem 'vcr' end diff --git a/Gemfile.lock b/Gemfile.lock index a7599faa6..706c620e8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -136,11 +136,7 @@ GEM activemodel (>= 3.0) activesupport (>= 3.0) request_store (~> 1.0) - em-websocket (0.5.1) - eventmachine (>= 0.12.9) - http_parser.rb (~> 0.6.0) erubis (2.7.0) - eventmachine (1.0.8) excon (0.49.0) execjs (2.7.0) factory_girl (4.5.0) @@ -283,24 +279,6 @@ GEM formatador (0.2.5) globalid (0.3.7) activesupport (>= 4.1.0) - guard (2.13.0) - formatador (>= 0.2.4) - listen (>= 2.7, <= 4.0) - lumberjack (~> 1.0) - nenv (~> 0.1) - notiffany (~> 0.0) - pry (>= 0.9.12) - shellany (~> 0.0) - thor (>= 0.18.1) - guard-compat (1.2.1) - guard-livereload (2.5.1) - em-websocket (~> 0.5) - guard (~> 2.8) - guard-compat (~> 1.0) - multi_json (~> 1.8) - guard-rspec (4.3.1) - guard (~> 2.1) - rspec (>= 2.14, < 4.0) haml (4.0.6) tilt haml-rails (0.9.0) @@ -318,7 +296,6 @@ GEM ruby_parser (~> 3.5) http-cookie (1.0.2) domain_name (~> 0.5) - http_parser.rb (0.6.0) httpclient (2.6.0.1) i18n (0.7.0) inflecto (0.0.2) @@ -346,16 +323,12 @@ GEM railties (>= 3.1) leaflet-rails (0.7.4) libv8 (3.16.14.7) - listen (3.0.4) - rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9) logstash-event (1.2.02) logstasher (0.6.5) logstash-event (~> 1.2.0) request_store loofah (2.0.3) nokogiri (>= 1.5.9) - lumberjack (1.0.9) mail (2.6.4) mime-types (>= 1.16, < 4) mailjet (1.1.0) @@ -369,14 +342,10 @@ GEM minitest (5.9.0) multi_json (1.11.2) multipart-post (2.0.0) - nenv (0.2.0) netrc (0.10.3) nokogiri (1.6.8) mini_portile2 (~> 2.1.0) pkg-config (~> 1.1.7) - notiffany (0.0.8) - nenv (~> 0.1) - shellany (~> 0.0) nyan-cat-formatter (0.11) rspec (>= 2.99, >= 2.14.2, < 4) open4 (1.3.4) @@ -451,9 +420,6 @@ GEM rainbow (2.0.0) raindrops (0.13.0) rake (11.2.2) - rb-fsevent (0.9.6) - rb-inotify (0.9.5) - ffi (>= 0.5.0) rbvmomi (1.8.2) builder nokogiri (>= 1.4.1) @@ -528,7 +494,6 @@ GEM sentry-raven (0.13.1) faraday (>= 0.7.6) sexp_processor (4.6.0) - shellany (0.0.1) shoulda-matchers (2.8.0) activesupport (>= 3.0.0) simplecov (0.9.1) @@ -643,9 +608,6 @@ DEPENDENCIES fog fog-openstack font-awesome-rails - guard - guard-livereload (~> 2.4) - guard-rspec haml-rails hashie jbuilder (~> 2.0) diff --git a/app/assets/images/logos/logo-opensimplif.jpg b/app/assets/images/logos/logo-opensimplif.jpg new file mode 100644 index 000000000..d87c8b015 Binary files /dev/null and b/app/assets/images/logos/logo-opensimplif.jpg differ diff --git a/app/assets/images/logo-tps.png b/app/assets/images/logos/logo-tps.png similarity index 100% rename from app/assets/images/logo-tps.png rename to app/assets/images/logos/logo-tps.png diff --git a/app/assets/javascripts/dossiers_list_filter.js b/app/assets/javascripts/dossiers_list_filter.js index dee999526..3a50fc6a5 100644 --- a/app/assets/javascripts/dossiers_list_filter.js +++ b/app/assets/javascripts/dossiers_list_filter.js @@ -3,9 +3,21 @@ $(document).ready(filters_init); function filters_init() { + $('html').click(function(event) { + var visible_filter = $('.filter_framed:visible') + if(visible_filter.length) { + if (!$(event.target).closest('.filter_framed').is(":visible")) { + visible_filter.hide(); + } + } + }); $(".filter").on('click', function (event) { filter_framed_show(event); filter_framed_close_all_excepted(framed_id(event)); + event.stopPropagation(); + }); + $(".erase-filter").on('click', function (event) { + $(this).parent().find(".filter_input").val(""); }); } @@ -24,4 +36,4 @@ function filter_framed_show(event) { dom_object.css('top', (event.pageY + 7) + 'px'); dom_object.css('left', (event.pageX + 7) + 'px'); -} \ No newline at end of file +} diff --git a/app/assets/javascripts/pref_list_dossier.js b/app/assets/javascripts/pref_list_dossier.js index 70bf1a4dd..977778ff1 100644 --- a/app/assets/javascripts/pref_list_dossier.js +++ b/app/assets/javascripts/pref_list_dossier.js @@ -30,4 +30,4 @@ function pref_list_dossier_close_action() { } ) }); -} \ No newline at end of file +} diff --git a/app/controllers/admin/procedures_controller.rb b/app/controllers/admin/procedures_controller.rb index 0e51c2097..4d8e44af3 100644 --- a/app/controllers/admin/procedures_controller.rb +++ b/app/controllers/admin/procedures_controller.rb @@ -179,7 +179,12 @@ class Admin::ProceduresController < AdminController end def path_list - render json: ProcedurePath.where("path LIKE '%#{params[:request]}%'").pluck(:path, :administrateur_id).inject([]) { + render json: ProcedurePath + .joins(', procedures') + .where("procedures.id = procedure_paths.procedure_id AND procedures.archived != true") + .where("path LIKE '%#{params[:request]}%'") + .pluck(:path, :administrateur_id) + .inject([]) { |acc, value| acc.push({label: value.first, mine: value.second == current_administrateur.id}) }.to_json end diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index 8e175d8b2..f5ef2472f 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -30,6 +30,13 @@ class Users::DossiersController < UsersController procedure = ProcedurePath.where(path: params[:procedure_path]).first!.procedure end + if procedure.archived? + + @dossier = Dossier.new(procedure: procedure) + + return render 'commencer/archived' + end + redirect_to new_users_dossier_path(procedure_id: procedure.id) rescue ActiveRecord::RecordNotFound error_procedure diff --git a/app/decorators/procedure_decorator.rb b/app/decorators/procedure_decorator.rb index df848570d..f78a02d88 100644 --- a/app/decorators/procedure_decorator.rb +++ b/app/decorators/procedure_decorator.rb @@ -1,4 +1,5 @@ class ProcedureDecorator < Draper::Decorator + delegate_all def lien @@ -10,7 +11,7 @@ class ProcedureDecorator < Draper::Decorator end def logo_img - return 'logo-tps.png' if logo.blank? + return h.image_url(LOGO_NAME) if logo.blank? File.join(STORAGE_URL, File.basename(logo.path)) end def geographic_information diff --git a/app/models/preference_list_dossier.rb b/app/models/preference_list_dossier.rb index c09ed6682..0fa14f24e 100644 --- a/app/models/preference_list_dossier.rb +++ b/app/models/preference_list_dossier.rb @@ -36,10 +36,10 @@ class PreferenceListDossier < ActiveRecord::Base table = nil { - dossier_id: create_column('ID', table, 'id', 'id', 1), + dossier_id: create_column('N°', table, 'id', 'id', 1), created_at: create_column('Créé le', table, 'created_at', 'first_creation', 2), updated_at: create_column('Mise à jour le', table, 'updated_at', 'last_update', 2), - state: create_column('Statut', table, 'state', 'display_state', 1) + state: create_column('État', table, 'state', 'display_state', 1) } end diff --git a/app/models/procedure.rb b/app/models/procedure.rb index f8d737532..9a81ed2b6 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -103,7 +103,6 @@ class Procedure < ActiveRecord::Base end def archive - self.procedure_path.destroy! if self.path self.update_attributes!({archived: true}) end diff --git a/app/views/admin/accompagnateurs/show.html.haml b/app/views/admin/accompagnateurs/show.html.haml index edcac3188..e12a5e379 100644 --- a/app/views/admin/accompagnateurs/show.html.haml +++ b/app/views/admin/accompagnateurs/show.html.haml @@ -7,7 +7,8 @@ = smart_listing_render :accompagnateurs_not_assign %br - %h3 Ajouter un accompagnateur + %h3 + =t('dynamics.admin.procedure.onglet_accompagnateurs.add.title') #procedure_new.section.section-label = form_for @gestionnaire, url: {controller: 'admin/gestionnaires', action: :create} do |f| .row diff --git a/app/views/admin/procedures/_navbar.html.haml b/app/views/admin/procedures/_navbar.html.haml index f2d67d181..b9a736f4f 100644 --- a/app/views/admin/procedures/_navbar.html.haml +++ b/app/views/admin/procedures/_navbar.html.haml @@ -2,7 +2,7 @@ = link_to('Informations', admin_procedure_path(@procedure)) %li{ class: ('active' if active == 'Accompagnateurs') } - = link_to('Accompagnateurs', admin_procedure_accompagnateurs_path(@procedure)) + = link_to(t('dynamics.admin.procedure.onglets.accompagnateurs'), admin_procedure_accompagnateurs_path(@procedure)) %li{ class: ('disabled' if @procedure.locked?) || ('active' if active == 'Description') } = link_to_unless(@procedure.locked?, 'Description', edit_admin_procedure_path(@procedure)) do diff --git a/app/views/admin/procedures/index.html.haml b/app/views/admin/procedures/index.html.haml index f79272923..825ad5f5e 100644 --- a/app/views/admin/procedures/index.html.haml +++ b/app/views/admin/procedures/index.html.haml @@ -1,5 +1,6 @@ -= link_to("Nouvelle procédure", "/admin/procedures/new", class: 'btn btn-success', style: 'float:right; margin-top:2%;') -%h1 Gestion des procédures += link_to(t('dynamics.admin.dossiers.tableau_de_bord.nouvelle_procedure'), "/admin/procedures/new", class: 'btn btn-success', style: 'float:right; margin-top:2%;') +%h1 + =t('dynamics.admin.dossiers.tableau_de_bord.title') %br = render partial: 'onglets' diff --git a/app/views/admin/procedures/new.html.haml b/app/views/admin/procedures/new.html.haml index d72bed14b..391adde06 100644 --- a/app/views/admin/procedures/new.html.haml +++ b/app/views/admin/procedures/new.html.haml @@ -1,4 +1,5 @@ -%h2 Nouvelle procédure +%h2 + =t('dynamics.admin.dossiers.tableau_de_bord.nouvelle_procedure') #procedure_new.section.section-label = form_for @procedure, url: {controller: 'admin/procedures', action: :create}, multipart: true do |f| diff --git a/app/views/admin/procedures/show.html.haml b/app/views/admin/procedures/show.html.haml index d14ff8065..b250fbda5 100644 --- a/app/views/admin/procedures/show.html.haml +++ b/app/views/admin/procedures/show.html.haml @@ -83,7 +83,8 @@ = piece_justificative.libelle %br %br - %h3 Dossiers + %h3 + =t('dynamics.admin.procedure.stats.title') .row .col-md-6.col-lg-6{style:'margin-left:3%'} diff --git a/app/views/administrateurs/_login_banner.html.haml b/app/views/administrateurs/_login_banner.html.haml index 0d6c464da..90353b334 100644 --- a/app/views/administrateurs/_login_banner.html.haml +++ b/app/views/administrateurs/_login_banner.html.haml @@ -9,11 +9,13 @@ %li = link_to(admin_procedures_path, id: :menu_item_procedure) do %i.fa.fa-list{ style: "background-size: 10px;"} -  Procédures +   + =t('dynamics.admin.menu.procedures') %li = link_to(admin_gestionnaires_path) do %i.fa.fa-user -  Accompagnateur +   + =t('dynamics.admin.menu.accompagnateurs') %li.divider{ role: :separator} %li = link_to(admin_profile_path, id: :profile) do diff --git a/app/views/administrateurs/sessions/new.html.haml b/app/views/administrateurs/sessions/new.html.haml index b560b422d..2c2185b9b 100644 --- a/app/views/administrateurs/sessions/new.html.haml +++ b/app/views/administrateurs/sessions/new.html.haml @@ -1,8 +1,9 @@ #form_login %br - = image_tag('logo-tps.png') + = image_tag(image_url(LOGO_NAME)) %br - %h2#login_admin Administration + %h2#login_admin + =t('dynamics.admin.connexion_title') %br %br @@ -16,7 +17,7 @@ = f.email_field :email, class: 'form-control' %br %h4 - = f.label :password + = f.label 'Mot de passe' .input-group .input-group-addon %span.glyphicon.glyphicon-asterisk diff --git a/app/views/backoffice/dossiers/_filter_framed.html.haml b/app/views/backoffice/dossiers/_filter_framed.html.haml index 0c69e2aed..35c60c7f8 100644 --- a/app/views/backoffice/dossiers/_filter_framed.html.haml +++ b/app/views/backoffice/dossiers/_filter_framed.html.haml @@ -3,6 +3,8 @@ = preference.libelle =form_tag @dossiers_list_facade.filter_url, {class: 'panel-body form-inline', method: :post} do - %input.form-control.filter_input{name: "filter_input[#{preference.table_attr}]", style:'width: 84%', value: "#{preference.filter}"} + %input.form-control.filter_input{name: "filter_input[#{preference.table_attr}]", style:'width: 69%', value: "#{preference.filter}"} %button.btn.btn-sm.btn-success - %i.fa.fa-check \ No newline at end of file + %i.fa.fa-check + %div.btn.btn-sm.btn-danger.erase-filter + %i.fa.fa-remove diff --git a/app/views/backoffice/dossiers/_follow_action.html.haml b/app/views/backoffice/dossiers/_follow_action.html.haml index 2a87b49eb..c695c9942 100644 --- a/app/views/backoffice/dossiers/_follow_action.html.haml +++ b/app/views/backoffice/dossiers/_follow_action.html.haml @@ -1,4 +1,4 @@ - if current_gestionnaire.follow?(@facade.dossier.id) - = link_to('Quitter'.html_safe, backoffice_dossier_follow_path(dossier_id: @facade.dossier.id), 'data-method' => :put, class: 'btn btn-md btn-danger', id: "suivre_dossier_#{@facade.dossier.id}") + = link_to('Se désabonner'.html_safe, backoffice_dossier_follow_path(dossier_id: @facade.dossier.id), 'data-method' => :put, class: 'btn btn-md btn-danger', id: "suivre_dossier_#{@facade.dossier.id}") -else - = link_to('Suivre', backoffice_dossier_follow_path(dossier_id: @facade.dossier.id), 'data-method' => :put, class: 'btn btn-md btn-primary', id: "suivre_dossier_#{@facade.dossier.id}") + = link_to("S'abonner", backoffice_dossier_follow_path(dossier_id: @facade.dossier.id), 'data-method' => :put, class: 'btn btn-md btn-primary', id: "suivre_dossier_#{@facade.dossier.id}") diff --git a/app/views/backoffice/dossiers/_followers.html.haml b/app/views/backoffice/dossiers/_followers.html.haml index 8274055d4..be87860b8 100644 --- a/app/views/backoffice/dossiers/_followers.html.haml +++ b/app/views/backoffice/dossiers/_followers.html.haml @@ -1,4 +1,5 @@ -%h3 Personnes suivant l'activité de ce dossier +%h3 + =t('dynamics.dossiers.followers.title') %br .row diff --git a/app/views/backoffice/dossiers/_onglets.html.haml b/app/views/backoffice/dossiers/_onglets.html.haml index c19dcf170..fa32c51b0 100644 --- a/app/views/backoffice/dossiers/_onglets.html.haml +++ b/app/views/backoffice/dossiers/_onglets.html.haml @@ -1,6 +1,9 @@ -#filter_by_procedure{style:'margin-left: 5%'} +#filter_by_procedure{style:'margin-left: 2%'} + %b.text-info + = t('dynamics.backoffice.filter_procedure.title') %select{onchange: 'location = this.value', style:'margin-top: 10px; margin-bottom: 10px', id: 'filter_by_procedure_select'} %option{value: backoffice_dossiers_path} + = t('dynamics.backoffice.filter_procedure.first') - @dossiers_list_facade.gestionnaire_procedures_name_and_id_list.each do |procedure| %option{value: backoffice_dossiers_procedure_path(procedure[:id]), ('selected' if procedure[:id] == params[:id].to_i) => '' } = truncate(procedure[:libelle], {length: 50}) @@ -55,7 +58,7 @@ %a = form_tag(backoffice_dossiers_search_url, method: :get) do .input-group{style:'width: 300px'} - = text_field_tag('q', "#{@search_terms unless @search_terms.nil? }", id: 'q', placeholder: "Rechercher un dossier ...", class:'form-control') + = text_field_tag('q', "#{@search_terms unless @search_terms.nil? }", id: 'q', placeholder: t('dynamics.backoffice.research.placeholder'), class:'form-control') %span.input-group-btn %button.btn.btn-default{ id:'search_button' } %i.fa.fa-search diff --git a/app/views/backoffice/dossiers/_pref_list.html.haml b/app/views/backoffice/dossiers/_pref_list.html.haml index b45576213..310852807 100644 --- a/app/views/backoffice/dossiers/_pref_list.html.haml +++ b/app/views/backoffice/dossiers/_pref_list.html.haml @@ -1,9 +1,10 @@ %button#pref_list_dossier_close_action.btn.btn-danger.btn-xs{style:'float:right'} %i.fa.fa-close -%h3 Gestion de colonnes affichées +%h3 + =t('dynamics.backoffice.pref_list.title') %p{style:'margin-top: 15px; margin-bottom: 20px'} - Ce menu vous permet de choisir les différentes colonnes que vous souhaitez voir apparaitrent dans votre interface de suivi des dossiers. + =t('dynamics.backoffice.pref_list.description') %h4.text-primary Actuelles diff --git a/app/views/backoffice/dossiers/index.html.haml b/app/views/backoffice/dossiers/index.html.haml index 7a9a68328..2f1f62703 100644 --- a/app/views/backoffice/dossiers/index.html.haml +++ b/app/views/backoffice/dossiers/index.html.haml @@ -2,8 +2,9 @@ #pref_list_menu = render partial: 'backoffice/dossiers/pref_list' - =link_to 'Tous mes dossiers en CSV', backoffice_download_dossiers_tps_path, {class: 'btn btn-success btn-sm', style: 'float: right; margin-right: 4%; margin-top: 7px'} - %h1 Gestion des dossiers + =link_to t('dynamics.backoffice.download_all_dossiers'), backoffice_download_dossiers_tps_path, {class: 'btn btn-success btn-sm', style: 'float: right; margin-right: 4%; margin-top: 7px'} + %h1 + =t('dynamics.backoffice.title') = render partial: 'backoffice/dossiers/onglets' diff --git a/app/views/backoffice/dossiers/show.html.haml b/app/views/backoffice/dossiers/show.html.haml index 9d0288dd9..223c49508 100644 --- a/app/views/backoffice/dossiers/show.html.haml +++ b/app/views/backoffice/dossiers/show.html.haml @@ -1,6 +1,6 @@ #backoffice_dossier_show %h1#dossier_id.text-info{ :style => 'text-align:right'} - = "Dossier n°#{@facade.dossier.id}" + = t('dynamics.dossiers.numéro') + @facade.dossier.id.to_s %div{:style => 'text-align:right'} %h3{:class => 'text-success'} diff --git a/app/views/commencer/archived.html.haml b/app/views/commencer/archived.html.haml new file mode 100644 index 000000000..5ad9c0f18 --- /dev/null +++ b/app/views/commencer/archived.html.haml @@ -0,0 +1,15 @@ +%br +%div{style: 'text-align: center; max-width:500px; margin-left:auto; margin-right:auto; padding: 20px;'} + = render partial: 'users/sessions/resume_procedure' + +.center{style:'margin-top: -20px'} + %h3 + La campagne de création de nouveau dossier + %br + pour cette démarche en ligne est maintenant terminée. + + %br + %p + Si vous avez déjà déposé un ou plusieurs dossiers : + %a.btn.btn-lg.btn-info{href: new_user_session_path} + Accéder à mon espace en ligne. \ No newline at end of file diff --git a/app/views/dossiers/_infos_dossier.html.haml b/app/views/dossiers/_infos_dossier.html.haml index 2a18e98fa..c34efe26c 100644 --- a/app/views/dossiers/_infos_dossier.html.haml +++ b/app/views/dossiers/_infos_dossier.html.haml @@ -7,7 +7,8 @@ - if @facade.procedure.for_individual? %br .individual.text-info - %h4 Dépositaire + %h4 + =t('dynamics.dossiers.depositaite') %table.table{style:'width: 60%'} %tr @@ -25,11 +26,12 @@ Prénom %td.col-md-5.col-lg-5 = @facade.individual.prenom - %tr - %th.col-md-3.col-lg-3 - Date de naissance - %td.col-md-5.col-lg-5 - = @facade.individual.birthdate + - unless Features.opensimplif + %tr + %th.col-md-3.col-lg-3 + Date de naissance + %td.col-md-5.col-lg-5 + = @facade.individual.birthdate - if @facade.dossier.mandataire_social && gestionnaire_signed_in? .mandataire_social.text-success.center diff --git a/app/views/dossiers/_invites.html.haml b/app/views/dossiers/_invites.html.haml index 8328ef5c4..d2fa82d4e 100644 --- a/app/views/dossiers/_invites.html.haml +++ b/app/views/dossiers/_invites.html.haml @@ -9,7 +9,7 @@ %li = invite.email - else - Aucune personne invité + Aucune personne invitée .col-md-3.col-lg-3 =form_tag invites_dossier_path(dossier_id: @facade.dossier.id), method: :post, class: 'form-inline' do diff --git a/app/views/dossiers/_tab_objects_dossier.html.haml b/app/views/dossiers/_tab_objects_dossier.html.haml index 3384c2e26..6e0c684fe 100644 --- a/app/views/dossiers/_tab_objects_dossier.html.haml +++ b/app/views/dossiers/_tab_objects_dossier.html.haml @@ -17,7 +17,7 @@ Abonnés %li{role: "presentation"} %a{href: "#champs_private", 'aria-controls' => "champs_private", role: "tab", 'data-toggle' => "tab"} - Formulaire + Champs privés %div{class: "tab-content"} %div{role: "tabpanel", class: "tab-pane fade in active", id:"commentaires"} @@ -34,11 +34,11 @@ %div{role: "tabpanel", class: "tab-pane fade", id:"followers"} = render partial: 'followers' %div{role: "tabpanel", class: "tab-pane fade", id:"champs_private"} - %h3 Formulaire privé + %h3 Champs privés - if @champs.nil? || @champs.empty? %br %h4.text-primary - Pas de formulaire privé pour ce dossier + Pas de champ privé pour ce dossier - else = form_for @facade.dossier, url: {controller: 'backoffice/private_formulaires', action: :update, dossier_id: @facade.dossier.id}, remote: true do = render partial: '/users/description/champs' diff --git a/app/views/gestionnaires/passwords/edit.html.haml b/app/views/gestionnaires/passwords/edit.html.haml index ff4027fe4..7b387b366 100644 --- a/app/views/gestionnaires/passwords/edit.html.haml +++ b/app/views/gestionnaires/passwords/edit.html.haml @@ -1,7 +1,7 @@ = devise_error_messages! #form_login - = image_tag('logo-tps.png') + = image_tag(image_url(LOGO_NAME)) %br %h2#gestionnaire_login Changement de mot de passe diff --git a/app/views/gestionnaires/passwords/new.html.haml b/app/views/gestionnaires/passwords/new.html.haml index eed941e40..b0e8cddb9 100644 --- a/app/views/gestionnaires/passwords/new.html.haml +++ b/app/views/gestionnaires/passwords/new.html.haml @@ -2,7 +2,7 @@ %br #form_login - = image_tag('logo-tps.png') + = image_tag(image_url(LOGO_NAME)) %br %h2#gestionnaire_login Mot de passe oublié diff --git a/app/views/gestionnaires/sessions/new.html.haml b/app/views/gestionnaires/sessions/new.html.haml index a3de3cd1e..d6e4dc203 100644 --- a/app/views/gestionnaires/sessions/new.html.haml +++ b/app/views/gestionnaires/sessions/new.html.haml @@ -1,6 +1,6 @@ #form_login %br - = image_tag('logo-tps.png') + = image_tag(image_url(LOGO_NAME)) %br %h2#gestionnaire_login Accompagnateur diff --git a/app/views/layouts/_navbar.html.haml b/app/views/layouts/_navbar.html.haml index 47dd43354..c67a744f2 100644 --- a/app/views/layouts/_navbar.html.haml +++ b/app/views/layouts/_navbar.html.haml @@ -5,22 +5,22 @@ Env Test = image_tag('marianne_small.png', class: 'logo') %a{href: '/'} - = image_tag('logo-tps.png', class: 'logo') + = image_tag(image_url(LOGO_NAME), class: 'logo') rescue nil - if gestionnaire_signed_in? && user_signed_in? %a{href: (current_gestionnaire.procedure_filter.blank? ? backoffice_dossiers_path : backoffice_dossiers_procedure_path(current_gestionnaire.procedure_filter)), class: 'btn btn-md'} - Dossiers + =t('dynamics.backoffice.dossiers') %a{href: users_dossiers_path, class: 'btn btn-md'} - Mes Dossiers + =t('dynamics.users.mes_dossiers') - elsif gestionnaire_signed_in? %a{href: (current_gestionnaire.procedure_filter.blank? ? backoffice_dossiers_path : backoffice_dossiers_procedure_path(current_gestionnaire.procedure_filter)), class: 'btn btn-md'} - Mes Dossiers + =t('dynamics.users.mes_dossiers') - elsif user_signed_in? %a{href: users_dossiers_path, class: 'btn btn-md'} - Mes Dossiers + =t('dynamics.users.mes_dossiers') - elsif administrateur_signed_in? %a{href: admin_procedures_path, class: 'btn btn-md'} - Mes Procédures + =t('dynamics.admin.menu.title') #sign_out -if user_signed_in? diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index aab4cbe64..d1bda0bb0 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -51,7 +51,7 @@ \- - =link_to 'Contact', "mailto:contact@tps.apientreprise.fr" + =link_to 'Contact', "mailto:"+t('dynamics.contact_email') diff --git a/app/views/users/description/_show.html.haml b/app/views/users/description/_show.html.haml index 7c49b634d..03217cb0e 100644 --- a/app/views/users/description/_show.html.haml +++ b/app/views/users/description/_show.html.haml @@ -14,7 +14,8 @@ %h2.text-info = @dossier.procedure.libelle - %h3 Votre dossier + - unless Features.opensimplif + %h3 Votre dossier -#TODO use form_for = form_tag(url_for({controller: 'users/description', action: :create, dossier_id: @dossier.id}), class: 'form-inline', method: 'POST', multipart: true) do @@ -37,19 +38,19 @@ //TODO a refactorer = render partial: 'users/description/pieces_justificatives' - #state_description.row{style:'width: 50%; margin-left:20px'} - .panel.panel-info - .panel-body.center - .row - .col-md-1.col-lg-1 - .fa.fa-info-circle.text-info{style:'font-size: 2em; margin-top: 20%'} - .col-md-11.col-lg-11 - Les documents administratifs ne sont pas indispensables afin d'initier votre dossier. - Vous pourrez dans tous les cas les compléter plus tard si vous ne les possédez pas de suite. + - unless Features.opensimplif + #state_description.row{style:'width: 50%; margin-left:20px'} + .panel.panel-info + .panel-body.center + .row + .col-md-1.col-lg-1 + .fa.fa-info-circle.text-info{style:'font-size: 2em; margin-top: 20%'} + .col-md-11.col-lg-11 + Les documents administratifs ne sont pas indispensables afin d'initier votre dossier. + Vous pourrez dans tous les cas les compléter plus tard si vous ne les possédez pas de suite. - if user_signed_in? - %div{style: 'text-align:right'} %h6 Tous les champs portant un * sont obligatoires. diff --git a/app/views/users/dossiers/index.html.haml b/app/views/users/dossiers/index.html.haml index 46774910d..229fc6008 100644 --- a/app/views/users/dossiers/index.html.haml +++ b/app/views/users/dossiers/index.html.haml @@ -1,5 +1,6 @@ #users_index - %h1 Mes dossiers + %h1 + =t('dynamics.users.mes_dossiers') -unless Features.opensimplif = render partial: 'onglets' diff --git a/app/views/users/passwords/edit.html.haml b/app/views/users/passwords/edit.html.haml index 60c694678..bcfb616b7 100644 --- a/app/views/users/passwords/edit.html.haml +++ b/app/views/users/passwords/edit.html.haml @@ -29,7 +29,7 @@ = devise_error_messages! #form_login - = image_tag('logo-tps.png') + = image_tag(image_url(LOGO_NAME)) %br %h2#gestionnaire_login Changement de mot de passe diff --git a/app/views/users/passwords/new.html.haml b/app/views/users/passwords/new.html.haml index 6504a7295..a08703e6a 100644 --- a/app/views/users/passwords/new.html.haml +++ b/app/views/users/passwords/new.html.haml @@ -30,7 +30,7 @@ %br #form_login - = image_tag('logo-tps.png') + = image_tag(image_url(LOGO_NAME)) %br %h2#gestionnaire_login Mot de passe oublié diff --git a/app/views/users/recapitulatif/show.html.haml b/app/views/users/recapitulatif/show.html.haml index 253c4f865..355c92446 100644 --- a/app/views/users/recapitulatif/show.html.haml +++ b/app/views/users/recapitulatif/show.html.haml @@ -8,7 +8,7 @@ .col-md-3.col-lg-3 %h2#dossier_id{:class => 'text-info', :style => 'text-align:right; margin-bottom:15px'} - = "Dossier n°#{@facade.dossier.id}" + = t('dynamics.dossiers.numéro') + @facade.dossier.id.to_s - if user_signed_in? && current_user.email == @facade.dossier.user.email -if @facade.dossier.validated? diff --git a/app/views/users/registrations/new.html.haml b/app/views/users/registrations/new.html.haml index 17054c523..b44bc289c 100644 --- a/app/views/users/registrations/new.html.haml +++ b/app/views/users/registrations/new.html.haml @@ -30,7 +30,7 @@ #form_login %br - = image_tag('logo-tps.png') + = image_tag(image_url(LOGO_NAME)) %br %h2#gestionnaire_login Inscription diff --git a/app/views/users/sessions/_resume_procedure.html.haml b/app/views/users/sessions/_resume_procedure.html.haml new file mode 100644 index 000000000..f99ce8bd8 --- /dev/null +++ b/app/views/users/sessions/_resume_procedure.html.haml @@ -0,0 +1,18 @@ +- if @dossier + = link_to 'X', users_no_procedure_url, class: 'btn btn-xs', style:'float: right' + + - if @dossier.procedure.euro_flag + #euro_flag.flag + =image_tag('drapeau_europe.png') + + #logo_procedure.flag + =image_tag( @dossier.procedure.decorate.logo_img ) + + %h2#titre_procedure.text-info + = @dossier.procedure.libelle + %p + = h @dossier.procedure.description.html_safe + +- else + = image_tag(image_url(LOGO_NAME), {id: 'logo_tps'}) +%br \ No newline at end of file diff --git a/app/views/users/sessions/new.html.haml b/app/views/users/sessions/new.html.haml index 0cade0fe2..718da7056 100644 --- a/app/views/users/sessions/new.html.haml +++ b/app/views/users/sessions/new.html.haml @@ -1,26 +1,9 @@ #form_login %br - - if @dossier - = link_to 'X', users_no_procedure_url, class: 'btn btn-xs', style:'float: right' + = render partial: 'users/sessions/resume_procedure' - - if @dossier.procedure.euro_flag - #euro_flag.flag - =image_tag('drapeau_europe.png') - - #logo_procedure.flag - =image_tag( @dossier.procedure.decorate.logo_img ) - - %h2#titre_procedure.text-info - = @dossier.procedure.libelle - %p - = h @dossier.procedure.description.html_safe - - - - else - = image_tag('logo-tps.png', {id: 'logo_tps'}) - %br - - %h2#login_user Connexion + %h2#login_user + =t('dynamics.users.connexion_title') %a.btn_fc#btn_fcp{href: '/france_connect/particulier'} = image_tag 'franceconnect_logo.png' @@ -39,7 +22,7 @@ = f.email_field :email, class: 'form-control' %br %h4 - = f.label :password + = f.label 'Mot de passe' .input-group .input-group-addon %span.fa.fa-asterisk diff --git a/app/views/users/siret/_pro.html.haml b/app/views/users/siret/_pro.html.haml index 34e119cb8..c56920d71 100644 --- a/app/views/users/siret/_pro.html.haml +++ b/app/views/users/siret/_pro.html.haml @@ -1,6 +1,6 @@ %p.lead{id: 'pro_section'} - = image_tag('logo-tps.png') + = image_tag(image_url(LOGO_NAME)) %br %h2#titre_procedure.text-info = @procedure.libelle diff --git a/config/deploy.rb b/config/deploy.rb index 14abbcaa5..cf3617318 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -94,6 +94,7 @@ set :shared_paths, [ "config/initializers/super_admin.rb", "config/unicorn.rb", "config/initializers/raven.rb", + "config/locales/dynamics/fr.yml", 'config/france_connect.yml', 'config/initializers/mailjet.rb', 'config/initializers/storage_url.rb', @@ -138,6 +139,9 @@ task :setup => :environment do queue! %[mkdir -p "#{deploy_to}/shared/app"] queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/app"] + queue! %[mkdir -p "#{deploy_to}/shared/config/locales/dynamics"] + queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/config/locales/dynamics"] + queue! %[touch "#{deploy_to}/shared/config/database.yml"] queue %[echo "-----> Be sure to edit 'shared/config/database.yml'."] diff --git a/config/initializers/logos.rb b/config/initializers/logos.rb new file mode 100644 index 000000000..ad429846b --- /dev/null +++ b/config/initializers/logos.rb @@ -0,0 +1,2 @@ +LOGO_NAME = 'logos/logo-tps.png' unless Features.opensimplif +LOGO_NAME = 'logos/logo-opensimplif.jpg' if Features.opensimplif diff --git a/config/locales/dynamics/fr.yml b/config/locales/dynamics/fr.yml new file mode 100644 index 000000000..0d8e42293 --- /dev/null +++ b/config/locales/dynamics/fr.yml @@ -0,0 +1,44 @@ +fr: + dynamics: + contact_email: contact@tps.apientreprise.fr + users: + connexion_title: Connexion + mes_dossiers: 'Mes dossiers' + + backoffice: + title: Gestion des dossiers + dossiers: Dossiers + pref_list: + title: 'Gestion de colonnes affichées' + description: 'Ce menu vous permet de choisir les différentes colonnes que vous souhaitez voir apparaître dans votre interface de suivi des dossiers.' + download_all_dossiers: 'Tous mes dossiers en CSV' + research: + placeholder: 'Rechercher un dossier ...' + filter_procedure: + title: "Voir qu'une procédure :" + first: '' + + dossiers: + depositaite: "Dépositaire" + numéro: 'Dossier n°' + followers: + title: "Personnes suivant l'activité de ce dossier" + + admin: + connexion_title: Administration + dossiers: + tableau_de_bord: + title: 'Gestion des procédures' + nouvelle_procedure: 'Nouvelle procédure' + menu: + title: Mes procédures + accompagnateurs: Accompagnateurs + procedures: Procédures + procedure: + onglets: + accompagnateurs: Accompagnateurs + stats: + title: Dossiers + onglet_accompagnateurs: + add: + title: 'Ajouter un accompagnateur' \ No newline at end of file diff --git a/config/locales/dynamics/fr_opensimplif.yml b/config/locales/dynamics/fr_opensimplif.yml new file mode 100644 index 000000000..ed8b4c7e0 --- /dev/null +++ b/config/locales/dynamics/fr_opensimplif.yml @@ -0,0 +1,44 @@ +fr_opensimplif: + dynamics: + contact_email: simplification.sgmap@modernisation.gouv.fr + users: + connexion_title: "Connectez-vous en tant qu'utilisateur" + mes_dossiers: 'Mon tableau de bord' + + backoffice: + title: Tableau de bord + dossiers: Tableau de bord + pref_list: + title: 'Affichage du tableau de bord' + description: 'Ce menu vous permet de choisir les différentes colonnes que vous souhaitez voir apparaître dans le tableau de bord.' + download_all_dossiers: 'Exporter' + research: + placeholder: 'Rechercher une simplification ...' + filter_procedure: + title: "Statut des simplifications :" + first: 'Tous' + + dossiers: + depositaite: "Emetteur de la simplification" + numéro: 'Simplification n°' + followers: + title: "Personnes suivant l'activité de cette simplification" + + admin: + connexion_title: Connectez-vous en tant qu'administrateur + dossiers: + tableau_de_bord: + title: 'Tableau de bord' + nouvelle_procedure: 'Nouveau format de fiche' + menu: + title: Tableau de bord + accompagnateurs: Utilisateurs + procedures: Tableau de bord + procedure: + onglets: + accompagnateurs: Utilisateurs + stats: + title: Simplification + onglet_accompagnateurs: + add: + title: 'Ajouter un utilisateur' \ No newline at end of file diff --git a/spec/controllers/admin/procedures_controller_spec.rb b/spec/controllers/admin/procedures_controller_spec.rb index c6ddc9462..c72a02d35 100644 --- a/spec/controllers/admin/procedures_controller_spec.rb +++ b/spec/controllers/admin/procedures_controller_spec.rb @@ -299,7 +299,7 @@ describe Admin::ProceduresController, type: :controller do it 'archive previous procedure' do expect(procedure2.published).to be_truthy expect(procedure2.archived).to be_truthy - expect(procedure2.path).to be_nil + expect(procedure2.path).not_to be_nil end end @@ -427,21 +427,31 @@ describe Admin::ProceduresController, type: :controller do let!(:procedure) { create(:procedure, :published, administrateur: admin) } let(:admin2) { create(:administrateur) } let!(:procedure2) { create(:procedure, :published, administrateur: admin2) } + let!(:procedure3) { create(:procedure, :published, administrateur: admin2) } + subject { get :path_list } + let(:body) { JSON.parse(response.body) } - before do - subject + describe 'when no params' do + before do + subject + end + + it { expect(response.status).to eq(200) } + it { expect(body.size).to eq(3) } + it { expect(body.first['label']).to eq(procedure.path) } + it { expect(body.first['mine']).to be_truthy } + it { expect(body.second['label']).to eq(procedure2.path) } + it { expect(body.second['mine']).to be_falsy } + end - it { expect(response.status).to eq(200) } - it { expect(body.size).to eq(2) } - it { expect(body.first['label']).to eq(procedure.path) } - it { expect(body.first['mine']).to be_truthy } - it { expect(body.second['label']).to eq(procedure2.path) } - it { expect(body.second['mine']).to be_falsy } - context 'filtered' do + before do + subject + end + subject { get :path_list, request: procedure2.path } it { expect(response.status).to eq(200) } @@ -449,6 +459,18 @@ describe Admin::ProceduresController, type: :controller do it { expect(body.first['label']).to eq(procedure2.path) } it { expect(body.first['mine']).to be_falsy } end + + context 'when procedure is archived' do + + before do + procedure3.update_attribute :archived, true + subject + end + + it 'do not return on the json' do + expect(body.size).to eq(2) + end + end end describe 'POST transfer' do @@ -467,7 +489,7 @@ describe Admin::ProceduresController, type: :controller do let(:email_admin) { new_admin.email } it { expect(subject.status).to eq 200 } - it { expect {subject}.to change(Procedure, :count).by(1) } + it { expect { subject }.to change(Procedure, :count).by(1) } context { before do diff --git a/spec/controllers/users/dossiers_controller_spec.rb b/spec/controllers/users/dossiers_controller_spec.rb index d88ae049a..9bdb158de 100644 --- a/spec/controllers/users/dossiers_controller_spec.rb +++ b/spec/controllers/users/dossiers_controller_spec.rb @@ -157,6 +157,16 @@ describe Users::DossiersController, type: :controller do it { expect(subject.status).to eq 302 } it { expect(subject).to redirect_to new_users_dossier_path(procedure_id: procedure.id) } + + context 'when procedure is archived' do + let(:procedure) { create(:procedure, :published, archived: true) } + + before do + procedure.update_column :archived, true + end + + it { expect(subject.status).to eq 200 } + end end describe 'POST #siret_informations' do diff --git a/spec/decorators/procedure_decorator_spec.rb b/spec/decorators/procedure_decorator_spec.rb index c730f7c84..d94025473 100644 --- a/spec/decorators/procedure_decorator_spec.rb +++ b/spec/decorators/procedure_decorator_spec.rb @@ -16,7 +16,7 @@ describe ProcedureDecorator do describe 'logo_img' do subject { super().logo_img } - it { is_expected.to eq('logo-tps.png') } + it { is_expected.to match(/http.*#{ActionController::Base.helpers.image_url(LOGO_NAME)}/) } end describe 'geographic_information' do diff --git a/spec/models/preference_list_dossier_spec.rb b/spec/models/preference_list_dossier_spec.rb index 3558dd699..76abc8441 100644 --- a/spec/models/preference_list_dossier_spec.rb +++ b/spec/models/preference_list_dossier_spec.rb @@ -26,7 +26,7 @@ describe PreferenceListDossier do describe 'dossier_id' do subject { super()[:dossier_id] } - it { expect(subject[:libelle]).to eq 'ID' } + it { expect(subject[:libelle]).to eq 'N°' } it { expect(subject[:table]).to be_nil } it { expect(subject[:attr]).to eq 'id' } it { expect(subject[:attr_decorate]).to eq 'id' } @@ -62,7 +62,7 @@ describe PreferenceListDossier do describe 'state' do subject { super()[:state] } - it { expect(subject[:libelle]).to eq 'Statut' } + it { expect(subject[:libelle]).to eq 'État' } it { expect(subject[:table]).to be_nil } it { expect(subject[:attr]).to eq 'state' } it { expect(subject[:attr_decorate]).to eq 'display_state' } diff --git a/spec/models/procedure_spec.rb b/spec/models/procedure_spec.rb index 47356f165..db62fda24 100644 --- a/spec/models/procedure_spec.rb +++ b/spec/models/procedure_spec.rb @@ -243,14 +243,14 @@ describe Procedure do end it 'is not available from a valid path anymore' do - expect(procedure.path).to be_nil + expect(procedure.path).to eq procedure_path.path expect(procedure.published).to be_truthy expect(procedure.archived).to be_truthy end it 'is not in ProcedurePath table anymore' do - expect(ProcedurePath.where(path: procedure.path).count).to eq(0) - expect(ProcedurePath.find_by_procedure_id(procedure.id)).to be_nil + expect(ProcedurePath.where(path: procedure.path).count).to eq(1) + expect(ProcedurePath.find_by_procedure_id(procedure.id)).not_to be_nil end end diff --git a/spec/views/layouts/_navbar_spec.rb b/spec/views/layouts/_navbar_spec.rb index dab6e8493..c9e9b887e 100644 --- a/spec/views/layouts/_navbar_spec.rb +++ b/spec/views/layouts/_navbar_spec.rb @@ -33,8 +33,8 @@ describe 'layouts/_navbar.html.haml', type: :view do it { is_expected.not_to match(/href="\/users\/sign_in">Utilisateur/) } it { is_expected.not_to match(/href="\/gestionnaires\/sign_in">Accompagnateur/) } it { is_expected.not_to match(/href="\/administrateurs\/sign_in">Administrateur/) } - it { is_expected.not_to match(/Mes Dossiers/) } - it { is_expected.to match(/Mes Procédures/) } + it { is_expected.not_to match(/Mes dossiers/) } + it { is_expected.to match(/Mes procédures/) } it { is_expected.to match(/Se déconnecter/) } end @@ -50,8 +50,8 @@ describe 'layouts/_navbar.html.haml', type: :view do it { is_expected.not_to match(/href="\/users\/sign_in">Utilisateur/) } it { is_expected.not_to match(/href="\/gestionnaires\/sign_in">Accompagnateur/) } it { is_expected.not_to match(/href="\/administrateurs\/sign_in">Administrateur/) } - it { is_expected.not_to match(/Mes Procédures/) } - it { is_expected.to match(/Mes Dossiers/) } + it { is_expected.not_to match(/Mes procédures/) } + it { is_expected.to match(/Mes dossiers/) } it { is_expected.to match(/Déconnexion/) } end