Merge branch 'staging'

This commit is contained in:
Xavier J 2016-11-07 17:25:36 +01:00
commit c37e474520
54 changed files with 298 additions and 151 deletions

View file

@ -1 +1 @@
2.1.5 2.3.1

View file

@ -104,9 +104,9 @@ group :test do
gem 'simplecov', require: false gem 'simplecov', require: false
gem 'poltergeist' gem 'poltergeist'
gem 'timecop' gem 'timecop'
gem 'guard' # gem 'guard'
gem 'guard-rspec', require: false # gem 'guard-rspec', require: false
gem 'guard-livereload', '~> 2.4', require: false # gem 'guard-livereload', '~> 2.4', require: false
gem 'vcr' gem 'vcr'
end end

View file

@ -136,11 +136,7 @@ GEM
activemodel (>= 3.0) activemodel (>= 3.0)
activesupport (>= 3.0) activesupport (>= 3.0)
request_store (~> 1.0) request_store (~> 1.0)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
erubis (2.7.0) erubis (2.7.0)
eventmachine (1.0.8)
excon (0.49.0) excon (0.49.0)
execjs (2.7.0) execjs (2.7.0)
factory_girl (4.5.0) factory_girl (4.5.0)
@ -283,24 +279,6 @@ GEM
formatador (0.2.5) formatador (0.2.5)
globalid (0.3.7) globalid (0.3.7)
activesupport (>= 4.1.0) activesupport (>= 4.1.0)
guard (2.13.0)
formatador (>= 0.2.4)
listen (>= 2.7, <= 4.0)
lumberjack (~> 1.0)
nenv (~> 0.1)
notiffany (~> 0.0)
pry (>= 0.9.12)
shellany (~> 0.0)
thor (>= 0.18.1)
guard-compat (1.2.1)
guard-livereload (2.5.1)
em-websocket (~> 0.5)
guard (~> 2.8)
guard-compat (~> 1.0)
multi_json (~> 1.8)
guard-rspec (4.3.1)
guard (~> 2.1)
rspec (>= 2.14, < 4.0)
haml (4.0.6) haml (4.0.6)
tilt tilt
haml-rails (0.9.0) haml-rails (0.9.0)
@ -318,7 +296,6 @@ GEM
ruby_parser (~> 3.5) ruby_parser (~> 3.5)
http-cookie (1.0.2) http-cookie (1.0.2)
domain_name (~> 0.5) domain_name (~> 0.5)
http_parser.rb (0.6.0)
httpclient (2.6.0.1) httpclient (2.6.0.1)
i18n (0.7.0) i18n (0.7.0)
inflecto (0.0.2) inflecto (0.0.2)
@ -346,16 +323,12 @@ GEM
railties (>= 3.1) railties (>= 3.1)
leaflet-rails (0.7.4) leaflet-rails (0.7.4)
libv8 (3.16.14.7) libv8 (3.16.14.7)
listen (3.0.4)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
logstash-event (1.2.02) logstash-event (1.2.02)
logstasher (0.6.5) logstasher (0.6.5)
logstash-event (~> 1.2.0) logstash-event (~> 1.2.0)
request_store request_store
loofah (2.0.3) loofah (2.0.3)
nokogiri (>= 1.5.9) nokogiri (>= 1.5.9)
lumberjack (1.0.9)
mail (2.6.4) mail (2.6.4)
mime-types (>= 1.16, < 4) mime-types (>= 1.16, < 4)
mailjet (1.1.0) mailjet (1.1.0)
@ -369,14 +342,10 @@ GEM
minitest (5.9.0) minitest (5.9.0)
multi_json (1.11.2) multi_json (1.11.2)
multipart-post (2.0.0) multipart-post (2.0.0)
nenv (0.2.0)
netrc (0.10.3) netrc (0.10.3)
nokogiri (1.6.8) nokogiri (1.6.8)
mini_portile2 (~> 2.1.0) mini_portile2 (~> 2.1.0)
pkg-config (~> 1.1.7) pkg-config (~> 1.1.7)
notiffany (0.0.8)
nenv (~> 0.1)
shellany (~> 0.0)
nyan-cat-formatter (0.11) nyan-cat-formatter (0.11)
rspec (>= 2.99, >= 2.14.2, < 4) rspec (>= 2.99, >= 2.14.2, < 4)
open4 (1.3.4) open4 (1.3.4)
@ -451,9 +420,6 @@ GEM
rainbow (2.0.0) rainbow (2.0.0)
raindrops (0.13.0) raindrops (0.13.0)
rake (11.2.2) rake (11.2.2)
rb-fsevent (0.9.6)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rbvmomi (1.8.2) rbvmomi (1.8.2)
builder builder
nokogiri (>= 1.4.1) nokogiri (>= 1.4.1)
@ -528,7 +494,6 @@ GEM
sentry-raven (0.13.1) sentry-raven (0.13.1)
faraday (>= 0.7.6) faraday (>= 0.7.6)
sexp_processor (4.6.0) sexp_processor (4.6.0)
shellany (0.0.1)
shoulda-matchers (2.8.0) shoulda-matchers (2.8.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
simplecov (0.9.1) simplecov (0.9.1)
@ -643,9 +608,6 @@ DEPENDENCIES
fog fog
fog-openstack fog-openstack
font-awesome-rails font-awesome-rails
guard
guard-livereload (~> 2.4)
guard-rspec
haml-rails haml-rails
hashie hashie
jbuilder (~> 2.0) jbuilder (~> 2.0)

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View file

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -3,9 +3,21 @@ $(document).ready(filters_init);
function filters_init() { function filters_init() {
$('html').click(function(event) {
var visible_filter = $('.filter_framed:visible')
if(visible_filter.length) {
if (!$(event.target).closest('.filter_framed').is(":visible")) {
visible_filter.hide();
}
}
});
$(".filter").on('click', function (event) { $(".filter").on('click', function (event) {
filter_framed_show(event); filter_framed_show(event);
filter_framed_close_all_excepted(framed_id(event)); filter_framed_close_all_excepted(framed_id(event));
event.stopPropagation();
});
$(".erase-filter").on('click', function (event) {
$(this).parent().find(".filter_input").val("");
}); });
} }
@ -24,4 +36,4 @@ function filter_framed_show(event) {
dom_object.css('top', (event.pageY + 7) + 'px'); dom_object.css('top', (event.pageY + 7) + 'px');
dom_object.css('left', (event.pageX + 7) + 'px'); dom_object.css('left', (event.pageX + 7) + 'px');
} }

