diff --git a/app/assets/stylesheets/default_data_block.scss b/app/assets/stylesheets/default_data_block.scss index adc1ad053..9de8963fe 100644 --- a/app/assets/stylesheets/default_data_block.scss +++ b/app/assets/stylesheets/default_data_block.scss @@ -2,8 +2,6 @@ font-family: Arial; .show-block { - width: 840px; - min-width: 840px; margin-left: auto; margin-right: auto; box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.5); diff --git a/app/assets/stylesheets/navbar.scss b/app/assets/stylesheets/navbar.scss index ff11f412f..bad10bfdb 100644 --- a/app/assets/stylesheets/navbar.scss +++ b/app/assets/stylesheets/navbar.scss @@ -34,7 +34,7 @@ } } #navbar-body { - height: 60px; + min-height: 60px; background-color: #FFFFFF; box-shadow: 0 1px 2px 0 rgba(50,50,50,0.5); padding-left: 50px; @@ -43,7 +43,7 @@ font-size: 18px; font-weight: bold; line-height: 58px; - height: 58px; + min-height: 58px; color: #000000; overflow: hidden; text-overflow: ellipsis; @@ -56,7 +56,7 @@ color: #666666; padding: 8px; border-right: 1px solid #C8C6C8; - height: 60px; + min-height: 60px; .dropdown-toggle { cursor: pointer; } diff --git a/app/controllers/backoffice/dossiers_controller.rb b/app/controllers/backoffice/dossiers_controller.rb index 88b4fd83e..267b5cfee 100644 --- a/app/controllers/backoffice/dossiers_controller.rb +++ b/app/controllers/backoffice/dossiers_controller.rb @@ -159,6 +159,15 @@ class Backoffice::DossiersController < Backoffice::DossiersListController redirect_to backoffice_dossiers_path end + def reopen + create_dossier_facade params[:dossier_id] + + @facade.dossier.initiated! + flash.notice = 'Dossier réouvert.' + + redirect_to backoffice_dossiers_path + end + private def create_dossier_facade dossier_id diff --git a/app/decorators/mail_template_decorator.rb b/app/decorators/mail_template_decorator.rb index d75b576c7..b9c153553 100644 --- a/app/decorators/mail_template_decorator.rb +++ b/app/decorators/mail_template_decorator.rb @@ -5,6 +5,7 @@ class MailTemplateDecorator < Draper::Decorator case object.type when "MailReceived" "E-mail d'accusé de réception" + else object.type end end diff --git a/app/views/backoffice/dossiers/show.html.haml b/app/views/backoffice/dossiers/show.html.haml index 1e8fd6961..be9e5d17d 100644 --- a/app/views/backoffice/dossiers/show.html.haml +++ b/app/views/backoffice/dossiers/show.html.haml @@ -1,2 +1,2 @@ -%div.col-lg-12.col-md-12.col-sm-12.col-xs-12#backoffice_dossier_show +#backoffice_dossier_show.col-xs-12 = render partial: "dossiers/dossier_show" diff --git a/app/views/layouts/_main_container.html.haml b/app/views/layouts/_main_container.html.haml index 362a66024..9e04a4a32 100644 --- a/app/views/layouts/_main_container.html.haml +++ b/app/views/layouts/_main_container.html.haml @@ -1,4 +1,4 @@ -%div#main-container{class: "col-lg-#{main_container_size} col-md-#{main_container_size}"} +%div#main-container{class: "col-xs-#{main_container_size}"} %div.row = render partial: 'layouts/flash_messages' %div.row 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 13a482ccc..43dbfac81 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 @@ -17,6 +17,7 @@ = 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 + = link_to 'Reouvrir', backoffice_dossier_reopen_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' diff --git a/app/views/layouts/navbars/_navbar_admin_procedurescontroller_index.html.haml b/app/views/layouts/navbars/_navbar_admin_procedurescontroller_index.html.haml index b4d06fa30..8adfbc93d 100644 --- a/app/views/layouts/navbars/_navbar_admin_procedurescontroller_index.html.haml +++ b/app/views/layouts/navbars/_navbar_admin_procedurescontroller_index.html.haml @@ -1,6 +1,6 @@ -%div.col-lg-8.col-md-8.col-sm-8.col-xs-8.main-info +.col-xs-7.main-info -%div.col-lg-3.col-md-3.col-sm-3.col-xs-3.options +.col-xs-3.options %div{ style: "decorate:none; display: flex;box-shadow:none; float:right; display: flex; margin-top: 5px" } %div{ style: "vertical-align: middle; margin-right: 10px; margin-top: auto; margin-bottom: auto;" } = current_administrateur.email diff --git a/app/views/layouts/navbars/_navbar_backoffice_dossiers_procedurecontroller_index.html.haml b/app/views/layouts/navbars/_navbar_backoffice_dossiers_procedurecontroller_index.html.haml index 453341a12..79fba1681 100644 --- a/app/views/layouts/navbars/_navbar_backoffice_dossiers_procedurecontroller_index.html.haml +++ b/app/views/layouts/navbars/_navbar_backoffice_dossiers_procedurecontroller_index.html.haml @@ -1,4 +1,4 @@ -%div.col-lg-8.col-md-8.col-sm-8.col-xs-8.main-info +.col-xs-7.main-info = @facade_data_view.procedure_id.nil? ? "Tous les dossiers" : @facade_data_view.procedure.libelle %div.col-lg-3.col-md-3.col-sm-3.col-xs-3.options %div.row diff --git a/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_show.html.haml b/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_show.html.haml index 9e0a297d8..bcf5694b2 100644 --- a/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_show.html.haml +++ b/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_show.html.haml @@ -1,9 +1,9 @@ -%div.col-lg-8.col-md-8.col-sm-8.col-xs-8.main-info +.col-xs-7.main-info %span{ 'data-toggle' => :tooltip, "data-placement" => :bottom, title: @facade.dossier.procedure.libelle } = @facade.dossier.procedure.libelle -%div.col-lg-3.col-md-3.col-sm-3.col-xs-3.options - %div.row - %div.col-lg-12.col-md-12.col-sm-12.col-xs-12 +.col-xs-3.options + .row + .col-xs-12 - if current_gestionnaire.follow?(@facade.dossier.id) = link_to backoffice_dossier_follow_path(dossier_id: @facade.dossier.id), "data-method" => :put, class: "button-navbar-action",id: "suivre_dossier_#{@facade.dossier.id}" do %i.fa.fa-user-times @@ -12,14 +12,14 @@ = link_to backoffice_dossier_follow_path(dossier_id: @facade.dossier.id), 'data-method' => :put, class: 'button-navbar-action', id: "suivre_dossier_#{@facade.dossier.id}" do %i.fa.fa-user-plus Suivre le dossier - %div.row - %div.col-lg-12.col-md-12.col-sm-12.col-xs-12 - %div#invitations.dropdown-toggle{ 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false } + .row + .col-xs-12 + #invitations.dropdown-toggle{ 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false } %i.fa.fa-user = t('utils.involved') .badge.progress-bar-info = @facade.dossier.invites.count - %div.dropdown-menu.dropdown-menu-right.dropdown-pannel + .dropdown-menu.dropdown-menu-right.dropdown-pannel %h4= t('dynamics.dossiers.followers.title') %ul - unless @facade.followers.empty? diff --git a/app/views/layouts/navbars/_navbar_log_options.html.haml b/app/views/layouts/navbars/_navbar_log_options.html.haml index 99709e842..a5d8ca7e1 100644 --- a/app/views/layouts/navbars/_navbar_log_options.html.haml +++ b/app/views/layouts/navbars/_navbar_log_options.html.haml @@ -1,17 +1,15 @@ --#%span.fa.fa-sign-out - -if user_signed_in? - .col-lg-1.col-md-1.col-sm-1.col-xs-1#sign_out.no-padding + #sign_out.col-xs-2.no-padding = render partial: 'users/login_banner' = render partial: 'layouts/credentials' -elsif gestionnaire_signed_in? - .col-lg-1.col-md-1.col-sm-1.col-xs-1#sign_out.no-padding + #sign_out.col-xs-2.no-padding = render partial: 'gestionnaires/login_banner' = render partial: 'layouts/credentials' -elsif administrateur_signed_in? - .col-lg-1.col-md-1.col-sm-1.col-xs-1#sign_out.no-padding + #sign_out.col-xs-2.no-padding = render partial: 'administrateurs/login_banner' = render partial: 'layouts/credentials' -else - .col-lg-1.col-md-1.col-sm-1.col-xs-1#sign_in + #sign_in.col-xs-2 = link_to "Connexion", new_user_session_path, :class => 'btn btn-lg btn-primary' \ No newline at end of file diff --git a/app/views/layouts/navbars/_navbar_users_recapitulatifcontroller_show.html.haml b/app/views/layouts/navbars/_navbar_users_recapitulatifcontroller_show.html.haml index b82f836ad..7a5f4299b 100644 --- a/app/views/layouts/navbars/_navbar_users_recapitulatifcontroller_show.html.haml +++ b/app/views/layouts/navbars/_navbar_users_recapitulatifcontroller_show.html.haml @@ -1,4 +1,4 @@ -%div.col-lg-8.col-md-8.col-sm-8.col-xs-8.main-info +.col-xs-7.main-info %span{ 'data-toggle' => :tooltip, "data-placement" => :bottom, title: @facade.dossier.procedure.libelle } = @facade.dossier.procedure.libelle.truncate(60) %div.col-lg-3.col-md-3.col-sm-3.col-xs-3.options diff --git a/config/routes.rb b/config/routes.rb index dfffb56eb..1c3f99b72 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -163,6 +163,7 @@ Rails.application.routes.draw do post 'without_continuation' => 'dossiers#without_continuation' post 'close' => 'dossiers#close' post 'archive' => 'dossiers#archive' + post 'reopen' => 'dossiers#reopen' put 'follow' => 'dossiers#follow' resources :commentaires, only: [:index] diff --git a/spec/controllers/backoffice/dossiers_controller_spec.rb b/spec/controllers/backoffice/dossiers_controller_spec.rb index a73cfddff..3d0043ea6 100644 --- a/spec/controllers/backoffice/dossiers_controller_spec.rb +++ b/spec/controllers/backoffice/dossiers_controller_spec.rb @@ -357,6 +357,23 @@ describe Backoffice::DossiersController, type: :controller do end end + describe 'POST #reopen' do + before do + dossier.received! + sign_in gestionnaire + end + + subject { post :reopen, params: {dossier_id: dossier_id} } + + it 'change state to initiated' do + subject + + dossier.reload + expect(dossier.state).to eq('initiated') + end + + it { is_expected.to redirect_to backoffice_dossiers_path } + end describe 'POST #archive' do before do