From 5d733c11fd2076197a199c42a25f500f46af910c Mon Sep 17 00:00:00 2001 From: Xavier J Date: Mon, 13 Feb 2017 15:46:28 +0100 Subject: [PATCH 01/17] Delete references @opensimplif --- .../preference_list_dossier_controller.rb | 2 +- app/controllers/opensimplif_controller.rb | 61 --------- app/controllers/root_controller.rb | 6 - app/controllers/users/sessions_controller.rb | 14 --- app/facades/dossiers_list_facades.rb | 1 - app/uploaders/base_uploader.rb | 6 +- app/views/backoffice/dossiers/_list.html.haml | 10 +- app/views/dossiers/_infos_dossier.html.haml | 18 +-- .../_switch_devise_profile_module.html.haml | 2 +- ...koffice_dossierscontroller_index.html.haml | 13 +- ...ckoffice_dossierscontroller_show.html.haml | 50 ++++---- app/views/opensimplif/_pref_list.js.erb | 14 --- app/views/opensimplif/index.html.haml | 43 ------- app/views/opensimplif/index.js.erb | 6 - app/views/opensimplif/nothing.html.haml | 6 - app/views/users/description/_show.html.haml | 19 ++- app/views/users/dossiers/index.html.haml | 3 +- config/deploy.rb | 15 +-- config/initializers/features.yml | 3 +- config/initializers/logos.rb | 3 +- config/routes.rb | 7 -- lib/tasks/opensimplif_import.rake | 118 ------------------ spec/controllers/root_controller_spec.rb | 13 -- .../backoffice/flux_de_commentaires_spec.rb | 29 ----- .../users/flux_de_commentaires_spec.rb | 30 ----- spec/features/users/onglets_link_spec.rb | 11 -- spec/uploaders/base_uploader_spec.rb | 8 -- 27 files changed, 54 insertions(+), 457 deletions(-) delete mode 100644 app/controllers/opensimplif_controller.rb delete mode 100644 app/views/opensimplif/_pref_list.js.erb delete mode 100644 app/views/opensimplif/index.html.haml delete mode 100644 app/views/opensimplif/index.js.erb delete mode 100644 app/views/opensimplif/nothing.html.haml delete mode 100644 lib/tasks/opensimplif_import.rake diff --git a/app/controllers/backoffice/preference_list_dossier_controller.rb b/app/controllers/backoffice/preference_list_dossier_controller.rb index 5ab0391ce..1e58aac67 100644 --- a/app/controllers/backoffice/preference_list_dossier_controller.rb +++ b/app/controllers/backoffice/preference_list_dossier_controller.rb @@ -36,7 +36,7 @@ class Backoffice::PreferenceListDossierController < Backoffice::DossiersListCont private def path - Features.opensimplif ? 'opensimplif/pref_list' : 'backoffice/dossiers/pref_list' + 'backoffice/dossiers/pref_list' end def params_procedure_id diff --git a/app/controllers/opensimplif_controller.rb b/app/controllers/opensimplif_controller.rb deleted file mode 100644 index ff5305427..000000000 --- a/app/controllers/opensimplif_controller.rb +++ /dev/null @@ -1,61 +0,0 @@ -class OpensimplifController < Backoffice::Dossiers::ProcedureController - def index - if params[:id].nil? - procedure = current_gestionnaire.procedures.order('libelle ASC').first - - if procedure.nil? - return redirect_to simplifications_nothing_path - else - return redirect_to simplification_path(id: procedure.id) - end - end - - smartlisting_dossier - end - - def nothing - - end - - def reload_smartlisting - smartlisting_dossier - - render 'opensimplif/index', formats: :js - end - - private - - def smartlisting_dossier dossiers_list=nil, liste='all_state' - dossiers_list_facade liste - - mes_dossiers_list = current_user.dossiers - follow_dossiers_list = dossiers_list_facade.service.suivi - all_state_dossiers_list = dossiers_list_facade.service.all_state - - if param_page.nil? - params[:dossiers_smart_listing] = {page: dossiers_list_facade.service.default_page} - end - - smart_listing_create :mes_dossiers, - mes_dossiers_list, - partial: "backoffice/dossiers/list", - array: true, - default_sort: dossiers_list_facade.service.default_sort - - smart_listing_create :follow_dossiers, - follow_dossiers_list, - partial: "backoffice/dossiers/list", - array: true, - default_sort: dossiers_list_facade.service.default_sort - - smart_listing_create :all_state_dossiers, - all_state_dossiers_list, - partial: "backoffice/dossiers/list", - array: true, - default_sort: dossiers_list_facade.service.default_sort - end - - def dossiers_list_facade liste='all_state' - @facade_data_view ||= DossiersListFacades.new current_gestionnaire, liste, retrieve_procedure - end -end diff --git a/app/controllers/root_controller.rb b/app/controllers/root_controller.rb index 679911acb..61500da6b 100644 --- a/app/controllers/root_controller.rb +++ b/app/controllers/root_controller.rb @@ -7,12 +7,6 @@ class RootController < ApplicationController route = Rails.application.routes.recognize_path(new_user_session_path) end - if Features.opensimplif - unless !user_signed_in? && !administrateur_signed_in? && !gestionnaire_signed_in? - return redirect_to simplifications_path - end - end - if user_signed_in? && !route[:controller].match('users').nil? return redirect_to users_dossiers_path diff --git a/app/controllers/users/sessions_controller.rb b/app/controllers/users/sessions_controller.rb index 31a486234..6fef62105 100644 --- a/app/controllers/users/sessions_controller.rb +++ b/app/controllers/users/sessions_controller.rb @@ -29,8 +29,6 @@ class Users::SessionsController < Sessions::SessionsController current_user.update_attributes(loged_in_with_france_connect: '') end - check_opensimplif if Features.opensimplif - if user_signed_in? redirect_to after_sign_in_path_for(:user) elsif gestionnaire_signed_in? @@ -74,18 +72,6 @@ class Users::SessionsController < Sessions::SessionsController private - def check_opensimplif - return if (user_signed_in? && gestionnaire_signed_in?) || administrateur_signed_in? - - if gestionnaire_signed_in? - User.create email: params[:user][:email], password: params[:user][:password] - try_to_authenticate User - elsif user_signed_in? - Gestionnaire.create email: params[:user][:email], password: params[:user][:password] - try_to_authenticate Gestionnaire - end - end - def error_procedure flash.alert = t('errors.messages.procedure_not_found') redirect_to url_for root_path diff --git a/app/facades/dossiers_list_facades.rb b/app/facades/dossiers_list_facades.rb index e6e11a353..52e5672ea 100644 --- a/app/facades/dossiers_list_facades.rb +++ b/app/facades/dossiers_list_facades.rb @@ -6,7 +6,6 @@ class DossiersListFacades def initialize current_devise_profil, liste, procedure = nil @current_devise_profil = current_devise_profil @liste = liste - @liste = 'all_state' if Features.opensimplif @procedure = procedure end diff --git a/app/uploaders/base_uploader.rb b/app/uploaders/base_uploader.rb index b575299d8..f7023f4f2 100644 --- a/app/uploaders/base_uploader.rb +++ b/app/uploaders/base_uploader.rb @@ -3,11 +3,7 @@ class BaseUploader < CarrierWave::Uploader::Base def cache_dir if Rails.env.production? - if Features.opensimplif? - '/tmp/opensimplif-cache' - else - '/tmp/tps-cache' - end + '/tmp/tps-cache' else '/tmp/tps-dev-cache' end diff --git a/app/views/backoffice/dossiers/_list.html.haml b/app/views/backoffice/dossiers/_list.html.haml index 27b2b6ca1..348b51baf 100644 --- a/app/views/backoffice/dossiers/_list.html.haml +++ b/app/views/backoffice/dossiers/_list.html.haml @@ -3,9 +3,8 @@ - if smart_listing.name.to_s == 'follow_dossiers' %th.col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1.center %i.fa.fa-bell - - unless Features.opensimplif - %th.col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1 - État + %th.col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1 + État - @facade_data_view.preference_list_dossiers_filter.each do |preference| - unless preference.libelle == 'Statut' || preference.libelle == 'État' @@ -33,9 +32,8 @@ - else .badge.progress-bar-warning = total_notif - - unless Features.opensimplif - %td.col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1 - = dossier.decorate.display_state + %td.col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1 + = dossier.decorate.display_state - @facade_data_view.preference_list_dossiers_filter.each_with_index do |preference, index| - unless preference.libelle == 'Statut' || preference.libelle == 'État' %td diff --git a/app/views/dossiers/_infos_dossier.html.haml b/app/views/dossiers/_infos_dossier.html.haml index 7158949e1..7d2d50c41 100644 --- a/app/views/dossiers/_infos_dossier.html.haml +++ b/app/views/dossiers/_infos_dossier.html.haml @@ -17,11 +17,10 @@ %div.col-md-6.col-sm-6.col-xs-6.col-lg-6.depositaire-label Prénom %div.col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off= "-" %div.col-md-5.col-sm-5.col-xs-5.col-lg-5.despositaire-info= @facade.individual.prenom - - unless Features.opensimplif - .row - %div.col-md-6.col-sm-6.col-xs-6.col-lg-6.depositaire-label Date de naissance - %div.col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off= "-" - %div.col-md-5.col-sm-5.col-xs-5.col-lg-5.depositaire-info= @facade.individual.birthdate + .row + %div.col-md-6.col-sm-6.col-xs-6.col-lg-6.depositaire-label Date de naissance + %div.col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off= "-" + %div.col-md-5.col-sm-5.col-xs-5.col-lg-5.depositaire-info= @facade.individual.birthdate .row.margin-top-20 - unless @facade.champs.nil? @@ -34,15 +33,6 @@ - else .row %div.col-md-6.col-sm-6.col-xs-6.col-lg-6.depositaire-label= champ.libelle - -#- if Features.opensimplif - -# %div.col-md-1.col-lg-1.col-sm-1.col-xs-1.comments - -# - if gestionnaire_signed_in? - -# = link_to "", "data-href" => backoffice_dossier_commentaires_path(@facade.dossier, champs_id: champ.id), "data-toggle" => "modal", "data-target" => "#modalCommentairesDossierParChamp" do - -# %i.fa.fa-comment-o - -# - else - -# = link_to "", "data-href" => users_dossier_commentaires_path(@facade.dossier, champs_id: champ.id), "data-toggle" => "modal", "data-target" => "#modalCommentairesDossierParChamp" do - -# %i.fa.fa-commenting-o - -#- else %div.col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off = "-" %div.col-md-5.col-sm-5.col-xs-5.col-lg-5.depositaire-info{ id: "champ-#{champ.id}-value" } diff --git a/app/views/layouts/_switch_devise_profile_module.html.haml b/app/views/layouts/_switch_devise_profile_module.html.haml index 57a11fdd7..c8f3e6705 100644 --- a/app/views/layouts/_switch_devise_profile_module.html.haml +++ b/app/views/layouts/_switch_devise_profile_module.html.haml @@ -1,4 +1,4 @@ -- if SwitchDeviseProfileService.new(warden).multiple_devise_profile_connect? && !Features.opensimplif +- if SwitchDeviseProfileService.new(warden).multiple_devise_profile_connect? #switch_menu.dropdown.dropup %button.btn.btn-default.dropdown-toggle{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false} %i.fa.fa-toggle-on diff --git a/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_index.html.haml b/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_index.html.haml index 84864759c..6f8b17d10 100644 --- a/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_index.html.haml +++ b/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_index.html.haml @@ -2,10 +2,9 @@ %div.dossiers-en-cours .count= @facade_data_view.total_dossier_follow .text= "SUIVIS" - - unless Features.opensimplif - %div.nouveaux-dossiers - .count= @facade_data_view.total_new_dossier - .text= "NOUVEAUX" + %div.nouveaux-dossiers + .count= @facade_data_view.total_new_dossier + .text= "NOUVEAUX" %div.nouvelles-notifications .count= @facade_data_view.dossiers_with_unread_notifications.count .text= "MODIFIÉS" @@ -23,13 +22,11 @@ #procedure_list - @facade_data_view.gestionnaire_procedures_name_and_id_list.each do |procedure| - - url_path = Features.opensimplif ? simplification_path(procedure[:id]) : backoffice_dossiers_procedure_path(procedure[:id]) - - = link_to url_path, {title: procedure[:libelle]} do + = link_to backoffice_dossiers_procedure_path(procedure[:id]), {title: procedure[:libelle]} do %div.procedure_list_element{ class: ('active' if procedure[:id] == @facade_data_view.procedure.id rescue '') } = truncate(procedure[:libelle], length: 50) - total_new = @facade_data_view.new_dossier_number procedure[:id] - - if total_new > 0 && !Features.opensimplif + - if total_new > 0 .badge.progress-bar-success{title:'Nouveaux dossiers'} = total_new -if procedure[:unread_notifications] > 0 diff --git a/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.html.haml b/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.html.haml index f157a0361..512ceb8f0 100644 --- a/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.html.haml +++ b/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.html.haml @@ -2,39 +2,37 @@ %div.infos #dossier_id= t('dynamics.dossiers.numéro') + @facade.dossier.id.to_s -- unless Features.opensimplif - %div#action-block - - if gestionnaire_signed_in? - - if !@facade.dossier.read_only? - = form_tag(url_for({controller: 'backoffice/dossiers', action: :valid, dossier_id: @facade.dossier.id}), class: 'form-inline', method: 'POST') do - %button.action{'data-toggle' => :tooltip, title: 'En cliquant ici, vous figez le dossier et autorisez le dépôt du dossier pour instruction.'} - = 'Déclarer complet'.upcase - - elsif @facade.dossier.submitted? - = form_tag(url_for({controller: 'backoffice/dossiers', action: :receive, dossier_id: @facade.dossier.id}), class: 'form-inline', method: 'POST') do - %button.action - = 'Accuser réception'.upcase - - elsif @facade.dossier.received? - = form_tag(url_for({controller: 'backoffice/dossiers', action: :close, dossier_id: @facade.dossier.id}), class: 'form-inline action_button', method: 'POST', style: 'display:inline', 'data-toggle' => :tooltip, title: 'Accepter') do - %button.action.close-dossier - %i.fa.fa-check - = form_tag(url_for({controller: 'backoffice/dossiers', action: :without_continuation, dossier_id: @facade.dossier.id}), class: 'form-inline action_button', method: 'POST', style: 'display:inline', 'data-toggle' => :tooltip, title: 'Classer sans suite') do - %button.action.forget-dossier - %i.fa.fa-circle-o - = form_tag(url_for({controller: 'backoffice/dossiers', action: :refuse, dossier_id: @facade.dossier.id}), class: 'form-inline action_button', method: 'POST', style: 'display:inline', 'data-toggle' => :tooltip, title: 'Refuser') do - %button.action.refuse-dossier - %i.fa.fa-times +%div#action-block + - if gestionnaire_signed_in? + - if !@facade.dossier.read_only? + = form_tag(url_for({controller: 'backoffice/dossiers', action: :valid, dossier_id: @facade.dossier.id}), class: 'form-inline', method: 'POST') do + %button.action{'data-toggle' => :tooltip, title: 'En cliquant ici, vous figez le dossier et autorisez le dépôt du dossier pour instruction.'} + = 'Déclarer complet'.upcase + - elsif @facade.dossier.submitted? + = form_tag(url_for({controller: 'backoffice/dossiers', action: :receive, dossier_id: @facade.dossier.id}), class: 'form-inline', method: 'POST') do + %button.action + = 'Accuser réception'.upcase + - elsif @facade.dossier.received? + = form_tag(url_for({controller: 'backoffice/dossiers', action: :close, dossier_id: @facade.dossier.id}), class: 'form-inline action_button', method: 'POST', style: 'display:inline', 'data-toggle' => :tooltip, title: 'Accepter') do + %button.action.close-dossier + %i.fa.fa-check + = form_tag(url_for({controller: 'backoffice/dossiers', action: :without_continuation, dossier_id: @facade.dossier.id}), class: 'form-inline action_button', method: 'POST', style: 'display:inline', 'data-toggle' => :tooltip, title: 'Classer sans suite') do + %button.action.forget-dossier + %i.fa.fa-circle-o + = form_tag(url_for({controller: 'backoffice/dossiers', action: :refuse, dossier_id: @facade.dossier.id}), class: 'form-inline action_button', method: 'POST', style: 'display:inline', 'data-toggle' => :tooltip, title: 'Refuser') do + %button.action.refuse-dossier + %i.fa.fa-times - - unless @facade.dossier.archived? - = link_to 'Archiver', backoffice_dossier_archive_path(@facade.dossier), method: :post, class: 'btn btn-default btn-block' + - unless @facade.dossier.archived? + = link_to 'Archiver', backoffice_dossier_archive_path(@facade.dossier), method: :post, class: 'btn btn-default btn-block' %div#menu-block %div#infos-block - - unless Features.opensimplif - %div.split-hr-left - %div.dossier-state= @facade.dossier.display_state + %div.split-hr-left + %div.dossier-state= @facade.dossier.display_state %div.split-hr-left %div.notifications - if @facade.dossier.notifications.empty? diff --git a/app/views/opensimplif/_pref_list.js.erb b/app/views/opensimplif/_pref_list.js.erb deleted file mode 100644 index c3c7cc107..000000000 --- a/app/views/opensimplif/_pref_list.js.erb +++ /dev/null @@ -1,14 +0,0 @@ -$.ajax({ - method: 'get', - url: '/simplifications/reload_smartlisting?id=<%= @procedure_id %>', - async: true -}); - -$.ajax({ - methd: 'get', - url: '/backoffice/preference_list_dossier/reload_pref_list?procedure_id=<%= @procedure_id %>', - async: true -}).done(function (data) { - $("#pref_list_menu").html(data); - pref_list_dossier_actions(); -}); diff --git a/app/views/opensimplif/index.html.haml b/app/views/opensimplif/index.html.haml deleted file mode 100644 index a54739f3d..000000000 --- a/app/views/opensimplif/index.html.haml +++ /dev/null @@ -1,43 +0,0 @@ -#backoffice_index - #pref_list_menu - = render partial: 'backoffice/dossiers/pref_list' - - .default_data_block.default_visible - %div.row.show-block#new_dossiers - %div.header - %div.col-lg-10.col-md-10.col-sm-10.col-xs-10.title - %div.carret-right - %div.carret-down - Mes simplifications - %div.col-lg-2.col-md-2.col-sm-2.col-xs-2.count - =current_user.dossiers.count - SIMPLIFICATIONS - %div.body - = smart_listing_render :mes_dossiers - - .default_data_block.default_visible - %div.row.show-block#new_dossiers - %div.header - %div.col-lg-10.col-md-10.col-sm-10.col-xs-10.title - %div.carret-right - %div.carret-down - Les simplifications que je suivis - %div.col-lg-2.col-md-2.col-sm-2.col-xs-2.count - =@facade_data_view.suivi_total - simplifications - %div.body - = smart_listing_render :follow_dossiers - - - .default_data_block - %div.row.show-block#new_dossiers - %div.header - %div.col-lg-10.col-md-10.col-sm-10.col-xs-10.title - %div.carret-right - %div.carret-down - Les autres - %div.col-lg-2.col-md-2.col-sm-2.col-xs-2.count - =@facade_data_view.all_state_total - simplifications - %div.body - = smart_listing_render :all_state_dossiers diff --git a/app/views/opensimplif/index.js.erb b/app/views/opensimplif/index.js.erb deleted file mode 100644 index 41790287e..000000000 --- a/app/views/opensimplif/index.js.erb +++ /dev/null @@ -1,6 +0,0 @@ -<%= smart_listing_update :mes_dossiers, {force: true} %> -<%= smart_listing_update :follow_dossiers, {force: true} %> -<%= smart_listing_update :all_state_dossiers, {force: true} %> - -filters_init(); -link_init(); \ No newline at end of file diff --git a/app/views/opensimplif/nothing.html.haml b/app/views/opensimplif/nothing.html.haml deleted file mode 100644 index 92bf1d421..000000000 --- a/app/views/opensimplif/nothing.html.haml +++ /dev/null @@ -1,6 +0,0 @@ -.center - %h3.text-danger - Vous n'avez aucun droit de lecture sur cette plateforme. - - %h4 - Merci de prendre contact avec votre reponsable simplification afin de remedier à ce problème. \ No newline at end of file diff --git a/app/views/users/description/_show.html.haml b/app/views/users/description/_show.html.haml index a1ec74144..5aebd3baa 100644 --- a/app/views/users/description/_show.html.haml +++ b/app/views/users/description/_show.html.haml @@ -30,16 +30,15 @@ .col-lg-8 = render partial: 'users/description/pieces_justificatives', locals: { dossier: @dossier } - - 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.col-sm-1.col-xs-1 - .fa.fa-info-circle.text-info{style:'font-size: 2em; margin-top: 20%'} - .col-md-11.col-sm-11.col-xs-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. + #state_description.row{style:'width: 50%; margin-left:20px'} + .panel.panel-info + .panel-body.center + .row + .col-md-1.col-lg-1.col-sm-1.col-xs-1 + .fa.fa-info-circle.text-info{style:'font-size: 2em; margin-top: 20%'} + .col-md-11.col-sm-11.col-xs-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. -route = Rails.application.routes.recognize_path(request.referrer) diff --git a/app/views/users/dossiers/index.html.haml b/app/views/users/dossiers/index.html.haml index 509f46629..fce9b71a8 100644 --- a/app/views/users/dossiers/index.html.haml +++ b/app/views/users/dossiers/index.html.haml @@ -12,5 +12,4 @@ %div.body = smart_listing_render :dossiers - - unless Features.opensimplif - = render partial: 'state_description', locals: {dossiers_list_facade: @dossiers_list_facade} + = render partial: 'state_description', locals: {dossiers_list_facade: @dossiers_list_facade} diff --git a/config/deploy.rb b/config/deploy.rb index e11f920ce..8403f2974 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -11,7 +11,7 @@ require 'mina/rbenv' # for rbenv support. (http://rbenv.org) # branch - Branch name to deploy. (needed by mina/git) ENV['to'] ||= "staging" -raise "Bad to=#{+ENV['to']}" unless ["staging", "production", "opensimplif", "tps_v2"].include?(ENV['to']) +raise "Bad to=#{+ENV['to']}" unless ["staging", "production", "tps_v2"].include?(ENV['to']) raise "missing domain, run with 'rake deploy domain=37.187.154.237'" if ENV['domain'].nil? @@ -42,15 +42,6 @@ elsif ENV["to"] == "production" set :deploy_to, '/var/www/tps' set :user, 'tps' # Username in the server to SSH to. appname = 'tps' -elsif ENV["to"] == "opensimplif" - if ENV['branch'].nil? - set :branch, 'master' - else - set :branch, ENV['branch'] - end - set :deploy_to, '/var/www/opensimplif' - set :user, 'opensimplif' # Username in the server to SSH to. - appname = 'opensimplif' elsif ENV["to"] == "tps_v2" if ENV['branch'].nil? set :branch, 'staging_v2' @@ -64,9 +55,7 @@ end set :rails_env, ENV["to"] -if ENV["to"] == "opensimplif" - set :rails_env, "production" -elsif ENV["to"] == "tps_v2" +if ENV["to"] == "tps_v2" set :rails_env, "staging" end diff --git a/config/initializers/features.yml b/config/initializers/features.yml index d243bd5f6..efd3e5324 100644 --- a/config/initializers/features.yml +++ b/config/initializers/features.yml @@ -1,2 +1 @@ -remote_storage: false -opensimplif: false +remote_storage: false \ No newline at end of file diff --git a/config/initializers/logos.rb b/config/initializers/logos.rb index ad429846b..17446e837 100644 --- a/config/initializers/logos.rb +++ b/config/initializers/logos.rb @@ -1,2 +1 @@ -LOGO_NAME = 'logos/logo-tps.png' unless Features.opensimplif -LOGO_NAME = 'logos/logo-opensimplif.jpg' if Features.opensimplif +LOGO_NAME = 'logos/logo-tps.png' diff --git a/config/routes.rb b/config/routes.rb index 66ab9bdf5..4925ef475 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -42,13 +42,6 @@ Rails.application.routes.draw do get 'admin' => 'admin#index' get 'backoffice' => 'backoffice#index' - if Features.opensimplif - get 'simplifications' => 'opensimplif#index' - get 'simplifications/reload_smartlisting' => 'opensimplif#reload_smartlisting' - get 'simplifications/nothing' => 'opensimplif#nothing' - get 'simplifications/:id' => 'opensimplif#index', as: :simplification - end - resources :administrations namespace :france_connect do diff --git a/lib/tasks/opensimplif_import.rake b/lib/tasks/opensimplif_import.rake deleted file mode 100644 index 7131153ed..000000000 --- a/lib/tasks/opensimplif_import.rake +++ /dev/null @@ -1,118 +0,0 @@ -require 'csv' -require 'json' - -namespace :opensimplif_import do - task :import_all => :environment do - puts 'start opensimplif' - - Rake::Task['opensimplif_import:import_proposition'].invoke - Rake::Task['opensimplif_import:import_piste'].invoke - Rake::Task['opensimplif_import:import_mesure'].invoke - - puts 'end import opensimplif' - end - - task :import_proposition do - file_path = "lib/tasks/161102_OS_Inputs_test_propositions.csv" - procedure_id = 35 - - matching = [ - {id: 44, key: 'Intitulé de la proposition'}, - {id: 43, key: 'Champ concerné'}, - {id: 45, key: 'Champ ministériel chef de file'}, - {id: 59, key: 'Date de la proposition'}, - {id: 60, key: 'Moment de vie'}, - {id: 61, key: 'Source'}, - {id: 48, key: 'Description de la proposition'} - ] - - puts 'start propositions' - import file_path, procedure_id, matching - puts 'done propositions' - end - - task :import_piste do - file_path = "lib/tasks/161102_OS_Inputs_test_pistes.csv" - procedure_id = 36 - - matching = [ - {id: 81, key: 'Intitulé de la piste *'}, - {id: 82, key: 'Usager concerné *'}, - {id: 83, key: 'Champ ministériel chef de file *'}, - {id: 84, key: 'Champ ministériel contributeur'}, - {id: 85, key: 'Date de saisine'}, - {id: 66, key: 'Moment de vie'}, - {id: 80, key: 'Source de la piste'}, - {id: 70, key: 'Description de la piste '}, - {id: 68, key: 'Objectifs / bénéfices attendus'}, - {id: 65, key: 'Description détaillée des démarches impactées par la piste'}, - {id: 69, key: 'Levier de mise en oeuvre'}, - {id: 67, key: 'Précision sur le levier de meo'}, - {id: 64, key: 'Calendrier de mise en oeuvre'} - ] - - puts 'start piste' - import file_path, procedure_id, matching - puts 'done pistes' - end - - task :import_mesure do - file_path = "lib/tasks/161102_OS_Inputs_test_mesures.csv" - procedure_id = 37 - - matching = [ - {id: 107, key: 'Intitulé projet / mesure'}, - {id: 104, key: 'Champ concerné'}, - {id: 105, key: 'Champ ministériel chef de file'}, - {id: 112, key: 'Direction chef de file'}, - {id: 106, key: 'Champ ministériel contributeur'}, - {id: 113, key: 'Direction contributrice'}, - {id: 92, key: 'Moment de vie'}, - {id: 109, key: 'Date d\'annonce'}, - {id: 114, key: 'N° de la mesure'}, - {id: 115, key: 'Responsable ministère'}, - {id: 116, key: 'Responsable SGMAP'}, - {id: 89, key: 'Actions réalisées'}, - {id: 95, key: 'Etapes nécessaires à l\'atteinte de la cible et alertes'}, - {id: 102, key: 'Alertes'}, - {id: 101, key: 'Échéance initiale'}, - {id: 96, key: 'Échéance prévisionnelle / réelle'}, - {id: 94, key: 'Appréciation avancement'}, - {id: 91, key: 'Etat d\'avancement LOLF'}, - {id: 111, key: '§ de com'} - ] - - puts 'start mesures' - import file_path, procedure_id, matching - puts 'done mesures' - end - - def self.import file_path, procedure_id, matching - user = User.find_or_create_by(email: 'import@opensimplif.modernisation.fr') - - unless user.valid? - user.password = 'TPSpassword2016' - user.save - end - - file ||= CSV.open(file_path, :col_sep => ";", :headers => true).map { |x| x.to_h }.to_json - file = JSON.parse(file) - - procedure = Procedure.find(procedure_id) - - user.dossiers.where(procedure_id: procedure.id).destroy_all - - file.each do |proposition| - dossier = Dossier.create procedure: procedure, user: user, state: :initiated - - dossier.champs.each do |champ| - matching.each do |match| - if match[:id] == champ.type_de_champ.id - champ.update_column :value, proposition[match[:key]] - break - end - end - end - end - end -end diff --git a/spec/controllers/root_controller_spec.rb b/spec/controllers/root_controller_spec.rb index de5bb6759..94e83fe2f 100644 --- a/spec/controllers/root_controller_spec.rb +++ b/spec/controllers/root_controller_spec.rb @@ -83,19 +83,6 @@ describe RootController, type: :controller do end - context 'when opensimplif features is true' do - pending - # let(:gestionnaire) { create(:gestionnaire) } - # - # before do - # sign_in gestionnaire - # - # allow_any_instance_of(Features).to receive(:opensimplif).and_return(true) - # end - # - # it { expect(subject).to redirect_to(simplifications_path) } - end - context "unified login" do render_views diff --git a/spec/features/backoffice/flux_de_commentaires_spec.rb b/spec/features/backoffice/flux_de_commentaires_spec.rb index 833225cbb..cb01618cd 100644 --- a/spec/features/backoffice/flux_de_commentaires_spec.rb +++ b/spec/features/backoffice/flux_de_commentaires_spec.rb @@ -22,33 +22,4 @@ feature 'backoffice: flux de commentaires' do comments = find(".commentaires") expect(comments).to have_selector(".content", count: 1) end - - scenario "affichage des commentaires du champs", js: true do - pending 'later: open simplif' - find("#liste_champs th", text: champ1.libelle).click_link("COM") - expect(page).to have_css("#modalCommentairesDossierParChamp.in") - - modal = find("#modalCommentairesDossierParChamp") - expect(modal).to have_css(".description", count: 2) - end - - scenario "crée un commentaire sur un champ", js: true do - pending 'later: open simplif' - # ouverture modale - find("#liste_champs th", text: champ1.libelle).click_link("COM") - - # ajout du commentaire - form = find("#modalCommentairesDossierParChamp").find("#commentaire_new") - form.fill_in("texte_commentaire", with: "le corps du commentaire sur le champ #{champ1.libelle}") - form.click_on("Poster") - - # le commentaire ne s'ajoute pas aux commentaires généraux - comments = find("#commentaires_flux") - expect(comments).to have_selector(".description", count: 1) - - # ajout du commentaire aux commentaires du champs - find("#liste_champs th", text: champ1.libelle).click_link("COM") - modal = find("#modalCommentairesDossierParChamp") - expect(modal).to have_css(".description", count: 3) - end end diff --git a/spec/features/users/flux_de_commentaires_spec.rb b/spec/features/users/flux_de_commentaires_spec.rb index 0c087f429..4ce44cd3e 100644 --- a/spec/features/users/flux_de_commentaires_spec.rb +++ b/spec/features/users/flux_de_commentaires_spec.rb @@ -22,34 +22,4 @@ feature 'users: flux de commentaires' do comments = find(".commentaires") expect(comments).to have_selector(".content", count: 1) end - - scenario "affichage des commentaires du champs", js: true do - pending 'later: open simplif' - th = find("#liste_champs th", text: champ1.libelle) - th.click_link("COM") - expect(page).to have_css("#modalCommentairesDossierParChamp.in") - - modal = find("#modalCommentairesDossierParChamp") - expect(modal).to have_css(".description", count: 2) - end - - scenario "crée un commentaire sur un champ", js: true do - pending 'later: open simplif' - # ouverture modale - find("#liste_champs th", text: champ1.libelle).click_link("COM") - - # ajout du commentaire - form = find("#modalCommentairesDossierParChamp").find("#commentaire_new") - form.fill_in("texte_commentaire", with: "le corps du commentaire sur le champ #{champ1.libelle}") - form.click_on("Poster") - - # le commentaire ne s'ajoute pas aux commentaires généraux - comments = find("#commentaires_flux") - expect(comments).to have_selector(".description", count: 1) - - # ajout du commentaire aux commentaires du champs - find("#liste_champs th", text: champ1.libelle).click_link("COM") - modal = find("#modalCommentairesDossierParChamp") - expect(modal).to have_css(".description", count: 3) - end end diff --git a/spec/features/users/onglets_link_spec.rb b/spec/features/users/onglets_link_spec.rb index 3da3fd4b3..013699c6d 100644 --- a/spec/features/users/onglets_link_spec.rb +++ b/spec/features/users/onglets_link_spec.rb @@ -77,15 +77,4 @@ feature 'on click on tabs button' do end end end - - context "OpenSimplif" do - before do - allow(Features).to receive(:opensimplif).and_return(true) - visit users_dossiers_url - end - - scenario "it hides the tabs" do - expect(page).to_not have_css('#onglets') - end - end end diff --git a/spec/uploaders/base_uploader_spec.rb b/spec/uploaders/base_uploader_spec.rb index 5adf98b35..0aa66297d 100644 --- a/spec/uploaders/base_uploader_spec.rb +++ b/spec/uploaders/base_uploader_spec.rb @@ -17,14 +17,6 @@ describe BaseUploader do end it { is_expected.to eq '/tmp/tps-cache' } - - context 'when is opensimplif' do - before do - allow(Features).to receive(:opensimplif?).and_return(true) - end - - it { is_expected.to eq '/tmp/opensimplif-cache' } - end end end end \ No newline at end of file From 308a037f1987933a79c06251e6bb263e85ea1e1f Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Tue, 14 Feb 2017 11:13:48 +0100 Subject: [PATCH 02/17] Add clickable links in champ description and use bootstrap layout for forms --- .byebug_history | 9 +++ Gemfile | 5 +- app/assets/javascripts/bootstrap_wysihtml5.js | 4 +- app/assets/javascripts/description.js | 8 -- app/assets/stylesheets/application.scss | 4 - app/assets/stylesheets/description.scss | 11 +-- app/decorators/champ_decorator.rb | 7 +- app/decorators/type_de_champ_decorator.rb | 2 +- app/views/users/description/_show.html.haml | 2 +- .../champs/_render_list_champs.html.haml | 76 ++++++++++--------- .../description/champs/_textarea.html.haml | 2 +- 11 files changed, 62 insertions(+), 68 deletions(-) diff --git a/.byebug_history b/.byebug_history index f22879884..bfbe59fde 100644 --- a/.byebug_history +++ b/.byebug_history @@ -1,3 +1,12 @@ +continue +next +SIADETOKEN +next +exit +params +next +params +SIADETOKEN exit xit xtei diff --git a/Gemfile b/Gemfile index e38f8d656..4acfb8697 100644 --- a/Gemfile +++ b/Gemfile @@ -119,12 +119,11 @@ end group :development do # Access an IRB console on exception pages or by using <%= console %> in views - gem 'web-console' - gem 'rack-handlers' - gem 'xray-rails' + gem 'guard' + end group :development, :test do diff --git a/app/assets/javascripts/bootstrap_wysihtml5.js b/app/assets/javascripts/bootstrap_wysihtml5.js index 4f1ed7bcf..b0606ce8a 100644 --- a/app/assets/javascripts/bootstrap_wysihtml5.js +++ b/app/assets/javascripts/bootstrap_wysihtml5.js @@ -3,6 +3,6 @@ $(document).on('page:load', wysihtml5_active); function wysihtml5_active (){ $('.wysihtml5').each(function(i, elem) { - $(elem).wysihtml5({ toolbar:{ "fa": true, "link": false, "color": true }, "locale": "fr-FR" }); + $(elem).wysihtml5({ toolbar:{ "fa": true, "link": false, "color": false }, "locale": "fr-FR" }); }); -} \ No newline at end of file +} diff --git a/app/assets/javascripts/description.js b/app/assets/javascripts/description.js index 24a9e7e56..6df9f436d 100644 --- a/app/assets/javascripts/description.js +++ b/app/assets/javascripts/description.js @@ -18,14 +18,6 @@ function action_type_de_champs() { toggleErrorClass(this, validatePhone(val)); }); - $("#liste_champs input").on('focus', function () { - $("#description_" + this.id).slideDown(); - }); - - $("#liste_champs input").on('blur', function () { - $("#description_" + this.id).slideUp(); - }); - address_type_init(); } diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 58f55fa66..be9827586 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -143,10 +143,6 @@ textarea#description { max-width: 27px; } -label { - font-weight: normal; -} - div.pagination { padding-top: 20px; display: block; diff --git a/app/assets/stylesheets/description.scss b/app/assets/stylesheets/description.scss index dc24f6646..c471c10c1 100644 --- a/app/assets/stylesheets/description.scss +++ b/app/assets/stylesheets/description.scss @@ -7,9 +7,7 @@ .show-block { width: 90%; .body{ - padding-left: 35px; - padding-right: 35px; - padding-bottom: 35px; + padding: 15px; } } } @@ -134,10 +132,3 @@ width: 160px; } } - -.description_div { - margin-top: 5px; - margin-left: 5px; - color: dimgrey; - display: none; -} \ No newline at end of file diff --git a/app/decorators/champ_decorator.rb b/app/decorators/champ_decorator.rb index 6713e5049..42c9639e4 100644 --- a/app/decorators/champ_decorator.rb +++ b/app/decorators/champ_decorator.rb @@ -7,4 +7,9 @@ class ChampDecorator < Draper::Decorator end object.value end -end \ No newline at end of file + + def description_with_links + description.gsub(URI.regexp, '\0').html_safe if description + end + +end diff --git a/app/decorators/type_de_champ_decorator.rb b/app/decorators/type_de_champ_decorator.rb index d149996a7..ffe824855 100644 --- a/app/decorators/type_de_champ_decorator.rb +++ b/app/decorators/type_de_champ_decorator.rb @@ -39,4 +39,4 @@ class TypeDeChampDecorator < Draper::Decorator @count_type_de_champ ||= procedure.types_de_champ.count end end -end \ No newline at end of file +end diff --git a/app/views/users/description/_show.html.haml b/app/views/users/description/_show.html.haml index 5aebd3baa..1c28d55d0 100644 --- a/app/views/users/description/_show.html.haml +++ b/app/views/users/description/_show.html.haml @@ -15,7 +15,7 @@ = @dossier.procedure.libelle -#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 + = form_tag(url_for({controller: 'users/description', action: :create, dossier_id: @dossier.id}), class: 'form', method: 'POST', multipart: true) do -unless @champs.nil? #liste_champs =render partial: 'users/description/champs', locals:{private: false} diff --git a/app/views/users/description/champs/_render_list_champs.html.haml b/app/views/users/description/champs/_render_list_champs.html.haml index e15eceef6..021054b59 100644 --- a/app/views/users/description/champs/_render_list_champs.html.haml +++ b/app/views/users/description/champs/_render_list_champs.html.haml @@ -1,54 +1,56 @@ --champs.each do |champ| +- champs.decorate.each do |champ| - if champ.order_place > order_place - if champ.type_champ == 'header_section' - break - unless champ.type_champ == 'checkbox' || champ.type_champ == 'engagement' - %h4 - = champ.libelle - - if champ.mandatory? - = '*' + .row + %div{ class: if champ.type_champ == 'textarea' then 'col-md-12' else 'col-md-6' end } + .form-group + %label{ for: "champs_#{ champ.id }"} + = champ.libelle + - if champ.mandatory? + * - -if champ.type_champ == 'textarea' - =render partial: 'users/description/champs/textarea', locals: {champ: champ} + - if champ.type_champ == 'textarea' + = render partial: 'users/description/champs/textarea', locals: { champ: champ } - -elsif champ.type_champ == 'checkbox' - = render partial: 'users/description/champs/checkbox', locals: {champ: champ} + - elsif champ.type_champ == 'checkbox' + = render partial: 'users/description/champs/checkbox', locals: { champ: champ } - -elsif champ.type_champ == 'civilite' - =render partial: 'users/description/champs/civilite', locals: {champ: champ} + - elsif champ.type_champ == 'civilite' + = render partial: 'users/description/champs/civilite', locals: { champ: champ } - - elsif champ.type_champ == 'datetime' - =render partial: 'users/description/champs/datetime', locals: {champ: champ} + - elsif champ.type_champ == 'datetime' + = render partial: 'users/description/champs/datetime', locals: { champ: champ } - - elsif champ.type_champ == 'yes_no' - =render partial: 'users/description/champs/yes_no', locals: {champ: champ} + - elsif champ.type_champ == 'yes_no' + = render partial: 'users/description/champs/yes_no', locals: { champ: champ } - - elsif champ.type_champ == 'drop_down_list' - =render partial: 'users/description/champs/drop_down_list', locals: {champ: champ} + - elsif champ.type_champ == 'drop_down_list' + = render partial: 'users/description/champs/drop_down_list', locals: { champ: champ } - - elsif champ.type_champ == 'pays' - =render partial: 'users/description/champs/pays', locals: {champ: champ} + - elsif champ.type_champ == 'pays' + = render partial: 'users/description/champs/pays', locals: { champ: champ } - - elsif champ.type_champ == 'regions' - =render partial: 'users/description/champs/regions', locals: {champ: champ} + - elsif champ.type_champ == 'regions' + = render partial: 'users/description/champs/regions', locals: { champ: champ } - - elsif champ.type_champ == 'engagement' - =render partial: 'users/description/champs/engagement', locals: {champ: champ} + - elsif champ.type_champ == 'engagement' + = render partial: 'users/description/champs/engagement', locals: { champ: champ } - - elsif champ.type_champ == 'departements' - =render partial: 'users/description/champs/departements', locals: {champ: champ} + - elsif champ.type_champ == 'departements' + = render partial: 'users/description/champs/departements', locals: { champ: champ } - -else - %input.form-control{name:"champs['#{champ.id}']", - placeholder: champ.libelle, - id: "champs_#{champ.id}", - value: champ.value, - type: champ.type_champ, - 'data-provide' => champ.data_provide, - 'data-date-format' => champ.data_date_format} + - else + %input.form-control{name:"champs['#{ champ.id }']", + placeholder: champ.libelle, + id: "champs_#{ champ.id }", + value: champ.value, + type: champ.type_champ, + 'data-provide' => champ.data_provide, + 'data-date-format' => champ.data_date_format} - - unless champ.description.empty? || champ.type_champ == 'engagement' - .row - .col-lg-8.col-md-8.col-sm-8.col-xs-8{class: 'description_div', id:"description_champs_#{champ.id}"} - = champ.description + - unless champ.description.empty? || champ.type_champ == 'engagement' + .help-block{ id:"description_champs_#{ champ.id }" } + = champ.description_with_links diff --git a/app/views/users/description/champs/_textarea.html.haml b/app/views/users/description/champs/_textarea.html.haml index 4c062a300..9ea66d68e 100644 --- a/app/views/users/description/champs/_textarea.html.haml +++ b/app/views/users/description/champs/_textarea.html.haml @@ -2,4 +2,4 @@ placeholder: champ.description, id: "champs_#{champ.id}", row: '6'} - =champ.value \ No newline at end of file + = champ.value From 86901f7f2092aca820bbfc219482adf657ea801c Mon Sep 17 00:00:00 2001 From: LeSim Date: Tue, 14 Feb 2017 11:22:28 +0100 Subject: [PATCH 03/17] Update type_de_champ_decorator.rb From 8a3df4979b2777641984dbbf466a4765bbbd94a3 Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Tue, 14 Feb 2017 12:05:08 +0100 Subject: [PATCH 04/17] remove byebug and guard until it works --- .byebug_history | 13 ------------- Gemfile | 2 -- 2 files changed, 15 deletions(-) delete mode 100644 .byebug_history diff --git a/.byebug_history b/.byebug_history deleted file mode 100644 index bfbe59fde..000000000 --- a/.byebug_history +++ /dev/null @@ -1,13 +0,0 @@ -continue -next -SIADETOKEN -next -exit -params -next -params -SIADETOKEN -exit -xit -xtei -cniuecniu diff --git a/Gemfile b/Gemfile index 4acfb8697..7e1ca50c9 100644 --- a/Gemfile +++ b/Gemfile @@ -122,8 +122,6 @@ group :development do gem 'web-console' gem 'rack-handlers' gem 'xray-rails' - gem 'guard' - end group :development, :test do From b08a4c5091aa740c42d4aaba9f57f590ed0f5b5f Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Tue, 14 Feb 2017 14:34:00 +0100 Subject: [PATCH 05/17] Fix style for checkbox and radios --- app/assets/stylesheets/typeahead.scss | 3 +++ .../users/description/champs/_civilite.html.haml | 13 +++++++------ .../users/description/champs/_yes_no.html.haml | 13 +++++++------ 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/app/assets/stylesheets/typeahead.scss b/app/assets/stylesheets/typeahead.scss index 8cda8e19b..8d4c2a37c 100644 --- a/app/assets/stylesheets/typeahead.scss +++ b/app/assets/stylesheets/typeahead.scss @@ -1,3 +1,6 @@ +.twitter-typeahead { + width: 100%; // http://stackoverflow.com/questions/17957513/extending-the-width-of-bootstrap-typeahead-to-match-input-field +} .tt-menu { padding: 8px 0; diff --git a/app/views/users/description/champs/_civilite.html.haml b/app/views/users/description/champs/_civilite.html.haml index 1a9ad45f3..c6fcf6525 100644 --- a/app/views/users/description/champs/_civilite.html.haml +++ b/app/views/users/description/champs/_civilite.html.haml @@ -1,7 +1,8 @@ -%label.radio-inline - = radio_button_tag "champs['#{champ.id}']", "M.", champ.value == 'Mme' ? false : true - Monsieur +%div + %label.radio-inline + = radio_button_tag "champs['#{champ.id}']", "M.", champ.value == 'Mme' ? false : true + Monsieur -%label.radio-inline - = radio_button_tag "champs['#{champ.id}']", "Mme", champ.value == 'Mme' - Madame \ No newline at end of file + %label.radio-inline + = radio_button_tag "champs['#{champ.id}']", "Mme", champ.value == 'Mme' + Madame \ No newline at end of file diff --git a/app/views/users/description/champs/_yes_no.html.haml b/app/views/users/description/champs/_yes_no.html.haml index 9224f98f5..58cfac7e4 100644 --- a/app/views/users/description/champs/_yes_no.html.haml +++ b/app/views/users/description/champs/_yes_no.html.haml @@ -1,7 +1,8 @@ -%label.radio-inline - = radio_button_tag "champs['#{champ.id}']", "true", champ.value == 'true' - Oui +%div + %label.radio-inline + = radio_button_tag "champs['#{champ.id}']", "true", champ.value == 'true' + Oui -%label.radio-inline - = radio_button_tag "champs['#{champ.id}']", "false", champ.value == 'false' - Non \ No newline at end of file + %label.radio-inline + = radio_button_tag "champs['#{champ.id}']", "false", champ.value == 'false' + Non \ No newline at end of file From f60098311ef93130bffd728d15e52f64f30ca7c9 Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Tue, 14 Feb 2017 14:55:08 +0100 Subject: [PATCH 06/17] Fix hidden checkbox bug, address field : full width --- .../description/champs/_checkbox.html.haml | 8 +- .../description/champs/_engagement.html.haml | 11 +-- .../champs/_render_list_champs.html.haml | 77 +++++++++---------- 3 files changed, 43 insertions(+), 53 deletions(-) diff --git a/app/views/users/description/champs/_checkbox.html.haml b/app/views/users/description/champs/_checkbox.html.haml index 8f2727f9d..bae7b55ad 100644 --- a/app/views/users/description/champs/_checkbox.html.haml +++ b/app/views/users/description/champs/_checkbox.html.haml @@ -1,6 +1,2 @@ -%h4{style:'margin-left:15px;'} - = champ.libelle - - if champ.mandatory? - = '*' - %input{type: 'hidden', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", value: ''} - %input{type: 'checkbox', style:'margin-left: 15px;', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", checked: ('checked' if champ.value == 'on')} +%input{type: 'hidden', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", value: ''} +%input{type: 'checkbox', style:'margin-left: 15px;', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", checked: ('checked' if champ.value == 'on')} diff --git a/app/views/users/description/champs/_engagement.html.haml b/app/views/users/description/champs/_engagement.html.haml index 9381266cf..9addfed85 100644 --- a/app/views/users/description/champs/_engagement.html.haml +++ b/app/views/users/description/champs/_engagement.html.haml @@ -1,8 +1,3 @@ -%h4{style:'margin-left:15px;'} - = champ.libelle - - if champ.mandatory? - = '*' - %input{type: 'hidden', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", value: ''} - %input{type: 'checkbox', style:'margin-left: 15px;', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", checked: ('checked' if champ.value == 'on')} -%div{style:'margin-left: 5%; margin-right: 5%; text-align: justify; text-justify: inter-word;'} - = champ.description.gsub(/\r\n/, '
').html_safe \ No newline at end of file +%div + %input{type: 'hidden', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", value: ''} + %input{type: 'checkbox', style:'margin-left: 15px;', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", checked: ('checked' if champ.value == 'on')} diff --git a/app/views/users/description/champs/_render_list_champs.html.haml b/app/views/users/description/champs/_render_list_champs.html.haml index 021054b59..261ef88e1 100644 --- a/app/views/users/description/champs/_render_list_champs.html.haml +++ b/app/views/users/description/champs/_render_list_champs.html.haml @@ -3,54 +3,53 @@ - if champ.type_champ == 'header_section' - break - - unless champ.type_champ == 'checkbox' || champ.type_champ == 'engagement' - .row - %div{ class: if champ.type_champ == 'textarea' then 'col-md-12' else 'col-md-6' end } - .form-group - %label{ for: "champs_#{ champ.id }"} - = champ.libelle - - if champ.mandatory? - * + .row + %div{ class: if champ.type_champ == 'textarea' || champ.type_champ == 'engagement' then 'col-md-12' else 'col-md-6' end } + .form-group + %label{ for: "champs_#{ champ.id }"} + = champ.libelle + - if champ.mandatory? + * - - if champ.type_champ == 'textarea' - = render partial: 'users/description/champs/textarea', locals: { champ: champ } + - if champ.type_champ == 'textarea' + = render partial: 'users/description/champs/textarea', locals: { champ: champ } - - elsif champ.type_champ == 'checkbox' - = render partial: 'users/description/champs/checkbox', locals: { champ: champ } + - elsif champ.type_champ == 'checkbox' + = render partial: 'users/description/champs/checkbox', locals: { champ: champ } - - elsif champ.type_champ == 'civilite' - = render partial: 'users/description/champs/civilite', locals: { champ: champ } + - elsif champ.type_champ == 'civilite' + = render partial: 'users/description/champs/civilite', locals: { champ: champ } - - elsif champ.type_champ == 'datetime' - = render partial: 'users/description/champs/datetime', locals: { champ: champ } + - elsif champ.type_champ == 'datetime' + = render partial: 'users/description/champs/datetime', locals: { champ: champ } - - elsif champ.type_champ == 'yes_no' - = render partial: 'users/description/champs/yes_no', locals: { champ: champ } + - elsif champ.type_champ == 'yes_no' + = render partial: 'users/description/champs/yes_no', locals: { champ: champ } - - elsif champ.type_champ == 'drop_down_list' - = render partial: 'users/description/champs/drop_down_list', locals: { champ: champ } + - elsif champ.type_champ == 'drop_down_list' + = render partial: 'users/description/champs/drop_down_list', locals: { champ: champ } - - elsif champ.type_champ == 'pays' - = render partial: 'users/description/champs/pays', locals: { champ: champ } + - elsif champ.type_champ == 'pays' + = render partial: 'users/description/champs/pays', locals: { champ: champ } - - elsif champ.type_champ == 'regions' - = render partial: 'users/description/champs/regions', locals: { champ: champ } + - elsif champ.type_champ == 'regions' + = render partial: 'users/description/champs/regions', locals: { champ: champ } - - elsif champ.type_champ == 'engagement' - = render partial: 'users/description/champs/engagement', locals: { champ: champ } + - elsif champ.type_champ == 'engagement' + = render partial: 'users/description/champs/engagement', locals: { champ: champ } - - elsif champ.type_champ == 'departements' - = render partial: 'users/description/champs/departements', locals: { champ: champ } + - elsif champ.type_champ == 'departements' + = render partial: 'users/description/champs/departements', locals: { champ: champ } - - else - %input.form-control{name:"champs['#{ champ.id }']", - placeholder: champ.libelle, - id: "champs_#{ champ.id }", - value: champ.value, - type: champ.type_champ, - 'data-provide' => champ.data_provide, - 'data-date-format' => champ.data_date_format} + - else + %input.form-control{name:"champs['#{ champ.id }']", + placeholder: champ.libelle, + id: "champs_#{ champ.id }", + value: champ.value, + type: champ.type_champ, + 'data-provide' => champ.data_provide, + 'data-date-format' => champ.data_date_format} - - unless champ.description.empty? || champ.type_champ == 'engagement' - .help-block{ id:"description_champs_#{ champ.id }" } - = champ.description_with_links + - unless champ.description.empty? + %div{ id:"description_champs_#{ champ.id }", class: ('help-block' unless champ.type_champ == 'engagement') } + = champ.description_with_links From 933d1ac09a4b7def203b72ff5626f10117328c60 Mon Sep 17 00:00:00 2001 From: Xavier J Date: Tue, 14 Feb 2017 15:20:10 +0100 Subject: [PATCH 07/17] Move JS: true for start demande spec --- spec/features/users/start_demande_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/features/users/start_demande_spec.rb b/spec/features/users/start_demande_spec.rb index a1448e139..e3b8014b0 100644 --- a/spec/features/users/start_demande_spec.rb +++ b/spec/features/users/start_demande_spec.rb @@ -6,7 +6,7 @@ feature 'user arrive on siret page' do let(:siret) { '42149333900020' } let(:siren) { siret[0...9] } - context 'when user is not logged in', js: true do + context 'when user is not logged in' do before do visit new_users_dossiers_path(procedure_id: procedure.id) end @@ -24,7 +24,7 @@ feature 'user arrive on siret page' do scenario 'he is redirected to siret page to enter a siret' do expect(page).to have_css('#new_siret') end - context 'when enter a siret' do + context 'when enter a siret', js: true do before do stub_request(:get, "https://api-dev.apientreprise.fr/v2/etablissements/#{siret}?token=#{SIADETOKEN}") .to_return(status: 200, body: File.read('spec/support/files/etablissement.json')) @@ -39,6 +39,7 @@ feature 'user arrive on siret page' do page.click_on 'Valider' end scenario 'he is redirected to recap info entreprise page' do + wait_for_ajax expect(page).to have_css('#recap_info_entreprise') end end From 1e3c5bf14ab3485d0f6e43631c5cbe8d54819956 Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Tue, 14 Feb 2017 15:23:39 +0100 Subject: [PATCH 08/17] Fix engagement field --- app/views/users/description/champs/_engagement.html.haml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/views/users/description/champs/_engagement.html.haml b/app/views/users/description/champs/_engagement.html.haml index 9addfed85..bae7b55ad 100644 --- a/app/views/users/description/champs/_engagement.html.haml +++ b/app/views/users/description/champs/_engagement.html.haml @@ -1,3 +1,2 @@ -%div - %input{type: 'hidden', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", value: ''} - %input{type: 'checkbox', style:'margin-left: 15px;', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", checked: ('checked' if champ.value == 'on')} +%input{type: 'hidden', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", value: ''} +%input{type: 'checkbox', style:'margin-left: 15px;', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", checked: ('checked' if champ.value == 'on')} From e7b91c3db5fdf3f296db11c18599553d7a7a68dd Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Tue, 14 Feb 2017 16:09:52 +0100 Subject: [PATCH 09/17] Bootstrap default font-size is set to 16px --- app/assets/stylesheets/_variables.scss | 1 + app/assets/stylesheets/application.scss | 1 + 2 files changed, 2 insertions(+) create mode 100644 app/assets/stylesheets/_variables.scss diff --git a/app/assets/stylesheets/_variables.scss b/app/assets/stylesheets/_variables.scss new file mode 100644 index 000000000..daf479d2c --- /dev/null +++ b/app/assets/stylesheets/_variables.scss @@ -0,0 +1 @@ +$font-size-base: 16px; \ No newline at end of file diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 58f55fa66..52609b760 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -20,6 +20,7 @@ *= require franceconnect *= require bootstrap-wysihtml5 */ +@import "variables"; @import "bootstrap-sprockets"; @import "bootstrap"; From 6c41cbcc5e06dae74f8c69ea86a4ae9096dac2c0 Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Tue, 14 Feb 2017 16:20:52 +0100 Subject: [PATCH 10/17] Clean css --- app/assets/stylesheets/dossier_show.scss | 15 +-------------- app/views/dossiers/commentaires/_form.html.haml | 4 ++-- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/app/assets/stylesheets/dossier_show.scss b/app/assets/stylesheets/dossier_show.scss index 3d9c6ba98..33907469b 100644 --- a/app/assets/stylesheets/dossier_show.scss +++ b/app/assets/stylesheets/dossier_show.scss @@ -59,20 +59,7 @@ border-bottom: 1px solid #979797; } #new-commentaire { - padding: 35px; - .btn-send { - background-color: #E45B51; - text-align: center; - color: #FFFFFF; - width: 150px; - height: 40px; - line-height: 28px; - font-family: Arial; - font-size: 16px; - font-weight: bold; - float: right; - border-radius: 0; - } + padding: 15px; } } .infos { diff --git a/app/views/dossiers/commentaires/_form.html.haml b/app/views/dossiers/commentaires/_form.html.haml index 41163c221..e245c4964 100644 --- a/app/views/dossiers/commentaires/_form.html.haml +++ b/app/views/dossiers/commentaires/_form.html.haml @@ -7,5 +7,5 @@ %h4.text-primary{style: 'margin-top: 0px'} Ajouter un fichier = file_field_tag "piece_justificative[content]", accept: PieceJustificative.accept_format, style: 'float: left; margin-left: 20px' - .col-md-6 - %input#save-message.form-control.btn.btn-send{ type: 'submit', value: 'ENVOYER' } + .col-md-6.text-right + %input#save-message.form-control.btn.btn-danger{ type: 'submit', value: 'ENVOYER' } From 11c793a60cbc33ab12385f411ccea3265de05540 Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Tue, 14 Feb 2017 16:23:48 +0100 Subject: [PATCH 11/17] Remove custom button code, use bootstrap classes --- app/assets/stylesheets/dossier_show.scss | 12 ------------ app/views/dossiers/_messagerie.html.haml | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/app/assets/stylesheets/dossier_show.scss b/app/assets/stylesheets/dossier_show.scss index 33907469b..f840b193a 100644 --- a/app/assets/stylesheets/dossier_show.scss +++ b/app/assets/stylesheets/dossier_show.scss @@ -30,18 +30,6 @@ color: #000000; margin-bottom: 10px; } - .new-action { - background-color: #E45B51; - text-align: center; - cursor: pointer; - color: #FFFFFF; - width: 253px; - height: 40px; - line-height: 40px; - font-family: Arial; - font-size: 16px; - font-weight: bold; - } .file { padding-right: 70px; text-align: center; diff --git a/app/views/dossiers/_messagerie.html.haml b/app/views/dossiers/_messagerie.html.haml index d19127d4a..58a8ac81b 100644 --- a/app/views/dossiers/_messagerie.html.haml +++ b/app/views/dossiers/_messagerie.html.haml @@ -25,5 +25,5 @@ DERNIER MESSAGE = render partial: 'dossiers/commentaires/commentaire', object: last_comment - #open-message.new-action + %button#open-message.new-action.btn.btn-danger ENVOYER UN MESSAGE From 3b827fa5e3cb00372baf5e0dd26085d0ef64d767 Mon Sep 17 00:00:00 2001 From: Simon Lehericey Date: Tue, 14 Feb 2017 14:31:06 +0100 Subject: [PATCH 12/17] Remove specific cerfa in favor of default enclosed documents --- app/views/admin/procedures/_informations.html.haml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/admin/procedures/_informations.html.haml b/app/views/admin/procedures/_informations.html.haml index dfbbcaf67..6f38f2576 100644 --- a/app/views/admin/procedures/_informations.html.haml +++ b/app/views/admin/procedures/_informations.html.haml @@ -49,13 +49,13 @@ Cadastre .col-md-6.col-sm-6.col-xs-6.col-lg-6 - %h4 Formulaire de demande ou CERFA - %label - =f.check_box :cerfa_flag - Activer l'envoi de formulaire de demande ou CERFA - %br - =f.text_field :lien_demarche, class: 'form-control', placeholder: 'URL vers le formulaire vierge (facultatif)' - + - if @procedure.cerfa_flag + %h4 Formulaire de demande ou CERFA + %label + =f.check_box :cerfa_flag + Activer l'envoi de formulaire de demande ou CERFA + %br + =f.text_field :lien_demarche, class: 'form-control', placeholder: 'URL vers le formulaire vierge (facultatif)' %br .row .col-md-6.col-sm-6.col-xs-6.col-lg-6 From 5359c046e6080eaa9b8577d75026f6f904fad709 Mon Sep 17 00:00:00 2001 From: Simon Lehericey Date: Tue, 14 Feb 2017 17:08:14 +0100 Subject: [PATCH 13/17] Clean grid usage --- .../_list_not_assign.html.haml | 2 +- .../admin/accompagnateurs/show.html.haml | 8 +-- app/views/admin/gestionnaires/index.html.haml | 10 ++-- .../admin/procedures/_informations.html.haml | 10 ++-- app/views/admin/procedures/_list.html.haml | 2 +- app/views/admin/procedures/show.html.haml | 4 +- app/views/administrations/_list.html.haml | 8 +-- .../backoffice/dossiers/_followers.html.haml | 2 +- .../backoffice/dossiers/_pref_list.html.haml | 2 +- .../dossiers/_state_description.html.haml | 2 +- app/views/demo/_list.html.haml | 4 +- app/views/dossiers/_infos_carto.html.haml | 2 +- app/views/dossiers/_infos_dossier.html.haml | 52 +++++++++--------- .../dossiers/_infos_entreprise.html.haml | 54 +++++++++---------- .../dossiers/_infos_pieces_jointes.html.haml | 14 ++--- .../dossiers/_infos_private_fields.html.haml | 2 +- app/views/dossiers/_invites.html.haml | 4 +- app/views/dossiers/etapes/_etape1.html.haml | 6 +-- app/views/dossiers/etapes/_etape3.html.haml | 4 +- app/views/dossiers/etapes/_etape4.html.haml | 4 +- .../etapes/etape_2/_entreprise.html.haml | 4 +- .../etapes/etape_2/_individual.html.haml | 12 ++--- .../_support_navigator_banner.html.haml | 2 +- app/views/users/description/_show.html.haml | 4 +- app/views/users/dossiers/_list.html.haml | 8 +-- .../dossiers/_state_description.html.haml | 2 +- 26 files changed, 114 insertions(+), 114 deletions(-) diff --git a/app/views/admin/accompagnateurs/_list_not_assign.html.haml b/app/views/admin/accompagnateurs/_list_not_assign.html.haml index e5b206f97..3eb519dcd 100644 --- a/app/views/admin/accompagnateurs/_list_not_assign.html.haml +++ b/app/views/admin/accompagnateurs/_list_not_assign.html.haml @@ -14,7 +14,7 @@ - @accompagnateurs_not_assign.each do |accompagnateur| %tr - %td.col-md-11.col-sm-11.col-xs-11.col-lg-11{style:'padding-top: 11px; font-size:15px'}= accompagnateur.email + %td.col-xs-11{style:'padding-top: 11px; font-size:15px'}= accompagnateur.email %td.center %a.btn.btn-success.gestionnaire-affectation{href: "#{admin_procedure_accompagnateurs_path(procedure_id: @procedure.id, accompagnateur_id: accompagnateur.id, to: AccompagnateurService::ASSIGN)}", 'data-method' => 'put'} .fa.fa-arrow-right diff --git a/app/views/admin/accompagnateurs/show.html.haml b/app/views/admin/accompagnateurs/show.html.haml index 114f3729f..d62a10c54 100644 --- a/app/views/admin/accompagnateurs/show.html.haml +++ b/app/views/admin/accompagnateurs/show.html.haml @@ -1,7 +1,7 @@ .row.white-back #accompagnateur_form .row - .col-md-6.col-sm-6.col-xs-6.col-lg-6 + .col-xs-6 %h3.text-info Disponibles = smart_listing_render :accompagnateurs_not_assign @@ -11,13 +11,13 @@ #procedure_new.section.section-label = form_for @gestionnaire, url: {controller: 'admin/gestionnaires', action: :create} do |f| .row - .col-md-5.col-sm-5.col-xs-5.col-lg-5 + .col-xs-5 = hidden_field_tag :procedure_id, params[:procedure_id] =render partial: 'admin/gestionnaires/informations', locals: {f: f} - .col-md-2.col-sm-2.col-xs-2.col-lg-2 + .col-xs-2 %br %br = f.submit 'Valider', class: 'btn btn-info', style: 'float:left', id: 'add-gestionnaire-email' - .col-md-6.col-sm-6.col-xs-6.col-lg-6 + .col-xs-6 %h3.text-success Affectés = smart_listing_render :accompagnateurs_assign diff --git a/app/views/admin/gestionnaires/index.html.haml b/app/views/admin/gestionnaires/index.html.haml index 23860546f..aa9836843 100644 --- a/app/views/admin/gestionnaires/index.html.haml +++ b/app/views/admin/gestionnaires/index.html.haml @@ -2,18 +2,18 @@ %br .row - .col-md-4.col-sm-4.col-xs-4.col-lg-4 + .col-xs-4 = smart_listing_render :gestionnaires - .col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1 + .col-xs-1   - .col-md-6.col-sm-6.col-xs-6.col-lg-6 + .col-xs-6 %h3 Ajouter un accompagnateur #procedure_new.section.section-label = form_for @gestionnaire, url: {controller: 'admin/gestionnaires', action: :create} do |f| .row - .col-md-5.col-sm-5.col-xs-5.col-lg-5 + .col-xs-5 = render partial: 'informations', locals: {f: f} - .col-md-2.col-sm-2.col-xs-2.col-lg-2 + .col-xs-2 %br %br = f.submit 'Valider', class: 'btn btn-info', style: 'float:left' diff --git a/app/views/admin/procedures/_informations.html.haml b/app/views/admin/procedures/_informations.html.haml index dfbbcaf67..30c62580e 100644 --- a/app/views/admin/procedures/_informations.html.haml +++ b/app/views/admin/procedures/_informations.html.haml @@ -12,7 +12,7 @@ = f.text_field key, class: 'form-control', placeholder: value .row - .col-md-6.col-sm-6.col-xs-6.col-lg-6 + .col-xs-6 %h4 Logo de la procédure - unless @procedure.logo.blank? = image_tag @procedure.decorate.logo_img, {style: 'height: 40px; display: inline; margin-right: 6px', id: 'preview_procedure_logo'} @@ -21,7 +21,7 @@ %div{style:'margin-top:5px'} %i Fichier accepté : JPG / JPEG / PNG - .col-md-6.col-sm-6.col-xs-6.col-lg-6 + .col-xs-6 %h4 Drapeau européen %label =f.check_box :euro_flag @@ -30,7 +30,7 @@ %br .row - .col-md-6.col-sm-6.col-xs-6.col-lg-6 + .col-xs-6 %h4 Cartographie = f.fields_for :module_api_carto, @procedure.module_api_carto do |ff| @@ -48,7 +48,7 @@ = ff.check_box :cadastre Cadastre - .col-md-6.col-sm-6.col-xs-6.col-lg-6 + .col-xs-6 %h4 Formulaire de demande ou CERFA %label =f.check_box :cerfa_flag @@ -58,7 +58,7 @@ %br .row - .col-md-6.col-sm-6.col-xs-6.col-lg-6 + .col-xs-6 %h4 Particuliers %div %label diff --git a/app/views/admin/procedures/_list.html.haml b/app/views/admin/procedures/_list.html.haml index e1ae6bfb4..ba30f2e6f 100644 --- a/app/views/admin/procedures/_list.html.haml +++ b/app/views/admin/procedures/_list.html.haml @@ -12,7 +12,7 @@ - procedure = procedure.decorate %tr{id: "tr_dossier_#{procedure.id}", 'data-dossier_url' => admin_procedure_path(id: procedure.id)} %td= procedure.id - %td.col-md-6.col-sm-6.col-xs-6.col-lg-6 + %td.col-xs-6 = procedure.libelle - if @active_class %td= link_to procedure.lien, procedure.lien, class: 'procedure-lien', 'data-method' => :get diff --git a/app/views/admin/procedures/show.html.haml b/app/views/admin/procedures/show.html.haml index f13f46bfb..13bbd5516 100644 --- a/app/views/admin/procedures/show.html.haml +++ b/app/views/admin/procedures/show.html.haml @@ -96,7 +96,7 @@ =t('dynamics.admin.procedure.stats.title') .row - .col-md-6.col-sm-6.col-xs-6.col-lg-6{style:'margin-left:3%'} + .col-xs-6{style:'margin-left:3%'} %h4 Total %div = @facade.dossiers_total @@ -126,7 +126,7 @@ %p 0 - .col-md-5.col-sm-5.col-xs-5.col-lg-5 + .col-xs-5 %h4 Non archivés = javascript_include_tag "https://code.highcharts.com/highcharts.js", "chartkick" - if @facade.dossiers_for_pie_highchart.blank? diff --git a/app/views/administrations/_list.html.haml b/app/views/administrations/_list.html.haml index c31059e24..10d515c57 100644 --- a/app/views/administrations/_list.html.haml +++ b/app/views/administrations/_list.html.haml @@ -1,10 +1,10 @@ - unless smart_listing.empty? %table.table %thead - %th.col-md-4.col-sm-4.col-xs-4.col-lg-4= smart_listing.sortable 'Email', :email - %th.col-md-4.col-sm-4.col-xs-4.col-lg-4= smart_listing.sortable 'Date de dernière connexion', :last_sign_in_at - %th.col-md-2.col-sm-2.col-xs-2.col-lg-2 Procédure active - %th.col-md-2.col-sm-2.col-xs-2.col-lg-2 Dossier en cours + %th.col-xs-4= smart_listing.sortable 'Email', :email + %th.col-xs-4= smart_listing.sortable 'Date de dernière connexion', :last_sign_in_at + %th.col-xs-2 Procédure active + %th.col-xs-2 Dossier en cours - @admins.each do |admin| %tr diff --git a/app/views/backoffice/dossiers/_followers.html.haml b/app/views/backoffice/dossiers/_followers.html.haml index 4578680fd..11c6c37b5 100644 --- a/app/views/backoffice/dossiers/_followers.html.haml +++ b/app/views/backoffice/dossiers/_followers.html.haml @@ -3,7 +3,7 @@ %br .row - .col-md-4.col-sm-4.col-xs-4.col-lg-4 + .col-xs-4 - if @facade.followers.size > 0 %ul - @facade.followers.each do |follower| diff --git a/app/views/backoffice/dossiers/_pref_list.html.haml b/app/views/backoffice/dossiers/_pref_list.html.haml index 4815ca782..15fe33893 100644 --- a/app/views/backoffice/dossiers/_pref_list.html.haml +++ b/app/views/backoffice/dossiers/_pref_list.html.haml @@ -27,7 +27,7 @@ - if index%2 == 0 || tables.first.to_s.include?('champs') %tr - %td.col-sm-5.col-md-5.col-sm-5.col-xs-5.col-lg-5{style: 'vertical-align: top', colspan: (tables.first == :champs ? 2 : 1)} + %td.col-xs-5{style: 'vertical-align: top', colspan: (tables.first == :champs ? 2 : 1)} %h5= tables.first.to_s.gsub('_', ' ').capitalize %ul - if tables.second diff --git a/app/views/backoffice/dossiers/_state_description.html.haml b/app/views/backoffice/dossiers/_state_description.html.haml index 280074d9d..60ac57068 100644 --- a/app/views/backoffice/dossiers/_state_description.html.haml +++ b/app/views/backoffice/dossiers/_state_description.html.haml @@ -4,7 +4,7 @@ .row .col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1 .fa.fa-info-circle.text-info{style:'font-size: 2em; margin-top: 20%'} - .col-md-11.col-sm-11.col-xs-11.col-lg-11 + .col-xs-11 -if dossiers_list_facade.liste == 'nouveaux' Tous les dossiers présents dans cette liste sont ceux qui %b diff --git a/app/views/demo/_list.html.haml b/app/views/demo/_list.html.haml index 852751809..5340fcfb1 100644 --- a/app/views/demo/_list.html.haml +++ b/app/views/demo/_list.html.haml @@ -14,11 +14,11 @@ %tr %td = procedure.id - %td.col-md-4.col-sm-4.col-xs-4.col-lg-4 + %td.col-xs-4 = link_to procedure.libelle, procedure.lien %td = procedure.description - %td.col-md-3.col-sm-3.col-xs-3.col-lg-3 + %td.col-xs-3 = procedure.organisation = smart_listing.paginate diff --git a/app/views/dossiers/_infos_carto.html.haml b/app/views/dossiers/_infos_carto.html.haml index 1c706b2f5..c51812500 100644 --- a/app/views/dossiers/_infos_carto.html.haml +++ b/app/views/dossiers/_infos_carto.html.haml @@ -1,5 +1,5 @@ .row - .col-md-12.col-sm-12.col-xs-12.col-lg-12 + .col-xs-12 #map.mini{class: @facade.dossier.procedure.module_api_carto.classes} %input{id: 'json_latlngs', type:'hidden', value: "#{@facade.dossier.json_latlngs}"} diff --git a/app/views/dossiers/_infos_dossier.html.haml b/app/views/dossiers/_infos_dossier.html.haml index 7d2d50c41..afe71a442 100644 --- a/app/views/dossiers/_infos_dossier.html.haml +++ b/app/views/dossiers/_infos_dossier.html.haml @@ -2,40 +2,40 @@ .col-lg-12.col-md-12.col-sm-12.col-xs-12 - if @facade.procedure.for_individual? .row.title-row - %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.split-hr - %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.dossier-title= t('utils.depositaire').upcase - %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.split-hr + %div.col-xs-4.split-hr + %div.col-xs-4.dossier-title= t('utils.depositaire').upcase + %div.col-xs-4.split-hr .row - %div.col-md-6.col-sm-6.col-xs-6.col-lg-6.depositaire-label Civilité + %div.col-xs-6.depositaire-label Civilité %div.col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off= "-" - %div.col-md-5.col-sm-5.col-xs-5.col-lg-5.depositaire-info= @facade.individual.gender + %div.col-xs-5.depositaire-info= @facade.individual.gender .row - %div.col-md-6.col-sm-6.col-xs-6.col-lg-6.depositaire-label Nom + %div.col-xs-6.depositaire-label Nom %div.col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off= "-" - %div.col-md-5.col-sm-5.col-xs-5.col-lg-5.depositaire-info= @facade.individual.nom + %div.col-xs-5.depositaire-info= @facade.individual.nom .row - %div.col-md-6.col-sm-6.col-xs-6.col-lg-6.depositaire-label Prénom + %div.col-xs-6.depositaire-label Prénom %div.col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off= "-" - %div.col-md-5.col-sm-5.col-xs-5.col-lg-5.despositaire-info= @facade.individual.prenom + %div.col-xs-5.despositaire-info= @facade.individual.prenom .row - %div.col-md-6.col-sm-6.col-xs-6.col-lg-6.depositaire-label Date de naissance + %div.col-xs-6.depositaire-label Date de naissance %div.col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off= "-" - %div.col-md-5.col-sm-5.col-xs-5.col-lg-5.depositaire-info= @facade.individual.birthdate + %div.col-xs-5.depositaire-info= @facade.individual.birthdate .row.margin-top-20 - unless @facade.champs.nil? - @facade.champs.each do |champ| - if champ.type_champ == 'header_section' .row.title-row.margin-top-40 - %div.col-md-3.col-sm-3.col-xs-3.col-lg-3.split-hr - %div.col-md-6.col-sm-6.col-xs-6.col-lg-6.dossier-title= champ.libelle.upcase - %div.col-md-3.col-sm-3.col-xs-3.col-lg-3.split-hr + %div.col-xs-3.split-hr + %div.col-xs-6.dossier-title= champ.libelle.upcase + %div.col-xs-3.split-hr - else .row - %div.col-md-6.col-sm-6.col-xs-6.col-lg-6.depositaire-label= champ.libelle + %div.col-xs-6.depositaire-label= champ.libelle %div.col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off = "-" - %div.col-md-5.col-sm-5.col-xs-5.col-lg-5.depositaire-info{ id: "champ-#{champ.id}-value" } + %div.col-xs-5.depositaire-info{ id: "champ-#{champ.id}-value" } - unless champ.decorate.value.blank? = champ.decorate.value.html_safe @@ -50,18 +50,18 @@ - if @facade.procedure.cerfa_flag? || @facade.dossier.types_de_piece_justificative.count > 0 .col-lg-12.col-md-12.col-sm-12.col-xs-12 .row.title-row - %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.split-hr - %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.dossier-title= t('utils.pieces').upcase - %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.split-hr + %div.col-xs-4.split-hr + %div.col-xs-4.dossier-title= t('utils.pieces').upcase + %div.col-xs-4.split-hr .col-lg-12.col-md-12.col-sm-12.col-xs-12#pieces_justificatives.margin-bot-40 .row - if @facade.procedure.cerfa_flag? - .col-md-12.col-sm-12.col-xs-12.col-lg-12#piece_justificative_0 + .col-xs-12#piece_justificative_0 .row.piece-row - .col-md-6.col-sm-6.col-xs-6.col-lg-6.depositaire-label= 'Formulaire' + .col-xs-6.depositaire-label= 'Formulaire' .col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off= "-" - .col-md-5.col-sm-5.col-xs-5.col-lg-5.despositaire-info + .col-xs-5.despositaire-info - if @facade.dossier.cerfa_available? %a{ href: "#{@facade.dossier.cerfa.last.content_url}", target: '_blank' } Consulter %span{style:'margin-left:12px'} @@ -71,14 +71,14 @@ - else = 'Pièce non fournie' .row - .col-md-12.col-sm-12.col-xs-12.col-lg-12 + .col-xs-12 - @facade.types_de_pieces_justificatives.each do |type_de_piece_justificative| .row.piece-row - .col-md-12.col-sm-12.col-xs-12.col-lg-12{ id: "piece_justificative_#{type_de_piece_justificative.id}" } + .col-xs-12{ id: "piece_justificative_#{type_de_piece_justificative.id}" } .row - %div.col-md-6.col-sm-6.col-xs-6.col-lg-6.depositaire-label= type_de_piece_justificative.libelle + %div.col-xs-6.depositaire-label= type_de_piece_justificative.libelle %div.col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off= "-" - %div.col-md-5.col-sm-5.col-xs-5.col-lg-5.despositaire-info + %div.col-xs-5.despositaire-info - if type_de_piece_justificative.api_entreprise %span.text-success Nous l'avons récupéré pour vous. - elsif !(@pj = @facade.dossier.retrieve_last_piece_justificative_by_type(type_de_piece_justificative.id)).nil? diff --git a/app/views/dossiers/_infos_entreprise.html.haml b/app/views/dossiers/_infos_entreprise.html.haml index 81f670643..f1395b513 100644 --- a/app/views/dossiers/_infos_entreprise.html.haml +++ b/app/views/dossiers/_infos_entreprise.html.haml @@ -2,51 +2,51 @@ %h4 = @facade.entreprise.raison_sociale_or_name .row.split-row - %div.col-md-12.col-sm-12.col-xs-12.col-lg-12.split-hr + %div.col-xs-12.split-hr %div.row - .col-lg-12.col-md-12.col-sm-12.col-xs-12 + .col-xs-12 .row - %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label Siret : - %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info= @facade.etablissement.siret + %div.col-xs-4.entreprise-label Siret : + %div.col-xs-8.entreprise-info= @facade.etablissement.siret - if @facade.etablissement.siret != @facade.entreprise.siret_siege_social .row - %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label SIRET siège social : - %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info= @facade.entreprise.siret_siege_social + %div.col-xs-4.entreprise-label SIRET siège social : + %div.col-xs-8.entreprise-info= @facade.entreprise.siret_siege_social .row - %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label Forme juridique : - %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info= @facade.entreprise.forme_juridique + %div.col-xs-4.entreprise-label Forme juridique : + %div.col-xs-8.entreprise-info= @facade.entreprise.forme_juridique .row - %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label Libellé naf : - %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info= @facade.etablissement.libelle_naf + %div.col-xs-4.entreprise-label Libellé naf : + %div.col-xs-8.entreprise-info= @facade.etablissement.libelle_naf .row - %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label Code naf : - %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info= @facade.etablissement.naf + %div.col-xs-4.entreprise-label Code naf : + %div.col-xs-8.entreprise-info= @facade.etablissement.naf .row - %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label Date de création : - %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info= Time.at(@facade.entreprise.date_creation).strftime "%d-%m-%Y" + %div.col-xs-4.entreprise-label Date de création : + %div.col-xs-8.entreprise-info= Time.at(@facade.entreprise.date_creation).strftime "%d-%m-%Y" .row - %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label Effectif organisation : - %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info= @facade.entreprise.effectif + %div.col-xs-4.entreprise-label Effectif organisation : + %div.col-xs-8.entreprise-info= @facade.entreprise.effectif .row - %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label Code effectif : - %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info= @facade.entreprise.code_effectif_entreprise + %div.col-xs-4.entreprise-label Code effectif : + %div.col-xs-8.entreprise-info= @facade.entreprise.code_effectif_entreprise .row - %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label Numéro TVA intracommunautaire : - %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info= @facade.entreprise.numero_tva_intracommunautaire + %div.col-xs-4.entreprise-label Numéro TVA intracommunautaire : + %div.col-xs-8.entreprise-info= @facade.entreprise.numero_tva_intracommunautaire .row - %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label Adresse : - %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info + %div.col-xs-4.entreprise-label Adresse : + %div.col-xs-8.entreprise-info - @facade.etablissement.adresse.split("\n").each do |line| = line .row - %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label Capital social : - %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info= @facade.entreprise.pretty_capital_social + %div.col-xs-4.entreprise-label Capital social : + %div.col-xs-8.entreprise-info= @facade.entreprise.pretty_capital_social .row - %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label Exercices : - %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info + %div.col-xs-4.entreprise-label Exercices : + %div.col-xs-8.entreprise-info - @facade.etablissement.exercices.each_with_index do |exercice, index| %strong = "#{exercice.dateFinExercice.year} : " @@ -54,7 +54,7 @@ %br .row.split-row - %div.col-md-12.col-sm-12.col-xs-12.col-lg-12.split-hr + %div.col-xs-12.split-hr - unless @facade.entreprise.rna_information.nil? = render partial: '/dossiers/infos_rna' diff --git a/app/views/dossiers/_infos_pieces_jointes.html.haml b/app/views/dossiers/_infos_pieces_jointes.html.haml index 3d562b8a9..5268bdadb 100644 --- a/app/views/dossiers/_infos_pieces_jointes.html.haml +++ b/app/views/dossiers/_infos_pieces_jointes.html.haml @@ -1,11 +1,11 @@ #pieces_justificatives .row - if @facade.procedure.cerfa_flag? - .col-md-12.col-sm-12.col-xs-12.col-lg-12#piece_justificative_0 + .col-xs-12#piece_justificative_0 .row.piece-row - .col-md-6.col-sm-6.col-xs-6.col-lg-6.piece-label= 'Formulaire' + .col-xs-6.piece-label= 'Formulaire' .col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off= "-" - .col-md-5.col-sm-5.col-xs-5.col-lg-5 + .col-xs-5 - if @facade.dossier.cerfa_available? %a{ href: "#{@facade.dossier.cerfa.last.content_url}", target: '_blank' } Consulter %span{style:'margin-left:12px'} @@ -20,13 +20,13 @@ = 'Pièce non fournie' .row - .col-md-12.col-sm-12.col-xs-12.col-lg-12 + .col-xs-12 - @facade.dossier.types_de_piece_justificative.order('order_place ASC').each do |type_de_piece_justificative| .row.piece-row - .col-md-12.col-sm-12.col-xs-12.col-lg-12{ id: "piece_justificative_#{type_de_piece_justificative.id}" } + .col-xs-12{ id: "piece_justificative_#{type_de_piece_justificative.id}" } .row - .col-md-6.col-sm-6.col-xs-6.col-lg-6= type_de_piece_justificative.libelle - .col-md-6.col-sm-6.col-xs-6.col-lg-6 + .col-xs-6= type_de_piece_justificative.libelle + .col-xs-6 - if type_de_piece_justificative.api_entreprise %span.text-success Nous l'avons récupéré pour vous. - elsif !(@pj = @facade.dossier.retrieve_last_piece_justificative_by_type(type_de_piece_justificative.id)).nil? diff --git a/app/views/dossiers/_infos_private_fields.html.haml b/app/views/dossiers/_infos_private_fields.html.haml index b6aac7f24..295f6be56 100644 --- a/app/views/dossiers/_infos_private_fields.html.haml +++ b/app/views/dossiers/_infos_private_fields.html.haml @@ -1,5 +1,5 @@ .row{style: 'margin-top: -20px'} - .col-md-12.col-sm-12.col-xs-12.col-lg-12 + .col-xs-12 = form_for @facade.dossier, url: {controller: 'backoffice/private_formulaires', action: :update, dossier_id: @facade.dossier.id}, remote: true do = render partial: '/users/description/champs', locals:{private: true} .row.center diff --git a/app/views/dossiers/_invites.html.haml b/app/views/dossiers/_invites.html.haml index 72307147e..345760df0 100644 --- a/app/views/dossiers/_invites.html.haml +++ b/app/views/dossiers/_invites.html.haml @@ -2,7 +2,7 @@ %br .row - .col-md-4.col-sm-4.col-xs-4.col-lg-4 + .col-xs-4 - if @facade.invites.size > 0 %ul - @facade.invites.each do |invite| @@ -11,7 +11,7 @@ - else Aucune personne invitée - .col-md-3.col-sm-3.col-xs-3.col-lg-3 + .col-xs-3 = form_tag invites_dossier_path(dossier_id: @facade.dossier.id), method: :post, class: 'form-inline' do = text_field_tag :email, '', class: 'form-control', placeholder: 'Envoyer une invitation' = submit_tag 'Ajouter', class: 'btn btn-success', id: 'send-invitation' diff --git a/app/views/dossiers/etapes/_etape1.html.haml b/app/views/dossiers/etapes/_etape1.html.haml index 025e135bb..784796e4b 100644 --- a/app/views/dossiers/etapes/_etape1.html.haml +++ b/app/views/dossiers/etapes/_etape1.html.haml @@ -1,4 +1,4 @@ -.col-md-3.col-sm-3.col-xs-3.col-lg-3.center +.col-xs-3.center %h3 Ma procédure #logos.center{class: (@facade.entreprise.nil? ? '' : 'mask')} @@ -9,9 +9,9 @@ #logo_procedure.flag =image_tag( @facade.procedure.decorate.logo_img ) -.etape.etapes_informations.col-md-9.col-sm-9.col-xs-9.col-lg-9 +.etape.etapes_informations.col-xs-9 .row - .col-md-12.col-sm-12.col-xs-12.col-lg-12.padding-left-30 + .col-xs-12.padding-left-30 %h2#titre_procedure.text-info = @facade.procedure.libelle diff --git a/app/views/dossiers/etapes/_etape3.html.haml b/app/views/dossiers/etapes/_etape3.html.haml index 2190f7966..a163bbe81 100644 --- a/app/views/dossiers/etapes/_etape3.html.haml +++ b/app/views/dossiers/etapes/_etape3.html.haml @@ -1,6 +1,6 @@ -.etape.etapes_menu.col-md-3.col-sm-3.col-xs-3.col-lg-3 +.etape.etapes_menu.col-xs-3 %h3 Ma zone d'intervention -.etape.etapes_informations.col-md-9.col-sm-9.col-xs-9.col-lg-9 +.etape.etapes_informations.col-xs-9 .row diff --git a/app/views/dossiers/etapes/_etape4.html.haml b/app/views/dossiers/etapes/_etape4.html.haml index 04556443b..68a4c0fc4 100644 --- a/app/views/dossiers/etapes/_etape4.html.haml +++ b/app/views/dossiers/etapes/_etape4.html.haml @@ -1,6 +1,6 @@ -.etape.etapes_menu.col-md-3.col-sm-3.col-xs-3.col-lg-3 +.etape.etapes_menu.col-xs-3 %h3 Mon dossier -.etape.etapes_informations.col-md-9.col-sm-9.col-xs-9.col-lg-9 +.etape.etapes_informations.col-xs-9 .row diff --git a/app/views/dossiers/etapes/etape_2/_entreprise.html.haml b/app/views/dossiers/etapes/etape_2/_entreprise.html.haml index bac50fe87..6f0d121f8 100644 --- a/app/views/dossiers/etapes/etape_2/_entreprise.html.haml +++ b/app/views/dossiers/etapes/etape_2/_entreprise.html.haml @@ -1,4 +1,4 @@ -.etape.etapes_menu.col-md-3.col-sm-3.col-xs-3.col-lg-3 +.etape.etapes_menu.col-xs-3 %h3 Mes informations %br @@ -12,7 +12,7 @@ = f.submit 'Changer de SIRET', class: %w(btn btn-xs btn-primary) -.etape.etapes_informations.col-md-9.col-sm-9.col-xs-9.col-lg-9 +.etape.etapes_informations.col-xs-9 .row - if @facade.entreprise.nil? #new_siret{style:'margin-left: 20%; margin-top: 5%'} diff --git a/app/views/dossiers/etapes/etape_2/_individual.html.haml b/app/views/dossiers/etapes/etape_2/_individual.html.haml index 2c7423a64..ae1d3a56e 100644 --- a/app/views/dossiers/etapes/etape_2/_individual.html.haml +++ b/app/views/dossiers/etapes/etape_2/_individual.html.haml @@ -1,14 +1,14 @@ -.col-md-3.col-sm-3.col-xs-3.col-lg-3.center +.col-xs-3.center %h3 Mes informations %p Les informations de bases %br vous concernant. -.etape.etapes_informations.col-md-9.col-sm-9.col-xs-9.col-lg-9 +.etape.etapes_informations.col-xs-9 = form_for @facade.dossier, url: { controller: '/users/dossiers', action: :update } do |f| .row - .col-md-12.col-sm-12.col-xs-12.col-lg-12.padding-left-30 + .col-xs-12.padding-left-30 = f.hidden_field :id = f.fields_for :individual, @facade.individual do |ff| @@ -40,7 +40,7 @@ Vos informations personnelles ne seront jamais utilisées dans un but lucratif ou commercial. Elles ne pourront être communiquées à de tiers personnes sans votre accord préalable. Elles pourront en revanche être communiquées aux administrations compétentes afin d'instruire votre dossier, conformément à la déclaration CNIL effectué par le service TPS. =link_to 'en savoir plus', cgu_path, target: '_blank' .row - .col-md-5.col-sm-5.col-xs-5.col-lg-5.col-xs-5 - .col-md-2.col-sm-2.col-xs-2.col-lg-2.col-xs-2 + .col-xs-5.col-xs-5 + .col-xs-2.col-xs-2 = f.submit 'Etape suivante', class: "action", id: 'etape_suivante' - .col-md-5.col-sm-5.col-xs-5.col-lg-5.col-xs-5 + .col-xs-5.col-xs-5 diff --git a/app/views/layouts/_support_navigator_banner.html.haml b/app/views/layouts/_support_navigator_banner.html.haml index 26a53c962..16c371807 100644 --- a/app/views/layouts/_support_navigator_banner.html.haml +++ b/app/views/layouts/_support_navigator_banner.html.haml @@ -1,6 +1,6 @@ - unless BrowserService.recommended_browser? #support_navigator_banner.row - .col-md-12.col-sm-12.col-xs-12.col-lg-12 + .col-xs-12 = BROWSER.value.name = BROWSER.value.version \- diff --git a/app/views/users/description/_show.html.haml b/app/views/users/description/_show.html.haml index 5aebd3baa..65a3c4997 100644 --- a/app/views/users/description/_show.html.haml +++ b/app/views/users/description/_show.html.haml @@ -6,7 +6,7 @@ .row .col-md-1.col-lg-1.col-sm-1.col-xs-1 .fa.fa-info-circle.text-info{style:'font-size: 2em; margin-top: 20%'} - .col-md-10.col-sm-10.col-xs-10.col-lg-10{style:'padding-right: 0px'} + .col-xs-10{style:'padding-right: 0px'} %b =link_to 'Accéder au guide', @dossier.procedure.lien_notice, {target: '_blank'} pour remplir pour votre dossier @@ -36,7 +36,7 @@ .row .col-md-1.col-lg-1.col-sm-1.col-xs-1 .fa.fa-info-circle.text-info{style:'font-size: 2em; margin-top: 20%'} - .col-md-11.col-sm-11.col-xs-11.col-lg-11 + .col-xs-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. diff --git a/app/views/users/dossiers/_list.html.haml b/app/views/users/dossiers/_list.html.haml index e3c7b05aa..9707d9e68 100644 --- a/app/views/users/dossiers/_list.html.haml +++ b/app/views/users/dossiers/_list.html.haml @@ -2,11 +2,11 @@ %table#dossiers_list.table %thead %th#sort-id.col-md-1.col-lg-1.col-sm-1.col-xs-1= smart_listing.sortable 'Numéro', 'id' - %th#sort-libelle.col-md-5.col-sm-5.col-xs-5.col-lg-5= smart_listing.sortable 'Procédure', 'procedure.libelle' - %th#sort-state.col-md-2.col-sm-2.col-xs-2.col-lg-2= smart_listing.sortable 'État', 'state' - %th#sort-updated.col-md-2.col-sm-2.col-xs-2.col-lg-2= smart_listing.sortable 'Date de mise à jour', 'updated_at' + %th#sort-libelle.col-xs-5= smart_listing.sortable 'Procédure', 'procedure.libelle' + %th#sort-state.col-xs-2= smart_listing.sortable 'État', 'state' + %th#sort-updated.col-xs-2= smart_listing.sortable 'Date de mise à jour', 'updated_at' - if @liste == "brouillon" - %th.col-md-2.col-sm-2.col-xs-2.col-lg-2= 'Action' + %th.col-xs-2= 'Action' - @dossiers.each do |dossier| - if dossier.kind_of? Invite - invite = dossier diff --git a/app/views/users/dossiers/_state_description.html.haml b/app/views/users/dossiers/_state_description.html.haml index 5cf936cef..6d66eb71b 100644 --- a/app/views/users/dossiers/_state_description.html.haml +++ b/app/views/users/dossiers/_state_description.html.haml @@ -4,7 +4,7 @@ .row .col-md-1.col-lg-1.col-sm-1.col-xs-1 .fa.fa-info-circle.text-info{style:'font-size: 2em; margin-top: 20%'} - .col-md-11.col-sm-11.col-xs-11.col-lg-11 + .col-xs-11 -if dossiers_list_facade.liste == 'brouillon' Les dossiers présents dans cette liste %b From 58d5e401305e3128eb96b564f92d6030212e9065 Mon Sep 17 00:00:00 2001 From: Simon Lehericey Date: Wed, 15 Feb 2017 15:26:24 +0100 Subject: [PATCH 14/17] Remove duplicate email received --- ...5102943_remove_duplicate_email_received.rb | 11 ++++++++ db/schema.rb | 2 +- .../remove_duplicate_email_received_spec.rb | 25 +++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20170215102943_remove_duplicate_email_received.rb create mode 100644 spec/migrations/remove_duplicate_email_received_spec.rb diff --git a/db/migrate/20170215102943_remove_duplicate_email_received.rb b/db/migrate/20170215102943_remove_duplicate_email_received.rb new file mode 100644 index 000000000..ec37aaf93 --- /dev/null +++ b/db/migrate/20170215102943_remove_duplicate_email_received.rb @@ -0,0 +1,11 @@ +class RemoveDuplicateEmailReceived < ActiveRecord::Migration[5.0] + def change + all_mails = MailReceived.all + groupped = all_mails.group_by { |m| m.procedure_id } + filtered = groupped.reject { |k, v| v.length < 2 } + filtered.each do |k, duplicate_mails| + duplicate_mails.pop + duplicate_mails.each(&:destroy) + end + end +end diff --git a/db/schema.rb b/db/schema.rb index f6a873372..7eee27d55 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20170125152856) do +ActiveRecord::Schema.define(version: 20170215102943) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" diff --git a/spec/migrations/remove_duplicate_email_received_spec.rb b/spec/migrations/remove_duplicate_email_received_spec.rb new file mode 100644 index 000000000..9fd83c40a --- /dev/null +++ b/spec/migrations/remove_duplicate_email_received_spec.rb @@ -0,0 +1,25 @@ +load 'spec/spec_helper.rb' +load 'db/migrate/20170215102943_remove_duplicate_email_received.rb' + +describe RemoveDuplicateEmailReceived do + context 'with one procedure and one associated mail_received' do + let!(:procedure) { create(:procedure) } + + it 'keeps the procedure mails' do + RemoveDuplicateEmailReceived.new.change + expect(MailReceived.count).to eq(1) + end + + context 'and another mail_received' do + before :each do + MailReceived.create!(procedure: procedure) + end + + it 'destroys the unecessary maiL_received' do + RemoveDuplicateEmailReceived.new.change + expect(MailReceived.count).to eq(1) + expect(procedure.mail_received).not_to be_nil + end + end + end +end From 8995c6754265c5b6c3f9cdadc50ab0fec0efb6e9 Mon Sep 17 00:00:00 2001 From: Simon Lehericey Date: Wed, 15 Feb 2017 15:31:06 +0100 Subject: [PATCH 15/17] Add timestamp to mailtemplate --- ...20170215142944_add_timestamps_to_mail_template.rb | 6 ++++++ db/schema.rb | 12 +++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 db/migrate/20170215142944_add_timestamps_to_mail_template.rb diff --git a/db/migrate/20170215142944_add_timestamps_to_mail_template.rb b/db/migrate/20170215142944_add_timestamps_to_mail_template.rb new file mode 100644 index 000000000..bbdb2fd2b --- /dev/null +++ b/db/migrate/20170215142944_add_timestamps_to_mail_template.rb @@ -0,0 +1,6 @@ +class AddTimestampsToMailTemplate < ActiveRecord::Migration[5.0] + def change + add_column :mail_templates, :created_at, :datetime + add_column :mail_templates, :updated_at, :datetime + end +end diff --git a/db/schema.rb b/db/schema.rb index 7eee27d55..3af9d7709 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20170215102943) do +ActiveRecord::Schema.define(version: 20170215142944) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -234,10 +234,12 @@ ActiveRecord::Schema.define(version: 20170215102943) do end create_table "mail_templates", force: :cascade do |t| - t.string "object" - t.text "body" - t.string "type" - t.integer "procedure_id" + t.string "object" + t.text "body" + t.string "type" + t.integer "procedure_id" + t.datetime "created_at" + t.datetime "updated_at" end create_table "module_api_cartos", force: :cascade do |t| From a1240692102177c587a83e305d8e774aa3c5e488 Mon Sep 17 00:00:00 2001 From: Simon Lehericey Date: Wed, 15 Feb 2017 15:43:56 +0100 Subject: [PATCH 16/17] Procedure: use after_create to build_default_mails --- app/models/procedure.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/procedure.rb b/app/models/procedure.rb index 6f43a774e..a70b7bcdd 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -30,7 +30,7 @@ class Procedure < ActiveRecord::Base validates :libelle, presence: true, allow_blank: false, allow_nil: false validates :description, presence: true, allow_blank: false, allow_nil: false - after_save :build_default_mails, if: Proc.new { id_changed? } + after_create :build_default_mails def build_default_mails MailReceived.create(procedure: self) unless mail_received From 9fcc0920e6c752806832164ef735bb7adbb9a91c Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Thu, 16 Feb 2017 13:59:32 +0100 Subject: [PATCH 17/17] Css update --- app/assets/stylesheets/carte.scss | 4 -- .../admin/procedures_controller.rb | 2 +- app/views/admin/mail_templates/edit.html.haml | 9 +-- .../admin/procedures/_informations.html.haml | 69 ++++++++++--------- app/views/admin/procedures/edit.html.haml | 6 +- app/views/admin/procedures/show.html.haml | 12 ++-- 6 files changed, 50 insertions(+), 52 deletions(-) diff --git a/app/assets/stylesheets/carte.scss b/app/assets/stylesheets/carte.scss index f1d7d4dbb..486e98b64 100644 --- a/app/assets/stylesheets/carte.scss +++ b/app/assets/stylesheets/carte.scss @@ -3,10 +3,6 @@ // You can use Sass (SCSS) here: http://sass-lang.com/ @import "bootstrap"; -table { - font-size: 13px; -} - #carte_page { #map { @extend .col-md-12; diff --git a/app/controllers/admin/procedures_controller.rb b/app/controllers/admin/procedures_controller.rb index 2f7f11d1b..e047f9cc1 100644 --- a/app/controllers/admin/procedures_controller.rb +++ b/app/controllers/admin/procedures_controller.rb @@ -81,7 +81,7 @@ class Admin::ProceduresController < AdminController return render 'edit' end - flash.notice = 'Préocédure modifiée' + flash.notice = 'Procédure modifiée' redirect_to edit_admin_procedure_path(id: @procedure.id) end diff --git a/app/views/admin/mail_templates/edit.html.haml b/app/views/admin/mail_templates/edit.html.haml index a5471782a..1017a2012 100644 --- a/app/views/admin/mail_templates/edit.html.haml +++ b/app/views/admin/mail_templates/edit.html.haml @@ -12,7 +12,7 @@ = f.button :submit, 'Mettre à jour', class: "btn-success" .row - .col-md-6 + .col-md-8 %table.table %tr %th @@ -23,8 +23,9 @@ %tr %td.center %b.text-success - \-- - = balise.first - \-- + = raw "--#{balise.first}--" + -# \-- + -# = balise.first + -# \-- %td =balise.second[:description] diff --git a/app/views/admin/procedures/_informations.html.haml b/app/views/admin/procedures/_informations.html.haml index d34f1c07f..0b5e9a2ce 100644 --- a/app/views/admin/procedures/_informations.html.haml +++ b/app/views/admin/procedures/_informations.html.haml @@ -1,6 +1,3 @@ - -%br - -{libelle: 'Libellé*', description: 'Description*', organisation: 'Organisation', direction: 'Direction', lien_site_web: 'Lien site internet', lien_notice: 'Lien notice'}.each do |key, value| .form-group %h4 @@ -23,54 +20,58 @@ Fichier accepté : JPG / JPEG / PNG .col-xs-6 %h4 Drapeau européen - %label - =f.check_box :euro_flag - Afficher le drapeau européen - -%br + .checkbox + %label + =f.check_box :euro_flag + Afficher le drapeau européen .row .col-xs-6 %h4 Cartographie = f.fields_for :module_api_carto, @procedure.module_api_carto do |ff| - %label - =ff.check_box :use_api_carto, {id: :procedure_module_api_carto_use_api_carto} - Utilisation de la cartographie + .checkbox + %label + =ff.check_box :use_api_carto, {id: :procedure_module_api_carto_use_api_carto} + Utilisation de la cartographie %ul#modules_api_carto %li - %label - = ff.check_box :quartiers_prioritaires - Quartiers Prioritaires + .checkbox + %label + = ff.check_box :quartiers_prioritaires + Quartiers Prioritaires %li - %label - = ff.check_box :cadastre - Cadastre + .checkbox + %label + = ff.check_box :cadastre + Cadastre .col-xs-6 - if @procedure.cerfa_flag %h4 Formulaire de demande ou CERFA - %label - =f.check_box :cerfa_flag - Activer l'envoi de formulaire de demande ou CERFA - %br + .checkbox + %label + =f.check_box :cerfa_flag + Activer l'envoi de formulaire de demande ou CERFA =f.text_field :lien_demarche, class: 'form-control', placeholder: 'URL vers le formulaire vierge (facultatif)' -%br .row .col-xs-6 %h4 Particuliers - %div - %label - =f.check_box :for_individual - Cette procédure s'adresse à un public qui - %b - ne possède pas (ou pas encore) de numéro SIRET, - qui doivent donc s'identifier en tant que personne physique. - - %ul#individual_with_siret{style:'margin-top: 8px'} - %li + %ul.list-unstyled + %li + .checkbox %label - =f.check_box :individual_with_siret - Donner la possibilité de renseigner un SIRET au cours de la construction du dossier. + =f.check_box :for_individual + Cette procédure s'adresse à un public qui + %b + ne possède pas (ou pas encore) de numéro SIRET, + qui doit donc s'identifier en tant que personne physique. + + %ul.list-unstyled#individual_with_siret{style:'margin-left: 15px'} + %li + .checkbox + %label + =f.check_box :individual_with_siret + Donner la possibilité de renseigner un SIRET au cours de la construction du dossier. diff --git a/app/views/admin/procedures/edit.html.haml b/app/views/admin/procedures/edit.html.haml index c1a2c7dbe..e8097c911 100644 --- a/app/views/admin/procedures/edit.html.haml +++ b/app/views/admin/procedures/edit.html.haml @@ -2,6 +2,6 @@ #procedure_new.section.section-label = form_for @procedure, url: url_for({controller: 'admin/procedures', action: :update, id: @procedure.id}), multipart: true do |f| = render partial: 'informations', locals: {f: f} - = f.submit 'Editer', class: 'btn btn-success', style: 'float:right' - %br - %br + + .text-right + = f.submit 'Editer', class: 'btn btn-success' diff --git a/app/views/admin/procedures/show.html.haml b/app/views/admin/procedures/show.html.haml index 13bbd5516..1bcceffa9 100644 --- a/app/views/admin/procedures/show.html.haml +++ b/app/views/admin/procedures/show.html.haml @@ -70,18 +70,18 @@ Champs .badge.progress-bar-info = @facade.procedure.types_de_champ.size - - @facade.procedure.types_de_champ.order(:order_place).each do |champ| - = champ.libelle - %br + %ul + - @facade.procedure.types_de_champ.order(:order_place).each do |champ| + %li= champ.libelle .champs_private.col-xs-6.col-md-3 %h4.text-info Champs privés .badge.progress-bar-info = @facade.procedure.types_de_champ_private.size - - @facade.procedure.types_de_champ_private.order(:order_place).each do |champ| - = champ.libelle - %br + %ul + - @facade.procedure.types_de_champ_private.order(:order_place).each do |champ| + %li= champ.libelle .pieces_justificatives.col-xs-6.col-md-3 %h4.text-info