View file

@ -30,4 +30,4 @@ function pref_list_dossier_close_action() {
} }
) )
}); });
} }

View file

@ -179,7 +179,12 @@ class Admin::ProceduresController < AdminController
end end
def path_list def path_list
render json: ProcedurePath.where("path LIKE '%#{params[:request]}%'").pluck(:path, :administrateur_id).inject([]) { render json: ProcedurePath
.joins(', procedures')
.where("procedures.id = procedure_paths.procedure_id AND procedures.archived != true")
.where("path LIKE '%#{params[:request]}%'")
.pluck(:path, :administrateur_id)
.inject([]) {
|acc, value| acc.push({label: value.first, mine: value.second == current_administrateur.id}) |acc, value| acc.push({label: value.first, mine: value.second == current_administrateur.id})
}.to_json }.to_json
end end

View file

@ -30,6 +30,13 @@ class Users::DossiersController < UsersController
procedure = ProcedurePath.where(path: params[:procedure_path]).first!.procedure procedure = ProcedurePath.where(path: params[:procedure_path]).first!.procedure
end end
if procedure.archived?
@dossier = Dossier.new(procedure: procedure)
return render 'commencer/archived'
end
redirect_to new_users_dossier_path(procedure_id: procedure.id) redirect_to new_users_dossier_path(procedure_id: procedure.id)
rescue ActiveRecord::RecordNotFound rescue ActiveRecord::RecordNotFound
error_procedure error_procedure

View file

@ -1,4 +1,5 @@
class ProcedureDecorator < Draper::Decorator class ProcedureDecorator < Draper::Decorator
delegate_all delegate_all
def lien def lien
@ -10,7 +11,7 @@ class ProcedureDecorator < Draper::Decorator
end end
def logo_img def logo_img
return 'logo-tps.png' if logo.blank? return h.image_url(LOGO_NAME) if logo.blank?
File.join(STORAGE_URL, File.basename(logo.path)) File.join(STORAGE_URL, File.basename(logo.path))
end end
def geographic_information def geographic_information

View file

@ -36,10 +36,10 @@ class PreferenceListDossier < ActiveRecord::Base
table = nil table = nil
{ {
dossier_id: create_column('ID', table, 'id', 'id', 1), dossier_id: create_column('', table, 'id', 'id', 1),
created_at: create_column('Créé le', table, 'created_at', 'first_creation', 2), created_at: create_column('Créé le', table, 'created_at', 'first_creation', 2),
updated_at: create_column('Mise à jour le', table, 'updated_at', 'last_update', 2), updated_at: create_column('Mise à jour le', table, 'updated_at', 'last_update', 2),
state: create_column('Statut', table, 'state', 'display_state', 1) state: create_column('État', table, 'state', 'display_state', 1)
} }
end end

View file

@ -103,7 +103,6 @@ class Procedure < ActiveRecord::Base
end end
def archive def archive
self.procedure_path.destroy! if self.path
self.update_attributes!({archived: true}) self.update_attributes!({archived: true})
end end

View file

@ -7,7 +7,8 @@
= smart_listing_render :accompagnateurs_not_assign = smart_listing_render :accompagnateurs_not_assign
%br %br
%h3 Ajouter un accompagnateur %h3
=t('dynamics.admin.procedure.onglet_accompagnateurs.add.title')
#procedure_new.section.section-label #procedure_new.section.section-label
= form_for @gestionnaire, url: {controller: 'admin/gestionnaires', action: :create} do |f| = form_for @gestionnaire, url: {controller: 'admin/gestionnaires', action: :create} do |f|
.row .row

View file

@ -2,7 +2,7 @@
= link_to('Informations', admin_procedure_path(@procedure)) = link_to('Informations', admin_procedure_path(@procedure))
%li{ class: ('active' if active == 'Accompagnateurs') } %li{ class: ('active' if active == 'Accompagnateurs') }
= link_to('Accompagnateurs', admin_procedure_accompagnateurs_path(@procedure)) = link_to(t('dynamics.admin.procedure.onglets.accompagnateurs'), admin_procedure_accompagnateurs_path(@procedure))
%li{ class: ('disabled' if @procedure.locked?) || ('active' if active == 'Description') } %li{ class: ('disabled' if @procedure.locked?) || ('active' if active == 'Description') }
= link_to_unless(@procedure.locked?, 'Description', edit_admin_procedure_path(@procedure)) do = link_to_unless(@procedure.locked?, 'Description', edit_admin_procedure_path(@procedure)) do

View file

@ -1,5 +1,6 @@
= link_to("Nouvelle procédure", "/admin/procedures/new", class: 'btn btn-success', style: 'float:right; margin-top:2%;') = link_to(t('dynamics.admin.dossiers.tableau_de_bord.nouvelle_procedure'), "/admin/procedures/new", class: 'btn btn-success', style: 'float:right; margin-top:2%;')
%h1 Gestion des procédures %h1
=t('dynamics.admin.dossiers.tableau_de_bord.title')
%br %br
= render partial: 'onglets' = render partial: 'onglets'

