From d09a47ae234912f72c6038eb4b1df0b298cd7e7d Mon Sep 17 00:00:00 2001 From: Xavier J Date: Wed, 23 Nov 2016 15:21:42 +0100 Subject: [PATCH] First iteration navbar tableau de bord --- Gemfile | 5 +-- Gemfile.lock | 34 ++++++++++++++ Guardfile | 44 +++++++++---------- app/assets/stylesheets/application.scss | 4 ++ app/assets/stylesheets/navbar.scss | 9 ++++ .../dossiers/procedure_controller.rb | 2 + .../backoffice/dossiers/_onglets.html.haml | 5 --- .../backoffice/dossiers/search.html.haml | 8 +++- .../dossiers/_download_dossiers.html.haml | 4 +- ...ssiers_procedurecontroller_index.html.haml | 2 + ...office_dossierscontroller_search.html.haml | 2 + ...ionnaires_sessionscontroller_new.html.haml | 0 ...ssiers_procedurecontroller_index.html.haml | 1 + ...koffice_dossierscontroller_index.html.haml | 5 +++ ...office_dossierscontroller_search.html.haml | 1 + ...ionnaires_sessionscontroller_new.html.haml | 0 config/locales/dynamics/fr.yml | 2 +- 17 files changed, 94 insertions(+), 34 deletions(-) create mode 100644 app/views/layouts/left_panels/_left_panel_backoffice_dossiers_procedurecontroller_index.html.haml create mode 100644 app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_search.html.haml create mode 100644 app/views/layouts/left_panels/_left_panel_gestionnaires_sessionscontroller_new.html.haml create mode 100644 app/views/layouts/navbars/_navbar_backoffice_dossiers_procedurecontroller_index.html.haml create mode 100644 app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_search.html.haml create mode 100644 app/views/layouts/navbars/_navbar_gestionnaires_sessionscontroller_new.html.haml diff --git a/Gemfile b/Gemfile index e758985da..8a3cb8fdf 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,5 @@ source 'https://rubygems.org' - # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '5.0.0.1' @@ -104,9 +103,9 @@ group :test do gem 'simplecov', require: false gem 'poltergeist' gem 'timecop' - # gem 'guard' + gem 'guard' # gem 'guard-rspec', require: false - # gem 'guard-livereload', '~> 2.4', require: false + gem 'guard-livereload', '~> 2.4', require: false gem 'vcr' gem 'rails-controller-testing' end diff --git a/Gemfile.lock b/Gemfile.lock index 629edc5c7..1e658fc90 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -139,7 +139,11 @@ GEM activemodel-serializers-xml (~> 1.0) activesupport (~> 5.0) request_store (~> 1.0) + em-websocket (0.5.1) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0.6.0) erubis (2.7.0) + eventmachine (1.2.0.1) excon (0.54.0) execjs (2.7.0) factory_girl (4.7.0) @@ -279,6 +283,21 @@ GEM formatador (0.2.5) globalid (0.3.7) activesupport (>= 4.1.0) + guard (2.14.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.2) + em-websocket (~> 0.5) + guard (~> 2.8) + guard-compat (~> 1.0) + multi_json (~> 1.8) haml (4.0.7) tilt haml-rails (0.9.0) @@ -297,6 +316,7 @@ GEM htmlentities (4.3.4) http-cookie (1.0.3) domain_name (~> 0.5) + http_parser.rb (0.6.0) httpclient (2.8.2.4) i18n (0.7.0) inflecto (0.0.2) @@ -329,6 +349,9 @@ GEM railties (>= 3.1) leaflet-rails (0.7.7) libv8 (3.16.14.15) + listen (3.0.8) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) logstash-event (1.2.02) logstasher (1.0.1) activerecord (>= 4.0) @@ -337,6 +360,7 @@ GEM request_store loofah (2.0.3) nokogiri (>= 1.5.9) + lumberjack (1.0.10) mail (2.6.4) mime-types (>= 1.16, < 4) mailjet (1.4.10) @@ -353,10 +377,14 @@ GEM minitest (5.9.1) multi_json (1.12.1) multipart-post (2.0.0) + nenv (0.3.0) netrc (0.11.0) nio4r (1.2.1) nokogiri (1.6.8.1) mini_portile2 (~> 2.1.0) + notiffany (0.1.0) + nenv (~> 0.1) + shellany (~> 0.0) open4 (1.3.4) openid_connect (0.12.0) activemodel @@ -431,6 +459,9 @@ GEM rainbow (2.1.0) raindrops (0.17.0) rake (11.3.0) + rb-fsevent (0.9.7) + rb-inotify (0.9.7) + ffi (>= 0.5.0) rbvmomi (1.9.4) builder (~> 3.2) json (>= 1.8) @@ -505,6 +536,7 @@ GEM sentry-raven (2.1.2) faraday (>= 0.7.6, < 0.10.x) sexp_processor (4.7.0) + shellany (0.0.1) shoulda-matchers (3.1.1) activesupport (>= 4.0.0) simplecov (0.12.0) @@ -618,6 +650,8 @@ DEPENDENCIES fog fog-openstack font-awesome-rails + guard + guard-livereload (~> 2.4) haml-rails hashie jbuilder (~> 2.0) diff --git a/Guardfile b/Guardfile index 55e984025..a937e06b8 100644 --- a/Guardfile +++ b/Guardfile @@ -43,7 +43,7 @@ guard 'livereload' do rails_view_exts = %w(erb haml slim) # file types LiveReload may optimize refresh for - compiled_exts = extensions.values.distinct + compiled_exts = extensions.values watch(%r{public/.+\.(#{compiled_exts * '|'})}) extensions.each do |ext, type| @@ -64,24 +64,24 @@ guard 'livereload' do watch(%r{config/locales/.+\.yml}) end -guard :rspec, cmd: 'bin/rspec' do - watch(%r{^spec/.+_spec\.rb$}) - watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } - watch('spec/spec_helper.rb') { "spec" } - - # Rails example - watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } - watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" } - watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] } - watch(%r{^spec/support/(.+)\.rb$}) { "spec" } - watch('config/routes.rb') { "spec/routing" } - watch('app/controllers/application_controller.rb') { "spec/controllers" } - watch('spec/rails_helper.rb') { "spec" } - - # Capybara features specs - watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" } - - # Turnip features and steps - watch(%r{^spec/acceptance/(.+)\.feature$}) - watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' } -end +# guard :rspec, cmd: 'bin/rspec' do +# watch(%r{^spec/.+_spec\.rb$}) +# watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } +# watch('spec/spec_helper.rb') { "spec" } +# +# # Rails example +# watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } +# watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" } +# watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] } +# watch(%r{^spec/support/(.+)\.rb$}) { "spec" } +# watch('config/routes.rb') { "spec/routing" } +# watch('app/controllers/application_controller.rb') { "spec/controllers" } +# watch('spec/rails_helper.rb') { "spec" } +# +# # Capybara features specs +# watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" } +# +# # Turnip features and steps +# watch(%r{^spec/acceptance/(.+)\.feature$}) +# watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' } +# end diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 97455d0a8..bcc04ced3 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -35,6 +35,10 @@ body { padding-top: 50px; } +form { + margin-bottom: 0.3em; +} + .wysihtml5-sandbox { resize: vertical; } diff --git a/app/assets/stylesheets/navbar.scss b/app/assets/stylesheets/navbar.scss index adf1c03e7..9b65cdd8c 100644 --- a/app/assets/stylesheets/navbar.scss +++ b/app/assets/stylesheets/navbar.scss @@ -124,3 +124,12 @@ font-weight: 700; z-index: 10; } + +.button_navbar{ + color: #666666; + cursor: pointer; +} +.button_navbar:hover{ + text-decoration: none; +} + diff --git a/app/controllers/backoffice/dossiers/procedure_controller.rb b/app/controllers/backoffice/dossiers/procedure_controller.rb index 74b092f43..7fba5046f 100644 --- a/app/controllers/backoffice/dossiers/procedure_controller.rb +++ b/app/controllers/backoffice/dossiers/procedure_controller.rb @@ -5,6 +5,8 @@ class Backoffice::Dossiers::ProcedureController < Backoffice::DossiersListContro dossiers_list_facade.service.filter_procedure! params[:id] + @facade_data_view = dossiers_list_facade + render 'backoffice/dossiers/index' rescue ActiveRecord::RecordNotFound flash[:alert] = "Cette procédure n'existe pas ou vous n'y avez pas accès." diff --git a/app/views/backoffice/dossiers/_onglets.html.haml b/app/views/backoffice/dossiers/_onglets.html.haml index b35281247..1eedb536e 100644 --- a/app/views/backoffice/dossiers/_onglets.html.haml +++ b/app/views/backoffice/dossiers/_onglets.html.haml @@ -63,9 +63,4 @@ %button.btn.btn-default{ id:'search_button' } %i.fa.fa-search - - if @dossiers_search.nil? - %li#pref_list - %a.btn#pref_list_dossier_open_action{href: '#'} - %i.fa.fa-columns - %br diff --git a/app/views/backoffice/dossiers/search.html.haml b/app/views/backoffice/dossiers/search.html.haml index a7e9fac0b..483f5b136 100644 --- a/app/views/backoffice/dossiers/search.html.haml +++ b/app/views/backoffice/dossiers/search.html.haml @@ -1,4 +1,10 @@ #backoffice_search - = render partial: 'onglets' + #pref_list_menu + = render partial: 'backoffice/dossiers/pref_list' + + %h1 + =t('dynamics.backoffice.title') + + = render partial: 'backoffice/dossiers/onglets' = smart_listing_render :dossiers \ No newline at end of file diff --git a/app/views/dossiers/_download_dossiers.html.haml b/app/views/dossiers/_download_dossiers.html.haml index 42078deb9..781a641ba 100644 --- a/app/views/dossiers/_download_dossiers.html.haml +++ b/app/views/dossiers/_download_dossiers.html.haml @@ -4,10 +4,10 @@ %span{'data-toggle' => :tooltip, "data-placement" => :left, title: 'Pour réduire le nombre de dossiers et ne pas dépasser la limite autorisée de 400, merci de bien vouloir appliquer des filtres.'} = t('dynamics.backoffice.limit_excess_download_all_dossiers') - else - %button.btn.btn-success.dropdown-toggle#dropdownDownloadMenu{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false } + %a.dropdown-toggle#dropdownDownloadMenu.button_navbar{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false } %i.fa.fa-download = t('dynamics.backoffice.download_all_dossiers') - %span.caret + -#%span.caret %ul.dropdown-menu.dropdown-menu-right %li = link_to backoffice_download_dossiers_tps_path(format: :csv, procedure_id: params[:id]), { class: 'btn btn-sm' } do diff --git a/app/views/layouts/left_panels/_left_panel_backoffice_dossiers_procedurecontroller_index.html.haml b/app/views/layouts/left_panels/_left_panel_backoffice_dossiers_procedurecontroller_index.html.haml new file mode 100644 index 000000000..139597f9c --- /dev/null +++ b/app/views/layouts/left_panels/_left_panel_backoffice_dossiers_procedurecontroller_index.html.haml @@ -0,0 +1,2 @@ + + diff --git a/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_search.html.haml b/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_search.html.haml new file mode 100644 index 000000000..139597f9c --- /dev/null +++ b/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_search.html.haml @@ -0,0 +1,2 @@ + + diff --git a/app/views/layouts/left_panels/_left_panel_gestionnaires_sessionscontroller_new.html.haml b/app/views/layouts/left_panels/_left_panel_gestionnaires_sessionscontroller_new.html.haml new file mode 100644 index 000000000..e69de29bb 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 new file mode 100644 index 000000000..4ac20c271 --- /dev/null +++ b/app/views/layouts/navbars/_navbar_backoffice_dossiers_procedurecontroller_index.html.haml @@ -0,0 +1 @@ += render partial: 'layouts/navbars/navbar_backoffice_dossierscontroller_index' \ No newline at end of file diff --git a/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_index.html.haml b/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_index.html.haml index 04707d70b..0cd09c2a7 100644 --- a/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_index.html.haml +++ b/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_index.html.haml @@ -1,6 +1,11 @@ %div.col-lg-7.col-md-7.main-info Start UP region ile de france (8 dossiers en cours) %div.col-lg-3.col-md-3.options + %div.row + %div.col-lg-12.col-md-12 + %a.button_navbar#pref_list_dossier_open_action{href: '#', type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false } + %i.fa.fa-pencil + Modifier le tableau %div.row %div.col-lg-12.col-md-12 = render partial: "dossiers/download_dossiers" diff --git a/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_search.html.haml b/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_search.html.haml new file mode 100644 index 000000000..4ac20c271 --- /dev/null +++ b/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_search.html.haml @@ -0,0 +1 @@ += render partial: 'layouts/navbars/navbar_backoffice_dossierscontroller_index' \ No newline at end of file diff --git a/app/views/layouts/navbars/_navbar_gestionnaires_sessionscontroller_new.html.haml b/app/views/layouts/navbars/_navbar_gestionnaires_sessionscontroller_new.html.haml new file mode 100644 index 000000000..e69de29bb diff --git a/config/locales/dynamics/fr.yml b/config/locales/dynamics/fr.yml index c85b36fab..3c614368f 100644 --- a/config/locales/dynamics/fr.yml +++ b/config/locales/dynamics/fr.yml @@ -13,7 +13,7 @@ fr: 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: 'Télécharger mes dossiers' - limit_excess_download_all_dossiers: 'Limite de dossiers fixée à 200 pour le téléchargement' + limit_excess_download_all_dossiers: 'Limite de dossiers fixée à 400 pour le téléchargement' format_csv: 'Au format CSV' format_xlsx: 'Au format XLSX' format_ods: 'Au format ODS'