From adaa1e0dec3afe489f202bba4e1d0bfcbd4b85ff Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Fri, 10 Nov 2017 17:20:59 +0100 Subject: [PATCH] [Fix #939] Remove demo page in staging --- app/controllers/demo_controller.rb | 13 ------------ app/views/demo/_list.html.haml | 27 ------------------------ app/views/demo/index.html.haml | 1 - app/views/demo/index.js.erb | 1 - config/routes.rb | 1 - spec/controllers/demo_controller_spec.rb | 17 --------------- 6 files changed, 60 deletions(-) delete mode 100644 app/controllers/demo_controller.rb delete mode 100644 app/views/demo/_list.html.haml delete mode 100644 app/views/demo/index.html.haml delete mode 100644 app/views/demo/index.js.erb delete mode 100644 spec/controllers/demo_controller_spec.rb diff --git a/app/controllers/demo_controller.rb b/app/controllers/demo_controller.rb deleted file mode 100644 index 6bc8b5b35..000000000 --- a/app/controllers/demo_controller.rb +++ /dev/null @@ -1,13 +0,0 @@ -class DemoController < ApplicationController - include SmartListing::Helper::ControllerExtensions - helper SmartListing::Helper - - def index - return redirect_to root_path if Rails.env.production? - - smart_listing_create :procedures, - Procedure.publiees.order("id DESC"), - partial: "demo/list", - array: true - end -end diff --git a/app/views/demo/_list.html.haml b/app/views/demo/_list.html.haml deleted file mode 100644 index b439c7884..000000000 --- a/app/views/demo/_list.html.haml +++ /dev/null @@ -1,27 +0,0 @@ -- unless smart_listing.empty? - %table.table - %tr - %th{ colspan: 4 } - %h4 Lien vers les procédures TPS - %tr - %th= smart_listing.sortable 'ID', 'id' - %th= smart_listing.sortable 'Titre', 'libelle' - %th Description - %th= smart_listing.sortable 'Organisme', 'organisation' - - - smart_listing.collection.each do |procedure| - - procedure = procedure.decorate - %tr - %td - = procedure.id - %td.col-xs-4 - = link_to procedure.libelle, procedure.lien - %td - = procedure.description - %td.col-xs-3 - = procedure.organisation - - = smart_listing.paginate - = smart_listing.pagination_per_page_links -- else - %p Aucune procédure trouvée diff --git a/app/views/demo/index.html.haml b/app/views/demo/index.html.haml deleted file mode 100644 index c29e1ff71..000000000 --- a/app/views/demo/index.html.haml +++ /dev/null @@ -1 +0,0 @@ -= smart_listing_render :procedures diff --git a/app/views/demo/index.js.erb b/app/views/demo/index.js.erb deleted file mode 100644 index 5a5864f10..000000000 --- a/app/views/demo/index.js.erb +++ /dev/null @@ -1 +0,0 @@ -<%= smart_listing_update :procedures %> \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index fcbf4ffa0..4cdfe871a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -39,7 +39,6 @@ Rails.application.routes.draw do root 'root#index' get 'cgu' => 'cgu#index' - get 'demo' => 'demo#index' get 'users' => 'users#index' get 'admin' => 'admin#index' get 'backoffice' => 'backoffice#index' diff --git a/spec/controllers/demo_controller_spec.rb b/spec/controllers/demo_controller_spec.rb deleted file mode 100644 index 5e9ef92e9..000000000 --- a/spec/controllers/demo_controller_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -require 'spec_helper' - -describe DemoController, type: :controller do - describe 'GET #index' do - subject { get :index } - - it { expect(subject.status).to eq 200 } - - context 'when rails environnement is production' do - before do - allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new("production")) - end - - it { expect(subject.status).to eq 302 } - end - end -end