View file

@ -1,4 +1,5 @@
%h2 Nouvelle procédure %h2
=t('dynamics.admin.dossiers.tableau_de_bord.nouvelle_procedure')
#procedure_new.section.section-label #procedure_new.section.section-label
= form_for @procedure, url: {controller: 'admin/procedures', action: :create}, multipart: true do |f| = form_for @procedure, url: {controller: 'admin/procedures', action: :create}, multipart: true do |f|

View file

@ -83,7 +83,8 @@
= piece_justificative.libelle = piece_justificative.libelle
%br %br
%br %br
%h3 Dossiers %h3
=t('dynamics.admin.procedure.stats.title')
.row .row
.col-md-6.col-lg-6{style:'margin-left:3%'} .col-md-6.col-lg-6{style:'margin-left:3%'}

View file

@ -9,11 +9,13 @@
%li %li
= link_to(admin_procedures_path, id: :menu_item_procedure) do = link_to(admin_procedures_path, id: :menu_item_procedure) do
%i.fa.fa-list{ style: "background-size: 10px;"} %i.fa.fa-list{ style: "background-size: 10px;"}
&nbsp;Procédures &nbsp;
=t('dynamics.admin.menu.procedures')
%li %li
= link_to(admin_gestionnaires_path) do = link_to(admin_gestionnaires_path) do
%i.fa.fa-user %i.fa.fa-user
&nbsp;Accompagnateur &nbsp;
=t('dynamics.admin.menu.accompagnateurs')
%li.divider{ role: :separator} %li.divider{ role: :separator}
%li %li
= link_to(admin_profile_path, id: :profile) do = link_to(admin_profile_path, id: :profile) do

View file

@ -1,8 +1,9 @@
#form_login #form_login
%br %br
= image_tag('logo-tps.png') = image_tag(image_url(LOGO_NAME))
%br %br
%h2#login_admin Administration %h2#login_admin
=t('dynamics.admin.connexion_title')
%br %br
%br %br
@ -16,7 +17,7 @@
= f.email_field :email, class: 'form-control' = f.email_field :email, class: 'form-control'
%br %br
%h4 %h4
= f.label :password = f.label 'Mot de passe'
.input-group .input-group
.input-group-addon .input-group-addon
%span.glyphicon.glyphicon-asterisk %span.glyphicon.glyphicon-asterisk

View file

@ -3,6 +3,8 @@
= preference.libelle = preference.libelle
=form_tag @dossiers_list_facade.filter_url, {class: 'panel-body form-inline', method: :post} do =form_tag @dossiers_list_facade.filter_url, {class: 'panel-body form-inline', method: :post} do
%input.form-control.filter_input{name: "filter_input[#{preference.table_attr}]", style:'width: 84%', value: "#{preference.filter}"} %input.form-control.filter_input{name: "filter_input[#{preference.table_attr}]", style:'width: 69%', value: "#{preference.filter}"}
%button.btn.btn-sm.btn-success %button.btn.btn-sm.btn-success
%i.fa.fa-check %i.fa.fa-check
%div.btn.btn-sm.btn-danger.erase-filter
%i.fa.fa-remove

View file

@ -1,4 +1,4 @@
- if current_gestionnaire.follow?(@facade.dossier.id) - if current_gestionnaire.follow?(@facade.dossier.id)
= link_to('Quitter'.html_safe, backoffice_dossier_follow_path(dossier_id: @facade.dossier.id), 'data-method' => :put, class: 'btn btn-md btn-danger', id: "suivre_dossier_#{@facade.dossier.id}") = link_to('Se désabonner'.html_safe, backoffice_dossier_follow_path(dossier_id: @facade.dossier.id), 'data-method' => :put, class: 'btn btn-md btn-danger', id: "suivre_dossier_#{@facade.dossier.id}")
-else -else
= link_to('Suivre', backoffice_dossier_follow_path(dossier_id: @facade.dossier.id), 'data-method' => :put, class: 'btn btn-md btn-primary', id: "suivre_dossier_#{@facade.dossier.id}") = link_to("S'abonner", backoffice_dossier_follow_path(dossier_id: @facade.dossier.id), 'data-method' => :put, class: 'btn btn-md btn-primary', id: "suivre_dossier_#{@facade.dossier.id}")

View file

@ -1,4 +1,5 @@
%h3 Personnes suivant l'activité de ce dossier %h3
=t('dynamics.dossiers.followers.title')
%br %br
.row .row

View file

