diff --git a/app/services/render_partial_service.rb b/app/services/render_partial_service.rb deleted file mode 100644 index 9bfb61445..000000000 --- a/app/services/render_partial_service.rb +++ /dev/null @@ -1,36 +0,0 @@ -class RenderPartialService - attr_accessor :controller, :method - - def initialize(controller, method) - @controller = controller - @method = method - end - - def navbar - retrieve_navbar - end - - def left_panel - retrieve_left_panel - end - - def self.left_panel_exist?(left_panel_url) - file = left_panel_url.split('/').last - - File.exist?(Rails.root.join('app', 'views', 'layouts', 'left_panels', "_#{file}.html.haml")) - end - - private - - def retrieve_navbar - "layouts/navbars/navbar_#{retrieve_name}" - end - - def retrieve_left_panel - "layouts/left_panels/left_panel_#{retrieve_name}" - end - - def retrieve_name - "#{controller.to_s.parameterize.underscore}_#{method}" - end -end diff --git a/app/views/layouts/left_panels/_left_panel_admin_assignscontroller_show.html.haml b/app/views/layouts/left_panels/_left_panel_admin_assignscontroller_show.html.haml deleted file mode 100644 index 67d77cdcc..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_assignscontroller_show.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: { active: 'Instructeurs' } diff --git a/app/views/layouts/left_panels/_left_panel_admin_attestationtemplatescontroller_edit.html.haml b/app/views/layouts/left_panels/_left_panel_admin_attestationtemplatescontroller_edit.html.haml deleted file mode 100644 index 832761229..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_attestationtemplatescontroller_edit.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: { active: 'Attestation' } diff --git a/app/views/layouts/left_panels/_left_panel_admin_mailtemplatescontroller_edit.html.haml b/app/views/layouts/left_panels/_left_panel_admin_mailtemplatescontroller_edit.html.haml deleted file mode 100644 index 6d4ad3d89..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_mailtemplatescontroller_edit.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: { active: 'E-mails' } diff --git a/app/views/layouts/left_panels/_left_panel_admin_mailtemplatescontroller_index.html.haml b/app/views/layouts/left_panels/_left_panel_admin_mailtemplatescontroller_index.html.haml deleted file mode 100644 index 6d4ad3d89..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_mailtemplatescontroller_index.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: { active: 'E-mails' } diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_archived.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_archived.html.haml deleted file mode 100644 index fb215e59f..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_archived.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_index' diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_draft.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_draft.html.haml deleted file mode 100644 index fb215e59f..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_draft.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_index' diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_edit.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_edit.html.haml deleted file mode 100644 index 43587373d..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_edit.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: { active: 'Description' } diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_index.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_index.html.haml deleted file mode 100644 index e1a5393bd..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_index.html.haml +++ /dev/null @@ -1,34 +0,0 @@ -#first-block - .en-cours - %b - = dossier_count = current_administrateur.procedures.count - = "Démarche".pluralize(dossier_count) - -#action-block - -#menu-block - .split-hr-left - #procedure-list - %a#draft-procedures{ :href => "#{url_for :admin_procedures_draft}" } - .procedure-list-element{ class: @draft_class } - En test - .badge.progress-bar-default - = current_administrateur.procedures.brouillons.count - - %a#active-procedures{ :href => "#{url_for :admin_procedures}" } - .procedure-list-element{ class: @active_class } - Publiées - .badge.progress-bar-success - = current_administrateur.procedures.publiees.count - - %a#archived-procedures{ :href => "#{url_for :admin_procedures_archived}" } - .procedure-list-element{ class: @archived_class } - Closes - .badge.progress-bar-purple - = current_administrateur.procedures.closes.count - - .split-hr-left - = render partial: 'layouts/switch_devise_profile_module' - - -#infos-block diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_monavis.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_monavis.html.haml deleted file mode 100644 index fad3db3bb..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_monavis.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: { active: 'MonAvis' } diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_navbar.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_navbar.html.haml deleted file mode 100644 index 0d6d0eb8c..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_navbar.html.haml +++ /dev/null @@ -1,82 +0,0 @@ -#first-block - .en-cours - = image_tag @procedure.logo_url, style: 'width: 30px;' - %b - = @procedure.libelle - -#action-block - -#menu-block - .split-hr-left - #procedure-list - %a#onglet-infos{ href: url_for(admin_procedure_path(@procedure)) } - .procedure-list-element{ class: ('active' if active == 'Informations') } - - if @procedure.brouillon? - Test et publication - - else - Publication - - %a#onglet-description{ href: url_for(edit_admin_procedure_path(@procedure)) } - .procedure-list-element{ class: ('active' if active == 'Description') } - Description - - %a#onglet-services{ href: (@procedure.service.present? || current_administrateur.services.present?) ? url_for(admin_services_path(procedure_id: @procedure.id)) : url_for(new_admin_service_path(procedure_id: @procedure.id)) } - .procedure-list-element - Service - - if @procedure.missing_steps.include?(:service) - %p.missing-steps (à compléter) - - %a#onglet-administrateurs{ href: url_for(admin_procedure_administrateurs_path(@procedure)) } - .procedure-list-element - Administrateurs - - - if !feature_enabled?(:administrateur_routage) - %a#onglet-instructeurs{ href: url_for(admin_procedure_groupe_instructeur_path(@procedure, @procedure.defaut_groupe_instructeur)) } - .procedure-list-element{ class: ('active' if active == 'Instructeurs') } - Instructeurs - - if @procedure.missing_steps.include?(:instructeurs) - %p.missing-steps (à compléter) - - - if feature_enabled?(:administrateur_routage) - %a#onglet-instructeurs{ href: url_for(admin_procedure_groupe_instructeurs_path(@procedure)) } - .procedure-list-element - Groupe d'instructeurs - - - if !@procedure.locked? - %a#onglet-champs{ href: champs_admin_procedure_path(@procedure) } - .procedure-list-element{ class: ('active' if active == 'Champs') } - Champs - - - if !@procedure.locked? - %a#onglet-private-champs{ href: annotations_admin_procedure_path(@procedure) } - .procedure-list-element{ class: ('active' if active == 'Annotations privées') } - Annotations privées - - %a#onglet-preview{ href: url_for(apercu_admin_procedure_path(@procedure)), target: "_blank", rel: "noopener" } - .procedure-list-element{ class: ('active' if active == 'Prévisualisation') } - Prévisualisation - - %a#onglet-inemailsfos{ href: url_for(admin_procedure_mail_templates_path(@procedure)) } - .procedure-list-element{ class: ('active' if active == 'E-mails') } - E-mails - - %a#onglet-attestation{ href: url_for(edit_admin_procedure_attestation_template_path(@procedure)) } - .procedure-list-element{ class: ('active' if active == 'Attestation') } - Attestation - - %a#onglet-description{ href: url_for(monavis_admin_procedure_path(@procedure)) } - .procedure-list-element{ class: ('active' if active == 'MonAvis') } - MonAvis - - %a#onglet-description{ href: url_for(jeton_admin_procedure_path(@procedure)) } - .procedure-list-element - Jeton - - %a#onglet-description{ href: url_for(admin_procedures_path()) } - .procedure-list-element - Sortir - - .split-hr-left - - -#infos-block diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_show.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_show.html.haml deleted file mode 100644 index ffc8baf08..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_show.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: { active: 'Informations' } diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_update.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_update.html.haml deleted file mode 100644 index 43587373d..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_update.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: { active: 'Description' } diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_update_monavis.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_update_monavis.html.haml deleted file mode 100644 index fad3db3bb..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_update_monavis.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: { active: 'MonAvis' } diff --git a/app/views/layouts/left_panels/_left_panel_default.html.haml b/app/views/layouts/left_panels/_left_panel_default.html.haml deleted file mode 100644 index d6c626d3a..000000000 --- a/app/views/layouts/left_panels/_left_panel_default.html.haml +++ /dev/null @@ -1,2 +0,0 @@ -%div - Default Left Panel diff --git a/spec/services/render_partial_service_spec.rb b/spec/services/render_partial_service_spec.rb deleted file mode 100644 index cc0df90b9..000000000 --- a/spec/services/render_partial_service_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -describe RenderPartialService do - let(:service) { RenderPartialService.new(controller, method) } - let(:controller) { ApplicationController } - let(:method) { :index } - - describe 'navbar' do - subject { service.navbar } - - it { is_expected.to eq "layouts/navbars/navbar_#{controller.to_s.parameterize}_#{method}" } - end - - describe 'left_panel' do - subject { service.left_panel } - - it { is_expected.to eq "layouts/left_panels/left_panel_#{controller.to_s.parameterize}_#{method}" } - end -end