@ -1,6 +1,9 @@
#filter_by_procedure{style:'margin-left: 5%'} #filter_by_procedure{style:'margin-left: 2%'}
%b.text-info
= t('dynamics.backoffice.filter_procedure.title')
%select{onchange: 'location = this.value', style:'margin-top: 10px; margin-bottom: 10px', id: 'filter_by_procedure_select'} %select{onchange: 'location = this.value', style:'margin-top: 10px; margin-bottom: 10px', id: 'filter_by_procedure_select'}
%option{value: backoffice_dossiers_path} %option{value: backoffice_dossiers_path}
= t('dynamics.backoffice.filter_procedure.first')
- @dossiers_list_facade.gestionnaire_procedures_name_and_id_list.each do |procedure| - @dossiers_list_facade.gestionnaire_procedures_name_and_id_list.each do |procedure|
%option{value: backoffice_dossiers_procedure_path(procedure[:id]), ('selected' if procedure[:id] == params[:id].to_i) => '' } %option{value: backoffice_dossiers_procedure_path(procedure[:id]), ('selected' if procedure[:id] == params[:id].to_i) => '' }
= truncate(procedure[:libelle], {length: 50}) = truncate(procedure[:libelle], {length: 50})
@ -55,7 +58,7 @@
%a %a
= form_tag(backoffice_dossiers_search_url, method: :get) do = form_tag(backoffice_dossiers_search_url, method: :get) do
.input-group{style:'width: 300px'} .input-group{style:'width: 300px'}
= text_field_tag('q', "#{@search_terms unless @search_terms.nil? }", id: 'q', placeholder: "Rechercher un dossier ...", class:'form-control') = text_field_tag('q', "#{@search_terms unless @search_terms.nil? }", id: 'q', placeholder: t('dynamics.backoffice.research.placeholder'), class:'form-control')
%span.input-group-btn %span.input-group-btn
%button.btn.btn-default{ id:'search_button' } %button.btn.btn-default{ id:'search_button' }
%i.fa.fa-search %i.fa.fa-search

View file

@ -1,9 +1,10 @@
%button#pref_list_dossier_close_action.btn.btn-danger.btn-xs{style:'float:right'} %button#pref_list_dossier_close_action.btn.btn-danger.btn-xs{style:'float:right'}
%i.fa.fa-close %i.fa.fa-close
%h3 Gestion de colonnes affichées %h3
=t('dynamics.backoffice.pref_list.title')
%p{style:'margin-top: 15px; margin-bottom: 20px'} %p{style:'margin-top: 15px; margin-bottom: 20px'}
Ce menu vous permet de choisir les différentes colonnes que vous souhaitez voir apparaitrent dans votre interface de suivi des dossiers. =t('dynamics.backoffice.pref_list.description')
%h4.text-primary %h4.text-primary
Actuelles Actuelles

View file

@ -2,8 +2,9 @@
#pref_list_menu #pref_list_menu
= render partial: 'backoffice/dossiers/pref_list' = render partial: 'backoffice/dossiers/pref_list'
=link_to 'Tous mes dossiers en CSV', backoffice_download_dossiers_tps_path, {class: 'btn btn-success btn-sm', style: 'float: right; margin-right: 4%; margin-top: 7px'} =link_to t('dynamics.backoffice.download_all_dossiers'), backoffice_download_dossiers_tps_path, {class: 'btn btn-success btn-sm', style: 'float: right; margin-right: 4%; margin-top: 7px'}
%h1 Gestion des dossiers %h1
=t('dynamics.backoffice.title')
= render partial: 'backoffice/dossiers/onglets' = render partial: 'backoffice/dossiers/onglets'

View file

@ -1,6 +1,6 @@
#backoffice_dossier_show #backoffice_dossier_show
%h1#dossier_id.text-info{ :style => 'text-align:right'} %h1#dossier_id.text-info{ :style => 'text-align:right'}
= "Dossier n°#{@facade.dossier.id}" = t('dynamics.dossiers.numéro') + @facade.dossier.id.to_s
%div{:style => 'text-align:right'} %div{:style => 'text-align:right'}
%h3{:class => 'text-success'} %h3{:class => 'text-success'}

View file

@ -0,0 +1,15 @@
%br
%div{style: 'text-align: center; max-width:500px; margin-left:auto; margin-right:auto; padding: 20px;'}
= render partial: 'users/sessions/resume_procedure'
.center{style:'margin-top: -20px'}
%h3
La campagne de création de nouveau dossier
%br
pour cette démarche en ligne est maintenant terminée.
%br
%p
Si vous avez déjà déposé un ou plusieurs dossiers :
%a.btn.btn-lg.btn-info{href: new_user_session_path}
Accéder à mon espace en ligne.

View file

@ -7,7 +7,8 @@
- if @facade.procedure.for_individual? - if @facade.procedure.for_individual?
%br %br
.individual.text-info .individual.text-info
%h4 Dépositaire %h4
=t('dynamics.dossiers.depositaite')
%table.table{style:'width: 60%'} %table.table{style:'width: 60%'}
%tr %tr
@ -25,11 +26,12 @@
Prénom Prénom
%td.col-md-5.col-lg-5 %td.col-md-5.col-lg-5
= @facade.individual.prenom = @facade.individual.prenom
%tr - unless Features.opensimplif
%th.col-md-3.col-lg-3 %tr
Date de naissance %th.col-md-3.col-lg-3
%td.col-md-5.col-lg-5 Date de naissance
= @facade.individual.birthdate %td.col-md-5.col-lg-5
= @facade.individual.birthdate
- if @facade.dossier.mandataire_social && gestionnaire_signed_in? - if @facade.dossier.mandataire_social && gestionnaire_signed_in?
.mandataire_social.text-success.center .mandataire_social.text-success.center

View file

@ -9,7 +9,7 @@
%li %li
= invite.email = invite.email
- else - else
Aucune personne invité Aucune personne invitée
.col-md-3.col-lg-3 .col-md-3.col-lg-3
=form_tag invites_dossier_path(dossier_id: @facade.dossier.id), method: :post, class: 'form-inline' do =form_tag invites_dossier_path(dossier_id: @facade.dossier.id), method: :post, class: 'form-inline' do

View file

@ -17,7 +17,7 @@
Abonnés Abonnés
%li{role: "presentation"} %li{role: "presentation"}
%a{href: "#champs_private", 'aria-controls' => "champs_private", role: "tab", 'data-toggle' => "tab"} %a{href: "#champs_private", 'aria-controls' => "champs_private", role: "tab", 'data-toggle' => "tab"}
Formulaire Champs privés
%div{class: "tab-content"} %div{class: "tab-content"}
%div{role: "tabpanel", class: "tab-pane fade in active", id:"commentaires"} %div{role: "tabpanel", class: "tab-pane fade in active", id:"commentaires"}
@ -34,11 +34,11 @@
%div{role: "tabpanel", class: "tab-pane fade", id:"followers"} %div{role: "tabpanel", class: "tab-pane fade", id:"followers"}
= render partial: 'followers' = render partial: 'followers'
%div{role: "tabpanel", class: "tab-pane fade", id:"champs_private"} %div{role: "tabpanel", class: "tab-pane fade", id:"champs_private"}
%h3 Formulaire privé %h3 Champs privés
- if @champs.nil? || @champs.empty? - if @champs.nil? || @champs.empty?
%br %br
%h4.text-primary %h4.text-primary
Pas de formulaire privé pour ce dossier Pas de champ privé pour ce dossier
- else - else
= form_for @facade.dossier, url: {controller: 'backoffice/private_formulaires', action: :update, dossier_id: @facade.dossier.id}, remote: true do = form_for @facade.dossier, url: {controller: 'backoffice/private_formulaires', action: :update, dossier_id: @facade.dossier.id}, remote: true do
= render partial: '/users/description/champs' = render partial: '/users/description/champs'

View file

@ -1,7 +1,7 @@
= devise_error_messages! = devise_error_messages!
#form_login #form_login
= image_tag('logo-tps.png') = image_tag(image_url(LOGO_NAME))
%br %br
%h2#gestionnaire_login Changement de mot de passe %h2#gestionnaire_login Changement de mot de passe

View file

@ -2,7 +2,7 @@
%br %br
#form_login #form_login
= image_tag('logo-tps.png') = image_tag(image_url(LOGO_NAME))
%br %br
%h2#gestionnaire_login Mot de passe oublié %h2#gestionnaire_login Mot de passe oublié

View file

@ -1,6 +1,6 @@
#form_login #form_login
%br %br
= image_tag('logo-tps.png') = image_tag(image_url(LOGO_NAME))
%br %br
%h2#gestionnaire_login Accompagnateur %h2#gestionnaire_login Accompagnateur

View file

@ -5,22 +5,22 @@
Env Test Env Test
= image_tag('marianne_small.png', class: 'logo') = image_tag('marianne_small.png', class: 'logo')
%a{href: '/'} %a{href: '/'}
= image_tag('logo-tps.png', class: 'logo') = image_tag(image_url(LOGO_NAME), class: 'logo') rescue nil
- if gestionnaire_signed_in? && user_signed_in? - if gestionnaire_signed_in? && user_signed_in?
%a{href: (current_gestionnaire.procedure_filter.blank? ? backoffice_dossiers_path : backoffice_dossiers_procedure_path(current_gestionnaire.procedure_filter)), class: 'btn btn-md'} %a{href: (current_gestionnaire.procedure_filter.blank? ? backoffice_dossiers_path : backoffice_dossiers_procedure_path(current_gestionnaire.procedure_filter)), class: 'btn btn-md'}
Dossiers =t('dynamics.backoffice.dossiers')
%a{href: users_dossiers_path, class: 'btn btn-md'} %a{href: users_dossiers_path, class: 'btn btn-md'}
Mes Dossiers =t('dynamics.users.mes_dossiers')
- elsif gestionnaire_signed_in? - elsif gestionnaire_signed_in?
%a{href: (current_gestionnaire.procedure_filter.blank? ? backoffice_dossiers_path : backoffice_dossiers_procedure_path(current_gestionnaire.procedure_filter)), class: 'btn btn-md'} %a{href: (current_gestionnaire.procedure_filter.blank? ? backoffice_dossiers_path : backoffice_dossiers_procedure_path(current_gestionnaire.procedure_filter)), class: 'btn btn-md'}
Mes Dossiers =t('dynamics.users.mes_dossiers')
- elsif user_signed_in? - elsif user_signed_in?
%a{href: users_dossiers_path, class: 'btn btn-md'} %a{href: users_dossiers_path, class: 'btn btn-md'}
Mes Dossiers =t('dynamics.users.mes_dossiers')
- elsif administrateur_signed_in? - elsif administrateur_signed_in?
%a{href: admin_procedures_path, class: 'btn btn-md'} %a{href: admin_procedures_path, class: 'btn btn-md'}
Mes Procédures =t('dynamics.admin.menu.title')
#sign_out #sign_out
-if user_signed_in? -if user_signed_in?

View file

@ -51,7 +51,7 @@
\- \-
=link_to 'Contact', "mailto:contact@tps.apientreprise.fr" =link_to 'Contact', "mailto:"+t('dynamics.contact_email')

View file

@ -14,7 +14,8 @@
%h2.text-info %h2.text-info
= @dossier.procedure.libelle = @dossier.procedure.libelle
%h3 Votre dossier - unless Features.opensimplif
%h3 Votre dossier
-#TODO use form_for -#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-inline', method: 'POST', multipart: true) do
@ -37,19 +38,19 @@
//TODO a refactorer //TODO a refactorer
= render partial: 'users/description/pieces_justificatives' = render partial: 'users/description/pieces_justificatives'
#state_description.row{style:'width: 50%; margin-left:20px'} - unless Features.opensimplif
.panel.panel-info #state_description.row{style:'width: 50%; margin-left:20px'}
.panel-body.center .panel.panel-info
.row .panel-body.center
.col-md-1.col-lg-1 .row
.fa.fa-info-circle.text-info{style:'font-size: 2em; margin-top: 20%'} .col-md-1.col-lg-1
.col-md-11.col-lg-11 .fa.fa-info-circle.text-info{style:'font-size: 2em; margin-top: 20%'}
Les documents administratifs ne sont pas indispensables afin d'initier votre dossier. .col-md-11.col-lg-11
Vous pourrez dans tous les cas les compléter plus tard si vous ne les possédez pas de suite. Les documents administratifs ne sont pas indispensables afin d'initier votre dossier.
Vous pourrez dans tous les cas les compléter plus tard si vous ne les possédez pas de suite.
- if user_signed_in? - if user_signed_in?
%div{style: 'text-align:right'} %div{style: 'text-align:right'}
%h6 Tous les champs portant un * sont obligatoires. %h6 Tous les champs portant un * sont obligatoires.

View file

@ -1,5 +1,6 @@
#users_index #users_index
%h1 Mes dossiers %h1
=t('dynamics.users.mes_dossiers')
-unless Features.opensimplif -unless Features.opensimplif
= render partial: 'onglets' = render partial: 'onglets'

View file

@ -29,7 +29,7 @@
= devise_error_messages! = devise_error_messages!
#form_login #form_login
= image_tag('logo-tps.png') = image_tag(image_url(LOGO_NAME))
%br %br
%h2#gestionnaire_login Changement de mot de passe %h2#gestionnaire_login Changement de mot de passe

View file

@ -30,7 +30,7 @@
%br %br
#form_login #form_login
= image_tag('logo-tps.png') = image_tag(image_url(LOGO_NAME))
%br %br
%h2#gestionnaire_login Mot de passe oublié %h2#gestionnaire_login Mot de passe oublié

View file

@ -8,7 +8,7 @@
.col-md-3.col-lg-3 .col-md-3.col-lg-3
%h2#dossier_id{:class => 'text-info', :style => 'text-align:right; margin-bottom:15px'} %h2#dossier_id{:class => 'text-info', :style => 'text-align:right; margin-bottom:15px'}
= "Dossier n°#{@facade.dossier.id}" = t('dynamics.dossiers.numéro') + @facade.dossier.id.to_s
- if user_signed_in? && current_user.email == @facade.dossier.user.email - if user_signed_in? && current_user.email == @facade.dossier.user.email
-if @facade.dossier.validated? -if @facade.dossier.validated?

View file

@ -30,7 +30,7 @@
#form_login #form_login
%br %br
= image_tag('logo-tps.png') = image_tag(image_url(LOGO_NAME))
%br %br
%h2#gestionnaire_login Inscription %h2#gestionnaire_login Inscription

View file

@ -0,0 +1,18 @@
- if @dossier
= link_to 'X', users_no_procedure_url, class: 'btn btn-xs', style:'float: right'
- if @dossier.procedure.euro_flag
#euro_flag.flag
=image_tag('drapeau_europe.png')
#logo_procedure.flag
=image_tag( @dossier.procedure.decorate.logo_img )
%h2#titre_procedure.text-info
= @dossier.procedure.libelle
%p
= h @dossier.procedure.description.html_safe
- else
= image_tag(image_url(LOGO_NAME), {id: 'logo_tps'})
%br

View file

@ -1,26 +1,9 @@
#form_login #form_login
%br %br
- if @dossier = render partial: 'users/sessions/resume_procedure'
= link_to 'X', users_no_procedure_url, class: 'btn btn-xs', style:'float: right'
- if @dossier.procedure.euro_flag %h2#login_user
#euro_flag.flag =t('dynamics.users.connexion_title')
=image_tag('drapeau_europe.png')
#logo_procedure.flag
=image_tag( @dossier.procedure.decorate.logo_img )
%h2#titre_procedure.text-info
= @dossier.procedure.libelle
%p
= h @dossier.procedure.description.html_safe
- else
= image_tag('logo-tps.png', {id: 'logo_tps'})
%br
%h2#login_user Connexion
%a.btn_fc#btn_fcp{href: '/france_connect/particulier'} %a.btn_fc#btn_fcp{href: '/france_connect/particulier'}
= image_tag 'franceconnect_logo.png' = image_tag 'franceconnect_logo.png'
@ -39,7 +22,7 @@
= f.email_field :email, class: 'form-control' = f.email_field :email, class: 'form-control'
%br %br
%h4 %h4
= f.label :password = f.label 'Mot de passe'
.input-group .input-group
.input-group-addon .input-group-addon
%span.fa.fa-asterisk %span.fa.fa-asterisk

View file

@ -1,6 +1,6 @@
%p.lead{id: 'pro_section'} %p.lead{id: 'pro_section'}
= image_tag('logo-tps.png') = image_tag(image_url(LOGO_NAME))
%br %br
%h2#titre_procedure.text-info %h2#titre_procedure.text-info
= @procedure.libelle = @procedure.libelle

View file

@ -94,6 +94,7 @@ set :shared_paths, [
"config/initializers/super_admin.rb", "config/initializers/super_admin.rb",
"config/unicorn.rb", "config/unicorn.rb",
"config/initializers/raven.rb", "config/initializers/raven.rb",
"config/locales/dynamics/fr.yml",
'config/france_connect.yml', 'config/france_connect.yml',
'config/initializers/mailjet.rb', 'config/initializers/mailjet.rb',
'config/initializers/storage_url.rb', 'config/initializers/storage_url.rb',
@ -138,6 +139,9 @@ task :setup => :environment do
queue! %[mkdir -p "#{deploy_to}/shared/app"] queue! %[mkdir -p "#{deploy_to}/shared/app"]
queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/app"] queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/app"]
queue! %[mkdir -p "#{deploy_to}/shared/config/locales/dynamics"]
queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/config/locales/dynamics"]
queue! %[touch "#{deploy_to}/shared/config/database.yml"] queue! %[touch "#{deploy_to}/shared/config/database.yml"]
queue %[echo "-----> Be sure to edit 'shared/config/database.yml'."] queue %[echo "-----> Be sure to edit 'shared/config/database.yml'."]

View file

@ -0,0 +1,2 @@
LOGO_NAME = 'logos/logo-tps.png' unless Features.opensimplif
LOGO_NAME = 'logos/logo-opensimplif.jpg' if Features.opensimplif

View file

@ -0,0 +1,44 @@
fr:
dynamics:
contact_email: contact@tps.apientreprise.fr
users:
connexion_title: Connexion
mes_dossiers: 'Mes dossiers'
backoffice:
title: Gestion des dossiers
dossiers: Dossiers
pref_list:
title: 'Gestion de colonnes affichées'
description: 'Ce menu vous permet de choisir les différentes colonnes que vous souhaitez voir apparaître dans votre interface de suivi des dossiers.'
download_all_dossiers: 'Tous mes dossiers en CSV'
research:
placeholder: 'Rechercher un dossier ...'
filter_procedure:
title: "Voir qu'une procédure :"
first: ''
dossiers:
depositaite: "Dépositaire"
numéro: 'Dossier n°'
followers:
title: "Personnes suivant l'activité de ce dossier"
admin:
connexion_title: Administration
dossiers:
tableau_de_bord:
title: 'Gestion des procédures'
nouvelle_procedure: 'Nouvelle procédure'
menu:
title: Mes procédures
accompagnateurs: Accompagnateurs
procedures: Procédures
procedure:
onglets:
accompagnateurs: Accompagnateurs
stats:
title: Dossiers
onglet_accompagnateurs:
add:
title: 'Ajouter un accompagnateur'

View file

@ -0,0 +1,44 @@
fr_opensimplif:
dynamics:
contact_email: simplification.sgmap@modernisation.gouv.fr
users:
connexion_title: "Connectez-vous en tant qu'utilisateur"
mes_dossiers: 'Mon tableau de bord'
backoffice:
title: Tableau de bord
dossiers: Tableau de bord
pref_list:
title: 'Affichage du tableau de bord'
description: 'Ce menu vous permet de choisir les différentes colonnes que vous souhaitez voir apparaître dans le tableau de bord.'
download_all_dossiers: 'Exporter'
research:
placeholder: 'Rechercher une simplification ...'
filter_procedure:
title: "Statut des simplifications :"
first: 'Tous'
dossiers:
depositaite: "Emetteur de la simplification"
numéro: 'Simplification n°'
followers:
title: "Personnes suivant l'activité de cette simplification"
admin:
connexion_title: Connectez-vous en tant qu'administrateur
dossiers:
tableau_de_bord:
title: 'Tableau de bord'
nouvelle_procedure: 'Nouveau format de fiche'
menu:
title: Tableau de bord
accompagnateurs: Utilisateurs
procedures: Tableau de bord
procedure:
onglets:
accompagnateurs: Utilisateurs
stats:
title: Simplification
onglet_accompagnateurs:
add:
title: 'Ajouter un utilisateur'

View file

@ -299,7 +299,7 @@ describe Admin::ProceduresController, type: :controller do
it 'archive previous procedure' do it 'archive previous procedure' do
expect(procedure2.published).to be_truthy expect(procedure2.published).to be_truthy
expect(procedure2.archived).to be_truthy expect(procedure2.archived).to be_truthy
expect(procedure2.path).to be_nil expect(procedure2.path).not_to be_nil
end end
end end
@ -427,21 +427,31 @@ describe Admin::ProceduresController, type: :controller do
let!(:procedure) { create(:procedure, :published, administrateur: admin) } let!(:procedure) { create(:procedure, :published, administrateur: admin) }
let(:admin2) { create(:administrateur) } let(:admin2) { create(:administrateur) }
let!(:procedure2) { create(:procedure, :published, administrateur: admin2) } let!(:procedure2) { create(:procedure, :published, administrateur: admin2) }
let!(:procedure3) { create(:procedure, :published, administrateur: admin2) }
subject { get :path_list } subject { get :path_list }
let(:body) { JSON.parse(response.body) } let(:body) { JSON.parse(response.body) }
before do describe 'when no params' do
subject before do
subject
end
it { expect(response.status).to eq(200) }
it { expect(body.size).to eq(3) }
it { expect(body.first['label']).to eq(procedure.path) }
it { expect(body.first['mine']).to be_truthy }
it { expect(body.second['label']).to eq(procedure2.path) }
it { expect(body.second['mine']).to be_falsy }
end end
it { expect(response.status).to eq(200) }
it { expect(body.size).to eq(2) }
it { expect(body.first['label']).to eq(procedure.path) }
it { expect(body.first['mine']).to be_truthy }
it { expect(body.second['label']).to eq(procedure2.path) }
it { expect(body.second['mine']).to be_falsy }
context 'filtered' do context 'filtered' do
before do
subject
end
subject { get :path_list, request: procedure2.path } subject { get :path_list, request: procedure2.path }
it { expect(response.status).to eq(200) } it { expect(response.status).to eq(200) }
@ -449,6 +459,18 @@ describe Admin::ProceduresController, type: :controller do
it { expect(body.first['label']).to eq(procedure2.path) } it { expect(body.first['label']).to eq(procedure2.path) }
it { expect(body.first['mine']).to be_falsy } it { expect(body.first['mine']).to be_falsy }
end end
context 'when procedure is archived' do
before do
procedure3.update_attribute :archived, true
subject
end
it 'do not return on the json' do
expect(body.size).to eq(2)
end
end
end end
describe 'POST transfer' do describe 'POST transfer' do
@ -467,7 +489,7 @@ describe Admin::ProceduresController, type: :controller do
let(:email_admin) { new_admin.email } let(:email_admin) { new_admin.email }
it { expect(subject.status).to eq 200 } it { expect(subject.status).to eq 200 }
it { expect {subject}.to change(Procedure, :count).by(1) } it { expect { subject }.to change(Procedure, :count).by(1) }
context { context {
before do before do

View file

@ -157,6 +157,16 @@ describe Users::DossiersController, type: :controller do
it { expect(subject.status).to eq 302 } it { expect(subject.status).to eq 302 }
it { expect(subject).to redirect_to new_users_dossier_path(procedure_id: procedure.id) } it { expect(subject).to redirect_to new_users_dossier_path(procedure_id: procedure.id) }
context 'when procedure is archived' do
let(:procedure) { create(:procedure, :published, archived: true) }
before do
procedure.update_column :archived, true
end
it { expect(subject.status).to eq 200 }
end
end end
describe 'POST #siret_informations' do describe 'POST #siret_informations' do

View file

@ -16,7 +16,7 @@ describe ProcedureDecorator do
describe 'logo_img' do describe 'logo_img' do
subject { super().logo_img } subject { super().logo_img }
it { is_expected.to eq('logo-tps.png') } it { is_expected.to match(/http.*#{ActionController::Base.helpers.image_url(LOGO_NAME)}/) }
end end
describe 'geographic_information' do describe 'geographic_information' do

View file

@ -26,7 +26,7 @@ describe PreferenceListDossier do
describe 'dossier_id' do describe 'dossier_id' do
subject { super()[:dossier_id] } subject { super()[:dossier_id] }
it { expect(subject[:libelle]).to eq 'ID' } it { expect(subject[:libelle]).to eq '' }
it { expect(subject[:table]).to be_nil } it { expect(subject[:table]).to be_nil }
it { expect(subject[:attr]).to eq 'id' } it { expect(subject[:attr]).to eq 'id' }
it { expect(subject[:attr_decorate]).to eq 'id' } it { expect(subject[:attr_decorate]).to eq 'id' }
@ -62,7 +62,7 @@ describe PreferenceListDossier do
describe 'state' do describe 'state' do
subject { super()[:state] } subject { super()[:state] }
it { expect(subject[:libelle]).to eq 'Statut' } it { expect(subject[:libelle]).to eq 'État' }
it { expect(subject[:table]).to be_nil } it { expect(subject[:table]).to be_nil }
it { expect(subject[:attr]).to eq 'state' } it { expect(subject[:attr]).to eq 'state' }
it { expect(subject[:attr_decorate]).to eq 'display_state' } it { expect(subject[:attr_decorate]).to eq 'display_state' }

View file

@ -243,14 +243,14 @@ describe Procedure do
end end
it 'is not available from a valid path anymore' do it 'is not available from a valid path anymore' do
expect(procedure.path).to be_nil expect(procedure.path).to eq procedure_path.path
expect(procedure.published).to be_truthy expect(procedure.published).to be_truthy
expect(procedure.archived).to be_truthy expect(procedure.archived).to be_truthy
end end
it 'is not in ProcedurePath table anymore' do it 'is not in ProcedurePath table anymore' do
expect(ProcedurePath.where(path: procedure.path).count).to eq(0) expect(ProcedurePath.where(path: procedure.path).count).to eq(1)
expect(ProcedurePath.find_by_procedure_id(procedure.id)).to be_nil expect(ProcedurePath.find_by_procedure_id(procedure.id)).not_to be_nil
end end
end end

View file

@ -33,8 +33,8 @@ describe 'layouts/_navbar.html.haml', type: :view do
it { is_expected.not_to match(/href="\/users\/sign_in">Utilisateur/) } it { is_expected.not_to match(/href="\/users\/sign_in">Utilisateur/) }
it { is_expected.not_to match(/href="\/gestionnaires\/sign_in">Accompagnateur/) } it { is_expected.not_to match(/href="\/gestionnaires\/sign_in">Accompagnateur/) }
it { is_expected.not_to match(/href="\/administrateurs\/sign_in">Administrateur/) } it { is_expected.not_to match(/href="\/administrateurs\/sign_in">Administrateur/) }
it { is_expected.not_to match(/Mes Dossiers/) } it { is_expected.not_to match(/Mes dossiers/) }
it { is_expected.to match(/Mes Procédures/) } it { is_expected.to match(/Mes procédures/) }
it { is_expected.to match(/Se déconnecter/) } it { is_expected.to match(/Se déconnecter/) }
end end
@ -50,8 +50,8 @@ describe 'layouts/_navbar.html.haml', type: :view do
it { is_expected.not_to match(/href="\/users\/sign_in">Utilisateur/) } it { is_expected.not_to match(/href="\/users\/sign_in">Utilisateur/) }
it { is_expected.not_to match(/href="\/gestionnaires\/sign_in">Accompagnateur/) } it { is_expected.not_to match(/href="\/gestionnaires\/sign_in">Accompagnateur/) }
it { is_expected.not_to match(/href="\/administrateurs\/sign_in">Administrateur/) } it { is_expected.not_to match(/href="\/administrateurs\/sign_in">Administrateur/) }
it { is_expected.not_to match(/Mes Procédures/) } it { is_expected.not_to match(/Mes procédures/) }
it { is_expected.to match(/Mes Dossiers/) } it { is_expected.to match(/Mes dossiers/) }
it { is_expected.to match(/Déconnexion/) } it { is_expected.to match(/Déconnexion/) }
end end