diff --git a/.circleci/config.yml b/.circleci/config.yml index 6d340f0ef..90725ad32 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -56,6 +56,9 @@ jobs: - run: name: Run haml-lint command: bundle exec haml-lint app/views/ + - run: + name: Run scss-lint + command: bundle exec scss-lint app/assets/stylesheets/ - add_ssh_keys: fingerprints: - "0a:67:42:7d:7e:b7:e1:3c:48:8f:bf:68:10:51:a8:44" diff --git a/.scss-lint.yml b/.scss-lint.yml new file mode 100644 index 000000000..918c14c70 --- /dev/null +++ b/.scss-lint.yml @@ -0,0 +1,256 @@ +linters: + BangFormat: + enabled: true + space_before_bang: true + space_after_bang: false + + BemDepth: + enabled: false + max_elements: 1 + + BorderZero: + enabled: true + convention: none + + # To enable later + ChainedClasses: + enabled: false + + ColorKeyword: + enabled: true + + # To enable later + ColorVariable: + enabled: false + + Comment: + enabled: true + style: silent + + DebugStatement: + enabled: true + + DeclarationOrder: + enabled: true + + DisableLinterReason: + enabled: false + + DuplicateProperty: + enabled: true + + ElsePlacement: + enabled: true + style: same_line + + EmptyLineBetweenBlocks: + enabled: true + ignore_single_line_blocks: false + + EmptyRule: + enabled: true + + ExtendDirective: + enabled: false + + FinalNewline: + enabled: true + present: true + + HexLength: + enabled: true + style: long + + HexNotation: + enabled: true + style: uppercase + + HexValidation: + enabled: true + + # To enable later + IdSelector: + enabled: false + + # To enable later + ImportantRule: + enabled: false + + ImportPath: + enabled: false + leading_underscore: false + filename_extension: false + + Indentation: + enabled: true + allow_non_nested_indentation: false + character: space + width: 2 + + LeadingZero: + enabled: true + style: include_zero + + MergeableSelector: + enabled: false + force_nesting: true + + NameFormat: + enabled: true + allow_leading_underscore: false + convention: hyphenated_lowercase + + # To enable later + NestingDepth: + enabled: false + max_depth: 3 + ignore_parent_selectors: false + + # To enable later + PlaceholderInExtend: + enabled: false + + PrivateNamingConvention: + enabled: false + prefix: _ + + PropertyCount: + enabled: false + include_nested: false + max_properties: 10 + + PropertySortOrder: + enabled: false + ignore_unspecified: false + min_properties: 2 + separate_groups: false + + PropertySpelling: + enabled: true + extra_properties: [] + disabled_properties: [] + + # To enable later + PropertyUnits: + enabled: false + global: [ + 'ch', 'em', 'ex', 'rem', # Font-relative lengths + 'cm', 'in', 'mm', 'pc', 'pt', 'px', 'q', # Absolute lengths + 'vh', 'vw', 'vmin', 'vmax', # Viewport-percentage lengths + 'deg', 'grad', 'rad', 'turn', # Angle + 'ms', 's', # Duration + 'Hz', 'kHz', # Frequency + 'dpi', 'dpcm', 'dppx', # Resolution + '%'] # Other + properties: {} + + PseudoElement: + enabled: true + + # To enable later + QualifyingElement: + enabled: false + allow_element_with_attribute: false + allow_element_with_class: false + allow_element_with_id: false + + # To enable later + SelectorDepth: + enabled: false + max_depth: 3 + + SelectorFormat: + enabled: true + convention: hyphenated_lowercase + + Shorthand: + enabled: false + allowed_shorthands: [1, 2, 3, 4] + + SingleLinePerProperty: + enabled: true + allow_single_line_rule_sets: false + + SingleLinePerSelector: + enabled: true + + SpaceAfterComma: + enabled: true + style: one_space + + SpaceAfterComment: + enabled: true + style: one_space + allow_empty_comments: true + + SpaceAfterPropertyColon: + enabled: true + style: one_space + + SpaceAfterPropertyName: + enabled: true + + SpaceAfterVariableColon: + enabled: true + style: one_space + + SpaceAfterVariableName: + enabled: true + + SpaceAroundOperator: + enabled: true + style: one_space + + SpaceBeforeBrace: + enabled: true + style: space + allow_single_line_padding: false + + SpaceBetweenParens: + enabled: true + spaces: 0 + + StringQuotes: + enabled: true + style: double_quotes + + TrailingSemicolon: + enabled: true + + TrailingWhitespace: + enabled: true + + TrailingZero: + enabled: true + + # To enable later + TransitionAll: + enabled: false + + UnnecessaryMantissa: + enabled: true + + UnnecessaryParentReference: + enabled: true + + UrlFormat: + enabled: true + + UrlQuotes: + enabled: true + + VariableForProperty: + enabled: false + properties: [] + + VendorPrefix: + enabled: true + identifier_list: base + additional_identifiers: [] + excluded_identifiers: [] + + ZeroUnit: + enabled: false + + Compass::*: + enabled: false diff --git a/Gemfile b/Gemfile index 24f75ba73..945efbb3a 100644 --- a/Gemfile +++ b/Gemfile @@ -124,6 +124,7 @@ group :development do gem 'rack-handlers' gem 'xray-rails' gem 'haml-lint' + gem 'scss_lint', require: false end group :development, :test do diff --git a/Gemfile.lock b/Gemfile.lock index b6a8ceacf..d2da50210 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -550,6 +550,9 @@ GEM scenic (1.3.0) activerecord (>= 4.0.0) railties (>= 4.0.0) + scss_lint (0.53.0) + rake (>= 0.9, < 13) + sass (~> 3.4.20) sdoc (0.4.2) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) @@ -715,6 +718,7 @@ DEPENDENCIES rspec-rails (~> 3.0) sass-rails (~> 5.0) scenic + scss_lint sdoc (~> 0.4.0) select2-rails sentry-raven diff --git a/app/assets/fonts/Muli-Bold.woff b/app/assets/fonts/Muli-Bold.woff new file mode 100644 index 000000000..fc7a6fa82 Binary files /dev/null and b/app/assets/fonts/Muli-Bold.woff differ diff --git a/app/assets/fonts/Muli-Regular.woff b/app/assets/fonts/Muli-Regular.woff new file mode 100644 index 000000000..f61ecf832 Binary files /dev/null and b/app/assets/fonts/Muli-Regular.woff differ diff --git a/app/assets/images/etapes/complet_2.png b/app/assets/images/etapes/complet_2.png deleted file mode 100644 index 148292409..000000000 Binary files a/app/assets/images/etapes/complet_2.png and /dev/null differ diff --git a/app/assets/images/etapes/create_1.png b/app/assets/images/etapes/create_1.png deleted file mode 100644 index cbc61e88e..000000000 Binary files a/app/assets/images/etapes/create_1.png and /dev/null differ diff --git a/app/assets/images/etapes/message_3.png b/app/assets/images/etapes/message_3.png deleted file mode 100644 index fa0cdbeb1..000000000 Binary files a/app/assets/images/etapes/message_3.png and /dev/null differ diff --git a/app/assets/images/etapes/shared_4.png b/app/assets/images/etapes/shared_4.png deleted file mode 100644 index 6fcdee938..000000000 Binary files a/app/assets/images/etapes/shared_4.png and /dev/null differ diff --git a/app/assets/images/favicons/16x16.png b/app/assets/images/favicons/16x16.png new file mode 100644 index 000000000..c73712dba Binary files /dev/null and b/app/assets/images/favicons/16x16.png differ diff --git a/app/assets/images/favicons/32x32.png b/app/assets/images/favicons/32x32.png new file mode 100644 index 000000000..d23898479 Binary files /dev/null and b/app/assets/images/favicons/32x32.png differ diff --git a/app/assets/images/favicons/96x96.png b/app/assets/images/favicons/96x96.png new file mode 100644 index 000000000..a4d73f1d7 Binary files /dev/null and b/app/assets/images/favicons/96x96.png differ diff --git a/app/assets/images/footer/logo-beta-gouv-fr.svg b/app/assets/images/footer/logo-beta-gouv-fr.svg new file mode 100644 index 000000000..b393c3d34 --- /dev/null +++ b/app/assets/images/footer/logo-beta-gouv-fr.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/assets/images/footer/logo-rf.svg b/app/assets/images/footer/logo-rf.svg new file mode 100644 index 000000000..283fe4c57 --- /dev/null +++ b/app/assets/images/footer/logo-rf.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/assets/images/header/logo-tps.svg b/app/assets/images/header/logo-tps.svg new file mode 100644 index 000000000..fe6557db5 --- /dev/null +++ b/app/assets/images/header/logo-tps.svg @@ -0,0 +1 @@ +C03A1FFC-B3DD-48D2-8111-A47EEA63E68F \ No newline at end of file diff --git a/app/assets/images/landing/features/collaborer.svg b/app/assets/images/landing/features/collaborer.svg new file mode 100755 index 000000000..f5fe6cf85 --- /dev/null +++ b/app/assets/images/landing/features/collaborer.svg @@ -0,0 +1 @@ +08D2E231-4C84-4B79-AC9D-982A43B5F62D \ No newline at end of file diff --git a/app/assets/images/landing/features/creer.svg b/app/assets/images/landing/features/creer.svg new file mode 100755 index 000000000..fc7082a93 --- /dev/null +++ b/app/assets/images/landing/features/creer.svg @@ -0,0 +1 @@ +BB9A4BB9-1A5D-4E79-92B9-D2AF8B16FCF3 \ No newline at end of file diff --git a/app/assets/images/landing/features/gerer.svg b/app/assets/images/landing/features/gerer.svg new file mode 100755 index 000000000..6372bf120 --- /dev/null +++ b/app/assets/images/landing/features/gerer.svg @@ -0,0 +1 @@ +48989501-DD47-4082-8A9E-1AFAB7A24CFE \ No newline at end of file diff --git a/app/assets/images/landing/hero/dematerialiser.svg b/app/assets/images/landing/hero/dematerialiser.svg new file mode 100755 index 000000000..8398e066f --- /dev/null +++ b/app/assets/images/landing/hero/dematerialiser.svg @@ -0,0 +1 @@ +0EA652BC-3A4A-4613-BA33-535DF72E7337 \ No newline at end of file diff --git a/app/assets/images/landing/testimonials/quotation-mark.svg b/app/assets/images/landing/testimonials/quotation-mark.svg new file mode 100644 index 000000000..7c49b4e05 --- /dev/null +++ b/app/assets/images/landing/testimonials/quotation-mark.svg @@ -0,0 +1 @@ +Slice \ No newline at end of file diff --git a/app/assets/images/landing/users/cci.jpg b/app/assets/images/landing/users/cci.jpg new file mode 100644 index 000000000..9c4a9e379 Binary files /dev/null and b/app/assets/images/landing/users/cci.jpg differ diff --git a/app/assets/images/landing/users/chambres-de-metiers.jpg b/app/assets/images/landing/users/chambres-de-metiers.jpg new file mode 100644 index 000000000..e7338b04b Binary files /dev/null and b/app/assets/images/landing/users/chambres-de-metiers.jpg differ diff --git a/app/assets/images/landing/users/driea-idf.jpg b/app/assets/images/landing/users/driea-idf.jpg new file mode 100644 index 000000000..df9a361ea Binary files /dev/null and b/app/assets/images/landing/users/driea-idf.jpg differ diff --git a/app/assets/images/landing/users/ministere-environnement.jpg b/app/assets/images/landing/users/ministere-environnement.jpg new file mode 100644 index 000000000..086c252b0 Binary files /dev/null and b/app/assets/images/landing/users/ministere-environnement.jpg differ diff --git a/app/assets/images/landing/users/region-idf.jpg b/app/assets/images/landing/users/region-idf.jpg new file mode 100644 index 000000000..052dcdf7a Binary files /dev/null and b/app/assets/images/landing/users/region-idf.jpg differ diff --git a/app/assets/images/landing_background.png b/app/assets/images/landing_background.png deleted file mode 100644 index 5e4169f67..000000000 Binary files a/app/assets/images/landing_background.png and /dev/null differ diff --git a/app/assets/javascripts/admin.js b/app/assets/javascripts/admin.js index 435a42006..5284d467d 100644 --- a/app/assets/javascripts/admin.js +++ b/app/assets/javascripts/admin.js @@ -16,27 +16,27 @@ function destroy_action(){ $(this).closest('td').find(".confirm").hide(); }); - $("#liste_gestionnaire #libelle").on('click', function(){ + $("#liste-gestionnaire #libelle").on('click', function(){ setTimeout(destroy_action, 500); }); } function on_change_type_de_champ_select (){ - $("select.form-control.type_champ").on('change', function(e){ + $("select.form-control.type-champ").on('change', function(e){ parent = $(this).parent().parent(); - parent.removeClass('header_section'); - parent.children(".drop_down_list").removeClass('show_inline'); + parent.removeClass('header-section'); + parent.children(".drop-down-list").removeClass('show-inline'); $('.mandatory', parent).show(); switch(this.value){ case 'header_section': - parent.addClass('header_section'); + parent.addClass('header-section'); break; case 'drop_down_list': case 'multiple_drop_down_list': - parent.children(".drop_down_list").addClass('show_inline'); + parent.children(".drop-down-list").addClass('show-inline'); break; case 'explication': $('.mandatory', parent).hide(); diff --git a/app/assets/javascripts/admin_procedures_modal.js b/app/assets/javascripts/admin_procedures_modal.js index b5059bf29..edbb6f538 100644 --- a/app/assets/javascripts/admin_procedures_modal.js +++ b/app/assets/javascripts/admin_procedures_modal.js @@ -8,16 +8,16 @@ function init_path_modal() { } function path_modal_action() { - $('#publishModal').on('show.bs.modal', function (event) { - $("#publishModal .modal-body .table .tr_content").hide(); + $('#publish-modal').on('show.bs.modal', function (event) { + $("#publish-modal .modal-body .table .tr-content").hide(); var button = $(event.relatedTarget) // Button that triggered the modal var modal_title = button.data('modal_title'); // Extract info from data-* attributes var modal_index = button.data('modal_index'); // Extract info from data-* attributes var modal = $(this) - modal.find('#publishModal_title').html(modal_title); - $("#publishModal .modal-body .table #"+modal_index).show(); + modal.find('#publish-modal-title').html(modal_title); + $("#publish-modal .modal-body .table #"+modal_index).show(); }) } @@ -29,7 +29,7 @@ function path_validation_action() { } function togglePathMessage(valid, mine) { - $('#path_messages .message').hide(); + $('#path-messages .message').hide(); if (valid === true && mine === true) { $('#path_is_mine').show(); @@ -40,9 +40,9 @@ function togglePathMessage(valid, mine) { } if ((valid && mine === null) || mine === true) - $('#publishModal #publish').removeAttr('disabled') + $('#publish-modal #publish').removeAttr('disabled') else - $('#publishModal #publish').attr('disabled', 'disabled') + $('#publish-modal #publish').attr('disabled', 'disabled') } function path_validation(el) { @@ -52,7 +52,7 @@ function path_validation(el) { } function validatePath(path) { - var re = /^[a-z0-9_]{3,30}$/; + var re = /^[a-z0-9_\-]{3,50}$/; return re.test(path); } @@ -77,7 +77,7 @@ function path_type_init() { source: bloodhound, templates: { empty: 'Ce lien est disponible !', - suggestion: Handlebars.compile("
{{label}}
") + suggestion: Handlebars.compile("
{{label}}
") }, limit: 5 }); diff --git a/app/assets/javascripts/carte/cadastre.js b/app/assets/javascripts/carte/cadastre.js index ea9de02a8..81bff065c 100644 --- a/app/assets/javascripts/carte/cadastre.js +++ b/app/assets/javascripts/carte/cadastre.js @@ -33,7 +33,7 @@ function display_cadastre(cadastre_array) { else if (cadastre_array.length > 0) { cadastre_array.forEach(function (cadastre) { - $("#cadastre.list ul").append('
  • Parcelle n°' + cadastre.numero + ' - Feuille ' + cadastre.code_arr + ' ' + cadastre.section + ' ' + cadastre.feuille+ '
  • '); + $("#cadastre.list ul").append('
  • Parcelle nº ' + cadastre.numero + ' - Feuille ' + cadastre.code_arr + ' ' + cadastre.section + ' ' + cadastre.feuille+ '
  • '); cadastreItems.addData(cadastre.geometry); }); diff --git a/app/assets/javascripts/carte/carte.js b/app/assets/javascripts/carte/carte.js index 6966e3791..5ce16d28f 100644 --- a/app/assets/javascripts/carte/carte.js +++ b/app/assets/javascripts/carte/carte.js @@ -152,11 +152,11 @@ function jsObject_to_array(qp_list) { } function add_event_search_address() { - $("#search_by_address input[type='address']").bind('typeahead:select', function (ev, seggestion) { + $("#search-by-address input[type='address']").bind('typeahead:select', function (ev, seggestion) { get_address_point(seggestion['label']); }); - $("#search_by_address input[type='address']").keypress(function (e) { + $("#search-by-address input[type='address']").keypress(function (e) { if (e.keyCode == 13) get_address_point($(this).val()); }); diff --git a/app/assets/javascripts/channels/notifications.js b/app/assets/javascripts/channels/notifications.js index 7a76c26b6..f1f2d519d 100644 --- a/app/assets/javascripts/channels/notifications.js +++ b/app/assets/javascripts/channels/notifications.js @@ -1,7 +1,7 @@ //App.messages = App.cable.subscriptions.create('NotificationsChannel', { // received: function (data) { // if (window.location.href.indexOf('backoffice') !== -1) { -// $("#notification_alert").html(data['message']); +// $("#notification-alert").html(data['message']); // // slideIn_notification_alert(); // } @@ -9,7 +9,7 @@ //}); function slideIn_notification_alert (){ - $("#notification_alert").animate({ + $("#notification-alert").animate({ right: '20px' }, 250); @@ -17,7 +17,7 @@ function slideIn_notification_alert (){ } function slideOut_notification_alert (){ - $("#notification_alert").animate({ + $("#notification-alert").animate({ right: '-250px' }, 200); } diff --git a/app/assets/javascripts/default_data_block.js b/app/assets/javascripts/default_data_block.js index 107681782..071d07bb0 100644 --- a/app/assets/javascripts/default_data_block.js +++ b/app/assets/javascripts/default_data_block.js @@ -1,20 +1,20 @@ $(document).on('turbolinks:load', init_default_data_block); function init_default_data_block() { - $('.default_data_block #dossier .body').toggle(); - $('.default_data_block #dossier .carret-right').toggle(); - $('.default_data_block #dossier .carret-down').toggle(); + $('.default-data-block #dossier .body').toggle(); + $('.default-data-block #dossier .carret-right').toggle(); + $('.default-data-block #dossier .carret-down').toggle(); - $('.default_data_block .title').click(function () { + $('.default-data-block .title').click(function () { toggle_default_data_bloc(this, 400); }); $('.new-action').click(function () { - var messages_block = $(this).parents().closest('.default_data_block').find('.title') + var messages_block = $(this).parents().closest('.default-data-block').find('.title') toggle_default_data_bloc(messages_block, 400); }); - $('.default_data_block.default_visible').each(function() { + $('.default-data-block.default_visible').each(function() { toggle_default_data_bloc($(this).find('.title'), 0); }); diff --git a/app/assets/javascripts/dossiers.js b/app/assets/javascripts/dossiers.js index 4e0d1836c..401eca7f8 100644 --- a/app/assets/javascripts/dossiers.js +++ b/app/assets/javascripts/dossiers.js @@ -3,14 +3,14 @@ $(document).on('turbolinks:load', pannel_switch); function pannel_switch() { $('#switch-notifications').click(function () { - $('#procedure_list').addClass('hidden'); - $('#notifications_list').removeClass('hidden'); + $('#procedure-list').addClass('hidden'); + $('#notifications-list').removeClass('hidden'); $(this).addClass('active'); $('#switch-procedures').removeClass('active'); }) $('#switch-procedures').click(function () { - $('#notifications_list').addClass('hidden'); - $('#procedure_list').removeClass('hidden'); + $('#notifications-list').addClass('hidden'); + $('#procedure-list').removeClass('hidden'); $(this).addClass('active'); $('#switch-notifications').removeClass('active'); }) @@ -44,16 +44,16 @@ function error_form_siret(invalid_siret) { $("input[type='submit']").removeClass('btn-success').addClass('btn-danger'); - $("#dossier_siret").addClass('input-error').val(invalid_siret).on('input', reset_form_siret); + $("#dossier-siret").addClass('input-error').val(invalid_siret).on('input', reset_form_siret); } function reset_form_siret() { $("input[type='submit']").removeClass('btn-danger').addClass('btn-success').val('Valider'); - $("#dossier_siret").removeClass('input-error'); + $("#dossier-siret").removeClass('input-error'); } function toggle_etape_1() { - $('.row.etape.etape_1 .etapes_menu #logos').toggle(100); - $('.row.etape.etape_1 .etapes_informations #description_procedure').toggle(100); + $('.row.etape.etape_1 .etapes-menu #logos').toggle(100); + $('.row.etape.etape_1 .etapes-informations #description_procedure').toggle(100); } diff --git a/app/assets/javascripts/dossiers_list_link.js b/app/assets/javascripts/dossiers_list_link.js index 147e109a3..cf2d74859 100644 --- a/app/assets/javascripts/dossiers_list_link.js +++ b/app/assets/javascripts/dossiers_list_link.js @@ -1,7 +1,7 @@ $(document).on('turbolinks:load', link_init); function link_init() { - $('#dossiers_list tr').on('click', function () { + $('#dossiers-list tr').on('click', function () { $(location).attr('href', $(this).data('dossier_url')) }); } diff --git a/app/assets/javascripts/gestionnaire_dossier_modal.js b/app/assets/javascripts/gestionnaire_dossier_modal.js index bb02ca501..65ca00dbb 100644 --- a/app/assets/javascripts/gestionnaire_dossier_modal.js +++ b/app/assets/javascripts/gestionnaire_dossier_modal.js @@ -1,15 +1,15 @@ $(document).on('turbolinks:load', modal_action); function modal_action() { - $('#PJmodal').on('show.bs.modal', function (event) { - $("#PJmodal .modal-body .table .tr_content").hide(); + $('#pj-modal').on('show.bs.modal', function (event) { + $("#pj-modal .modal-body .table .tr-content").hide(); var button = $(event.relatedTarget) // Button that triggered the modal var modal_title = button.data('modal_title'); // Extract info from data-* attributes var modal_index = button.data('modal_index'); // Extract info from data-* attributes var modal = $(this) - modal.find('#PJmodal_title').html(modal_title); - $("#PJmodal .modal-body .table #"+modal_index).show(); + modal.find('#pj-modal-title').html(modal_title); + $("#pj-modal .modal-body .table #"+modal_index).show(); }) } diff --git a/app/assets/javascripts/new-description.js b/app/assets/javascripts/new-description.js index 8de71855e..3b32782c4 100644 --- a/app/assets/javascripts/new-description.js +++ b/app/assets/javascripts/new-description.js @@ -5,7 +5,7 @@ }; var showData = function(data) { - $('.dossier-link .procedureLibelle').text(data.procedureLibelle); + $('.dossier-link .dossier-text-summary').text(data.textSummary); $('.dossier-link .text-info').show(); $('.dossier-link .text-warning').hide(); }; @@ -18,7 +18,7 @@ var fetchProcedureLibelle = function(e) { var dossierId = $(e.target).val(); if(dossierId) { - $.get('/users/dossiers/' + dossierId + '/procedure_libelle') + $.get('/users/dossiers/' + dossierId + '/text_summary') .done(showData) .fail(showNotFound); } else { diff --git a/app/assets/javascripts/pref_list_dossier.js b/app/assets/javascripts/pref_list_dossier.js index 21e7966df..1e81e3eee 100644 --- a/app/assets/javascripts/pref_list_dossier.js +++ b/app/assets/javascripts/pref_list_dossier.js @@ -6,25 +6,25 @@ function pref_list_dossier_actions() { } function pref_list_dossier_open_action() { - $("#pref_list_dossier_open_action").on('click', function () { - $("#pref_list_menu").css('display', 'block'); - $("#pref_list_menu").css('visibility', 'visible'); + $("#pref-list-dossier-open-action").on('click', function () { + $("#pref-list-menu").css('display', 'block'); + $("#pref-list-menu").css('visibility', 'visible'); - $("#pref_list_menu").animate({ + $("#pref-list-menu").animate({ right: 0 }, 250); }); } function pref_list_dossier_close_action() { - $("#pref_list_dossier_close_action").on('click', function () { - $("#pref_list_menu").animate({ - right: parseInt($("#pref_list_menu").css('width'), 10)*(-1)+'px' + $("#pref-list-dossier-close-action").on('click', function () { + $("#pref-list-menu").animate({ + right: parseInt($("#pref-list-menu").css('width'), 10)*(-1)+'px' },{ duration: 250, complete: function () { - $("#pref_list_menu").css('display', 'none'); - $("#pref_list_menu").css('visibility', 'hidden'); + $("#pref-list-menu").css('display', 'none'); + $("#pref-list-menu").css('visibility', 'hidden'); } } ) diff --git a/app/assets/javascripts/procedure.js b/app/assets/javascripts/procedure.js index d4f89f012..c2bcffb54 100644 --- a/app/assets/javascripts/procedure.js +++ b/app/assets/javascripts/procedure.js @@ -8,30 +8,30 @@ function button_edit_procedure_init(){ function buttons_api_carto () { - $("#procedure_module_api_carto_use_api_carto").on('change', function() { - $("#modules_api_carto").toggle() + $("#procedure-module-api-carto-use-api-carto").on('change', function() { + $("#modules-api-carto").toggle() }); - if ($('#procedure_module_api_carto_use_api_carto').is(':checked')) - $("#modules_api_carto").show(); + if ($('#procedure-module-api-carto-use-api-carto').is(':checked')) + $("#modules-api-carto").show(); } function button_cerfa () { $("#procedure_cerfa_flag").on('change', function() { - $("#procedure_lien_demarche").toggle() + $("#procedure-lien-demarche").toggle() }); if ($('#procedure_cerfa_flag').is(':checked')) - $("#procedure_lien_demarche").show(); + $("#procedure-lien-demarche").show(); } function button_individual () { $("#procedure_for_individual").on('change', function() { - $("#individual_with_siret").toggle() + $("#individual-with-siret").toggle() }); if ($('#procedure_for_individual').is(':checked')) - $("#individual_with_siret").show(); + $("#individual-with-siret").show(); } diff --git a/app/assets/javascripts/search.js b/app/assets/javascripts/search.js index bfbc7aded..eb61ae055 100644 --- a/app/assets/javascripts/search.js +++ b/app/assets/javascripts/search.js @@ -1,11 +1,11 @@ $(document).on('turbolinks:load', init_search_anim); function init_search_anim(){ - $("#search_area").on('click', search_fadeIn); + $("#search-area").on('click', search_fadeIn); } function search_fadeIn(){ - var search_area = $("#search_area"); + var search_area = $("#search-area"); var body_dom = $('body'); var positions = search_area.position(); var width = search_area.width(); @@ -16,10 +16,10 @@ function search_fadeIn(){ search_area.css('z-index', 300); search_area.css('width', width); search_area.find('#q').animate({ height: '50px' }); - search_area.find('#search_button').animate({ height: '50px' }); + search_area.find('#search-button').animate({ height: '50px' }); body_dom.append(search_area); - $('#mask_search').fadeIn(200); + $('#mask-search').fadeIn(200); var body_width = body_dom.width(); @@ -30,16 +30,16 @@ function search_fadeIn(){ left: (body_width/2 - search_area_width/2 + 40) }, 400, function() { search_area.off(); - $("#search_area input").focus(); + $("#search-area input").focus(); - $('#mask_search').on('click', search_fadeOut) + $('#mask-search').on('click', search_fadeOut) }); } function search_fadeOut(){ - var search_area = $("#search_area"); + var search_area = $("#search-area"); - $('#mask_search').fadeOut(200); + $('#mask-search').fadeOut(200); search_area.fadeOut(200, function(){ search_area.css('position', 'static'); @@ -48,7 +48,7 @@ function search_fadeOut(){ search_area.css('z-index', ''); search_area.css('width', 'auto'); search_area.find('#q').css('height', 34); - search_area.find('#search_button').css('height', 34); + search_area.find('#search-button').css('height', 34); $('#search-block').append(search_area); search_area.fadeIn(200); diff --git a/app/assets/stylesheets/_card.scss b/app/assets/stylesheets/_card.scss index 813406a9f..02cd722cc 100644 --- a/app/assets/stylesheets/_card.scss +++ b/app/assets/stylesheets/_card.scss @@ -1,6 +1,6 @@ .card { - background: white; + background: #FFFFFF; padding: 15px; - box-shadow: 0 1px 3px rgba(0, 0, 0, .15); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); border-radius: 2px; } diff --git a/app/assets/stylesheets/_colors.scss b/app/assets/stylesheets/_colors.scss new file mode 100644 index 000000000..0d72dde62 --- /dev/null +++ b/app/assets/stylesheets/_colors.scss @@ -0,0 +1,5 @@ +$blue: #4393F3; +$light-blue: rgba(61, 149, 236, 0.8); +$black: #333333; +$grey: #999999; +$light-grey: #F8F8F8; diff --git a/app/assets/stylesheets/_variables.scss b/app/assets/stylesheets/_constants.scss similarity index 55% rename from app/assets/stylesheets/_variables.scss rename to app/assets/stylesheets/_constants.scss index 701b59ca1..1208ef340 100644 --- a/app/assets/stylesheets/_variables.scss +++ b/app/assets/stylesheets/_constants.scss @@ -1,5 +1,7 @@ // colors $light-blue: #F2F6FA; -// Bootstrap variables +// Bootstrap constants $font-size-base: 16px; + +$page-width: 1040px; diff --git a/app/assets/stylesheets/_mixins.scss b/app/assets/stylesheets/_mixins.scss new file mode 100644 index 000000000..6e40c4a78 --- /dev/null +++ b/app/assets/stylesheets/_mixins.scss @@ -0,0 +1,9 @@ +@mixin horizontal-padding($value) { + padding-left: $value; + padding-right: $value; +} + +@mixin vertical-padding($value) { + padding-top: $value; + padding-bottom: $value; +} diff --git a/app/assets/stylesheets/_placeholders.scss b/app/assets/stylesheets/_placeholders.scss new file mode 100644 index 000000000..71870ccec --- /dev/null +++ b/app/assets/stylesheets/_placeholders.scss @@ -0,0 +1,14 @@ +%horizontal-list { + list-style-type: none; + margin: 0; + padding: 0; + font-size: 0px; +} + +%horizontal-list-item { + display: inline-block; + + &:last-of-type { + margin-right: 0; + } +} diff --git a/app/assets/stylesheets/_turbolinks.scss b/app/assets/stylesheets/_turbolinks.scss index 3a6401063..436f0541c 100644 --- a/app/assets/stylesheets/_turbolinks.scss +++ b/app/assets/stylesheets/_turbolinks.scss @@ -1,4 +1,4 @@ -@import "variables"; +@import "constants"; .turbolinks-progress-bar { background-color: $light-blue; diff --git a/app/assets/stylesheets/_typography.scss b/app/assets/stylesheets/_typography.scss new file mode 100644 index 000000000..351aac902 --- /dev/null +++ b/app/assets/stylesheets/_typography.scss @@ -0,0 +1,6 @@ +@import "colors"; + +%new-type { + font-family: "Muli"; + color: $black; +} diff --git a/app/assets/stylesheets/admin_index.scss b/app/assets/stylesheets/admin_index.scss deleted file mode 100644 index 8a4d10b22..000000000 --- a/app/assets/stylesheets/admin_index.scss +++ /dev/null @@ -1,22 +0,0 @@ -#admin_index{ - margin-left: 2em; - margin-right: 2em; - - .table { - #id { - width: 5%; - } - - #libelle { - width: 40%; - } - - #organisation { - width: 28%; - } - - #direction { - width: 22%; - } - } -} diff --git a/app/assets/stylesheets/admin_procedures_modal.scss b/app/assets/stylesheets/admin_procedures_modal.scss index 2ef9d03b0..6c1cf1497 100644 --- a/app/assets/stylesheets/admin_procedures_modal.scss +++ b/app/assets/stylesheets/admin_procedures_modal.scss @@ -1,17 +1,18 @@ -.path_mine_false { - color: red +.path-mine-false { + color: #FF0000; } -#path_messages { +#path-messages { .message { - display: none + display: none; } } -#publishModal { +#publish-modal { .twitter-typeahead { width: 300px; } + .tt-menu { width: 300px; } diff --git a/app/assets/stylesheets/admin_type_de_champ.scss b/app/assets/stylesheets/admin_type_de_champ.scss index bc2613075..5fc7aa54b 100644 --- a/app/assets/stylesheets/admin_type_de_champ.scss +++ b/app/assets/stylesheets/admin_type_de_champ.scss @@ -1,13 +1,13 @@ -.header_section{ +.header-section { background-color: rgb(0, 49, 137); margin-top: 20px; margin-bottom: 10px; margin-left: 0; margin-right: 0; - text-align:center; + text-align: center; padding-bottom: 8px; - color: white; + color: #FFFFFF; .form-control.libelle { font-weight: bold; @@ -22,26 +22,27 @@ } } -#liste_champ{ +#liste-champ { .form-inline { margin-bottom: 30px; } - .show_inline { + .show-inline { display: inline-block !important; } - .form-group.drop_down_list{ + .form-group.drop-down-list { display: none; } .form-group { vertical-align: top; - margin-right: 15px; + margin-right: 15px; } .description { padding: 0; + textarea { padding: 6px 12px; } diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index dd10a3f2b..adf15f626 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,28 +1,28 @@ -//= depend_on_asset "layers.png" -//= depend_on_asset "layers-2x.png" -/* - * This is a manifest file that'll be compiled into application.css, which will include all the files - * listed below. - * - * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, - * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. - * - * You're free to add application-wide styles to this file and they'll appear at the bottom of the - * compiled file so the styles you add here take precedence over styles defined in any styles - * defined in the other CSS/SCSS files in this directory. It is generally better to create a new - * file per style scope. - * - *= require_tree . - *= require_self - *= require bootstrap-datepicker3 - *= require leaflet - *= require font-awesome - *= require franceconnect - *= require bootstrap-wysihtml5 - *= require select2 - *= require select2-bootstrap - */ -@import "variables"; +// = depend_on_asset "layers.png" +// = depend_on_asset "layers-2x.png" + +// This is a manifest file that'll be compiled into application.css, which will include all the files +// listed below. +// +// Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, +// or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. +// +// You're free to add application-wide styles to this file and they'll appear at the bottom of the +// compiled file so the styles you add here take precedence over styles defined in any styles +// defined in the other CSS/SCSS files in this directory. It is generally better to create a new +// file per style scope. +// +// = require_tree . +// = require_self +// = require bootstrap-datepicker3 +// = require leaflet +// = require font-awesome +// = require franceconnect +// = require bootstrap-wysihtml5 +// = require select2 +// = require select2-bootstrap + +@import "constants"; @import "bootstrap-sprockets"; @import "bootstrap"; @@ -30,7 +30,8 @@ body { background-color: $light-blue; } -html, body { +html, +body { height: 100%; } @@ -53,12 +54,13 @@ form { overflow: hidden; } -#wrap:after { +#wrap::after { content: ""; display: block; } -#footer, #wrap:after { +#footer, +#wrap::after { height: 50px; } @@ -66,35 +68,32 @@ form { background-color: $light-blue; text-align: center; padding: 0; - a, p { + + a, + p { color: #000000; } + a:hover { color: #000000; } + p { line-height: 40px; padding: 0; } } -.beta_staging { +.beta-staging { background-color: #B00100 !important; } -.staging_warning { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); -} - .text-purple { - color: #8B008B + color: #8B008B; } .text-default { - color: grey; + color: #808080; } .progress-bar-purple { @@ -122,16 +121,16 @@ form { min-height: 100%; font-size: 100px; text-align: right; - filter: alpha(opacity=0); + filter: alpha(opacity = 0); opacity: 0; outline: none; - background: white; + background: #FFFFFF; cursor: inherit; display: block; } .vr { - border-left: 1px solid grey; + border-left: 1px solid #808080; } .center { @@ -142,10 +141,6 @@ textarea#description { width: 100%; } -.logo_fc_small { - max-width: 27px; -} - div.pagination { padding-top: 20px; display: block; @@ -156,7 +151,7 @@ div.pagination { margin-bottom: 0px; } -.alert.alert-success.move_up, +.alert.alert-success.move-up, .alert.alert-danger.siret { position: fixed; top: 0px; @@ -199,11 +194,11 @@ div.pagination { right: 50px; } -#fconnect-access:before { +#fconnect-access::before { left: 22.7% !important; } -#fconnect-access:after { +#fconnect-access::after { left: 23% !important; } @@ -217,7 +212,6 @@ div.pagination { font-size: 16px !important; margin-right: 0px !important; } - } .no-padding { diff --git a/app/assets/stylesheets/backoffice.scss b/app/assets/stylesheets/backoffice.scss index 4956cfeb4..cdbe3fa52 100644 --- a/app/assets/stylesheets/backoffice.scss +++ b/app/assets/stylesheets/backoffice.scss @@ -1,33 +1,31 @@ -#backoffice_index, #backoffice_search { +#backoffice-index, +#backoffice-search { margin-left: 2rem; margin-right: 2rem; - .default_data_block { + .default-data-block { background-color: #FFFFFF; margin-top: 20px; + .show-block { width: 100%; } + .body { height: auto; } } + .fixed-right { position: fixed; right: 20px; } } -#pref_list { - .dropdown-menu { - padding: 10px; - width: 500px; - } -} - #onglets { ul { - li, li.active { + li, + li.active { a { margin-top: 12px; height: 45px; diff --git a/app/assets/stylesheets/carte.scss b/app/assets/stylesheets/carte.scss index 486e98b64..8220729ad 100644 --- a/app/assets/stylesheets/carte.scss +++ b/app/assets/stylesheets/carte.scss @@ -3,26 +3,19 @@ // You can use Sass (SCSS) here: http://sass-lang.com/ @import "bootstrap"; -#carte_page { +#carte-page { #map { - @extend .col-md-12; - @extend .col-lg-12; - margin-left: 15px; width: 90%; height: 600px; } - #map.qp, #map.cadastre { - @extend .col-md-9; - @extend .col-lg-9; - + #map.qp, + #map.cadastre { width: 70%; } .list { - @extend .col-md-3; - @extend .col-lg-3; margin-bottom: 20px; h3 { @@ -36,10 +29,10 @@ } .leaflet-container path { - cursor: url('/assets/edit.png'), default !important; + cursor: url("/assets/edit.png"), default !important; } -#infos_dossier { +#infos-dossiers { #map.mini { height: 300px; width: 100%; @@ -51,14 +44,14 @@ top: 0; left: 0; pointer-events: none; - box-shadow: inset -100px 0 100px -100px rgba(0, 0, 0, .25); + box-shadow: inset -100px 0 100px -100px rgba(0, 0, 0, 0.25); width: 100%; height: 100%; z-index: 2001; } #map.mode-create { - cursor: url('/assets/pencil.png'), crosshair !important; + cursor: url("/assets/pencil.png"), crosshair !important; } #map g path.tracer { @@ -69,8 +62,7 @@ position: absolute; z-index: 1001; fill: #D7217E; - fill-opacity: .75; - -webkit-filter: none; + fill-opacity: 0.75; } #map.mode-delete path { @@ -78,12 +70,11 @@ } #map.mode-delete path:hover { - fill: #4d4d4d !important; + fill: #4D4D4D !important; } #map div.polygon-elbow { - -webkit-transition: opacity .25s; - box-shadow: 0 0 0 2px white, 0 0 10px rgba(0, 0, 0, .35); + box-shadow: 0 0 0 2px #FFFFFF, 0 0 10px rgba(0, 0, 0, 0.35); border: 5px solid #D7217E; border-radius: 10px; transition: opacity 0.25s; @@ -98,7 +89,7 @@ #map div.polygon-elbow.non-polygon { opacity: 0 !important; pointer-events: none !important; - border: 5px solid darkgray; + border: 5px solid #A9A9A9; } #map.mode-edit div.polygon-elbow { @@ -119,7 +110,6 @@ .info { padding: 6px 8px; font: 14px/16px Arial, Helvetica, sans-serif; - background: white; background: rgba(255, 255, 255, 0.8); box-shadow: 0 0 15px rgba(0, 0, 0, 0.2); border-radius: 5px; @@ -127,13 +117,14 @@ .info h4 { margin: 0 0 5px; - color: #777; + color: #777777; } -#search_by_address { +#search-by-address { .twitter-typeahead { width: 555px; } + .tt-menu { width: 555px; } diff --git a/app/assets/stylesheets/custom-mails.scss b/app/assets/stylesheets/custom-mails.scss index 6552f757f..c17eaeffa 100644 --- a/app/assets/stylesheets/custom-mails.scss +++ b/app/assets/stylesheets/custom-mails.scss @@ -2,7 +2,7 @@ padding: 20px; .wrapper { - background-color: #FFF; + background-color: #FFFFFF; box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.5); margin: 15px auto; max-width: 800px; diff --git a/app/assets/stylesheets/default_data_block.scss b/app/assets/stylesheets/default_data_block.scss index 9590ce8ff..1f37e839f 100644 --- a/app/assets/stylesheets/default_data_block.scss +++ b/app/assets/stylesheets/default_data_block.scss @@ -1,6 +1,6 @@ -@import "variables"; +@import "constants"; -.default_data_block { +.default-data-block { font-family: Arial; .show-block { @@ -9,6 +9,7 @@ box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.5); margin-bottom: 40px; } + .carret-right { float: left; width: 0; @@ -18,6 +19,7 @@ border-left: 14px solid #FFFFFF; margin: 12px 12px 0 15px; } + .carret-down { float: left; width: 0; @@ -28,24 +30,34 @@ border-top: 14px solid #FFFFFF; margin: 12px 12px 0 15px; } + .header { background-color: #003C92; height: 40px; color: #FFFFFF; font-size: 18px; font-weight: bold; - .title, .title-no-expanse, .action, .count { + + .title, + .title-no-expanse, + .action, + .count { height: 100%; line-height: 40px; padding: 0px; text-transform: uppercase; } + .title-no-expanse { cursor: not-allowed; } - .title, .action, .count { + + .title, + .action, + .count { cursor: pointer; } + .action { background-color: #E45B51; text-align: center; @@ -54,14 +66,17 @@ text-decoration: none; color: #FFFFFF; } + .action:hover { color: $light-blue; } + .count { font-size: 16px; text-align: center; } } + .body { background-color: #FFFFFF; display: none; diff --git a/app/assets/stylesheets/description.scss b/app/assets/stylesheets/description.scss index c471c10c1..6ad2f4339 100644 --- a/app/assets/stylesheets/description.scss +++ b/app/assets/stylesheets/description.scss @@ -1,12 +1,13 @@ @import "bootstrap"; @import "bootstrap-datepicker3"; -#description_page #liste_champs { +#description-page #liste-champs { - .default_data_block { + .default-data-block { .show-block { width: 90%; - .body{ + + .body { padding: 15px; } } @@ -18,16 +19,16 @@ } } -.page-header{ +.page-header { border-bottom: 1px solid #CCCCCC !important; } .input-error { - color: darkred !important; - border-color: darkred !important + color: #8B0000 !important; + border-color: #8B0000 !important; } -.type_champ-text { +.type-champ-text { @extend .col-md-6; @extend .col-lg-6; @@ -36,28 +37,30 @@ } } -.type_champ-header_section { +.type-champ-header-section { @extend .col-md-12; @extend .col-lg-12; } -.type_champ-address { +.type-champ-address { @extend .col-md-6; @extend .col-lg-6; .twitter-typeahead { width: 100%; + input { width: 100%; display: block !important; } } + .tt-menu { width: 100%; } } -.type_champ-email { +.type-champ-email { @extend .col-md-4; @extend .col-lg-4; @@ -66,23 +69,26 @@ } } -.type_champ-drop_down_list, .type_champ-regions, .type_champ-departements, .type_champ-pays { +.type-champ-drop-down-list, +.type-champ-regions, +.type-champ-departements, +.type-champ-pays { @extend .col-md-4; @extend .col-lg-4; } -.type_champ-civilite { +.type-champ-civilite { @extend .col-md-3; @extend .col-lg-3; } -.type_champ-yes_no { +.type-champ-yes-no { @extend .col-md-3; @extend .col-lg-3; } -.type_champ-phone { +.type-champ-phone { @extend .col-md-2; @extend .col-lg-2; @@ -92,11 +98,11 @@ } .datepicker-switch { - color: #0086b3; + color: #0086B3; text-decoration: underline; } -.type_champ-textarea { +.type-champ-textarea { @extend .col-md-8; @extend .col-lg-8; @@ -106,7 +112,7 @@ } } -.type_champ-number { +.type-champ-number { @extend .col-md-3; @extend .col-lg-3; @@ -115,7 +121,7 @@ } } -.type_champ-date { +.type-champ-date { @extend .col-md-2; @extend .col-lg-2; @@ -124,7 +130,7 @@ } } -.type_champ-datetime { +.type-champ-datetime { @extend .col-md-5; @extend .col-lg-5; diff --git a/app/assets/stylesheets/dossier_show.scss b/app/assets/stylesheets/dossier_show.scss index f840b193a..93f8ba5a5 100644 --- a/app/assets/stylesheets/dossier_show.scss +++ b/app/assets/stylesheets/dossier_show.scss @@ -1,27 +1,35 @@ -#backoffice_dossier_show, #users_recapitulatif_dossier_show { +#backoffice-dossier-show, +#users-recapitulatif-dossier-show { #messages { .last-commentaire { display: block; background-color: #FFFFFF; - .content, .new-action { + + .content, + .new-action { margin-bottom: 20px; } } + .body { .commentaires { max-height: 350px; overflow-y: scroll; - background: linear-gradient(to bottom, rgba(0, 0, 0, 0.075) 0%, rgba(219, 219, 219, 0) 50%, rgba(250, 251, 253, 0.18) 51%, #ffffff 100%); + background: linear-gradient(to bottom, rgba(0, 0, 0, 0.075) 0%, rgba(219, 219, 219, 0) 50%, rgba(250, 251, 253, 0.18) 51%, #FFFFFF 100%); } + .no-commentaires { text-align: center; font-size: 18px; padding-top: 20px; } } - .last-commentaire, .commentaire { + + .last-commentaire, + .commentaire { padding: 20px 0 0 20px; + .comment-header { font-family: Arial; font-size: 14px; @@ -30,10 +38,12 @@ color: #000000; margin-bottom: 10px; } + .file { padding-right: 70px; text-align: center; margin-bottom: 20px; + .link { span { width: 100%; @@ -42,41 +52,48 @@ } } } + .split-hr { margin: 20px 20px 0 20px; border-bottom: 1px solid #979797; } + #new-commentaire { padding: 15px; } } + .infos { .split-row { margin: 0 0 20px 0; } + .entreprise-info { font-size: 14px; } + .entreprise-label { font-weight: bold; text-align: end; } } - #carto { - } + #private-fields { .text-primary { - color: #337ab7; + color: #337AB7; } } + #pieces-jointes { .piece-row { margin: 20px; + .piece-label { text-align: right; font-weight: bold; } } + .modal-title { color: #000000; } @@ -89,31 +106,40 @@ } } - #dossier, #pieces-jointes, .infos, #carto, #private-fields { + #dossier, + #pieces-jointes, + .infos, + #carto, + #private-fields { .body { padding: 20px 20px 0 20px; color: #000000; + .libelle-procedure { font-style: italic; padding: 10px; } + .depositaire-label { font-weight: bold; text-align: end; } - .depositaire-info { - } - .btn-action{ + + .btn-action { border: none; margin: 20px 0 40px 0; } + .btn-action:hover { color: #EEEEEE; } + .action { margin: 50px 0 0 15px; } - .action, .btn-action { + + .action, + .btn-action { background-color: #E45B51; text-align: center; cursor: pointer; @@ -125,44 +151,55 @@ font-size: 16px; font-weight: bold; text-decoration: none; + a:hover { color: #EEEEEE; } } + .historique { color: #000000; margin-left: 20px; } + .comments { margin-right: -10px; } + .comments-off { margin-right: -35px; } + .dossier-title { font-size: 16px; min-height: 40px; text-align: center; } + .split-hr { border-bottom: 1px solid #979797; height: 12px; min-height: 10px; } + .title-row { margin: 20px 10px 10px 10px; } + .margin-top-40 { margin-top: 40px; } + .margin-top-20 { margin-top: 20px; } + .margin-bot-40 { margin-bottom: 40px; } } - #pieces_justificatives { + + #pieces-justificatives { .piece-row { margin: 0 0 0 0; } diff --git a/app/assets/stylesheets/dossiers.scss b/app/assets/stylesheets/dossiers.scss index c6a493da8..5a59dd7a8 100644 --- a/app/assets/stylesheets/dossiers.scss +++ b/app/assets/stylesheets/dossiers.scss @@ -3,10 +3,10 @@ // You can use Sass (SCSS) here: http://sass-lang.com/ h5 span { - font-weight: normal + font-weight: normal; } -#insee_infogreffe { +#insee-infogreffe { font-size: 17px; } @@ -23,13 +23,7 @@ h5 span { } } -#recap_dossier { - #validate_button { - float: right; - } -} - -#dossiers_list { +#dossiers-list { .filter { cursor: pointer; font-size: 1.1em; @@ -37,30 +31,40 @@ h5 span { } } -#dossiers_list tr:hover{ - background-color: #eeeeee; +#dossiers-list tr:hover { + background-color: #EEEEEE; cursor: pointer; } -#procedure_list, #notifications_list { +#procedure-list, +#notifications-list { margin-left: -10px; margin-top: 20px; - a, a:hover { + + a, + a:hover { color: #FFFFFF; text-decoration: none; } - .procedure_list_element.active, .notification.active { + + .procedure-list-element.active, + .notification.active { background-color: #668ABD; } - .procedure_list_element, .notification { + + .procedure-list-element, + .notification { padding: 15px 40px 15px 20px; cursor: pointer; line-height: 1.8em; + .progress-bar-warning { background-color: #E4594F; } } - .procedure_list_element:hover, .notification:hover { + + .procedure-list-element:hover, + .notification:hover { background-color: #668ABD; cursor: pointer; } diff --git a/app/assets/stylesheets/etapes.scss b/app/assets/stylesheets/etapes.scss index 4bef8c51a..2ff84fa6f 100644 --- a/app/assets/stylesheets/etapes.scss +++ b/app/assets/stylesheets/etapes.scss @@ -1,14 +1,15 @@ -.etape_2{ - .etapes_menu{ - #dossier_siret{ +.etape-2 { + .etapes-menu { + #dossier-siret { width: 200px; } - button{ + button { margin-top: 8px; } } - .etapes_informations{ + + .etapes-informations { padding-top: 15px; } } diff --git a/app/assets/stylesheets/fonts.scss b/app/assets/stylesheets/fonts.scss new file mode 100644 index 000000000..edc222672 --- /dev/null +++ b/app/assets/stylesheets/fonts.scss @@ -0,0 +1,13 @@ +@font-face { + font-family: "Muli"; + src: asset-url("Muli-Regular.woff") format("woff"); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: "Muli"; + src: asset-url("Muli-Bold.woff") format("woff"); + font-weight: bold; + font-style: normal; +} diff --git a/app/assets/stylesheets/france_connect_particulier.scss b/app/assets/stylesheets/france_connect_particulier.scss index 98cb7738e..72025e3a3 100644 --- a/app/assets/stylesheets/france_connect_particulier.scss +++ b/app/assets/stylesheets/france_connect_particulier.scss @@ -1,5 +1,5 @@ -#france_connect_particulier_email{ +#france-connect-particulier-email { width: 300px; - margin-left:auto; - margin-right:auto; + margin-left: auto; + margin-right: auto; } diff --git a/app/assets/stylesheets/header.scss b/app/assets/stylesheets/header.scss new file mode 100644 index 000000000..fdc9e81c8 --- /dev/null +++ b/app/assets/stylesheets/header.scss @@ -0,0 +1,53 @@ +@import "constants"; +@import "colors"; +@import "mixins"; +@import "typography"; + +// FIXME: Rename when the header is generalized +.new-header { + @extend %new-type; + height: 72px; + background-color: #FFFFFF; + // FIXME: Delete when the header is generalized + margin-top: -60px; +} + +.header-inner-content { + width: $page-width; + margin: 0 auto; +} + +.header-logo { + margin-top: 17px; +} + +$header-login-button-height: 36px; +$header-login-button-border-size: 1px; + +.header-login-button { + @include horizontal-padding(16px); + + display: inline-block; + height: $header-login-button-height; + line-height: $header-login-button-height - (2 * $header-login-button-border-size); + border-radius: $header-login-button-height; + border: $header-login-button-border-size solid $blue; + color: $blue; + font-size: 14px; + margin-top: 18px; + + &:hover { + color: #FFFFFF; + text-decoration: none; + background-color: $light-blue; + } + + &:focus { + color: $blue; + text-decoration: none; + } + + &:hover:focus { + color: #FFFFFF; + } +} diff --git a/app/assets/stylesheets/landing.scss b/app/assets/stylesheets/landing.scss index 249e37743..bc8481080 100644 --- a/app/assets/stylesheets/landing.scss +++ b/app/assets/stylesheets/landing.scss @@ -1,62 +1,252 @@ -#logo-tps { - width: 200px; +@import "constants"; +@import "colors"; +@import "mixins"; +@import "placeholders"; +@import "typography"; + +.landing { + @extend %new-type; + background-color: #FFFFFF; } -#landing { - background-image: image-url('landing_background.png'); - background-attachment: fixed; - background-size: 130% auto; - background-position: top center; - background-repeat: no-repeat; +.landing-panel { + @include vertical-padding(60px); +} - h5{ - color: grey; +.landing-panel-inner-content { + width: $page-width; + margin: 0 auto; +} + +.hero-tagline { + width: 500px; + font-size: 30px; + margin-bottom: 0px; +} + +.hero-tagline-em { + color: $blue; + font-size: 36px; + font-style: normal; + font-weight: bold; +} + +.hero-text { + width: 500px; +} + +.hero-illustration { + width: 500px; +} + +.hero-button { + @include horizontal-padding(30px); + + display: inline-block; + height: 60px; + line-height: 60px; + border-radius: 60px; + background-color: $blue; + color: #FFFFFF; + font-size: 24px; + margin-top: 30px; + + &:hover { + color: #FFFFFF; + text-decoration: none; + background-color: $light-blue; } - .logos { - width: 150px; - } - - #title { - padding-bottom: 2%; - padding-top: 1%; - - h2 { - font-size: 35px; - } - - .btn { - text-shadow: none; - } - - color: white; - text-shadow: 0px 0px 10px rgb(0, 0, 0); + &:focus { + color: #FFFFFF; + text-decoration: none; } } -.background-tps{ - background-color: #668AEA; - color: white; +.hero-phone-cta { + color: $grey; + text-align: center; + width: 293px; + margin-top: 12px; } -.latest_release{ - margin-left: 1% +.landing-panel-title { + font-size: 30px; + font-weight: normal; + text-align: center; + margin-bottom: 40px; + margin-top: 0; } -#landing_body{ - .split-hr-left { - margin-left: auto; - margin-right: auto; +.features-panel { + background-color: $blue; +} - margin-top: 40px; - margin-bottom: 20px; +.features-panel-title { + color: #FFFFFF; +} - border-color: grey; - width: 40%; - } +.features { + @extend %horizontal-list; +} - #etapes, #request_access{ - margin-top: 20px; - margin-bottom: 20px; +$feature-width: 320px; +$features-count: 3; + +.feature { + @extend %horizontal-list-item; + width: $feature-width; + margin-right: calc((#{$page-width} - (#{$feature-width} * #{$features-count})) / (#{$features-count} - 1)); +} + +.feature-text { + text-align: center; + color: #FFFFFF; + font-size: 20px; +} + +.feature-text-em { + font-weight: bold; + font-style: normal; +} + +.feature-image { + display: block; + margin: 0 auto; + margin-bottom: 24px; +} + +.quotes { + @extend %horizontal-list; +} + +$quote-width: 500px; +$quote-count: 2; + +.quote { + @extend %horizontal-list-item; + width: $quote-width; + margin-right: calc((#{$page-width} - (#{$quote-width} * #{$quote-count}))/ (#{$quote-count} - 1)); + background-color: #FFFFFF; + box-shadow: 0 4px 16px 0 rgba(153, 153, 153, 0.2); + padding: 24px; +} + +.quote-quotation-mark { + margin-top: 12px; +} + +.quote-content { + font-size: 18px; + width: 388px; + margin-bottom: 24px; +} + +.quote-author { + font-size: 14px; + margin-left: 64px; +} + +.quote-author-name { + font-weight: bold; +} + +.numbers-panel { + background-color: $light-grey; +} + +.numbers { + @extend %horizontal-list; +} + +$number-width: 320px; +$number-count: 3; + +.number { + @extend %horizontal-list-item; + width: $number-width; + margin-right: calc((#{$page-width} - (#{$number-width} * #{$number-count}))/ (#{$number-count} - 1)); + text-align: center; +} + +.number-value { + color: $blue; + font-weight: bold; + font-size: 36px; +} + +.number-label { + font-weight: bold; + font-size: 20px; +} + +.users { + @extend %horizontal-list; +} + +$image-width: 170px; +$images-total-width: $image-width * 5; +$images-count: 5; + +.user { + @extend %horizontal-list-item; + margin-right: calc((#{$page-width} - (#{$images-total-width}))/ (#{$images-count} - 1)); + + &:hover { + opacity: 0.6; } } + +.user-image { + width: $image-width; +} + +.cta-panel { + background-color: $blue; + color: #FFFFFF; +} + +.cta-panel-title { + font-size: 24px; + font-weight: bold; + margin-top: 13px; +} + +.cta-panel-explanation { + font-size: 24px; + margin-bottom: 0; +} + +$cta-panel-button-height: 60px; +$cta-panel-button-border-size: 2px; + +.cta-panel-button { + @include horizontal-padding(30px); + + display: block; + height: $cta-panel-button-height; + line-height: $cta-panel-button-height - (2 * $cta-panel-button-border-size); + border-radius: $cta-panel-button-height; + border: $cta-panel-button-border-size solid #FFFFFF; + color: #FFFFFF; + font-size: 24px; + + &:hover { + color: #FFFFFF; + text-decoration: none; + background-color: rgba(255, 255, 255, 0.2); + } + + &:focus { + color: #FFFFFF; + text-decoration: none; + } +} + +.cta-panel-phone-cta { + color: rgba(255, 255, 255, 0.9); + text-align: center; + width: 293px; + margin-top: 12px; + margin-bottom: 0; +} diff --git a/app/assets/stylesheets/left_panel.scss b/app/assets/stylesheets/left_panel.scss index 0b250ab77..02658aab1 100644 --- a/app/assets/stylesheets/left_panel.scss +++ b/app/assets/stylesheets/left_panel.scss @@ -7,7 +7,7 @@ top: 0; left: 0; bottom: 0; - color: white; + color: #FFFFFF; overflow-y: scroll; #first-block { @@ -15,16 +15,19 @@ font-size: 16px; line-height: 18px; margin-top: 20px; + .infos { font-size: 25px; text-align: center; margin: 10px 10px 30px 0; + .projet-name { font-size: 25px; line-height: normal; padding: 5px; } } + .count { display: inline-block; padding: 3px; @@ -33,37 +36,49 @@ text-align: center; line-height: 23px; } + .text { display: inline-block; width: 30px; margin: 0 0 0 8px; } - .dossiers-en-cours, .en-cours { + + .dossiers-en-cours, + .en-cours { margin-top: 20px; } + .dossiers-en-cours { .count { border: 1px solid #FFFFFF; } } + .nouveaux-dossiers { .count { background-color: #5CB85C; } } + .nouvelles-notifications { .count { background-color: #E4594F; } } - .dossiers-en-cours, .nouveaux-dossiers, .nouvelles-notifications, .en-cours { + + .dossiers-en-cours, + .nouveaux-dossiers, + .nouvelles-notifications, + .en-cours { margin: 5px auto 0 20px; width: 150px; } } + #action-block { text-align: center; margin: 10px; + .action { background-color: #E45B51; text-align: center; @@ -78,7 +93,10 @@ border: none; width: 100%; } - .close-dossier, .refuse-dossier, .forget-dossier { + + .close-dossier, + .refuse-dossier, + .forget-dossier { border: 1px solid #FFFFFF; border-radius: 25px; margin: 5px; @@ -86,20 +104,27 @@ margin-right: auto; width: 60px; } - .close-dossier:hover, .refuse-dossier:hover, .forget-dossier:hover { + + .close-dossier:hover, + .refuse-dossier:hover, + .forget-dossier:hover { color: #000000; border-color: #000000; } + .close-dossier { background-color: #2A9E2A; } + .refuse-dossier { background-color: #E4594F; } + .forget-dossier { background-color: #FF8300; } } + #menu-block { #switch-buttons { height: 30px; @@ -113,19 +138,24 @@ padding: 0 0 0 10px; border-radius: 25px; cursor: pointer; + .active { background-color: #668ABD !important; cursor: default; } + .separator { height: 26px; width: 1px; display: inline-block; background-color: #FFFFFF; } - #switch-procedures:hover, #switch-notifications:hover { + + #switch-procedures:hover, + #switch-notifications:hover { background-color: #668AEA; } + #switch-procedures { height: 28px; margin: 0 0 0 -10px; @@ -134,6 +164,7 @@ display: inline-block; border-radius: 25px 0 0 25px; } + #switch-notifications { width: 103px; display: inline-block; @@ -143,45 +174,55 @@ padding: 0 0 0 5px; } } + .split-hr { border-bottom: 1px solid #FFFFFF; width: 200px; margin: 20px 0 20px 0; } } + #infos-block { .split-hr { border-bottom: 1px solid #FFFFFF; width: 200px; margin: 20px 0 20px 0; } + .dossier-state { text-align: center; font-size: 25px; - width: 200px; margin-top: 20px; width: 200px; margin-left: auto; margin-right: auto; } - #notifications_list { + + #notifications-list { .no-notification { margin: 0 30px 0 30px; } + .notification { padding: 10px 2px 10px 15px; - .dossier, .updated-at { + + .dossier, + .updated-at { display: inline-block; color: #CCCCCC; font-size: 12px; text-align: left; } - .dossier-index, .updated-at-index, .count { + + .dossier-index, + .updated-at-index, + .count { display: inline-block; color: #FFFFFF; font-size: 14px; text-align: left; } + .count { background-color: #F0AD4E; border-radius: 25px; @@ -189,33 +230,41 @@ width: 25px; text-align: center; } + .type-notif { font-size: 16px; } } } + .notifications { margin: 20px 10px 0 5px; + .fa { font-size: 25px; width: 100%; margin: 0 0 15px 0; } + .type-notif { font-size: 16px; float: right; width: 30px; } + .notification { margin: 10px 0 10px 10px; + .type { margin-bottom: 20px; } + .updated-at { color: #CCCCCC; font-size: 12px; text-align: left; } + .split-hr { width: 40px; margin: auto; diff --git a/app/assets/stylesheets/login.scss b/app/assets/stylesheets/login.scss index 364a3176b..6be7b6cb3 100644 --- a/app/assets/stylesheets/login.scss +++ b/app/assets/stylesheets/login.scss @@ -1,28 +1,28 @@ -#form_login{ +#form-login { text-align: center; - max-width:500px; + max-width: 500px; - margin-left:auto; - margin-right:auto; + margin-left: auto; + margin-right: auto; padding: 20px; - .btn_fc { + .btn-fc { img { height: 100px; } } - #new_user{ + #new-user { width: 80%; - margin-left:auto; - margin-right:auto; + margin-left: auto; + margin-right: auto; } hr { margin-bottom: 40px; - border: 0; + border: none; height: 1px; background-image: linear-gradient(to right, rgba(100, 100, 100, 0), rgba(100, 100, 100, 0.75), rgba(100, 100, 100, 0)); } diff --git a/app/assets/stylesheets/navbar.scss b/app/assets/stylesheets/navbar.scss index 1ed38032d..857b64d8f 100644 --- a/app/assets/stylesheets/navbar.scss +++ b/app/assets/stylesheets/navbar.scss @@ -1,4 +1,4 @@ -@import "variables"; +@import "constants"; #header { top: 0; @@ -8,25 +8,30 @@ z-index: 10; border-radius: 0; height: 60px; - #title_navbar{ - color: white; + + #title-navbar { + color: #FFFFFF; font-weight: bold; font-size: 1.8em; z-index: 10; overflow: hidden; } - #title_navbar:hover{ + + #title-navbar:hover { text-decoration: none; } + #home { text-align: center; - box-shadow: 0 1px 2px 0 rgba(0,0,0,0.5); + box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.5); background-color: #003189; height: 60px; + .logo { margin-top: 10px; height: 40px; } + #tps-title { font-family: Arial; font-size: 24px; @@ -35,11 +40,13 @@ margin-top: 17px; } } + #navbar-body { min-height: 60px; background-color: #FFFFFF; - box-shadow: 0 1px 2px 0 rgba(50,50,50,0.5); + box-shadow: 0 1px 2px 0 rgba(50, 50, 50, 0.5); padding-left: 50px; + .main-info { font-family: Arial; font-size: 18px; @@ -51,6 +58,7 @@ white-space: nowrap; text-overflow: ellipsis; } + .options { font-family: Arial; font-size: 14px; @@ -60,18 +68,22 @@ padding: 8px; border-right: 1px solid #C8C6C8; min-height: 60px; + .dropdown-toggle { cursor: pointer; } + .dropdown-pannel { min-height: 100px; width: 400px; padding-left: 10px; } + .centered-option { line-height: 40px; height: 40px; } + .caret-right { border-bottom: 4px solid transparent; border-top: 4px solid transparent; @@ -84,15 +96,16 @@ } } - #sign_in{ + #sign-in { margin-top: 7px; + .btn { float: right; margin-right: 15px; } } - #sign_out{ + #sign-out { height: 60px; .fa { @@ -103,6 +116,7 @@ margin-right: 0.5em; font-size: 40px; } + .fa:hover { color: #668ABD; } @@ -118,37 +132,33 @@ } .btn-nav { - color: white; + color: #FFFFFF; background-color: transparent; margin-top: 6px; height: 36px; } .btn-nav:hover { - background-color: #eeeeee; - border-color: #eeeeee #eeeeee #ddd; + background-color: #EEEEEE; + border-color: #EEEEEE #EEEEEE #DDDDDD; border-bottom-left-radius: 0; border-bottom-right-radius: 0; } .btn-nav.text-info:hover { - color: #23527c; + color: #23527C; } .btn-nav.text-success:hover { - color: #3c763d; + color: #3C763D; } .btn-nav.text-danger:hover { - color: #a94442; + color: #A94442; } .navbar { border: 0 !important; - .sign_in_FC { - margin-top: -18px; - height: 70px; - } } #beta { @@ -159,15 +169,15 @@ right: -35px; transform: rotate(-45deg); width: 150px; - background-color: #008cba; - color: #fff; + background-color: #008CBA; + color: #FFFFFF; padding: 5px; font-size: 15px; font-weight: 700; z-index: 10; } -.button_navbar { +.button-navbar { color: #666666; cursor: pointer; } @@ -181,16 +191,19 @@ text-align: center; padding: 2px; float: right; + .fa { font-size: 20px; margin-right: 10px; } } + .button-navbar-action:hover { color: $light-blue; } -.button_navbar:hover, .button-navbar-action:hover { +.button-navbar:hover, +.button-navbar-action:hover { text-decoration: none; } @@ -200,6 +213,7 @@ padding: 10px; left: -130px; text-align: center; + .description { font-weight: bold; font-size: 20px; diff --git a/app/assets/stylesheets/new_footer.scss b/app/assets/stylesheets/new_footer.scss new file mode 100644 index 000000000..ffdaa9e6b --- /dev/null +++ b/app/assets/stylesheets/new_footer.scss @@ -0,0 +1,69 @@ +@import "constants"; +@import "mixins"; +@import "placeholders"; +@import "typography"; + +.footer { + @extend %new-type; + @include vertical-padding(72px); + background-color: $light-grey; +} + +.footer-inner-content { + width: $page-width; + margin: 0 auto; +} + +.footer-columns { + @extend %horizontal-list; +} + +$footer-column-width: 320px; +$footer-column-count: 3; + +.footer-column { + @extend %horizontal-list-item; + width: $footer-column-width; + margin-right: calc((#{$page-width} - (#{$footer-column-width} * #{$footer-column-count})) / (#{$footer-column-count} - 1)); + font-size: 14px; + vertical-align: top; +} + +.footer-logos, +.footer-links { + list-style-type: none; + padding: 0; + margin: 0; +} + +.footer-link { + margin-bottom: 14px; + + &:last-of-type { + margin-bottom: 0; + } +} + +.footer-logo:hover { + opacity: 0.8; +} + +.footer-logo-rf { + width: 75px; + margin-bottom: 14px; +} + +.footer-logo-beta-gouv-fr { + width: 190px; +} + +.footer-link a { + color: $black; + text-decoration: none; + + &:hover, + &:focus { + color: $blue; + text-decoration: none; + } +} diff --git a/app/assets/stylesheets/notification_alert.scss b/app/assets/stylesheets/notification_alert.scss index 6ba4e8f0b..49e7d4893 100644 --- a/app/assets/stylesheets/notification_alert.scss +++ b/app/assets/stylesheets/notification_alert.scss @@ -1,4 +1,4 @@ -#notification_alert { +#notification-alert { position: fixed; top: 20px; right: -250px; @@ -8,5 +8,5 @@ width: 250px; height: 80px; - border: solid black 1px; + border: solid #000000 1px; } diff --git a/app/assets/stylesheets/pieces_justificatives_fields.scss b/app/assets/stylesheets/pieces_justificatives_fields.scss new file mode 100644 index 000000000..144c0fbe2 --- /dev/null +++ b/app/assets/stylesheets/pieces_justificatives_fields.scss @@ -0,0 +1,5 @@ +.pieces-justificatives-fields { + .form-inline > .form-group { + vertical-align: top; + } +} diff --git a/app/assets/stylesheets/pj_modal.scss b/app/assets/stylesheets/pj_modal.scss index 4f3ab1c4b..deba37dfc 100644 --- a/app/assets/stylesheets/pj_modal.scss +++ b/app/assets/stylesheets/pj_modal.scss @@ -1,7 +1,7 @@ -#PJmodal { +#pj-modal { .modal-body { .table { - .tr_content { + .tr-content { display: none; } } diff --git a/app/assets/stylesheets/pref_list_menu.scss b/app/assets/stylesheets/pref_list_menu.scss index af4a430a7..11920ade8 100644 --- a/app/assets/stylesheets/pref_list_menu.scss +++ b/app/assets/stylesheets/pref_list_menu.scss @@ -1,4 +1,4 @@ -#pref_list_menu{ +#pref-list-menu { z-index: 100; display: none; position: fixed; @@ -6,15 +6,10 @@ top: 10px; right: -470px; background-color: rgba(255, 255, 255, 0.95); - border-left: solid 1px lightgrey; + border-left: solid 1px #D3D3D3; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2); width: 470px; height: calc(100% - 25px); padding: 15px; overflow-y: scroll; } - -.open_pref_list { - right: 0 !important; - display: block !important; -} diff --git a/app/assets/stylesheets/print.scss b/app/assets/stylesheets/print.scss index bdbc39347..4d0ef86b3 100644 --- a/app/assets/stylesheets/print.scss +++ b/app/assets/stylesheets/print.scss @@ -1,30 +1,18 @@ @media print { - html, body { + html, + body { margin: 0; } - #main_div{ - margin-left: 50px; - margin-right: 0; - } - - #commentaire_new { + #infos-dossiers .row:last-child { display: none; } - #commentaires_flux { - margin-top: -50px; - } - - #infos_dossier .row:last-child { - display: none; - } - - #infos_dossier { + #infos-dossiers { margin-bottom: -70px; } - #backoffice_dossier_show .nav-tabs { + #backoffice-dossier-show .nav-tabs { display: none; } diff --git a/app/assets/stylesheets/procedure.scss b/app/assets/stylesheets/procedure.scss index bb353956f..b1e5194f5 100644 --- a/app/assets/stylesheets/procedure.scss +++ b/app/assets/stylesheets/procedure.scss @@ -1,12 +1,12 @@ -#modules_api_carto { +#modules-api-carto { display: none; } -#procedure_lien_demarche{ +#procedure-lien-demarche { display: none; } -#individual_with_siret { +#individual-with-siret { display: none; } diff --git a/app/assets/stylesheets/recapitulatif.scss b/app/assets/stylesheets/recapitulatif.scss index 7d81a7c46..7a07fbd75 100644 --- a/app/assets/stylesheets/recapitulatif.scss +++ b/app/assets/stylesheets/recapitulatif.scss @@ -1,4 +1,4 @@ -#UploadPJmodal { +#upload-pj-modal { text-align: left; table { diff --git a/app/assets/stylesheets/search.scss b/app/assets/stylesheets/search.scss index ce3219ac5..26e91409a 100644 --- a/app/assets/stylesheets/search.scss +++ b/app/assets/stylesheets/search.scss @@ -1,13 +1,13 @@ -#search-block{ +#search-block { margin: 15px 10px 0 10px; height: 30px; } -#search_button { +#search-button { height: 34px; } -#mask_search{ +#mask-search { display: none; position: fixed; background-color: rgba(0, 0, 0, 0.4); diff --git a/app/assets/stylesheets/siret.scss b/app/assets/stylesheets/siret.scss index c5eac6f02..e5bdf2050 100644 --- a/app/assets/stylesheets/siret.scss +++ b/app/assets/stylesheets/siret.scss @@ -6,7 +6,7 @@ display: none; } -#titre_procedure { +#titre-procedure { margin-top: 3%; margin-bottom: 2%; } diff --git a/app/assets/stylesheets/stats.scss b/app/assets/stylesheets/stats.scss index 48d602275..42fef6ac1 100644 --- a/app/assets/stylesheets/stats.scss +++ b/app/assets/stylesheets/stats.scss @@ -8,6 +8,7 @@ $blue-hover: rgba(61, 149, 236, 0.8); $default-space: 15px; $new-h1-margin-bottom: 4 * $default-space; + .new-h1 { color: $dark-grey; text-align: center; @@ -16,6 +17,7 @@ $new-h1-margin-bottom: 4 * $default-space; } $statistiques-padding-top: $default-space * 2; + .statistiques { width: 1040px; margin: 0 auto; @@ -29,8 +31,8 @@ $statistiques-padding-top: $default-space * 2; } $stat-card-margin-bottom: 3 * $default-space; + .stat-card { - @extend .card; margin-bottom: $stat-card-margin-bottom; border-radius: 5px; box-shadow: none; @@ -38,6 +40,7 @@ $stat-card-margin-bottom: 3 * $default-space; } $stat-card-half-horizontal-spacing: 4 * $default-space; + .stat-card-half { width: calc((100% - #{$stat-card-half-horizontal-spacing}) / 2); margin-right: 3 * $default-space; @@ -51,6 +54,7 @@ $stat-card-half-horizontal-spacing: 4 * $default-space; } $segmented-control-margin-top: $default-space; + .segmented-control { border-radius: 36px; height: 36px; @@ -63,8 +67,8 @@ $segmented-control-margin-top: $default-space; $segmented-control-item-horizontal-padding: $default-space; $segmented-control-item-border-radius: 2 * $default-space; + .segmented-control-item { - color: $blue; display: inline-block; font-size: 15px; border: 2px solid $blue; @@ -84,14 +88,14 @@ $segmented-control-item-border-radius: 2 * $default-space; &:hover { background-color: $blue-hover; - color: white; + color: #FFFFFF; cursor: pointer; } } .segmented-control-item-active { background-color: $blue; - color: white; + color: #FFFFFF; } .chart-container { @@ -103,6 +107,7 @@ $segmented-control-item-border-radius: 2 * $default-space; } $big-number-card-padding: 2 * $segmented-control-item-border-radius; + .big-number-card { padding: $big-number-card-padding; } diff --git a/app/assets/stylesheets/support_navigator_banner.scss b/app/assets/stylesheets/support_navigator_banner.scss index bb6651142..bfb8a21fe 100644 --- a/app/assets/stylesheets/support_navigator_banner.scss +++ b/app/assets/stylesheets/support_navigator_banner.scss @@ -1,15 +1,16 @@ -#support_navigator_banner{ +#support-navigator-banner { position: fixed; - text-align:center; + text-align: center; line-height: 2em; - color: white; + color: #FFFFFF; background-color: #990000; width: 100%; margin: 0; bottom: 0; left: 0; z-index: 1000; - a{ - color: #c3d9ff; + + a { + color: #C3D9FF; } } diff --git a/app/assets/stylesheets/switch_menu.scss b/app/assets/stylesheets/switch_menu.scss index a7c66e6c1..e9c18733c 100644 --- a/app/assets/stylesheets/switch_menu.scss +++ b/app/assets/stylesheets/switch_menu.scss @@ -1,4 +1,4 @@ -#switch_menu{ +#switch-menu { position: fixed; left: 10px; bottom: 10px; diff --git a/app/assets/stylesheets/typeahead.scss b/app/assets/stylesheets/typeahead.scss index c22dbf622..1c6d87816 100644 --- a/app/assets/stylesheets/typeahead.scss +++ b/app/assets/stylesheets/typeahead.scss @@ -1,18 +1,13 @@ .twitter-typeahead { - width: 100%; // http://stackoverflow.com/questions/17957513/extending-the-width-of-bootstrap-typeahead-to-match-input-field + width: 100%; // http://stackoverflow.com/questions/17957513/extending-the-width-of-bootstrap-typeahead-to-match-input-field } .tt-menu { padding: 8px 0; - background-color: #fff; - border: 1px solid #ccc; + background-color: #FFFFFF; border: 1px solid rgba(0, 0, 0, 0.2); - -webkit-border-radius: 8px; - -moz-border-radius: 8px; border-radius: 8px; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2); - -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, .2); - box-shadow: 0 5px 10px rgba(0, 0, 0, .2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); } .tt-suggestion { @@ -23,12 +18,12 @@ .tt-suggestion:hover { cursor: pointer; - color: #fff; - background-color: #0097cf; + color: #FFFFFF; + background-color: #0097CF; } .tt-suggestion.tt-cursor { - color: #fff; - background-color: #0097cf; + color: #FFFFFF; + background-color: #0097CF; } diff --git a/app/assets/stylesheets/ul.scss b/app/assets/stylesheets/ul.scss deleted file mode 100644 index 25f26e3a5..000000000 --- a/app/assets/stylesheets/ul.scss +++ /dev/null @@ -1,14 +0,0 @@ -.dynamic_ul { - margin-left: 20px; - margin-top: 13%; - - li { - font: 200 20px/1.5 Helvetica, Verdana, sans-serif; - margin-top: 15px; - margin-bottom: 15px; - } - - li:last-child { - border: none; - } -} diff --git a/app/assets/stylesheets/users.scss b/app/assets/stylesheets/users.scss index bdf586ad3..08f0c5f10 100644 --- a/app/assets/stylesheets/users.scss +++ b/app/assets/stylesheets/users.scss @@ -1,43 +1,48 @@ -@import "variables"; +@import "constants"; -#users_index, #admins_index{ +#users-index, +#admins-index { margin-left: 2rem; margin-right: 2rem; - .default_data_block { + .default-data-block { margin-top: 20px; background-color: #FFFFFF; + .show-block { width: 100%; } + .body { height: auto; } } } -#users_siret_index { +#users-siret-index { margin: 20px; } -#description_page { -} - -#carto_page { +#carto-page { margin: 20px; } .white-back { margin: 20px !important; + #previsualisation { margin-top: 30px; } } -.white-back, #users_siret_index, #description_page, #carto_page { +.white-back, +#users-siret-index, +#description-page, +#carto-page { background-color: #FFFFFF; box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.5); padding: 20px; + .action { background-color: #E45B51; text-align: center; @@ -49,12 +54,15 @@ border: none; padding: 10px; } + .action:hover { color: $light-blue; } + .padding-left-30 { padding-left: 30px; } + h3 { margin-bottom: 20px; } diff --git a/app/controllers/admin/pieces_justificatives_controller.rb b/app/controllers/admin/pieces_justificatives_controller.rb index c899e3486..0f6d14987 100644 --- a/app/controllers/admin/pieces_justificatives_controller.rb +++ b/app/controllers/admin/pieces_justificatives_controller.rb @@ -25,7 +25,7 @@ class Admin::PiecesJustificativesController < AdminController def update_params params .require(:procedure) - .permit(types_de_piece_justificative_attributes: [:libelle, :description, :id, :order_place, :lien_demarche]) + .permit(types_de_piece_justificative_attributes: [:libelle, :description, :id, :order_place, :mandatory, :lien_demarche]) end def move_up diff --git a/app/controllers/api/v1/dossiers_controller.rb b/app/controllers/api/v1/dossiers_controller.rb index 0cf231f7b..e77e11351 100644 --- a/app/controllers/api/v1/dossiers_controller.rb +++ b/app/controllers/api/v1/dossiers_controller.rb @@ -6,10 +6,6 @@ class API::V1::DossiersController < APIController error code: 401, desc: "Non authorisé" error code: 404, desc: "Procédure inconnue" - description <<-EOS - Plop - EOS - meta champs: { } @@ -17,8 +13,8 @@ class API::V1::DossiersController < APIController procedure = current_administrateur.procedures.find(params[:procedure_id]) dossiers = procedure.dossiers.where.not(state: :draft).paginate(page: params[:page]) - render json: {dossiers: dossiers.map{|dossier| DossiersSerializer.new(dossier)}, pagination: pagination(dossiers)}, status: 200 - rescue ActiveRecord::RecordNotFound => e + render json: { dossiers: dossiers.map{ |dossier| DossiersSerializer.new(dossier) }, pagination: pagination(dossiers) }, status: 200 + rescue ActiveRecord::RecordNotFound render json: {}, status: 404 end @@ -29,10 +25,6 @@ class API::V1::DossiersController < APIController error code: 401, desc: "Non authorisé" error code: 404, desc: "Procédure ou dossier inconnu" - description <<-EOS - Plop - EOS - meta champs: { } @@ -42,10 +34,9 @@ class API::V1::DossiersController < APIController dossier = procedure.dossiers.find(params[:id]) respond_to do |format| - format.json { render json: {dossier: DossierSerializer.new(dossier).as_json}, status: 200 } - format.csv { render csv: dossier.as_csv, status: 200 } + format.json { render json: { dossier: DossierSerializer.new(dossier).as_json }, status: 200 } end - rescue ActiveRecord::RecordNotFound => e + rescue ActiveRecord::RecordNotFound render json: {}, status: 404 end diff --git a/app/controllers/api/v1/procedures_controller.rb b/app/controllers/api/v1/procedures_controller.rb index bc712abb0..b8a9fbdaa 100644 --- a/app/controllers/api/v1/procedures_controller.rb +++ b/app/controllers/api/v1/procedures_controller.rb @@ -5,10 +5,6 @@ class API::V1::ProceduresController < APIController error code: 401, desc: "Non authorisé" error code: 404, desc: "Procédure inconnue" - description <<-EOS - Plop - EOS - meta champs: { } diff --git a/app/controllers/backoffice/private_formulaires_controller.rb b/app/controllers/backoffice/private_formulaires_controller.rb index 81a728085..0353b02f3 100644 --- a/app/controllers/backoffice/private_formulaires_controller.rb +++ b/app/controllers/backoffice/private_formulaires_controller.rb @@ -5,12 +5,13 @@ class Backoffice::PrivateFormulairesController < ApplicationController dossier = current_gestionnaire.dossiers.find(params[:dossier_id]) unless params[:champs].nil? - champs_service_errors = ChampsService.save_champs dossier.champs_private, params + ChampsService.save_champs dossier.champs_private, params + champs_service_errors = ChampsService.build_error_messages(dossier.champs_private) if champs_service_errors.empty? flash[:notice] = "Formulaire enregistré" else - flash[:alert] = (champs_service_errors.inject('') { |acc, error| acc+= error[:message]+'
    ' }).html_safe + flash[:alert] = champs_service_errors.join('
    ').html_safe end end diff --git a/app/controllers/root_controller.rb b/app/controllers/root_controller.rb index 61500da6b..ec123d601 100644 --- a/app/controllers/root_controller.rb +++ b/app/controllers/root_controller.rb @@ -39,6 +39,6 @@ class RootController < ApplicationController @demo_environment_host = "https://tps-dev.apientreprise.fr" unless Rails.env.development? - render 'landing' + render 'landing', :layout => 'new_application' end end diff --git a/app/controllers/users/carte_controller.rb b/app/controllers/users/carte_controller.rb index 0b8a328e9..f38f52ab5 100644 --- a/app/controllers/users/carte_controller.rb +++ b/app/controllers/users/carte_controller.rb @@ -15,8 +15,8 @@ class Users::CarteController < UsersController def save dossier = current_user_dossier - dossier.quartier_prioritaires.map(&:destroy) - dossier.cadastres.map(&:destroy) + dossier.quartier_prioritaires.each(&:destroy) + dossier.cadastres.each(&:destroy) unless params[:json_latlngs].blank? ModuleApiCartoService.save_qp! dossier, params[:json_latlngs] diff --git a/app/controllers/users/description_controller.rb b/app/controllers/users/description_controller.rb index a45a402fb..bdd38cce9 100644 --- a/app/controllers/users/description_controller.rb +++ b/app/controllers/users/description_controller.rb @@ -24,50 +24,38 @@ class Users::DescriptionController < UsersController end def update - @dossier = current_user_dossier - @procedure = @dossier.procedure + dossier = current_user_dossier + procedure = dossier.procedure - return head :forbidden unless @dossier.can_be_initiated? + return head :forbidden unless dossier.can_be_initiated? - @champs = @dossier.ordered_champs + ChampsService.save_champs(dossier.champs, params) if params[:champs] - check_mandatory_fields = !draft_submission? - - if params[:champs] - champs_service_errors = ChampsService.save_champs @dossier.champs, - params, - check_mandatory_fields - - unless champs_service_errors.empty? - flash.alert = (champs_service_errors.inject('') { |acc, error| acc+= error[:message]+'
    ' }).html_safe - return redirect_to users_dossier_description_path(dossier_id: @dossier.id) - end + if procedure.cerfa_flag? && params[:cerfa_pdf] + cerfa = Cerfa.new(content: params[:cerfa_pdf], dossier: dossier, user: current_user) + return redirect_to_description_with_errors(dossier, cerfa.errors.full_messages) unless cerfa.save end - if @procedure.cerfa_flag? && params[:cerfa_pdf] - cerfa = Cerfa.new(content: params[:cerfa_pdf], dossier: @dossier, user: current_user) - unless cerfa.save - flash.alert = cerfa.errors.full_messages.join('
    ').html_safe - return redirect_to users_dossier_description_path(dossier_id: @dossier.id) - end - end + errors_upload = PiecesJustificativesService.upload!(dossier, current_user, params) + return redirect_to_description_with_errors(dossier, errors_upload) if errors_upload.any? - errors_upload = PiecesJustificativesService.upload!(@dossier, current_user, params) - unless errors_upload.empty? - flash.alert = errors_upload.html_safe - return redirect_to users_dossier_description_path(dossier_id: @dossier.id) + if params[:champs] && !draft_submission? + errors = + ChampsService.build_error_messages(dossier.champs) + + PiecesJustificativesService.missing_pj_error_messages(dossier) + return redirect_to_description_with_errors(dossier, errors) if errors.any? end if draft_submission? flash.notice = 'Votre brouillon a bien été sauvegardé.' redirect_to url_for(controller: :dossiers, action: :index, liste: :brouillon) else - if @dossier.draft? - @dossier.initiated! - NotificationMailer.send_notification(@dossier, @dossier.procedure.initiated_mail).deliver_now! + if dossier.draft? + dossier.initiated! + NotificationMailer.send_notification(dossier, procedure.initiated_mail).deliver_now! end flash.notice = 'Félicitations, votre demande a bien été enregistrée.' - redirect_to url_for(controller: :recapitulatif, action: :show, dossier_id: @dossier.id) + redirect_to url_for(controller: :recapitulatif, action: :show, dossier_id: dossier.id) end end @@ -88,9 +76,9 @@ class Users::DescriptionController < UsersController if !((errors_upload = PiecesJustificativesService.upload!(@dossier, current_user, params)).empty?) if flash.alert.nil? - flash.alert = errors_upload.html_safe + flash.alert = errors_upload.join('
    ').html_safe else - flash.alert = (flash.alert + '
    ' + errors_upload.html_safe).html_safe + flash.alert = (flash.alert + '
    ' + errors_upload.join('
    ').html_safe).html_safe end else @@ -111,6 +99,11 @@ class Users::DescriptionController < UsersController private + def redirect_to_description_with_errors(dossier, errors) + flash.alert = errors.join('
    ') + redirect_to users_dossier_description_path(dossier_id: dossier.id) + end + def draft_submission? params[:submit] && params[:submit].keys.first == 'brouillon' end diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index 4eade942c..8f42f2581 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -10,19 +10,29 @@ class Users::DossiersController < UsersController end def index - cookies[:liste] = param_liste + @liste ||= params[:liste] || 'a_traiter' - @dossiers_list_facade = DossiersListFacades.new current_user, param_liste + @user_dossiers = current_user.dossiers - unless DossiersListUserService.dossiers_liste_libelle.include?(param_liste) - cookies[:liste] = 'a_traiter' + @dossiers_filtered = case @liste + when 'brouillon' + @user_dossiers.brouillon.order_by_updated_at + when 'a_traiter' + @user_dossiers.en_construction.order_by_updated_at + when 'en_instruction' + @user_dossiers.en_instruction.order_by_updated_at + when 'termine' + @user_dossiers.termine.order_by_updated_at + when 'invite' + current_user.invites + else return redirect_to users_dossiers_path end @dossiers = smart_listing_create :dossiers, - @dossiers_list_facade.dossiers_to_display, - partial: "users/dossiers/list", - array: true + @dossiers_filtered, + partial: "users/dossiers/list", + array: true end def commencer @@ -154,9 +164,9 @@ class Users::DossiersController < UsersController redirect_to url_for users_dossiers_path end - def procedure_libelle + def text_summary dossier = Dossier.find(params[:dossier_id]) - render json: { procedureLibelle: dossier.procedure.libelle } + render json: { textSummary: dossier.text_summary } rescue ActiveRecord::RecordNotFound render json: {}, status: 404 end @@ -222,8 +232,4 @@ class Users::DossiersController < UsersController def facade id = params[:id] DossierFacades.new id, current_user.email end - - def param_liste - @liste ||= params[:liste] || cookies[:liste] || 'a_traiter' - end end diff --git a/app/controllers/users/sessions_controller.rb b/app/controllers/users/sessions_controller.rb index fee9dfad2..3e8efd878 100644 --- a/app/controllers/users/sessions_controller.rb +++ b/app/controllers/users/sessions_controller.rb @@ -54,10 +54,11 @@ class Users::SessionsController < Sessions::SessionsController sign_out :user - if connected_with_france_connect == 'entreprise' + case connected_with_france_connect + when 'entreprise' redirect_to FRANCE_CONNECT.entreprise_logout_endpoint return - elsif connected_with_france_connect == 'particulier' + when 'particulier' redirect_to FRANCE_CONNECT.particulier_logout_endpoint return end diff --git a/app/decorators/notification_decorator.rb b/app/decorators/notification_decorator.rb index 0763f1dc2..23cc86273 100644 --- a/app/decorators/notification_decorator.rb +++ b/app/decorators/notification_decorator.rb @@ -3,6 +3,6 @@ class NotificationDecorator < Draper::Decorator def index_display ['champs', 'piece_justificative'].include?(type_notif) ? type = liste.join(" ") : type = liste.last - { dossier: "Dossier n°#{dossier.id}", date: created_at.strftime('%d/%m %H:%M'), type: type } + { dossier: "Dossier nº #{dossier.id}", date: created_at.strftime('%d/%m %H:%M'), type: type } end end diff --git a/app/decorators/user_decorator.rb b/app/decorators/user_decorator.rb index d870ccd0a..8f77dc857 100644 --- a/app/decorators/user_decorator.rb +++ b/app/decorators/user_decorator.rb @@ -2,8 +2,12 @@ class UserDecorator < Draper::Decorator delegate_all def gender_fr - return 'M.' if gender == 'male' - return 'Mme' if gender == 'female' + case gender + when 'male' + 'M.' + when 'female' + 'Mme' + end end def birthdate_fr diff --git a/app/facades/dossiers_list_facades.rb b/app/facades/dossiers_list_facades.rb index 52e5672ea..016d007d8 100644 --- a/app/facades/dossiers_list_facades.rb +++ b/app/facades/dossiers_list_facades.rb @@ -10,11 +10,7 @@ class DossiersListFacades end def service - if gestionnaire? - @service ||= DossiersListGestionnaireService.new @current_devise_profil, @liste, @procedure - elsif user? - @service ||= DossiersListUserService.new @current_devise_profil, @liste - end + @service ||= DossiersListGestionnaireService.new @current_devise_profil, @liste, @procedure end def total_dossier @@ -63,84 +59,24 @@ class DossiersListFacades preference_list_dossiers_filter.where(table: :champs).where.not(filter: '').size == 0 end - def all_state_class - (@liste == 'all_state' ? 'active' : '') - end - - def brouillon_class - (@liste == 'brouillon' ? 'active' : '') - end - - def en_construction_class - (@liste == 'a_traiter' ? 'active' : '') - end - - def valides_class - (@liste == 'valides' ? 'active' : '') - end - - def en_instruction_class - (@liste == 'en_instruction' ? 'active' : '') - end - - def termine_class - (@liste == 'termine' ? 'active' : '') - end - - def invite_class - (@liste == 'invite' ? 'active' : '') - end - def all_state_total service.all_state.count end - def brouillon_total - service.brouillon.count - end - def nouveaux_total service.nouveaux.count end - def en_construction_total - service.en_construction.count - end - - def valides_total - service.valides.count - end - - def en_instruction_total - service.en_instruction.count - end - - def termine_total - service.termine.count - end - def suivi_total service.suivi.count end - def invite_total - service.invite.count - end - def filter_url @procedure.nil? ? backoffice_dossiers_filter_path(liste: liste) : backoffice_dossiers_procedure_filter_path(id: @procedure.id, liste: liste) end private - def gestionnaire? - @current_devise_profil.class == Gestionnaire - end - - def user? - @current_devise_profil.class == User - end - def base_url liste @procedure.nil? ? backoffice_dossiers_path(liste: liste) : backoffice_dossiers_procedure_path(id: @procedure.id, liste: liste) end diff --git a/app/mailers/notification_mailer.rb b/app/mailers/notification_mailer.rb index 185543d22..1fa5265ea 100644 --- a/app/mailers/notification_mailer.rb +++ b/app/mailers/notification_mailer.rb @@ -12,7 +12,7 @@ class NotificationMailer < ApplicationMailer end def new_answer dossier - send_mail dossier, "Nouveau message pour votre dossier TPS N°#{dossier.id}" + send_mail dossier, "Nouveau message pour votre dossier TPS nº #{dossier.id}" end private diff --git a/app/models/commentaire.rb b/app/models/commentaire.rb index 09c147dd4..0e39e5eba 100644 --- a/app/models/commentaire.rb +++ b/app/models/commentaire.rb @@ -7,7 +7,7 @@ class Commentaire < ActiveRecord::Base after_save :internal_notification def header - "#{email}, " + created_at.localtime.strftime('%d %b %Y %H:%M') + "#{email}, " + I18n.l(created_at.localtime, format: '%d %b %Y %H:%M') end private diff --git a/app/models/dossier.rb b/app/models/dossier.rb index bdadb8c00..17c7bf03e 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -1,6 +1,4 @@ class Dossier < ActiveRecord::Base - include SpreadsheetArchitect - enum state: {draft: 'draft', initiated: 'initiated', replied: 'replied', #action utilisateur demandé @@ -24,6 +22,7 @@ class Dossier < ActiveRecord::Base has_many :commentaires, dependent: :destroy has_many :invites, dependent: :destroy has_many :invites_user, class_name: 'InviteUser', dependent: :destroy + has_many :invites_gestionnaires, class_name: 'InviteGestionnaire', dependent: :destroy has_many :follows has_many :notifications, dependent: :destroy @@ -113,62 +112,64 @@ class Dossier < ActiveRecord::Base fail 'role is not valid' end - if role == 'user' + case role + when 'user' case action - when 'initiate' - if draft? - initiated! - end - when 'update' - if replied? - updated! - end - when 'comment' - if replied? - updated! - end + when 'initiate' + if draft? + initiated! + end + when 'update' + if replied? + updated! + end + when 'comment' + if replied? + updated! + end end - elsif role == 'gestionnaire' + when 'gestionnaire' case action - when 'comment' - if updated? - replied! - elsif initiated? - replied! - end - when 'follow' - if initiated? - updated! - end - when 'close' - if received? - closed! - end - when 'refuse' - if received? - refused! - end - when 'without_continuation' - if received? - without_continuation! - end + when 'comment' + if updated? + replied! + elsif initiated? + replied! + end + when 'follow' + if initiated? + updated! + end + when 'close' + if received? + closed! + end + when 'refuse' + if received? + refused! + end + when 'without_continuation' + if received? + without_continuation! + end end end - state - end - def brouillon? - BROUILLON.include?(state) + state end def self.all_state order = 'ASC' where(state: ALL_STATE, archived: false).order("updated_at #{order}") end - def self.brouillon order = 'ASC' - where(state: BROUILLON, archived: false).order("updated_at #{order}") + def brouillon? + BROUILLON.include?(state) end + scope :brouillon, -> { where(state: BROUILLON) } + + scope :order_by_updated_at, -> (order = :desc) { order(updated_at: order) } + def self.nouveaux order = 'ASC' where(state: NOUVEAUX, archived: false).order("updated_at #{order}") end @@ -181,7 +182,7 @@ class Dossier < ActiveRecord::Base where(state: WAITING_FOR_USER, archived: false).order("updated_at #{order}") end - scope :en_construction, -> { where(state: EN_CONSTRUCTION, archived: false).order(updated_at: :asc) } + scope :en_construction, -> { where(state: EN_CONSTRUCTION) } def self.ouvert order = 'ASC' where(state: OUVERT, archived: false).order("updated_at #{order}") @@ -191,15 +192,12 @@ class Dossier < ActiveRecord::Base where(state: A_INSTRUIRE, archived: false).order("updated_at #{order}") end - def self.en_instruction order = 'ASC' - where(state: EN_INSTRUCTION, archived: false).order("updated_at #{order}") - end + scope :en_instruction, -> { where(state: EN_INSTRUCTION) } - def self.termine order = 'ASC' - where(state: TERMINE, archived: false).order("updated_at #{order}") - end + scope :termine, -> { where(state: TERMINE) } scope :archived, -> { where(archived: true) } + scope :not_archived, -> { where(archived: false) } scope :downloadable, -> { all_state } @@ -233,19 +231,8 @@ class Dossier < ActiveRecord::Base return convert_specific_hash_values_to_string(etablissement_attr.merge(entreprise_attr)) end - def export_default_columns - dossier_attr = DossierSerializer.new(self).attributes - dossier_attr = convert_specific_hash_values_to_string(dossier_attr) - dossier_attr = dossier_attr.merge(self.export_entreprise_data) - return dossier_attr - end - - def spreadsheet_columns - self.export_default_columns.to_a - end - def data_with_champs - serialized_dossier = DossierProcedureSerializer.new(self) + serialized_dossier = DossierTableExportSerializer.new(self) data = serialized_dossier.attributes.values data += self.champs.order('type_de_champ_id ASC').map(&:value) data += self.export_entreprise_data.values @@ -253,15 +240,15 @@ class Dossier < ActiveRecord::Base end def export_headers - serialized_dossier = DossierProcedureSerializer.new(self) + serialized_dossier = DossierTableExportSerializer.new(self) headers = serialized_dossier.attributes.keys headers += self.procedure.types_de_champ.order('id ASC').map { |types_de_champ| types_de_champ.libelle.parameterize.underscore.to_sym } headers += self.export_entreprise_data.keys return headers end - def followers_gestionnaires_emails - follows.includes(:gestionnaire).map { |f| f.gestionnaire }.pluck(:email).join(' ') + def followers_gestionnaires + follows.includes(:gestionnaire).map(&:gestionnaire) end def reset! @@ -291,6 +278,28 @@ class Dossier < ActiveRecord::Base !(procedure.archived && draft?) end + def text_summary + if brouillon? + parts = [ + "Dossier en brouillon répondant à la démarche ", + procedure.libelle, + ", gérée par l'organisme ", + procedure.organisation + ] + else + parts = [ + "Dossier déposé le ", + initiated_at.strftime("%d/%m/%Y"), + ", sur la démarche ", + procedure.libelle, + ", gérée par l'organisme ", + procedure.organisation + ] + end + + parts.join + end + private def update_state_dates @@ -306,5 +315,4 @@ class Dossier < ActiveRecord::Base def serialize_value_for_export(value) value.nil? || value.kind_of?(Time) ? value : value.to_s end - end diff --git a/app/models/gestionnaire.rb b/app/models/gestionnaire.rb index ada358189..d646d7177 100644 --- a/app/models/gestionnaire.rb +++ b/app/models/gestionnaire.rb @@ -98,6 +98,10 @@ class Gestionnaire < ActiveRecord::Base 0 end + def dossiers_with_notifications_count + notifications.pluck(:dossier_id).uniq.count + end + private def valid_couple_table_attr? table, column diff --git a/app/models/mails/closed_mail.rb b/app/models/mails/closed_mail.rb index 3db0d84dc..2d113f71d 100644 --- a/app/models/mails/closed_mail.rb +++ b/app/models/mails/closed_mail.rb @@ -3,7 +3,7 @@ module Mails include MailTemplateConcern DISPLAYED_NAME = "Accusé d'acceptation" - DEFAULT_OBJECT = 'Votre dossier TPS N°--numero_dossier-- a été accepté' + DEFAULT_OBJECT = 'Votre dossier TPS nº --numero_dossier-- a été accepté' end end diff --git a/app/models/mails/initiated_mail.rb b/app/models/mails/initiated_mail.rb index e39aa0e7a..4f401e65e 100644 --- a/app/models/mails/initiated_mail.rb +++ b/app/models/mails/initiated_mail.rb @@ -3,7 +3,7 @@ module Mails include MailTemplateConcern DISPLAYED_NAME = 'Accusé de réception' - DEFAULT_OBJECT = 'Votre dossier TPS N°--numero_dossier-- a été bien reçu' + DEFAULT_OBJECT = 'Votre dossier TPS nº --numero_dossier-- a été bien reçu' end end diff --git a/app/models/mails/received_mail.rb b/app/models/mails/received_mail.rb index 41344f6ca..be65a36b2 100644 --- a/app/models/mails/received_mail.rb +++ b/app/models/mails/received_mail.rb @@ -3,7 +3,7 @@ module Mails include MailTemplateConcern DISPLAYED_NAME = 'Accusé de passage en instruction' - DEFAULT_OBJECT = 'Votre dossier TPS N°--numero_dossier-- va être instruit' + DEFAULT_OBJECT = 'Votre dossier TPS nº --numero_dossier-- va être instruit' end end diff --git a/app/models/mails/refused_mail.rb b/app/models/mails/refused_mail.rb index a1a1af8b4..281788535 100644 --- a/app/models/mails/refused_mail.rb +++ b/app/models/mails/refused_mail.rb @@ -3,7 +3,7 @@ module Mails include MailTemplateConcern DISPLAYED_NAME = 'Accusé de rejet du dossier' - DEFAULT_OBJECT = 'Votre dossier TPS N°--numero_dossier-- a été refusé' + DEFAULT_OBJECT = 'Votre dossier TPS nº --numero_dossier-- a été refusé' end end diff --git a/app/models/mails/without_continuation_mail.rb b/app/models/mails/without_continuation_mail.rb index da9724cf6..3d3bd8f74 100644 --- a/app/models/mails/without_continuation_mail.rb +++ b/app/models/mails/without_continuation_mail.rb @@ -3,7 +3,7 @@ module Mails include MailTemplateConcern DISPLAYED_NAME = 'Accusé de classement sans suite' - DEFAULT_OBJECT = 'Votre dossier TPS N°--numero_dossier-- a été classé sans suite' + DEFAULT_OBJECT = 'Votre dossier TPS nº --numero_dossier-- a été classé sans suite' end end diff --git a/app/models/notification.rb b/app/models/notification.rb index 4ff810f37..af36da06e 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -1,8 +1,5 @@ class Notification < ActiveRecord::Base belongs_to :dossier - - # after_save :broadcast_notification - enum type_notif: { commentaire: 'commentaire', cerfa: 'cerfa', @@ -10,10 +7,5 @@ class Notification < ActiveRecord::Base champs: 'champs', submitted: 'submitted' } - - # def broadcast_notification - # ActionCable.server.broadcast 'notifications', - # message: "Dossier n°#{self.dossier.id} : #{self.liste.last}", - # dossier: {id: self.dossier.id} - # end + scope :unread, -> { where(already_read: false) } end diff --git a/app/models/preference_list_dossier.rb b/app/models/preference_list_dossier.rb index b7880d5c1..60ec5b82c 100644 --- a/app/models/preference_list_dossier.rb +++ b/app/models/preference_list_dossier.rb @@ -36,7 +36,7 @@ class PreferenceListDossier < ActiveRecord::Base table = nil { - dossier_id: create_column('N°', table, 'id', 'id', 1), + dossier_id: create_column('Nº', table, 'id', 'id', 1), 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), state: create_column('État', table, 'state', 'display_state', 1) diff --git a/app/models/procedure.rb b/app/models/procedure.rb index 3d4edf63f..2e910acd3 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -3,6 +3,7 @@ class Procedure < ActiveRecord::Base has_many :types_de_champ, class_name: 'TypeDeChampPublic', dependent: :destroy has_many :types_de_champ_private, dependent: :destroy has_many :dossiers + has_many :notifications, through: :dossiers has_one :procedure_path, dependent: :destroy @@ -47,13 +48,15 @@ class Procedure < ActiveRecord::Base end scope :not_archived, -> { where(archived: false) } + scope :by_libelle, -> { order(libelle: :asc) } + def path procedure_path.path unless procedure_path.nil? end def default_path - libelle.downcase.gsub(/[^a-z0-9\-_]/, "_").gsub(/_*$/, '').gsub(/_+/, '_') + libelle.parameterize.first(50) end def types_de_champ_ordered diff --git a/app/models/procedure_path.rb b/app/models/procedure_path.rb index e68942ff1..98fd4e3d1 100644 --- a/app/models/procedure_path.rb +++ b/app/models/procedure_path.rb @@ -1,5 +1,5 @@ class ProcedurePath < ActiveRecord::Base - validates :path, procedure_path_format: true, presence: true, allow_blank: false, allow_nil: false + validates :path, format: { with: /\A[a-z0-9_\-]{3,50}\z/ }, presence: true, allow_blank: false, allow_nil: false validates :administrateur_id, presence: true, allow_blank: false, allow_nil: false validates :procedure_id, presence: true, allow_blank: false, allow_nil: false diff --git a/app/serializers/dossier_procedure_serializer.rb b/app/serializers/dossier_procedure_serializer.rb deleted file mode 100644 index 02ebc4815..000000000 --- a/app/serializers/dossier_procedure_serializer.rb +++ /dev/null @@ -1,13 +0,0 @@ -class DossierProcedureSerializer < ActiveModel::Serializer - attributes :id, - :created_at, - :updated_at, - :archived, - :mandataire_social, - :state, - :initiated_at, - :received_at, - :processed_at - - attribute :followers_gestionnaires_emails, key: :emails_accompagnateurs -end diff --git a/app/serializers/dossier_serializer.rb b/app/serializers/dossier_serializer.rb index eb074761b..73b7dcc8c 100644 --- a/app/serializers/dossier_serializer.rb +++ b/app/serializers/dossier_serializer.rb @@ -4,7 +4,13 @@ class DossierSerializer < ActiveModel::Serializer :updated_at, :archived, :mandataire_social, - :state + :state, + :simplified_state, + :initiated_at, + :received_at, + :processed_at, + :accompagnateurs, + :invites has_one :entreprise has_one :etablissement @@ -14,4 +20,16 @@ class DossierSerializer < ActiveModel::Serializer has_many :champs_private has_many :pieces_justificatives has_many :types_de_piece_justificative + + def simplified_state + object.decorate.display_state + end + + def accompagnateurs + object.followers_gestionnaires.pluck(:email) + end + + def invites + object.invites_gestionnaires.pluck(:email) + end end diff --git a/app/serializers/dossier_table_export_serializer.rb b/app/serializers/dossier_table_export_serializer.rb new file mode 100644 index 000000000..3bd4ba52a --- /dev/null +++ b/app/serializers/dossier_table_export_serializer.rb @@ -0,0 +1,38 @@ +class DossierTableExportSerializer < ActiveModel::Serializer + attributes :id, + :created_at, + :updated_at, + :archived, + :mandataire_social, + :state, + :initiated_at, + :received_at, + :processed_at + + attribute :emails_accompagnateurs + + attributes :individual_gender, + :individual_prenom, + :individual_nom, + :individual_birthdate + + def individual_prenom + object.individual.try(:prenom) + end + + def individual_nom + object.individual.try(:nom) + end + + def individual_birthdate + object.individual.try(:birthdate) + end + + def individual_gender + object.individual.try(:gender) + end + + def emails_accompagnateurs + object.followers_gestionnaires.pluck(:email).join(' ') + end +end diff --git a/app/services/accompagnateur_service.rb b/app/services/accompagnateur_service.rb index d526167a0..3c4129e4c 100644 --- a/app/services/accompagnateur_service.rb +++ b/app/services/accompagnateur_service.rb @@ -9,9 +9,10 @@ class AccompagnateurService end def change_assignement! - if @to == ASSIGN + case @to + when ASSIGN AssignTo.create(gestionnaire: @accompagnateur, procedure: @procedure) - elsif @to == NOT_ASSIGN + when NOT_ASSIGN AssignTo.where(gestionnaire: @accompagnateur, procedure: @procedure).delete_all end end diff --git a/app/services/champs_service.rb b/app/services/champs_service.rb index 31b53973f..40c46a993 100644 --- a/app/services/champs_service.rb +++ b/app/services/champs_service.rb @@ -1,11 +1,14 @@ class ChampsService class << self - def save_champs(champs, params, check_mandatory = true) + def save_champs(champs, params) fill_champs(champs, params) champs.select(&:changed?).each(&:save) + end - check_mandatory ? build_error_messages(champs) : [] + def build_error_messages(champs) + champs.select(&:mandatory_and_blank?) + .map { |c| "Le champ #{c.libelle} doit être rempli." } end private @@ -28,14 +31,5 @@ class ChampsService def extract_minute(champ_id, h) h[:time_minute]["'#{champ_id}'"] end - - def build_error_messages(champs) - champs.select(&:mandatory_and_blank?) - .map { |c| build_champ_error_message(c) } - end - - def build_champ_error_message(champ) - { message: "Le champ #{champ.libelle} doit être rempli." } - end end end diff --git a/app/services/dossiers_list_gestionnaire_service.rb b/app/services/dossiers_list_gestionnaire_service.rb index 93a1a4dc0..a53c35b4c 100644 --- a/app/services/dossiers_list_gestionnaire_service.rb +++ b/app/services/dossiers_list_gestionnaire_service.rb @@ -45,7 +45,7 @@ class DossiersListGestionnaireService end def termine - @termine ||= filter_dossiers.termine + @termine ||= filter_dossiers.termine.not_archived end def filter_dossiers diff --git a/app/services/dossiers_list_user_service.rb b/app/services/dossiers_list_user_service.rb deleted file mode 100644 index 24ec93b0f..000000000 --- a/app/services/dossiers_list_user_service.rb +++ /dev/null @@ -1,43 +0,0 @@ -class DossiersListUserService - def initialize current_devise_profil, liste - @current_devise_profil = current_devise_profil - @liste = liste - end - - def dossiers_to_display - {'brouillon' => brouillon, - 'a_traiter' => en_construction, - 'en_instruction' => en_instruction, - 'termine' => termine, - 'invite' => invite, - 'all_state' => all_state}[@liste] - end - - def self.dossiers_liste_libelle - ['brouillon', 'a_traiter', 'en_instruction', 'termine', 'invite', 'all_state'] - end - - def all_state - @all_state ||= @current_devise_profil.dossiers.all_state - end - - def brouillon - @brouillon ||= @current_devise_profil.dossiers.brouillon - end - - def en_construction - @en_construction ||= @current_devise_profil.dossiers.en_construction - end - - def invite - @invite ||= @current_devise_profil.invites - end - - def en_instruction - @en_instruction ||= @current_devise_profil.dossiers.en_instruction - end - - def termine - @termine ||= @current_devise_profil.dossiers.termine - end -end diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index 01bfe97e3..18415ebbd 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -34,7 +34,7 @@ class NotificationService when 'champs' attribut when 'submitted' - "Le dossier n°#{@dossier_id} a été déposé." + "Le dossier nº #{@dossier_id} a été déposé." else 'Notification par défaut' end diff --git a/app/services/pieces_justificatives_service.rb b/app/services/pieces_justificatives_service.rb index 266c4fffa..8003e3c92 100644 --- a/app/services/pieces_justificatives_service.rb +++ b/app/services/pieces_justificatives_service.rb @@ -1,40 +1,51 @@ class PiecesJustificativesService - def self.upload! dossier, user, params - errors = '' + def self.upload!(dossier, user, params) + tpj_contents = dossier.types_de_piece_justificative + .map { |tpj| [tpj, params["piece_justificative_#{tpj.id}"]] } + .select { |_, content| content.present? } - dossier.types_de_piece_justificative.each do |type_de_pieces_justificatives| - unless params["piece_justificative_#{type_de_pieces_justificatives.id}"].nil? + without_virus, with_virus = tpj_contents + .partition { |_, content| ClamavService.safe_file?(content.path) } - if ClamavService.safe_file? params["piece_justificative_#{type_de_pieces_justificatives.id}"].path - piece_justificative = PieceJustificative.new(content: params["piece_justificative_#{type_de_pieces_justificatives.id}"], - dossier: dossier, - type_de_piece_justificative: type_de_pieces_justificatives, - user: user) + errors = with_virus + .map { |_, content| content.original_filename + ' : virus détecté' } - unless piece_justificative.save - errors << piece_justificative.errors.messages[:content][0]+" (#{piece_justificative.libelle})"+"
    " - end - else - errors << params["piece_justificative_#{type_de_pieces_justificatives.id}"].original_filename+": Virus détecté !!"+"
    " - end - end - end - errors + errors += without_virus + .map { |tpj, content| save_pj(content, dossier, tpj, user) } + .compact() end def self.upload_one! dossier, user, params - if ClamavService.safe_file? params[:piece_justificative][:content].path - piece_justificative = PieceJustificative.new(content: params[:piece_justificative][:content], - dossier: dossier, - type_de_piece_justificative: nil, - user: user) + content = params[:piece_justificative][:content] + if ClamavService.safe_file? content.path + pj = PieceJustificative.new(content: content, + dossier: dossier, + type_de_piece_justificative: nil, + user: user) - piece_justificative.save + pj.save else - piece_justificative = PieceJustificative.new - piece_justificative.errors.add(:content, params[:piece_justificative][:content].original_filename+": Virus détecté !!") + pj = PieceJustificative.new + pj.errors.add(:content, content.original_filename + ': Virus détecté !!') end - piece_justificative + pj + end + + def self.save_pj(content, dossier, tpj, user) + pj = PieceJustificative.new(content: content, + dossier: dossier, + type_de_piece_justificative: tpj, + user: user) + + pj.save ? nil : "le fichier #{content.original_filename} (#{pj.libelle}) n'a pas pu être sauvegardé" + end + + def self.missing_pj_error_messages(dossier) + mandatory_pjs = dossier.types_de_piece_justificative.select(&:mandatory) + present_pjs = dossier.pieces_justificatives.map(&:type_de_piece_justificative) + missing_pjs = mandatory_pjs - present_pjs + + missing_pjs.map { |pj| "La pièce jointe #{pj.libelle} doit être fournie." } end end diff --git a/app/views/admin/accompagnateurs/_list_assign.html.haml b/app/views/admin/accompagnateurs/_list_assign.html.haml index faeec752d..d685264e4 100644 --- a/app/views/admin/accompagnateurs/_list_assign.html.haml +++ b/app/views/admin/accompagnateurs/_list_assign.html.haml @@ -1,7 +1,7 @@ .row{ style: 'height: 34px;' } - unless smart_listing.empty? - %table.table#liste_gestionnaire + %table.table#liste-gestionnaire %thead %th Enlever %th#email{ style: 'text-align: right;' } Email diff --git a/app/views/admin/accompagnateurs/_list_not_assign.html.haml b/app/views/admin/accompagnateurs/_list_not_assign.html.haml index d016ffe90..d310c1360 100644 --- a/app/views/admin/accompagnateurs/_list_not_assign.html.haml +++ b/app/views/admin/accompagnateurs/_list_not_assign.html.haml @@ -7,7 +7,7 @@ - unless smart_listing.empty? - %table.table#liste_gestionnaire + %table.table#liste-gestionnaire %thead %th#email Email %th Ajouter diff --git a/app/views/admin/gestionnaires/_list.html.haml b/app/views/admin/gestionnaires/_list.html.haml index 259f3c31f..bb93b043e 100644 --- a/app/views/admin/gestionnaires/_list.html.haml +++ b/app/views/admin/gestionnaires/_list.html.haml @@ -1,5 +1,5 @@ - unless smart_listing.empty? - %table.table#liste_gestionnaire + %table.table#liste-gestionnaire %thead %th#libelle= smart_listing.sortable 'Email', 'email' %th diff --git a/app/views/admin/pieces_justificatives/_fields.html.haml b/app/views/admin/pieces_justificatives/_fields.html.haml index 7cbdf5a99..e51a2676e 100644 --- a/app/views/admin/pieces_justificatives/_fields.html.haml +++ b/app/views/admin/pieces_justificatives/_fields.html.haml @@ -1,31 +1,36 @@ -= f.fields_for :types_de_piece_justificative, types_de_piece_justificative, remote: true do |ff| - .form-inline - .form-group - %h4 Libellé - = ff.text_field :libelle, class: 'form-control libelle', placeholder: 'Libellé' - .form-group - %h4 Description - = ff.text_area :description, class: 'form-control description', placeholder: 'Description' - .form-group - %h4 - Lien du formulaire vierge - %small - (optionel) - = ff.url_field :lien_demarche, class: 'form-control', placeholder: 'Lien du document vierge' +.pieces-justificatives-fields + = f.fields_for :types_de_piece_justificative, types_de_piece_justificative, remote: true do |ff| + .form-inline + .form-group + %h4 Libellé + = ff.text_field :libelle, class: 'form-control libelle', placeholder: 'Libellé' + .form-group + %h4 Description + = ff.text_area :description, class: 'form-control description', placeholder: 'Description' + .form-group + %h4 + Lien du formulaire vierge + %small + (optionel) + = ff.url_field :lien_demarche, class: 'form-control', placeholder: 'Lien du document vierge' + + .form-group + = ff.hidden_field :order_place, value: ff.index + = ff.hidden_field :id + - unless ff.object.id.nil? + .form-group + %br   + = ff.object.button_up(index: ff.index, url: move_up_admin_procedure_pieces_justificatives_path(@procedure, ff.index)) + = ff.object.button_down(index: ff.index, url: move_down_admin_procedure_pieces_justificatives_path(@procedure, ff.index)) + + .form-group + %h4 Obligatoire ? + .center + = ff.check_box :mandatory - .form-group - = ff.hidden_field :order_place, value: ff.index - = ff.hidden_field :id - - unless ff.object.id.nil? .form-group %br   - = ff.object.button_up(index: ff.index, url: move_up_admin_procedure_pieces_justificatives_path(@procedure, ff.index)) - = ff.object.button_down(index: ff.index, url: move_down_admin_procedure_pieces_justificatives_path(@procedure, ff.index)) - - - .form-group - %br   - - if ff.object.id.nil? - = f.submit('Ajouter la pièce', class: 'btn btn-success', id: 'add_piece_justificative') - - else - = link_to("", admin_procedure_piece_justificative_path(@procedure, ff.object.id), method: :delete, remote: true, id: "delete_type_de_piece_justificative_#{ff.object.id}", class: %w(form-control btn btn-danger fa fa-trash-o) ) + - if ff.object.id.nil? + = f.submit('Ajouter la pièce', class: 'btn btn-success', id: 'add_piece_justificative') + - else + = link_to("", admin_procedure_piece_justificative_path(@procedure, ff.object.id), method: :delete, remote: true, id: "delete_type_de_piece_justificative_#{ff.object.id}", class: %w(form-control btn btn-danger fa fa-trash-o) ) diff --git a/app/views/admin/pieces_justificatives/show.js.erb b/app/views/admin/pieces_justificatives/show.js.erb index 094e982cb..34ce0066b 100644 --- a/app/views/admin/pieces_justificatives/show.js.erb +++ b/app/views/admin/pieces_justificatives/show.js.erb @@ -1,4 +1,4 @@ <% flash.each do |type, message| %> -$("#flash_message").html("
    <%= message.html_safe %>
    ").children().fadeOut(5000) +$("#flash_message").html("
    <%= message.html_safe %>
    ").children().fadeOut(5000) <% end %> $('#piece_justificative_form').html("<%= escape_javascript(render partial: 'form', locals: { procedure: @procedure } ) %>"); diff --git a/app/views/admin/procedures/_informations.html.haml b/app/views/admin/procedures/_informations.html.haml index 476b8d250..553457b48 100644 --- a/app/views/admin/procedures/_informations.html.haml +++ b/app/views/admin/procedures/_informations.html.haml @@ -37,10 +37,10 @@ = f.fields_for :module_api_carto, @procedure.module_api_carto do |ff| .checkbox %label - = ff.check_box :use_api_carto, id: :procedure_module_api_carto_use_api_carto + = ff.check_box :use_api_carto, id: "procedure-module-api-carto-use-api-carto" Utilisation de la cartographie - %ul#modules_api_carto + %ul#modules-api-carto %li .checkbox %label @@ -73,7 +73,7 @@ ne possède pas (ou pas encore) de numéro SIRET, qui doivent donc s'identifier en tant que personne physique. - %ul#individual_with_siret + %ul#individual-with-siret %li .checkbox %label diff --git a/app/views/admin/procedures/_list.html.haml b/app/views/admin/procedures/_list.html.haml index cc2f21c65..5cf85a729 100644 --- a/app/views/admin/procedures/_list.html.haml +++ b/app/views/admin/procedures/_list.html.haml @@ -1,5 +1,5 @@ - unless smart_listing.empty? - %table.table#dossiers_list + %table.table#dossiers-list %thead %th#ID= smart_listing.sortable 'ID', 'id' %th#libelle= smart_listing.sortable 'Libellé', 'libelle' diff --git a/app/views/admin/procedures/_modal_publish.html.haml b/app/views/admin/procedures/_modal_publish.html.haml index 2619ca5e5..14fb1c234 100644 --- a/app/views/admin/procedures/_modal_publish.html.haml +++ b/app/views/admin/procedures/_modal_publish.html.haml @@ -1,4 +1,4 @@ -#publishModal.modal.fade{ "aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1" } +#publish-modal.modal.fade{ "aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1" } .modal-dialog.modal-lg{ :role => "document" } = form_tag admin_procedure_publish_path(procedure_id: @procedure.id), method: :put, remote: true do .modal-content @@ -8,7 +8,7 @@ %h4#myModalLabel.modal-title = @procedure.archived? ? 'Réactiver' : 'Publier' la procédure - %span#publishModal_title + %span#publish-modal-title .modal-body Vous vous apprêtez à = @procedure.archived? ? 'republier' : 'publier' @@ -28,9 +28,9 @@ id: 'procedure_path', placeholder: 'Chemin vers la procédure', class: 'form-control', - maxlength: 30, + maxlength: 50, style: 'width: 300px; display: inline;') - #path_messages + #path-messages #path_is_mine.text-warning.center.message Ce lien est déjà utilisé par une de vos procédure. %br @@ -40,7 +40,7 @@ %br Vous ne pouvez pas l'utiliser car il appartient à un autre administrateur. #path_is_invalid.text-danger.center.message - Ce lien n'est pas valide. Il doit comporter au moins 3 caractères et seuls les caractères a-z, 0-9 et '_' sont autorisés. + = t('activerecord.errors.models.procedure_path.attributes.path.format') .modal-footer = submit_tag "#{@procedure.archived? ? 'Réactiver' : 'Publier'}", class: %w(btn btn btn-success), id: 'publish', diff --git a/app/views/admin/procedures/index.html.haml b/app/views/admin/procedures/index.html.haml index 570a8cb9b..7b2e1370c 100644 --- a/app/views/admin/procedures/index.html.haml +++ b/app/views/admin/procedures/index.html.haml @@ -1,5 +1,5 @@ -#admins_index - .default_data_block.default_visible +#admins-index + .default-data-block.default_visible .row.show-block#new_dossiers .header .col-lg-10.col-md-10.col-sm-10.col-xs-10.title diff --git a/app/views/admin/procedures/show.html.haml b/app/views/admin/procedures/show.html.haml index 3913a4235..79d3090d9 100644 --- a/app/views/admin/procedures/show.html.haml +++ b/app/views/admin/procedures/show.html.haml @@ -6,7 +6,7 @@ %i.fa.fa-eraser Publier - else - %a.btn.btn-success{ "data-target" => "#publishModal", "data-toggle" => "modal", :type => "button", style: 'float: right; margin-top: 10px;', id: 'publish-procedure' } + %a.btn.btn-success{ "data-target" => "#publish-modal", "data-toggle" => "modal", :type => "button", style: 'float: right; margin-top: 10px;', id: 'publish-procedure' } %i.fa.fa-eraser Publier @@ -19,7 +19,7 @@ = render partial: '/admin/procedures/modal_transfer' - if @facade.procedure.archived? - %a#reenable.btn.btn-small.btn-default.text-info{ "data-target" => "#publishModal", "data-toggle" => "modal", :type => "button", style: 'float: right; margin-top: 10px;' } + %a#reenable.btn.btn-small.btn-default.text-info{ "data-target" => "#publish-modal", "data-toggle" => "modal", :type => "button", style: 'float: right; margin-top: 10px;' } %i.fa.fa-eraser Réactiver @@ -80,7 +80,7 @@ - @facade.procedure.types_de_champ_private.order(:order_place).each do |champ| %li= champ.libelle - .pieces_justificatives.col-xs-6.col-md-3 + .pieces-justificatives.col-xs-6.col-md-3 %h4.text-info Pièces jointes .badge.progress-bar-info diff --git a/app/views/admin/types_de_champ/_fields.html.haml b/app/views/admin/types_de_champ/_fields.html.haml index 3e84b68d7..aaf0a5ea6 100644 --- a/app/views/admin/types_de_champ/_fields.html.haml +++ b/app/views/admin/types_de_champ/_fields.html.haml @@ -1,20 +1,20 @@ = f.fields_for @types_de_champ_facade.fields_for_var, types_de_champ, remote: true do |ff| - type_champ = ff.object.object.type_champ - .form-inline{ class: (type_champ == 'header_section' ? 'header_section' : nil) } + .form-inline{ class: (type_champ == 'header_section' ? 'header-section' : nil) } .form-group.libelle %h4 Libellé = ff.text_field :libelle, class: 'form-control libelle', placeholder: 'Libellé' .form-group.type %h4 Type - = ff.select :type_champ, TypeDeChamp.type_de_champs_list_fr, {}, { class: 'form-control type_champ' } + = ff.select :type_champ, TypeDeChamp.type_de_champs_list_fr, {}, { class: 'form-control type-champ' } .form-group.description %h4 Description = ff.text_area :description, class: 'form-control description', placeholder: 'Description', rows: 3 - .form-group.drop_down_list{ class: (%w(drop_down_list multiple_drop_down_list).include?(type_champ) ? 'show_inline' : nil), style: 'margin-right: 5px;' } + .form-group.drop-down-list{ class: (%w(drop_down_list multiple_drop_down_list).include?(type_champ) ? 'show-inline' : nil), style: 'margin-right: 5px;' } %h4 Liste déroulante = ff.fields_for :drop_down_list_attributes, ff.object.object.drop_down_list do |fff| ~ fff.text_area :value, class: 'form-control drop_down_list', placeholder: "Ecrire une valeur par ligne et --valeur-- pour un séparateur.", rows: 3, cols: 30 diff --git a/app/views/admin/types_de_champ/show.html.haml b/app/views/admin/types_de_champ/show.html.haml index 1ec8b0871..6b3522fa1 100644 --- a/app/views/admin/types_de_champ/show.html.haml +++ b/app/views/admin/types_de_champ/show.html.haml @@ -1,3 +1,3 @@ .row.white-back - #liste_champ + #liste-champ = render partial: 'admin/types_de_champ/form' diff --git a/app/views/admin/types_de_champ/show.js.erb b/app/views/admin/types_de_champ/show.js.erb index 1406b46c8..1e156d1bb 100644 --- a/app/views/admin/types_de_champ/show.js.erb +++ b/app/views/admin/types_de_champ/show.js.erb @@ -1,5 +1,5 @@ <% flash.each do |type, message| %> -$("#flash_message").html("
    <%= message.html_safe %>
    ").children().fadeOut(5000) +$("#flash_message").html("
    <%= message.html_safe %>
    ").children().fadeOut(5000) <% end %> -$('#liste_champ').html("<%= escape_javascript(render partial: 'admin/types_de_champ/form', locals: { procedure: @procedure, types_de_champ: @types_de_champ } ) %>"); -on_change_type_de_champ_select (); \ No newline at end of file +$('#liste-champ').html("<%= escape_javascript(render partial: 'admin/types_de_champ/form', locals: { procedure: @procedure, types_de_champ: @types_de_champ } ) %>"); +on_change_type_de_champ_select (); diff --git a/app/views/administrateurs/sessions/new.html.haml b/app/views/administrateurs/sessions/new.html.haml index 7ebe37ba9..1a480db6f 100644 --- a/app/views/administrateurs/sessions/new.html.haml +++ b/app/views/administrateurs/sessions/new.html.haml @@ -1,4 +1,4 @@ -#form_login +#form-login %br = image_tag(image_url(LOGO_NAME)) %br @@ -7,7 +7,7 @@ %br %br - #new_user + #new-user = form_for @administrateur, url: { controller: 'administrateurs/sessions', action: :create } do |f| %h4 = f.label :email diff --git a/app/views/backoffice/dossiers/_list.html.haml b/app/views/backoffice/dossiers/_list.html.haml index 1aebea3ba..3316aa0c8 100644 --- a/app/views/backoffice/dossiers/_list.html.haml +++ b/app/views/backoffice/dossiers/_list.html.haml @@ -1,4 +1,4 @@ -%table#dossiers_list.table +%table#dossiers-list.table %thead - if smart_listing.name.to_s == 'follow_dossiers' %th.col-xs-1.center diff --git a/app/views/backoffice/dossiers/_pref_list.html.haml b/app/views/backoffice/dossiers/_pref_list.html.haml index b92e4a41c..31d6c1fed 100644 --- a/app/views/backoffice/dossiers/_pref_list.html.haml +++ b/app/views/backoffice/dossiers/_pref_list.html.haml @@ -1,4 +1,4 @@ -%button#pref_list_dossier_close_action.btn.btn-danger.btn-xs.fixed-right +%button#pref-list-dossier-close-action.btn.btn-danger.btn-xs.fixed-right %i.fa.fa-close %h3 = t('dynamics.backoffice.pref_list.title') diff --git a/app/views/backoffice/dossiers/_pref_list.js.erb b/app/views/backoffice/dossiers/_pref_list.js.erb index e15e3f068..00a569dd4 100644 --- a/app/views/backoffice/dossiers/_pref_list.js.erb +++ b/app/views/backoffice/dossiers/_pref_list.js.erb @@ -9,6 +9,6 @@ $.ajax({ url: '/backoffice/preference_list_dossier/reload_pref_list?procedure_id=<%= @procedure_id %>', async: true }).done(function (data) { - $("#pref_list_menu").html(data); + $("#pref-list-menu").html(data); pref_list_dossier_actions(); }); diff --git a/app/views/backoffice/dossiers/_state_description.html.haml b/app/views/backoffice/dossiers/_state_description.html.haml index b7d58ceea..345b3fecf 100644 --- a/app/views/backoffice/dossiers/_state_description.html.haml +++ b/app/views/backoffice/dossiers/_state_description.html.haml @@ -5,17 +5,18 @@ .col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1 .fa.fa-info-circle.text-info{ style: 'font-size: 2em; margin-top: 20%;' } .col-xs-11 - - if dossiers_list_facade.liste == 'nouveaux' + - case dossiers_list_facade.liste + - when 'nouveaux' Tous les dossiers présents dans cette liste sont ceux qui %b n'ont jamais été ouvert par votre service. Il attende une première lecture et intervention de votre part. - - elsif dossiers_list_facade.liste == 'a_traiter' + - when 'a_traiter' Tous les dossiers présents dans cette liste sont ceux qui sont %b en cours de construction avec l'usager. Ils ne sont pas figés et ne sont donc pas complets. - - elsif dossiers_list_facade.liste == 'fige' + - when 'fige' Tous les dossiers présents dans cette liste ont été déclarés %b complets @@ -23,14 +24,14 @@ %b plus modifiables par l'usager. Ils attendent donc leurs dépots officiels qui doit être effectué par l'usager. - - elsif dossiers_list_facade.liste == 'deposes' + - when 'deposes' Tous les dossiers présents dans cette liste ont été %b officiellement déposé par l'usager pour examen. Il faut donc que vous confirmiez par "accusé de réception" la bonne réception de toutes les informations et documents demandés avant examen final. - - elsif dossiers_list_facade.liste == 'a_instruire' + - when 'a_instruire' Tous les dossiers présents dans cette liste sont à instruire. Ceux sont tous les dossiers %b qui ont reçu bonne réception. - - elsif dossiers_list_facade.liste == 'termine' + - when 'termine' Tous les dossiers présents dans cette liste sont considérés comme cloturé car ils ont tous reçu un verdict final qui peut être "Validé", "Refusé" ou "Sans suite". diff --git a/app/views/backoffice/dossiers/formulaire_private.js.erb b/app/views/backoffice/dossiers/formulaire_private.js.erb index a4a9f595b..44b5a576a 100644 --- a/app/views/backoffice/dossiers/formulaire_private.js.erb +++ b/app/views/backoffice/dossiers/formulaire_private.js.erb @@ -1,4 +1,4 @@ <% flash.each do |type, message| %> -$("#flash_message").html("
    <%= message.html_safe %>
    ").children().fadeOut(5000) +$("#flash_message").html("
    <%= message.html_safe %>
    ").children().fadeOut(5000) <% end %> <% flash.clear %> diff --git a/app/views/backoffice/dossiers/index.html.haml b/app/views/backoffice/dossiers/index.html.haml index f10570616..54d14c648 100644 --- a/app/views/backoffice/dossiers/index.html.haml +++ b/app/views/backoffice/dossiers/index.html.haml @@ -1,8 +1,8 @@ -#backoffice_index - #pref_list_menu +#backoffice-index + #pref-list-menu = render partial: 'backoffice/dossiers/pref_list' - .default_data_block + .default-data-block .row.show-block#new_dossiers .header .col-xs-10.title @@ -24,7 +24,7 @@ .col-xs-3 = link_to 'Terminés', '?liste=termine', class: 'text-success', style: "text-decoration: #{@facade_data_view.liste == 'termine'? 'underline' : ''}" - .default_data_block.default_visible + .default-data-block.default_visible .row.show-block#follow_dossiers .header .col-xs-10.title @@ -36,7 +36,7 @@ .body = smart_listing_render :follow_dossiers - .default_data_block + .default-data-block .row.show-block#all_dossiers .header .col-xs-10.title @@ -50,7 +50,7 @@ - if @archived_dossiers - .default_data_block + .default-data-block .row.show-block#archived_dossiers .header .col-xs-10.title diff --git a/app/views/backoffice/dossiers/search.html.haml b/app/views/backoffice/dossiers/search.html.haml index 34ffd639d..6a17e254c 100644 --- a/app/views/backoffice/dossiers/search.html.haml +++ b/app/views/backoffice/dossiers/search.html.haml @@ -1,8 +1,8 @@ -#backoffice_search - #pref_list_menu +#backoffice-search + #pref-list-menu = render partial: 'backoffice/dossiers/pref_list' - .default_data_block.default_visible + .default-data-block.default_visible .row.show-block#new_dossiers .header .col-lg-10.col-md-10.col-sm-10.col-xs-10.title diff --git a/app/views/backoffice/dossiers/show.html.haml b/app/views/backoffice/dossiers/show.html.haml index be9e5d17d..de5a91238 100644 --- a/app/views/backoffice/dossiers/show.html.haml +++ b/app/views/backoffice/dossiers/show.html.haml @@ -1,2 +1,2 @@ -#backoffice_dossier_show.col-xs-12 +#backoffice-dossier-show.col-xs-12 = render partial: "dossiers/dossier_show" diff --git a/app/views/cgu/index.html.haml b/app/views/cgu/index.html.haml index 7f2116cd0..779d6ff83 100644 --- a/app/views/cgu/index.html.haml +++ b/app/views/cgu/index.html.haml @@ -35,7 +35,7 @@ %br/ Code APE 6202A %br/ - N° TVA : FR 22 424 761 419 + Nº TVA : FR 22 424 761 419 %br/ Siège social : 2 rue Kellermann - 59100 Roubaix - France. %br @@ -61,7 +61,7 @@ Déclaration CNIL %p Le SGMAP a procédé à la déclaration CNIL de TPS. Celle-ci porte le numéro "1986658 v 0" à la date du 30 août 2016. Néanmoins les administrations devront procéder à une déclaration complémentaire auprès de la CNIL si les données du formulaire qu’elles ont produit comportent des données de la nature suivante : %ul - %li N° de sécurité sociale, + %li Nº de sécurité sociale, %li Infractions, condamnations, mesures de sécurité, %li %a{ :href => "https://www.declaration.cnil.fr/declarations/declaration/donneesSensibles_DN.display.action" } Opinions philosophiques, politiques, religieuses, syndicales, vie sexuelle, données de santé, origine raciale. @@ -77,10 +77,10 @@ Traitement des données à caractère personnel %h4 Données personnelles : %p - En application de la loi n°78-17 Informatique et Libertés du 6 janvier 1978, vous disposez d'un droit d'accès, de rectification, de modification et de suppression concernant les données qui vous concernent. Vous pouvez exercer ce droit à travers la rubrique + En application de la loi nº 78-17 Informatique et Libertés du 6 janvier 1978, vous disposez d'un droit d'accès, de rectification, de modification et de suppression concernant les données qui vous concernent. Vous pouvez exercer ce droit à travers la rubrique %a{ :href => "http://www.faire-simple.gouv.fr/contact" } Contact %h4 Données de connexion : - %p Conformément à la loi n°2004-575 du 21 juin 2004 pour la confiance dans l’économie numérique, certaines données de connexion sont conservées par le service aux fins de protection contre les intrusions et de poursuites judiciaires le cas échéant. Ces données sont conservées pendant un an. + %p Conformément à la loi nº 2004-575 du 21 juin 2004 pour la confiance dans l’économie numérique, certaines données de connexion sont conservées par le service aux fins de protection contre les intrusions et de poursuites judiciaires le cas échéant. Ces données sont conservées pendant un an. %br %h3#entreprise_information diff --git a/app/views/dossiers/_dossier_show.html.haml b/app/views/dossiers/_dossier_show.html.haml index be5f83190..2a96ccc76 100644 --- a/app/views/dossiers/_dossier_show.html.haml +++ b/app/views/dossiers/_dossier_show.html.haml @@ -1,7 +1,7 @@ = render partial: 'dossiers/messagerie', locals: { dossier_facade: @facade } - if @facade.procedure.individual_with_siret - .default_data_block + .default-data-block .row.show-block.infos .header .col-xs-8.title-no-expanse @@ -13,7 +13,7 @@ Renseigner un SIRET - unless @facade.entreprise.nil? - .default_data_block + .default-data-block .row.show-block.infos#infos_entreprise .header .col-xs-12.title @@ -23,8 +23,8 @@ .body.display-block-on-print = render partial: '/dossiers/infos_entreprise' -.default_data_block.default_visible - .row.show-block.infos#infos_dossier +.default-data-block.default_visible + .row.show-block.infos#infos-dossiers .header .col-xs-10.title .carret-right @@ -35,7 +35,7 @@ = render partial: '/dossiers/infos_dossier' - if @facade.dossier.procedure.module_api_carto.use_api_carto - .default_data_block.default_visible.no-page-break-inside + .default-data-block.default_visible.no-page-break-inside .row.show-block#carto .header .col-xs-10.title @@ -53,7 +53,7 @@ - if @current_gestionnaire && gestionnaire_signed_in? && @champs_private.count > 0 - .default_data_block.default_visible + .default-data-block.default_visible .row.show-block#private-fields .header .col-xs-10.title diff --git a/app/views/dossiers/_download_dossiers.html.haml b/app/views/dossiers/_download_dossiers.html.haml index 369bd4327..26abe6925 100644 --- a/app/views/dossiers/_download_dossiers.html.haml +++ b/app/views/dossiers/_download_dossiers.html.haml @@ -1,5 +1,5 @@ .dropdown.pull-right#download-menu - %a.dropdown-toggle.button_navbar{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false } + %a.dropdown-toggle.button-navbar{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false } %i.fa.fa-download Télécharger tous les dossiers %span.caret diff --git a/app/views/dossiers/_edit_pieces_jointes.html.haml b/app/views/dossiers/_edit_pieces_jointes.html.haml index 61a8dc794..3584221a3 100644 --- a/app/views/dossiers/_edit_pieces_jointes.html.haml +++ b/app/views/dossiers/_edit_pieces_jointes.html.haml @@ -2,7 +2,7 @@ - if user_signed_in? && (@facade.dossier.owner?(current_user.email) || @facade.dossier.invite_by_user?(current_user.email)) - if @facade.procedure.cerfa_flag? || @facade.dossier.types_de_piece_justificative.size > 0 .col-lg-4.col-md-4.col-sm-4.col-xs-4.action - %a#maj_pj.action{ "data-target" => "#UploadPJmodal", + %a#maj_pj.action{ "data-target" => "#upload-pj-modal", "data-toggle" => "modal", :type => "button", style: 'margin-bottom: 15px; margin-top: -30px;' } diff --git a/app/views/dossiers/_infos_dossier.html.haml b/app/views/dossiers/_infos_dossier.html.haml index 954aa6856..15a1aa744 100644 --- a/app/views/dossiers/_infos_dossier.html.haml +++ b/app/views/dossiers/_infos_dossier.html.haml @@ -39,11 +39,13 @@ .col-xs-5.depositaire-info{ id: "champ-#{champ.id}-value" } - unless champ.decorate.value.blank? - if champ.type_champ == 'dossier_link' - - dossier = Dossier.find_by(id: champ.decorate.value) - - if dossier && gestionnaire_signed_in? - = link_to(dossier.procedure.libelle, backoffice_dossier_path(champ.decorate.value), target: '_blank') + - dossier = Dossier.includes(:procedure).find_by(id: champ.decorate.value) + - if dossier + = link_to("Dossier #{dossier.id}", backoffice_dossier_path(champ.decorate.value), target: '_blank') + %br + = dossier.text_summary - else - = dossier.nil? ? 'pas de dossier associé' : dossier.procedure.libelle + Pas de dossier associé - else = champ.decorate.value.html_safe @@ -62,7 +64,7 @@ .col-xs-4.dossier-title= t('utils.pieces').upcase .col-xs-4.split-hr - .col-xs-12#pieces_justificatives.margin-bot-40 + .col-xs-12#pieces-justificatives.margin-bot-40 .row - if @facade.procedure.cerfa_flag? .col-xs-12#piece_justificative_0 @@ -74,7 +76,7 @@ %a{ href: "#{@facade.dossier.cerfa.last.content_url}", target: '_blank' } Consulter %span{ style: 'margin-left: 12px;' } \- - = link_to "", class: "historique", "data-toggle" => "modal", "data-target" => "#PJmodal", :type => "button", "data-modal_title" => 'formulaires', "data-modal_index" => 'cerfa' do + = link_to "", class: "historique", "data-toggle" => "modal", "data-target" => "#pj-modal", :type => "button", "data-modal_title" => 'formulaires', "data-modal_index" => 'cerfa' do %span.fa.fa-clock-o - else Pièce non fournie @@ -94,7 +96,7 @@ %span{ style: 'margin-left: 12px;' } \- - if @facade.dossier.pieces_justificatives.where(type_de_piece_justificative_id: type_de_piece_justificative.id).count > 1 - = link_to "", class: "historique", "data-toggle" => "modal", "data-target" => "#PJmodal", :type => "button", "data-modal_title" => 'formulaires', "data-modal_index" => "type_de_pj_#{type_de_piece_justificative.id}" do + = link_to "", class: "historique", "data-toggle" => "modal", "data-target" => "#pj-modal", :type => "button", "data-modal_title" => 'formulaires', "data-modal_index" => "type_de_pj_#{type_de_piece_justificative.id}" do %span.fa.fa-clock-o - else Pièce non fournie @@ -104,7 +106,7 @@ - if @facade.procedure.cerfa_flag? || @facade.dossier.types_de_piece_justificative.size > 0 .row .col-xs-4 - %a#maj_pj.action{ "data-target" => "#UploadPJmodal", "data-toggle" => "modal", :type => "button" } + %a#maj_pj.action{ "data-target" => "#upload-pj-modal", "data-toggle" => "modal", :type => "button" } .col-xs-4.action Modifier les documents %br @@ -112,7 +114,7 @@ .col-xs-4 - if gestionnaire_signed_in? - #PJmodal.modal.fade{ "aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1" } + #pj-modal.modal.fade{ "aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1" } .modal-dialog.modal-lg{ :role => "document" } .modal-content .modal-header @@ -120,7 +122,7 @@ %span{ "aria-hidden" => "true" } × %h4#myModalLabel.modal-title Historique des - %span#PJmodal_title + %span#pj-modal-title .modal-body %table.table %thead @@ -130,7 +132,7 @@ Date d'envoi %th Lien - %thead.tr_content#cerfa + %thead.tr-content#cerfa - if @facade.procedure.cerfa_flag? - if @facade.dossier.cerfa_available? - @facade.cerfas_ordered.each do |cerfa| @@ -142,7 +144,7 @@ %td.col-md-6.col-sm-6.col-xs-6.col-lg-4 = link_to 'Récupérer', cerfa.content_url, { target: :blank } - @facade.dossier.types_de_piece_justificative.each do |type_de_piece_justificative| - %tbody.tr_content{ id: "type_de_pj_#{type_de_piece_justificative.id}" } + %tbody.tr-content{ id: "type_de_pj_#{type_de_piece_justificative.id}" } - @facade.dossier.retrieve_all_piece_justificative_by_type(type_de_piece_justificative.id).each do |piece_justificative| %tr %td.col-md-6.col-sm-6.col-xs-6.col-lg-4 diff --git a/app/views/dossiers/_infos_pieces_jointes.html.haml b/app/views/dossiers/_infos_pieces_jointes.html.haml index 78d1df89f..05faa1417 100644 --- a/app/views/dossiers/_infos_pieces_jointes.html.haml +++ b/app/views/dossiers/_infos_pieces_jointes.html.haml @@ -1,4 +1,4 @@ -#pieces_justificatives +#pieces-justificatives .row - if @facade.procedure.cerfa_flag? .col-xs-12#piece_justificative_0 @@ -11,7 +11,7 @@ %span{ style: 'margin-left: 12px;' } \- %a.btn.fa.fa-timer{ style: 'color: black; padding-top: 0;', - "data-target" => "#PJmodal", + "data-target" => "#pj-modal", "data-toggle" => "modal", :type => "button", "data-modal_title" => 'formulaires', @@ -37,7 +37,7 @@ %span{ style: 'margin-left: 12px;' } \- %a.btn.fa.fa-timer{ style: 'color: black; padding-top: 0;', - "data-target" => "#PJmodal", + "data-target" => "#pj-modal", "data-toggle" => "modal", :type => "button", "data-modal_title" => type_de_piece_justificative.libelle, diff --git a/app/views/dossiers/_messagerie.html.haml b/app/views/dossiers/_messagerie.html.haml index eb8b59324..ca223136d 100644 --- a/app/views/dossiers/_messagerie.html.haml +++ b/app/views/dossiers/_messagerie.html.haml @@ -1,4 +1,4 @@ -.default_data_block{ style: 'margin-top: 40px;' } +.default-data-block{ style: 'margin-top: 40px;' } .row.show-block.clearfix#messages .header .col-xs-10.title diff --git a/app/views/dossiers/_pieces_justificatives.html.haml b/app/views/dossiers/_pieces_justificatives.html.haml index f547b1a4d..74d837d30 100644 --- a/app/views/dossiers/_pieces_justificatives.html.haml +++ b/app/views/dossiers/_pieces_justificatives.html.haml @@ -1,4 +1,4 @@ -#pieces_justificatives +#pieces-justificatives %table.table - if @facade.procedure.cerfa_flag? %tr{ id: "piece_justificative_0" } @@ -10,7 +10,7 @@ %span{ style: 'margin-left: 12px;' } \- %a.btn.fa.fa-timer{ style: 'color: black; padding-top: 0;', - "data-target" => "#PJmodal", + "data-target" => "#pj-modal", "data-toggle" => "modal", :type => "button", "data-modal_title" => 'formulaires', @@ -33,7 +33,7 @@ %span{ style: 'margin-left: 12px;' } \- %a.btn.fa.fa-timer{ style: 'color: black; padding-top: 0;', - "data-target" => "#PJmodal", + "data-target" => "#pj-modal", "data-toggle" => "modal", :type => "button", "data-modal_title" => type_de_piece_justificative.libelle, diff --git a/app/views/dossiers/_show.html.haml b/app/views/dossiers/_show.html.haml index 61ab17978..a63cafa14 100644 --- a/app/views/dossiers/_show.html.haml +++ b/app/views/dossiers/_show.html.haml @@ -1,9 +1,9 @@ -#users_siret_index +#users-siret-index .row.etape.etape_1 = render partial: '/dossiers/etapes/etape1' - .row.etape.etape_2 + .row.etape.etape-2 = render partial: '/dossiers/etapes/etape2' -# - if @facade.procedure.module_api_carto.use_api_carto? diff --git a/app/views/dossiers/add_siret.js.erb b/app/views/dossiers/add_siret.js.erb index 72bb92d20..fe0cdc53c 100644 --- a/app/views/dossiers/add_siret.js.erb +++ b/app/views/dossiers/add_siret.js.erb @@ -1,6 +1,6 @@ <% if flash.empty? %> -$('.row.etape.etape_2').hide(300, render_new_siret); -$('.row.etape.etape_2').slideDown(400, the_terms); +$('.row.etape.etape-2').hide(300, render_new_siret); +$('.row.etape.etape-2').slideDown(400, the_terms); <% else %> error_form_siret('<%= invalid_siret %>'); <% end %> @@ -8,5 +8,5 @@ error_form_siret('<%= invalid_siret %>'); <% flash.clear %> function render_new_siret(){ - $('.row.etape.etape_2').html("<%= escape_javascript(render partial: '/dossiers/etapes/etape_2/entreprise', locals: { facade: @facade } ) %>"); + $('.row.etape.etape-2').html("<%= escape_javascript(render partial: '/dossiers/etapes/etape_2/entreprise', locals: { facade: @facade } ) %>"); } \ No newline at end of file diff --git a/app/views/dossiers/etapes/_etape1.html.haml b/app/views/dossiers/etapes/_etape1.html.haml index 5e1d46dbc..036cdce6b 100644 --- a/app/views/dossiers/etapes/_etape1.html.haml +++ b/app/views/dossiers/etapes/_etape1.html.haml @@ -9,10 +9,10 @@ #logo_procedure.flag = image_tag( @facade.procedure.decorate.logo_img ) -.etape.etapes_informations.col-xs-9 +.etape.etapes-informations.col-xs-9 .row .col-xs-12.padding-left-30 - %h2#titre_procedure.text-info + %h2#titre-procedure.text-info = @facade.procedure.libelle %p#description_procedure{ style: 'width: 95%;', class: (@facade.entreprise.nil? ? '' : 'mask') } diff --git a/app/views/dossiers/etapes/_etape3.html.haml b/app/views/dossiers/etapes/_etape3.html.haml index a163bbe81..4a0e54e99 100644 --- a/app/views/dossiers/etapes/_etape3.html.haml +++ b/app/views/dossiers/etapes/_etape3.html.haml @@ -1,6 +1,6 @@ -.etape.etapes_menu.col-xs-3 +.etape.etapes-menu.col-xs-3 %h3 Ma zone d'intervention -.etape.etapes_informations.col-xs-9 +.etape.etapes-informations.col-xs-9 .row diff --git a/app/views/dossiers/etapes/_etape4.html.haml b/app/views/dossiers/etapes/_etape4.html.haml index 68a4c0fc4..70456b83f 100644 --- a/app/views/dossiers/etapes/_etape4.html.haml +++ b/app/views/dossiers/etapes/_etape4.html.haml @@ -1,6 +1,6 @@ -.etape.etapes_menu.col-xs-3 +.etape.etapes-menu.col-xs-3 %h3 Mon dossier -.etape.etapes_informations.col-xs-9 +.etape.etapes-informations.col-xs-9 .row diff --git a/app/views/dossiers/etapes/etape_2/_entreprise.html.haml b/app/views/dossiers/etapes/etape_2/_entreprise.html.haml index c817a95a9..7e6e6f05c 100644 --- a/app/views/dossiers/etapes/etape_2/_entreprise.html.haml +++ b/app/views/dossiers/etapes/etape_2/_entreprise.html.haml @@ -1,4 +1,4 @@ -.etape.etapes_menu.col-xs-3 +.etape.etapes-menu.col-xs-3 %h3 Mes informations %br @@ -12,21 +12,21 @@ = f.submit 'Changer de SIRET', class: %w(btn btn-xs btn-primary) -.etape.etapes_informations.col-xs-9 +.etape.etapes-informations.col-xs-9 .row - if @facade.entreprise.nil? #new_siret{ style: 'margin-left: 20%; margin-top: 5%;' } = form_for @facade.dossier, html: { class: 'form-inline' }, url: users_dossier_siret_informations_path(dossier_id: @facade.dossier.id), method: :post, remote: true do |f| .form-group.form-group-lg - = f.text_field :siret, class: "form-control", placeholder: "Entrez votre Siret", value: @siret + = f.text_field :siret, id: "dossier-siret", class: "form-control", placeholder: "Entrez votre Siret", value: @siret = f.hidden_field :dossier_id, value: @facade.dossier.id = f.submit 'Valider', class: %w(btn btn-lg btn-success), id: 'submit-siret', data: { disable_with: "Recherche en cours ..." } - else %br - #recap_info_entreprise + #recap-info-entreprise = render partial: '/dossiers/infos_entreprise' - %p#insee_infogreffe{ style: 'color: grey; float: right;' } + %p#insee-infogreffe{ style: 'color: grey; float: right;' } %i Informations récupérées auprès de l'INSEE et d'INFOGREFFE diff --git a/app/views/dossiers/etapes/etape_2/_individual.html.haml b/app/views/dossiers/etapes/etape_2/_individual.html.haml index 2e2298c33..ce87a50fc 100644 --- a/app/views/dossiers/etapes/etape_2/_individual.html.haml +++ b/app/views/dossiers/etapes/etape_2/_individual.html.haml @@ -5,7 +5,7 @@ %br vous concernant. -.etape.etapes_informations.col-xs-9 +.etape.etapes-informations.col-xs-9 = form_for @facade.dossier, url: { controller: '/users/dossiers', action: :update } do |f| .row .col-xs-12.padding-left-30 diff --git a/app/views/dossiers/new_siret.js.erb b/app/views/dossiers/new_siret.js.erb index dcb6ce2b2..a84df50d7 100644 --- a/app/views/dossiers/new_siret.js.erb +++ b/app/views/dossiers/new_siret.js.erb @@ -1,6 +1,6 @@ <% if flash.empty? %> -$('.row.etape.etape_2').hide(300, render_new_siret); -$('.row.etape.etape_2').slideDown(400, the_terms); +$('.row.etape.etape-2').hide(300, render_new_siret); +$('.row.etape.etape-2').slideDown(400, the_terms); toggle_etape_1(); <% else %> error_form_siret('<%= invalid_siret %>'); @@ -9,5 +9,5 @@ error_form_siret('<%= invalid_siret %>'); <% flash.clear %> function render_new_siret(){ - $('.row.etape.etape_2').html("<%= escape_javascript(render partial: '/dossiers/etapes/etape2', locals: { facade: @facade } ) %>"); + $('.row.etape.etape-2').html("<%= escape_javascript(render partial: '/dossiers/etapes/etape2', locals: { facade: @facade } ) %>"); } \ No newline at end of file diff --git a/app/views/france_connect/particulier/check_email.html.haml b/app/views/france_connect/particulier/check_email.html.haml index da4efd5be..9922adda2 100644 --- a/app/views/france_connect/particulier/check_email.html.haml +++ b/app/views/france_connect/particulier/check_email.html.haml @@ -12,7 +12,7 @@ Afin d'associer ce compte à votre identifiant France Connect, merci de saisir votre mot de passe TPS. %br .center - #france_connect_particulier_email + #france-connect-particulier-email = form_for @user, url: { controller: 'france_connect/particulier', action: :check_email }, method: :post do |f| .form-group.form-group-lg = f.text_field :email_france_connect, class: "form-control", readonly: 'readonly' diff --git a/app/views/france_connect/particulier/new.html.haml b/app/views/france_connect/particulier/new.html.haml index 22f6c8e72..ddb7a5b0b 100644 --- a/app/views/france_connect/particulier/new.html.haml +++ b/app/views/france_connect/particulier/new.html.haml @@ -23,7 +23,7 @@ %br .center - #france_connect_particulier_email + #france-connect-particulier-email = form_for @user, url: { controller: 'france_connect/particulier', action: :check_email }, method: :post do |f| .form-group.form-group-lg = f.text_field :email_france_connect, class: "form-control", placeholder: "Entrez votre email" diff --git a/app/views/gestionnaires/passwords/edit.html.haml b/app/views/gestionnaires/passwords/edit.html.haml index 13888a958..64acc3d70 100644 --- a/app/views/gestionnaires/passwords/edit.html.haml +++ b/app/views/gestionnaires/passwords/edit.html.haml @@ -1,13 +1,13 @@ = devise_error_messages! -#form_login +#form-login = image_tag(image_url(LOGO_NAME)) %br %h2#gestionnaire_login Changement de mot de passe %br %br - #new_user + #new-user = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| = f.hidden_field :reset_password_token %h4 diff --git a/app/views/gestionnaires/passwords/new.html.haml b/app/views/gestionnaires/passwords/new.html.haml index 5cb58e0b1..63b9cf09c 100644 --- a/app/views/gestionnaires/passwords/new.html.haml +++ b/app/views/gestionnaires/passwords/new.html.haml @@ -1,14 +1,14 @@ = devise_error_messages! %br -#form_login +#form-login = image_tag(image_url(LOGO_NAME)) %br %h2#gestionnaire_login Mot de passe oublié %br %br - #new_user + #new-user = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %h4 = f.label :email diff --git a/app/views/gestionnaires/sessions/new.html.haml b/app/views/gestionnaires/sessions/new.html.haml index 051112da6..005803443 100644 --- a/app/views/gestionnaires/sessions/new.html.haml +++ b/app/views/gestionnaires/sessions/new.html.haml @@ -1,4 +1,4 @@ -#form_login +#form-login %br = image_tag(image_url(LOGO_NAME)) %br @@ -6,7 +6,7 @@ %br %br - #new_user + #new-user = form_for @gestionnaire, url: gestionnaire_session_path, method: :post do |f| %h4 = f.label :email diff --git a/app/views/layouts/_flash_messages.html.haml b/app/views/layouts/_flash_messages.html.haml index 2ed1b4013..a661dcdbd 100644 --- a/app/views/layouts/_flash_messages.html.haml +++ b/app/views/layouts/_flash_messages.html.haml @@ -4,4 +4,4 @@ = flash.notice - if flash.alert .alert.alert-danger - = flash.alert + = flash.alert.html_safe diff --git a/app/views/layouts/_navbar.html.haml b/app/views/layouts/_navbar.html.haml index 226fa8396..d3d3e9db5 100644 --- a/app/views/layouts/_navbar.html.haml +++ b/app/views/layouts/_navbar.html.haml @@ -1,5 +1,5 @@ .col-xs-2 - %a#title_navbar{ href: '/' } + %a#title-navbar{ href: '/' } .row#home .col-lg-6.no-padding = image_tag('marianne_small.png', class: 'logo') diff --git a/app/views/layouts/_new_footer.html.haml b/app/views/layouts/_new_footer.html.haml new file mode 100644 index 000000000..806541020 --- /dev/null +++ b/app/views/layouts/_new_footer.html.haml @@ -0,0 +1,35 @@ +.footer + .footer-inner-content + %ul.footer-columns + %li.footer-column + %ul.footer-logos + %li + = link_to image_tag("footer/logo-rf.svg", + :class => "footer-logo footer-logo-rf"), + "http://www.gouvernement.fr/" + %li + = link_to image_tag("footer/logo-beta-gouv-fr.svg", + :class => "footer-logo footer-logo-beta-gouv-fr"), + "https://beta.gouv.fr/" + + %li.footer-column + %ul.footer-links + %li.footer-link + = link_to "SGMAP", "http://www.modernisation.gouv.fr/le-sgmap", :class => "footer-link" + %li.footer-link + = link_to "Nouveautés", "https://github.com/sgmap/tps/releases", :class => "footer-link" + %li.footer-link + = link_to "Statistiques", stats_path, :class => "footer-link" + %li.footer-link + = link_to "Accès ancienne plateforme de test", "https://tps-dev.apientreprise.fr/", :class => "footer-link" + + %li.footer-column + %ul.footer-links + %li.footer-link + = link_to "Contact", + "mailto:#{t('dynamics.contact_email')}", + :class => "footer-link" + %li.footer-link + = link_to "Mentions légales", cgu_path, :class => "footer-link" + %li.footer-link + = link_to "CGU", cgu_path, :class => "footer-link" diff --git a/app/views/layouts/_new_header.haml b/app/views/layouts/_new_header.haml new file mode 100644 index 000000000..1f9049ce7 --- /dev/null +++ b/app/views/layouts/_new_header.haml @@ -0,0 +1,7 @@ +.new-header + .header-inner-content + %img{ src: image_url("header/logo-tps.svg"), class: "header-logo pull-left" } + + = link_to "Connexion", new_user_session_path, :class => "header-login-button pull-right" + + .clear-fix diff --git a/app/views/layouts/_notifications_alert.html.haml b/app/views/layouts/_notifications_alert.html.haml index 372fe7497..99c4a4682 100644 --- a/app/views/layouts/_notifications_alert.html.haml +++ b/app/views/layouts/_notifications_alert.html.haml @@ -1 +1 @@ -#notification_alert.alert.alert-success +#notification-alert.alert.alert-success diff --git a/app/views/layouts/_support_navigator_banner.html.haml b/app/views/layouts/_support_navigator_banner.html.haml index 8f892a3b8..ff3485071 100644 --- a/app/views/layouts/_support_navigator_banner.html.haml +++ b/app/views/layouts/_support_navigator_banner.html.haml @@ -1,5 +1,5 @@ - unless BrowserService.recommended_browser? - #support_navigator_banner.row + #support-navigator-banner.row .col-xs-12 = BROWSER.value.name = BROWSER.value.version diff --git a/app/views/layouts/_switch_devise_profile_module.html.haml b/app/views/layouts/_switch_devise_profile_module.html.haml index 53d3f2134..6b718ca0a 100644 --- a/app/views/layouts/_switch_devise_profile_module.html.haml +++ b/app/views/layouts/_switch_devise_profile_module.html.haml @@ -1,5 +1,5 @@ - if SwitchDeviseProfileService.new(warden).multiple_devise_profile_connect? - #switch_menu.dropdown.dropup + #switch-menu.dropdown.dropup %button.btn.btn-default.dropdown-toggle{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false } %i.fa.fa-toggle-on %span.caret diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 053d04646..225169964 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -6,6 +6,10 @@ = t('dynamics.page_title') %meta{ 'http-equiv' => "X-UA-Compatible", :content => "IE=edge" } + = favicon_link_tag(image_url("favicons/16x16.png"), type: "image/png", sizes: "16x16") + = favicon_link_tag(image_url("favicons/32x32.png"), type: "image/png", sizes: "32x32") + = favicon_link_tag(image_url("favicons/96x96.png"), type: "image/png", sizes: "96x96") + = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true = stylesheet_link_tag 'print', media: 'print', 'data-turbolinks-track' => true = javascript_include_tag 'application', 'data-turbolinks-track' => true @@ -14,7 +18,7 @@ = action_cable_meta_tag %body = render partial: 'layouts/support_navigator_banner' - #beta{ class: (Rails.env == 'production' ? '' : 'beta_staging') } + #beta{ class: (Rails.env == 'production' ? '' : 'beta-staging') } - if Rails.env == 'production' Beta - else @@ -45,7 +49,7 @@ - main_container_size = 12 = render partial: 'layouts/main_container', locals: { main_container_size: main_container_size } - #mask_search + #mask-search %h1 %i.fa.fa-times{ style: 'position: fixed; top: 10; right: 30; color: white;' } 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 index 53fcb38c2..865c47868 100644 --- 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 @@ -8,21 +8,21 @@ %div#menu-block .split-hr-left - #procedure_list + #procedure-list %a{ :href => "#{url_for :admin_procedures_draft}", id: "draft-procedures" } - .procedure_list_element{ class: @draft_class } + .procedure-list-element{ class: @draft_class } Brouillons .badge.progress-bar-default = current_administrateur.procedures.where(published: false, archived: false).count %a{ :href => "#{url_for :admin_procedures}", id: "active-procedures" } - .procedure_list_element{ class: @active_class } + .procedure-list-element{ class: @active_class } Actives .badge.progress-bar-success = current_administrateur.procedures.where(published: true, archived: false).count %a{ :href => "#{url_for :admin_procedures_archived}", id: "archived-procedures" } - .procedure_list_element{ class: @archived_class } + .procedure-list-element{ class: @archived_class } Archivées .badge.progress-bar-purple = current_administrateur.procedures.where(archived: true).count 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 index 60036b2a5..e23c96832 100644 --- 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 @@ -9,40 +9,40 @@ %div#menu-block .split-hr-left - #procedure_list + #procedure-list %a{ :href => "#{url_for admin_procedure_path(@procedure)}", id: 'onglet-infos' } - .procedure_list_element{ class: ('active' if active == 'Informations') } + .procedure-list-element{ class: ('active' if active == 'Informations') } Informations %a{ :href => "#{url_for admin_procedure_accompagnateurs_path(@procedure)}", id: 'onglet-accompagnateurs' } - .procedure_list_element{ class: ('active' if active == 'Accompagnateurs') } + .procedure-list-element{ class: ('active' if active == 'Accompagnateurs') } = t('dynamics.admin.procedure.onglets.accompagnateurs') %a{ :href => "#{url_for edit_admin_procedure_path(@procedure)}", id: 'onglet-description' } - .procedure_list_element{ class: ('active' if active == 'Description') } + .procedure-list-element{ class: ('active' if active == 'Description') } Description - unless @procedure.locked? %a{ :href => "#{url_for admin_procedure_types_de_champ_path(@procedure)}", id: 'onglet-champs' } - .procedure_list_element{ class: ('active' if active == 'Champs') } + .procedure-list-element{ class: ('active' if active == 'Champs') } Champs - unless @procedure.locked? %a{ :href => "#{url_for admin_procedure_pieces_justificatives_path(@procedure)}", id: 'onglet-pieces' } - .procedure_list_element{ class: ('active' if active == 'Pieces') } + .procedure-list-element{ class: ('active' if active == 'Pieces') } Pièces jointes - unless @procedure.locked? %a{ :href => "#{url_for admin_procedure_types_de_champ_private_path(@procedure)}", id: 'onglet-private-champs' } - .procedure_list_element{ class: ('active' if active == 'Champs privés') } + .procedure-list-element{ class: ('active' if active == 'Champs privés') } Champs privés %a{ :href => "#{url_for admin_procedure_mail_templates_path(@procedure)}", id: 'onglet-inemailsfos' } - .procedure_list_element{ class: ('active' if active == 'E-mails') } + .procedure-list-element{ class: ('active' if active == 'E-mails') } E-mails %a{ :href => "#{url_for admin_procedure_previsualisation_path(@procedure)}", id: 'onglet-preview' } - .procedure_list_element{ class: ('active' if active == 'Prévisualisation') } + .procedure-list-element{ class: ('active' if active == 'Prévisualisation') } Prévisualisation .split-hr-left diff --git a/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_index.html.haml b/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_index.html.haml index cd378550c..5d6e6c9d7 100644 --- a/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_index.html.haml +++ b/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_index.html.haml @@ -1,44 +1,44 @@ -%div#first-block +#first-block .dossiers-en-cours - .count= @facade_data_view.total_dossier_follow + .count= current_gestionnaire.dossiers_follow.count .text SUIVIS .nouveaux-dossiers - .count= @facade_data_view.total_new_dossier + .count= current_gestionnaire.dossiers.nouveaux.count .text NOUVEAUX .nouvelles-notifications - .count= @facade_data_view.dossiers_with_unread_notifications.count + .count= current_gestionnaire.dossiers_with_notifications_count .text MODIFIÉS -%div#action-block +#action-block -%div#menu-block +#menu-block .split-hr-left #switch-buttons #switch-procedures.active Procédures #switch-notifications Notifications -%div#infos-block +#infos-block .split-hr-left - #procedure_list - - @facade_data_view.gestionnaire_procedures_name_and_id_list.each do |procedure| - - = link_to backoffice_dossiers_procedure_path(procedure[:id]), { title: procedure[:libelle] } do - .procedure_list_element{ class: ('active' if procedure[:id] == @facade_data_view.procedure.id rescue '') } - = truncate(procedure[:libelle], length: 50) - - total_new = @facade_data_view.new_dossier_number procedure[:id] + #procedure-list + - current_gestionnaire.procedures.by_libelle.each do |procedure| + = link_to backoffice_dossiers_procedure_path(procedure.id), { title: procedure.libelle } do + .procedure-list-element{ class: ('active' if procedure.id.to_s == params[:id]) } + = procedure.libelle.truncate(50) + - total_new = procedure.dossiers.nouveaux.count - if total_new > 0 .badge.progress-bar-success{ title: 'Nouveaux dossiers' } = total_new - - if procedure[:unread_notifications] > 0 + - unread_notif_count = procedure.notifications.unread.count + - if unread_notif_count > 0 .badge.progress-bar-warning{ title: 'Notifications' } - = procedure[:unread_notifications] - #notifications_list.hidden - - if @facade_data_view.dossiers_with_unread_notifications.empty? + = unread_notif_count + #notifications-list.hidden + - if current_gestionnaire.notifications.empty? .no-notification Aucune notification pour le moment. - else - - @facade_data_view.dossiers_with_unread_notifications.each do |dossier| + - current_gestionnaire.notifications.includes(:dossier).map(&:dossier).uniq.each do |dossier| = link_to backoffice_dossier_path(dossier.id) do .notification - .dossier-index= "Dossier n°#{dossier.id}" + .dossier-index= "Dossier nº #{dossier.id}" .updated-at-index= dossier.first_unread_notification.created_at.strftime('%d/%m %H:%M') .count= dossier.unreaded_notifications.count diff --git a/app/views/layouts/left_panels/_left_panel_cgucontroller_index.html.haml b/app/views/layouts/left_panels/_left_panel_cgucontroller_index.html.haml index 1d386a756..6fce145f3 100644 --- a/app/views/layouts/left_panels/_left_panel_cgucontroller_index.html.haml +++ b/app/views/layouts/left_panels/_left_panel_cgucontroller_index.html.haml @@ -1,53 +1,53 @@ %div#cgu_menu_block - #procedure_list{ style: 'margin-top: 0;' } + #procedure-list{ style: 'margin-top: 0;' } = link_to cgu_path(:anchor => "editeur") do - .procedure_list_element + .procedure-list-element Editeur = link_to cgu_path(:anchor => "ingenieurie_hebergement") do - .procedure_list_element + .procedure-list-element Ingénierie et hébergement informatique = link_to cgu_path(:anchor => "object_website") do - .procedure_list_element + .procedure-list-element Object du site internet = link_to cgu_path(:anchor => "acteurs") do - .procedure_list_element + .procedure-list-element Acteurs de TPS = link_to cgu_path(:anchor => "CNIL") do - .procedure_list_element + .procedure-list-element Déclaration CNIL = link_to cgu_path(:anchor => "data_collects") do - .procedure_list_element + .procedure-list-element Données collectées et responsabilité des organismes utilisateurs = link_to cgu_path(:anchor => "individual_data") do - .procedure_list_element + .procedure-list-element Traitement des données à caractère personnel = link_to cgu_path(:anchor => "entreprise_information") do - .procedure_list_element + .procedure-list-element Règles relatives aux informations sur les entreprises mises à disposibition = link_to cgu_path(:anchor => "reproduction") do - .procedure_list_element + .procedure-list-element Droit de reproduction = link_to cgu_path(:anchor => "propriete_intellectuelle") do - .procedure_list_element + .procedure-list-element Propriété intellectuelle = link_to cgu_path(:anchor => "navigateurs") do - .procedure_list_element + .procedure-list-element Logiciels nécessaires à la consultation = link_to cgu_path(:anchor => "conception") do - .procedure_list_element + .procedure-list-element Conception et Réalisation - .procedure_list_element + .procedure-list-element - .procedure_list_element + .procedure-list-element diff --git a/app/views/layouts/left_panels/_left_panel_users_dossierscontroller_index.html.haml b/app/views/layouts/left_panels/_left_panel_users_dossierscontroller_index.html.haml index 06d8817d7..70c8fb208 100644 --- a/app/views/layouts/left_panels/_left_panel_users_dossierscontroller_index.html.haml +++ b/app/views/layouts/left_panels/_left_panel_users_dossierscontroller_index.html.haml @@ -9,37 +9,37 @@ %div#menu-block .split-hr-left - #procedure_list + #procedure-list - unless current_user.dossiers.count == 0 %a{ :href => "#{url_for users_dossiers_path(liste: 'brouillon')}", 'data-toggle' => :tooltip, title: 'Les dossiers jamais proposés à la relecture.' } - .procedure_list_element{ class: @dossiers_list_facade.brouillon_class, id: 'brouillon' } + .procedure-list-element{ class: ('active' if @liste == 'brouillon'), id: 'brouillon' } Brouillons .badge.progress-bar-default - = @dossiers_list_facade.brouillon_total + = @user_dossiers.brouillon.count %a{ :href => "#{url_for users_dossiers_path(liste: 'a_traiter')}", 'data-toggle' => :tooltip, title: 'Les dossiers qui requièrent une action de votre part.' } - .procedure_list_element{ class: @dossiers_list_facade.en_construction_class, id: 'a_traiter' } + .procedure-list-element{ class: ('active' if @liste == 'a_traiter'), id: 'a_traiter' } En construction .badge.progress-bar-danger - = @dossiers_list_facade.en_construction_total + = @user_dossiers.en_construction.count %a{ :href => "#{url_for users_dossiers_path(liste: 'en_instruction')}", 'data-toggle' => :tooltip, title: 'Les dossiers en cours d\'examen par l\'administration compétante.' } - .procedure_list_element{ class: @dossiers_list_facade.en_instruction_class, id: 'en_instruction' } + .procedure-list-element{ class: ('active' if @liste == 'en_instruction'), id: 'en_instruction' } En instruction .badge.progress-bar-default - = @dossiers_list_facade.en_instruction_total + = @user_dossiers.en_instruction.count %a{ :href => "#{url_for users_dossiers_path(liste: 'termine')}", 'data-toggle' => :tooltip, title: 'Les dossiers cloturés qui peuvent être "Accepté", "Refusé" ou "Sans suite".' } - .procedure_list_element{ class: @dossiers_list_facade.termine_class, id: 'termine' } + .procedure-list-element{ class: ('active' if @liste == 'termine'), id: 'termine' } Terminé .badge.progress-bar-success - = @dossiers_list_facade.termine_total + = @user_dossiers.termine.count %a{ :href => "#{url_for users_dossiers_path(liste: 'invite')}" } - .procedure_list_element{ class: @dossiers_list_facade.invite_class, id: 'invite' } + .procedure-list-element{ class: ('active' if @liste == 'invite'), id: 'invite' } Invitation .badge.progress-bar-warning - = @dossiers_list_facade.invite_total + = current_user.invites.count .split-hr-left diff --git a/app/views/layouts/left_panels/_search_area.html.haml b/app/views/layouts/left_panels/_search_area.html.haml index c4a49ea26..6532566e1 100644 --- a/app/views/layouts/left_panels/_search_area.html.haml +++ b/app/views/layouts/left_panels/_search_area.html.haml @@ -1,7 +1,7 @@ -#search_area +#search-area = form_tag(backoffice_dossiers_search_url, method: :get) do .input-group = text_field_tag('q', "#{@search_terms unless @search_terms.nil?}", id: 'q', placeholder: "Recherchez parmi tous vos dossiers", class: 'form-control') %span.input-group-btn - %button.btn.btn-default{ id: 'search_button' } + %button.btn.btn-default{ id: 'search-button' } %i.fa.fa-search 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 64e5e776d..cc23e5ca2 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 @@ -3,7 +3,7 @@ .col-lg-3.col-md-3.col-sm-3.col-xs-3.options .row .col-lg-12.col-md-12.col-sm-12.col-xs-12 - %a.button_navbar#pref_list_dossier_open_action{ href: '#', type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false } + %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 %span.caret-right diff --git a/app/views/layouts/navbars/_navbar_log_options.html.haml b/app/views/layouts/navbars/_navbar_log_options.html.haml index 6d04a698a..467e9b443 100644 --- a/app/views/layouts/navbars/_navbar_log_options.html.haml +++ b/app/views/layouts/navbars/_navbar_log_options.html.haml @@ -1,15 +1,15 @@ - if user_signed_in? - #sign_out.col-xs-2.no-padding + #sign-out.col-xs-2.no-padding = render partial: 'users/login_banner' = render partial: 'layouts/credentials' - elsif gestionnaire_signed_in? - #sign_out.col-xs-2.no-padding + #sign-out.col-xs-2.no-padding = render partial: 'gestionnaires/login_banner' = render partial: 'layouts/credentials' - elsif administrateur_signed_in? - #sign_out.col-xs-2.no-padding + #sign-out.col-xs-2.no-padding = render partial: 'administrateurs/login_banner' = render partial: 'layouts/credentials' - else - #sign_in.col-xs-2 + #sign-in.col-xs-2 = link_to "Connexion", new_user_session_path, :class => 'btn btn-lg btn-primary' diff --git a/app/views/layouts/new_application.html.haml b/app/views/layouts/new_application.html.haml new file mode 100644 index 000000000..9908098f3 --- /dev/null +++ b/app/views/layouts/new_application.html.haml @@ -0,0 +1,41 @@ +%html + %head + %meta{ "http-equiv" => "Content-Type", :content => "text/html; charset=UTF-8" } + %meta{ "http-equiv" => "X-UA-Compatible", :content => "IE=edge" } + %meta{ :name => "turbolinks-cache-control", :content => "no-cache" } + = csrf_meta_tags + = action_cable_meta_tag + + %title + = t("dynamics.page_title") + + = favicon_link_tag(image_url("favicons/16x16.png"), type: "image/png", sizes: "16x16") + = favicon_link_tag(image_url("favicons/32x32.png"), type: "image/png", sizes: "32x32") + = favicon_link_tag(image_url("favicons/96x96.png"), type: "image/png", sizes: "96x96") + + = stylesheet_link_tag "application", :media => "all", "data-turbolinks-track" => true + = stylesheet_link_tag "print", :media => "print", "data-turbolinks-track" => true + + %body + = render :partial => "layouts/support_navigator_banner" + = render :partial => "layouts/ie_lt_10" + #beta{ class:(Rails.env == "production" ? "" : "beta_staging") } + - if Rails.env == "production" + Beta + - else + Env Test + + = render partial: "layouts/new_header" + = render partial: "layouts/flash_messages" + = yield + + = render :partial => "layouts/switch_devise_profile_module" + = render :partial => "layouts/notifications_alert" + + = render partial: "layouts/new_footer" + = render partial: "layouts/google_analytics" + + = javascript_include_tag "application", "data-turbolinks-track" => true + - if Rails.env == "test" + %script{ :type => "text/javascript" } + (typeof jQuery !== "undefined") && (jQuery.fx.off = true); diff --git a/app/views/mails/closed_mail.html.haml b/app/views/mails/closed_mail.html.haml index 636817517..ac3153c9a 100644 --- a/app/views/mails/closed_mail.html.haml +++ b/app/views/mails/closed_mail.html.haml @@ -1,7 +1,7 @@ Bonjour %br %br -Votre dossier N°--numero_dossier-- a été accepté. +Votre dossier nº --numero_dossier-- a été accepté. %br %br A tout moment, vous pouvez consulter le contenu de vos dossiers et les éventuels commentaires de l'administration à cette adresse : --lien_dossier-- diff --git a/app/views/mails/initiated_mail.html.haml b/app/views/mails/initiated_mail.html.haml index d1e0ab917..ce3ae6324 100644 --- a/app/views/mails/initiated_mail.html.haml +++ b/app/views/mails/initiated_mail.html.haml @@ -1,7 +1,7 @@ Bonjour %br %br -Votre administration vous confirme la bonne réception de votre dossier n°--numero_dossier--. +Votre administration vous confirme la bonne réception de votre dossier nº --numero_dossier--. %br %br A tout moment, vous pouvez consulter le contenu de vos dossiers et les éventuels commentaires de l'administration à cette adresse : --lien_dossier-- diff --git a/app/views/mails/received_mail.html.haml b/app/views/mails/received_mail.html.haml index bc0b64ffa..113139052 100644 --- a/app/views/mails/received_mail.html.haml +++ b/app/views/mails/received_mail.html.haml @@ -1,7 +1,7 @@ Bonjour %br %br -Votre administration vous confirme la bonne réception de votre dossier n°--numero_dossier--. Celui-ci sera instruit dans le délai légal déclaré par votre interlocuteur. +Votre administration vous confirme la bonne réception de votre dossier nº --numero_dossier--. Celui-ci sera instruit dans le délai légal déclaré par votre interlocuteur. %br %br Bonne journée diff --git a/app/views/mails/refused_mail.html.haml b/app/views/mails/refused_mail.html.haml index d98bacab6..900942f26 100644 --- a/app/views/mails/refused_mail.html.haml +++ b/app/views/mails/refused_mail.html.haml @@ -1,7 +1,7 @@ Bonjour %br %br -Votre dossier N°--numero_dossier-- a été refusé. +Votre dossier nº --numero_dossier-- a été refusé. %br %br Pour en savoir plus sur le motif du refus, vous pouvez consulter le contenu de vos dossiers et les éventuels commentaires de l'administration à cette adresse : --lien_dossier-- diff --git a/app/views/mails/without_continuation_mail.html.haml b/app/views/mails/without_continuation_mail.html.haml index 5277c51a6..03ab071cc 100644 --- a/app/views/mails/without_continuation_mail.html.haml +++ b/app/views/mails/without_continuation_mail.html.haml @@ -1,7 +1,7 @@ Bonjour %br %br -Votre dossier N°--numero_dossier-- a été classé sans suite. +Votre dossier nº --numero_dossier-- a été classé sans suite. %br %br Pour en savoir plus sur les raisons de ce classement sans suite, vous pouvez consulter le contenu de vos dossiers et les éventuels commentaires de l'administration à cette adresse : --lien_dossier-- diff --git a/app/views/root/landing.html.haml b/app/views/root/landing.html.haml index 513517202..f49b66bb7 100644 --- a/app/views/root/landing.html.haml +++ b/app/views/root/landing.html.haml @@ -1,87 +1,141 @@ -#landing.max-size - #title - .center - = image_tag 'logos/logo-tps.png', id: 'logo-tps' - %h1.center - TéléProcédure Simplifiée +.landing + .landing-panel.hero-panel + .landing-panel-inner-content + .hero-text.pull-left + %p.hero-tagline + %em.hero-tagline-em Dématérialisez + %br + vos démarches administratives en quelques minutes - .row - .col-md-8.col-md-push-2.center - %h3 - Dématérialisez n'importe quelle démarche administrative en quelques minutes, - avec un outil - %strong - gratuit, simple, collaboratif et sûr + = link_to "Demander une démo", + "mailto:#{t("dynamics.contact_email")}?subject=Demande de démo TPS", + :class => "hero-button" - %p.mt-1 Vous êtes intéressés ? - %p= link_to 'Programmer une démo', "mailto:#{t('dynamics.contact_email')}?subject=Demande de démo TPS", target: '_blank', class: 'btn btn-danger btn-lg' + %p.hero-phone-cta + ou nous appeler au 01 40 15 68 49 -#landing_body.max-size - .row#etapes.center - #create_1.col-lg-3.col-md-3.col-sm-3.col-xs-3 - %img{ src: image_url('etapes/create_1.png') } - %br - %h4 Administration - %h3.text-info Je construis ma démarche 100% en ligne - #complet_2.col-lg-3.col-md-3.col-sm-3.col-xs-3 - %img{ src: image_url('etapes/complet_2.png') } - %br - %h4 Usager - %h3.text-success Je remplis un dossier de manière simplifiée - #message_3.col-lg-3.col-md-3.col-sm-3.col-xs-3 - %img{ src: image_url('etapes/message_3.png') } - %br - %h4 Usager - %h3.text-warning Je dialogue avec mon administration en ligne - #shared_4.col-lg-3.col-md-3.col-sm-3.col-xs-3 - %img{ src: image_url('etapes/shared_4.png') } - %br - %h4 Usager et Administrations - %h3.text-danger - J'invite des partenaires à co-construire le dossier + .hero-illustration.pull-right + %img{ :src => image_url("landing/hero/dematerialiser.svg") } - .split-hr-left + .clearfix - .row.demo_account.center - .col-md-4.col-lg-4 - %h3.text-primary Acteurs publics - %h4 Créez des démarches en ligne simplifiées et sécurisées. - = link_to 'Démonstration', "#{@demo_environment_host}/administrateurs/sign_in/demo", { class: 'btn btn-lg btn-primary' } + .landing-panel.features-panel + .landing-panel-inner-content + %h2.landing-panel-title.features-panel-title Un outil dédié aux organismes publics - .col-md-4.col-lg-4 - %h3.text-warning Agents et services - %h4 Accompagnez et co-traitez les projets avec les usagers. - = link_to 'Démonstration', "#{@demo_environment_host}/gestionnaires/sign_in/demo", { class: 'btn btn-lg btn-warning' } + %ul.features + %li.feature + %img.feature-image{ :src => image_url("landing/features/creer.svg") } + %p.feature-text + %em.feature-text-em Créer + %br + des procédures en ligne + %br + en toute simplicité + %li.feature + %img.feature-image{ :src => image_url("landing/features/gerer.svg") } + %p.feature-text + %em.feature-text-em Gérer + %br + les demandes des usagers
 + %br + sur la plateforme + %li.feature + %img.feature-image{ :src => image_url("landing/features/collaborer.svg") } + %p.feature-text + %em.feature-text-em Collaborer + %br + pour instruire les demandes
 + %br + à plusieurs - .col-md-4.col-lg-4 - %h3.text-success Usagers - %h4 Profitez de démarches simplifiées et d’échanges continus avec les services traitants. - = link_to 'Démonstration', "#{@demo_environment_host}/users/sign_in/demo", { class: 'btn btn-lg btn-success' } + .landing-panel + .landing-panel-inner-content + %h2.landing-panel-title Ce que les utilisateurs pensent du service - .split-hr-left + %ul.quotes + %li.quote + %img.quote-quotation-mark.pull-left{ :src => image_url("landing/testimonials/quotation-mark.svg") } + %p.quote-content.pull-right + TPS est un outil de dématérialisation adapté au dépôt de dossiers de demande d’inscription au registre des transporteurs routiers en Ile-de-France. Les échanges avec les usagers sont facilités, ce qui permet de réduire les délais d’instructions et de gagner en efficacité. + .clearfix - .center - .row - #utilisateurs.col-xs-12.col-sm-12.col-md-12.col-lg-12 - %h4 Ils nous font confiance + %p.quote-author.pull-left + %span.quote-author-name Elodie Le Rhun + %br + Chef de bureau, DRIEA Ile-de-France + .clearfix - Conseil Regional Ile de France, Politique de la ville du Pas de Calais (ensemble des administrations et collectivités territoriales concernées), DRIEA Ile de France - %br - Préfecture de la Martinique, DRIEE Ile de France, Ministère de l'Environnement, de l'Energie et de la Mer, MEEM, CCI Normandie, DGE, Assemblée permanente des chambres de métiers et de l'artisanat + %li.quote + %img.quote-quotation-mark.pull-left{ :src => image_url("landing/testimonials/quotation-mark.svg") } + %p.quote-content.pull-right + TPS c’est surtout l’assurance d’un dialogue en toute fluidité et en toute transparence entre les porteurs de projet et l’administration. Un service qui garantit une économie de temps et beaucoup moins de manipulations des dossiers. + .clearfix - %br - .row - #partenaires.col-xs-12.col-sm-12.col-md-12.col-lg-12 - %h4 Ils travaillent avec nous + %p.quote-author.pull-left + %span.quote-author-name Nadja Briki + %br + Déléguée de la Préfète du Pas-de-Calais + .clearfix - Insee, Infogreffe, Ministère de la Ville, de la Jeunesse et des Sports, IGN, DGFIP, CGET, France Connect, Open Streetmap, la BAN, api.gouv.fr, Euroquity - BPI, FNTP, Qualibat + - cache "numbers-panel", :expires_in => 3.hours do + .landing-panel.numbers-panel + .landing-panel-inner-content + %h2.landing-panel-title TPS en chiffres + %ul.numbers + %li.number + .number-value + = number_with_delimiter(Procedure.where(:published => true).count, :locale => :fr) + .number-label< + procédures + %br<> + dématérialisées + %li.number + .number-value + = number_with_delimiter(Dossier.where.not(:state => :draft).count, :locale => :fr) + .number-label< + dossiers + %br<> + déposés + %li.number + .number-value + = "#{number_with_delimiter(50, :locale => :fr)} %" + .number-label< + de réduction + %br<> + des délais de traitement - .split-hr-left + .landing-panel.users-panel + .landing-panel-inner-content + %h2.landing-panel-title Ils nous font confiance - #request_access.row.center - .col-xs-12.col-sm-12.col-md-12.col-lg-12 - %h3 Envie de commencer à créer votre démarche ? + %ul.users + %li.user + %a{ :href => "http://www.developpement-durable.gouv.fr/", :target => "_blank " } + %img.user-image{ :src => image_url("landing/users/ministere-environnement.jpg") } + %li.user + %a{ :href => "https://www.iledefrance.fr/", :target => "_blank " } + %img.user-image{ :src => image_url("landing/users/region-idf.jpg") } + %li.user + %a{ :href => "http://www.artisanat.fr/", :target => "_blank " } + %img.user-image{ :src => image_url("landing/users/chambres-de-metiers.jpg") } + %li.user + %a{ :href => "http://www.cci.fr/", :target => "_blank " } + %img.user-image{ :src => image_url("landing/users/cci.jpg") } + %li.user + %a{ :href => "http://www.driea.ile-de-france.developpement-durable.gouv.fr/", :target => "_blank " } + %img.user-image{ :src => image_url("landing/users/driea-idf.jpg") } - = link_to 'Demander un accès administrateur', 'https://tps.apientreprise.fr/users/dossiers/new?procedure_id=31', { class: 'btn btn-lg background-tps', target: '_blank' } + .landing-panel.cta-panel + .landing-panel-inner-content + .pull-right + = link_to "Demander une démo", + "mailto:#{t('dynamics.contact_email')}?subject=Demande de démo TPS", + :class => "cta-panel-button" + %p.cta-panel-phone-cta + ou nous appeler au 01 40 15 68 49 + .pull-left + %h1.cta-panel-title Commencez à dématerialiser vos démarches + %p.cta-panel-explanation Nous vous accompagnons dans la prise en main de l’outil + .clearfix - .split-hr-left diff --git a/app/views/stats/index.html.haml b/app/views/stats/index.html.haml index 42d6ea90c..88e596ab4 100644 --- a/app/views/stats/index.html.haml +++ b/app/views/stats/index.html.haml @@ -6,7 +6,7 @@ .stat-cards - .stat-card.stat-card-half.pull-left + .card.stat-card.stat-card-half.pull-left %ul.segmented-control.pull-right %li.segmented-control-item.segmented-control-item-active{ :onclick => "TPS.toggleChart(event, '.cumulative-procedures-chart');" } Cumul @@ -23,7 +23,7 @@ = line_chart @procedures_30_days_flow, :colors => ["rgba(61, 149, 236, 1)"] - .stat-card.stat-card-half.pull-left + .card.stat-card.stat-card-half.pull-left %ul.segmented-control.pull-right %li.segmented-control-item.segmented-control-item-active{ :onclick => "TPS.toggleChart(event, '.cumulative-dossiers-chart');" } Cumul @@ -40,14 +40,14 @@ = line_chart @dossiers_30_days_flow, :colors => ["rgba(61, 149, 236, 1)"] - .stat-card.stat-card-half.big-number-card.pull-left + .card.stat-card.stat-card-half.big-number-card.pull-left %span.big-number-card-title TOTAL DÉMARCHES DÉMATÉRIALISÉES %span.big-number-card-number - = @procedures_count + = number_with_delimiter(@procedures_count) - .stat-card.stat-card-half.big-number-card.pull-left + .card.stat-card.stat-card-half.big-number-card.pull-left %span.big-number-card-title TOTAL DOSSIERS DÉPOSÉS %span.big-number-card-number - = @dossiers_count + = number_with_delimiter(@dossiers_count) .clearfix diff --git a/app/views/users/carte/_map.html.haml b/app/views/users/carte/_map.html.haml index 8915c35d0..80f1bbf36 100644 --- a/app/views/users/carte/_map.html.haml +++ b/app/views/users/carte/_map.html.haml @@ -1,12 +1,12 @@ -#carte_page.row - #map{ class: dossier.procedure.module_api_carto.classes } +#carte-page.row + .col-md-12.col-lg-12#map{ class: dossier.procedure.module_api_carto.classes } - if dossier.procedure.module_api_carto.quartiers_prioritaires - #qp.list + .col-md-9.col-lg-9#qp.col-md-3.col-lg-3.list %h3.text-info Quartiers prioritaites %ul - if dossier.procedure.module_api_carto.cadastre - #cadastre.list + .col-md-9.col-lg-9#cadastre.col-md-3.col-lg-3.list %h3.text-warning Cadastres %ul diff --git a/app/views/users/carte/show.html.haml b/app/views/users/carte/show.html.haml index de4a0505f..db8d0115e 100644 --- a/app/views/users/carte/show.html.haml +++ b/app/views/users/carte/show.html.haml @@ -1,4 +1,4 @@ -.row#carto_page +.row#carto-page .col-lg-12.col-md-12.col-sm-12.col-xs-12 %h2 Localisation @@ -11,7 +11,7 @@ %i.fa.fa-pencil Ajouter une zone - %span#search_by_address{ style: 'margin-left: 20px;' } + %span#search-by-address{ style: 'margin-left: 20px;' } %input.form-control{ type: :address, placeholder: 'Rechercher une adresse' } %br %br diff --git a/app/views/users/description/_champs.html.haml b/app/views/users/description/_champs.html.haml index d6c5184b7..ab43c5923 100644 --- a/app/views/users/description/_champs.html.haml +++ b/app/views/users/description/_champs.html.haml @@ -7,7 +7,7 @@ = render partial: render_partial_url, locals: { libelle: 'Dossier', order_place: -1, champs: @champs } - @headers.each do |header| .row - %div{ class: "type_champ-#{header.type_champ}" } + %div{ class: "type-champ-#{header.type_champ.gsub('_', '-')}" } = render partial: render_partial_url, locals: { libelle: header.libelle, order_place: header.order_place, champs: @champs } - else .row diff --git a/app/views/users/description/_pieces_justificatives.html.haml b/app/views/users/description/_pieces_justificatives.html.haml index e3a109ba9..bb6604478 100644 --- a/app/views/users/description/_pieces_justificatives.html.haml +++ b/app/views/users/description/_pieces_justificatives.html.haml @@ -18,24 +18,24 @@ - else %input{ type: 'file', name: 'cerfa_pdf', id: 'cerfa_pdf', accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes } - - dossier.types_de_piece_justificative.order('order_place ASC').each do |type_de_piece_justificative| + - dossier.types_de_piece_justificative.order('order_place ASC').each do |tpj| %tr %th.piece-libelle - = type_de_piece_justificative.libelle + = tpj.mandatory ? tpj.libelle + ' *' : tpj.libelle %td - - unless type_de_piece_justificative.lien_demarche.blank? + - unless tpj.lien_demarche.blank? %em Récupérer le formulaire vierge pour mon dossier : - = link_to "Télécharger", type_de_piece_justificative.lien_demarche, target: :blank + = link_to "Télécharger", tpj.lien_demarche, target: :blank %td - - if type_de_piece_justificative.api_entreprise - %span.text-success{ id: "piece_justificative_#{type_de_piece_justificative.id}" } Nous l'avons récupéré pour vous. + - if tpj.api_entreprise + %span.text-success{ id: "piece_justificative_#{tpj.id}" } Nous l'avons récupéré pour vous. - else - - if dossier.retrieve_last_piece_justificative_by_type(type_de_piece_justificative.id).nil? - = file_field_tag "piece_justificative_#{type_de_piece_justificative.id}", accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes + - if dossier.retrieve_last_piece_justificative_by_type(tpj.id).nil? + = file_field_tag "piece_justificative_#{tpj.id}", accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes - else %span.btn.btn-sm.btn-file.btn-success Modifier - = file_field_tag "piece_justificative_#{type_de_piece_justificative.id}", accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes + = file_field_tag "piece_justificative_#{tpj.id}", accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes diff --git a/app/views/users/description/_show.html.haml b/app/views/users/description/_show.html.haml index 627773625..d83503308 100644 --- a/app/views/users/description/_show.html.haml +++ b/app/views/users/description/_show.html.haml @@ -1,4 +1,4 @@ -.container#description_page +.container#description-page - unless @dossier.procedure.lien_notice.blank? #lien_notice_panel.row{ style: 'width: 280px; position: fixed; background-color: white; right: 5%; top: 80px; z-index: 200;' } .panel.panel-info{ style: 'margin-bottom: 0;' } @@ -17,7 +17,7 @@ -# TODO use form_for = form_tag(url_for({ controller: 'users/description', action: :update, dossier_id: @dossier.id }), class: 'form', method: 'POST', multipart: true) do - unless @champs.nil? - #liste_champs + #liste-champs = render partial: 'users/description/champs', locals: { private: false } - if !@procedure.lien_demarche.blank? || @procedure.cerfa_flag || @dossier.types_de_piece_justificative.size > 0 diff --git a/app/views/users/description/champs/_dossier_link.html.haml b/app/views/users/description/champs/_dossier_link.html.haml index 41d6f0526..c29f2745c 100644 --- a/app/views/users/description/champs/_dossier_link.html.haml +++ b/app/views/users/description/champs/_dossier_link.html.haml @@ -1,11 +1,11 @@ - dossier = Dossier.find_by(id: champ.value) -- show_procedure_libelle = dossier ? true : false -- show_warning = !show_procedure_libelle && champ.value.present? -- procedure_libelle = dossier.nil? ? '' : dossier.procedure.libelle +- show_text_summary = dossier.present? +- show_warning = !show_text_summary && champ.value.present? +- text_summary = dossier.try(:text_summary) .dossier-link %input.form-control{ name: "champs['#{ champ.id }']", - placeholder: champ.libelle, + placeholder: "Numéro de dossier", id: "champs_#{ champ.id }", value: champ.value, type: 'number', @@ -13,9 +13,8 @@ 'data-type' => 'dossier-link' } .help-block - %p.text-info{ style: show_procedure_libelle ? nil : 'display: none;' } - ce dossier répond à la procédure : - %br - %span.procedureLibelle= procedure_libelle + %p.text-info{ style: show_text_summary ? nil : 'display: none;' } + %span.dossier-text-summary= text_summary + %p.text-warning{ style: show_warning ? nil : 'display: none;' } - ce dossier est inconnu + Ce dossier est inconnu diff --git a/app/views/users/description/champs/_header_section.html.haml b/app/views/users/description/champs/_header_section.html.haml index 410563165..b75094c2a 100644 --- a/app/views/users/description/champs/_header_section.html.haml +++ b/app/views/users/description/champs/_header_section.html.haml @@ -1,4 +1,4 @@ -.default_data_block.default_visible +.default-data-block.default_visible .row.show-block.infos .header .col-xs-12.title diff --git a/app/views/users/description/champs/_render_list_champs.html.haml b/app/views/users/description/champs/_render_list_champs.html.haml index 0d1f91f76..01c395d33 100644 --- a/app/views/users/description/champs/_render_list_champs.html.haml +++ b/app/views/users/description/champs/_render_list_champs.html.haml @@ -11,40 +11,41 @@ - if champ.mandatory? * - - if champ.type_champ == 'textarea' + - case champ.type_champ + - when 'textarea' = render partial: 'users/description/champs/textarea', locals: { champ: champ } - - elsif champ.type_champ == 'checkbox' + - when 'checkbox' = render partial: 'users/description/champs/checkbox', locals: { champ: champ } - - elsif champ.type_champ == 'civilite' + - when 'civilite' = render partial: 'users/description/champs/civilite', locals: { champ: champ } - - elsif champ.type_champ == 'datetime' + - when 'datetime' = render partial: 'users/description/champs/datetime', locals: { champ: champ } - - elsif champ.type_champ == 'yes_no' + - when 'yes_no' = render partial: 'users/description/champs/yes_no', locals: { champ: champ } - - elsif %w(drop_down_list multiple_drop_down_list).include?(champ.type_champ) + - when 'drop_down_list', 'multiple_drop_down_list' = render partial: 'users/description/champs/drop_down_list', locals: { champ: champ } - - elsif champ.type_champ == 'pays' + - when 'pays' = render partial: 'users/description/champs/pays', locals: { champ: champ } - - elsif champ.type_champ == 'regions' + - when 'regions' = render partial: 'users/description/champs/regions', locals: { champ: champ } - - elsif champ.type_champ == 'engagement' + - when 'engagement' = render partial: 'users/description/champs/engagement', locals: { champ: champ } - - elsif champ.type_champ == 'departements' + - when 'departements' = render partial: 'users/description/champs/departements', locals: { champ: champ } - - elsif champ.type_champ == 'dossier_link' + - when 'dossier_link' = render partial: 'users/description/champs/dossier_link', locals: { champ: champ } - - elsif champ.type_champ == 'explication' + - when 'explication' - else %input.form-control{ name: "champs['#{champ.id}']", diff --git a/app/views/users/dossiers/_list.html.haml b/app/views/users/dossiers/_list.html.haml index 89d902533..969e680f2 100644 --- a/app/views/users/dossiers/_list.html.haml +++ b/app/views/users/dossiers/_list.html.haml @@ -1,5 +1,5 @@ - unless smart_listing.empty? - %table#dossiers_list.table + %table#dossiers-list.table %thead %th#sort-id.col-md-1.col-lg-1.col-sm-1.col-xs-1= smart_listing.sortable 'Numéro', 'id' %th#sort-libelle.col-xs-5= smart_listing.sortable 'Procédure', 'procedure.libelle' diff --git a/app/views/users/dossiers/_state_description.html.haml b/app/views/users/dossiers/_state_description.html.haml index 52d13cab2..da1abe824 100644 --- a/app/views/users/dossiers/_state_description.html.haml +++ b/app/views/users/dossiers/_state_description.html.haml @@ -5,33 +5,34 @@ .col-md-1.col-lg-1.col-sm-1.col-xs-1 .fa.fa-info-circle.text-info{ style: 'font-size: 2em; margin-top: 20%;' } .col-xs-11 - - if dossiers_list_facade.liste == 'brouillon' + - case liste + - when 'brouillon' Les dossiers présents dans cette liste %b n'ont pas encore été soumis aux services instructeurs. Ils ne sont visibles que par vous. - - elsif dossiers_list_facade.liste == 'nouveaux' + - when 'nouveaux' Les dossiers présents dans cette liste %b n'ont pas encore été ouverts par les services instructeurs. Une notification vous sera envoyée quand votre demande aura été étudiée. - - elsif dossiers_list_facade.liste == 'a_traiter' + - when 'a_traiter' Les dossiers présents dans cette liste sont %b visibles par les services instructeurs. %br Ces dossiers ne sont pas encore figés et peuvent être modifiés à souhait. - - elsif dossiers_list_facade.liste == 'en_attente' + - when 'en_attente' Les dossiers présents dans cette liste sont %b en cours de relecture par les services instructeurs. Il reviendra vers vous si des informations ou documents sont manquants pour le futur examen de votre dossier. - - elsif dossiers_list_facade.liste == 'valides' + - when 'valides' Les dossiers présents dans cette liste ont été %b relus et considérés comme complets pour examen par les services instructeurs. Ceux-ci ne peuvent maintenant plus être modifiés. Il faut que vous procédiez à leur dépôt afin qu'une décision finale soit rendue. - - elsif dossiers_list_facade.liste == 'en_instruction' + - when 'en_instruction' Les dossiers présents dans cette liste sont %b en cours de réception @@ -39,12 +40,12 @@ %b en cours d'examen par les services instructeurs. Une notification vous sera envoyée une fois qu'une décision aura été rendue. - - elsif dossiers_list_facade.liste == 'termine' + - when 'termine' Les dossiers présents dans cette liste sont ceux qui ont été instruits et pour lesquels %b une décision finale a été rendue. Ils peuvent posséder trois états différents : Accepté, Refusé ou Sans Suite. - - elsif dossiers_list_facade.liste == 'invite' + - when 'invite' Les dossiers présents dans cette liste sont ceux %b auxquels vous avez été invités diff --git a/app/views/users/dossiers/add_siret/show.html.haml b/app/views/users/dossiers/add_siret/show.html.haml index 9cf12e4a3..134d78a16 100644 --- a/app/views/users/dossiers/add_siret/show.html.haml +++ b/app/views/users/dossiers/add_siret/show.html.haml @@ -1,2 +1,2 @@ -.row.etape.etape_2 +.row.etape.etape-2 = render partial: 'dossiers/etapes/etape_2/entreprise' diff --git a/app/views/users/dossiers/index.html.haml b/app/views/users/dossiers/index.html.haml index 3811c1ed8..77f085261 100644 --- a/app/views/users/dossiers/index.html.haml +++ b/app/views/users/dossiers/index.html.haml @@ -1,5 +1,5 @@ -#users_index - .default_data_block.default_visible +#users-index + .default-data-block.default_visible .row.show-block#new_dossiers .header .col-lg-10.col-md-10.col-sm-10.col-xs-10.title @@ -12,4 +12,4 @@ .body = smart_listing_render :dossiers - = render partial: 'state_description', locals: { dossiers_list_facade: @dossiers_list_facade } + = render partial: 'state_description', locals: { liste: @liste } diff --git a/app/views/users/passwords/edit.html.haml b/app/views/users/passwords/edit.html.haml index 2e6a246f4..d1688e75c 100644 --- a/app/views/users/passwords/edit.html.haml +++ b/app/views/users/passwords/edit.html.haml @@ -28,7 +28,7 @@ = devise_error_messages! -#form_login +#form-login .flag = image_tag(image_url(LOGO_NAME)) %br @@ -36,7 +36,7 @@ %br %br - #new_user + #new-user = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| = f.hidden_field :reset_password_token %h4 diff --git a/app/views/users/passwords/new.html.haml b/app/views/users/passwords/new.html.haml index 8a62b7652..fa5410532 100644 --- a/app/views/users/passwords/new.html.haml +++ b/app/views/users/passwords/new.html.haml @@ -29,7 +29,7 @@ = devise_error_messages! %br -#form_login +#form-login .flag = image_tag(image_url(LOGO_NAME)) %br @@ -37,7 +37,7 @@ %br %br - #new_user + #new-user = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %h4 = f.label :email diff --git a/app/views/users/recapitulatif/_modal_upload_pj.html.haml b/app/views/users/recapitulatif/_modal_upload_pj.html.haml index 63c3e5322..58adcae3f 100644 --- a/app/views/users/recapitulatif/_modal_upload_pj.html.haml +++ b/app/views/users/recapitulatif/_modal_upload_pj.html.haml @@ -1,4 +1,4 @@ -#UploadPJmodal.modal.fade{ "aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1" } +#upload-pj-modal.modal.fade{ "aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1" } .modal-dialog{ :role => "document" } .modal-content - @dossier = @facade.dossier diff --git a/app/views/users/recapitulatif/show.html.haml b/app/views/users/recapitulatif/show.html.haml index 672ab5867..f04ac5a43 100644 --- a/app/views/users/recapitulatif/show.html.haml +++ b/app/views/users/recapitulatif/show.html.haml @@ -1,2 +1,2 @@ -.col-lg-12.col-md-12.col-sm-12.col-xs-12#users_recapitulatif_dossier_show +.col-lg-12.col-md-12.col-sm-12.col-xs-12#users-recapitulatif-dossier-show = render partial: "dossiers/dossier_show" diff --git a/app/views/users/registrations/new.html.haml b/app/views/users/registrations/new.html.haml index 82da47322..a81def70b 100644 --- a/app/views/users/registrations/new.html.haml +++ b/app/views/users/registrations/new.html.haml @@ -28,7 +28,7 @@ = devise_error_messages! -#form_login +#form-login %br .flag = image_tag(image_url(LOGO_NAME)) @@ -37,7 +37,7 @@ %br %br - #new_user + #new-user = form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %h4 = f.label :email diff --git a/app/views/users/sessions/_resume_procedure.html.haml b/app/views/users/sessions/_resume_procedure.html.haml index 236bf7a10..bf385234e 100644 --- a/app/views/users/sessions/_resume_procedure.html.haml +++ b/app/views/users/sessions/_resume_procedure.html.haml @@ -10,7 +10,7 @@ #logo_procedure.flag = image_tag( @dossier.procedure.decorate.logo_img ) - %h2#titre_procedure.text-info + %h2#titre-procedure.text-info = @dossier.procedure.libelle %p.procedure-description = h @dossier.procedure.description.html_safe diff --git a/app/views/users/sessions/new.html.haml b/app/views/users/sessions/new.html.haml index add5365c3..51ba7cda6 100644 --- a/app/views/users/sessions/new.html.haml +++ b/app/views/users/sessions/new.html.haml @@ -1,11 +1,11 @@ -#form_login.user_connexion_page +#form-login.user_connexion_page %br = render partial: 'users/sessions/resume_procedure' - %h2#login_user + %h2#login-user = t('dynamics.users.connexion_title') - %a.btn_fc#btn_fcp{ href: '/france_connect/particulier' } + %a.btn-fc#btn-fcp{ href: '/france_connect/particulier' } = image_tag 'franceconnect_logo.png' %br @@ -15,13 +15,14 @@ %hr .text-left - = simple_form_for @user, url: user_session_path do |f| - = f.input :email - = f.input :password, label: 'Mot de passe', input_html: { value: @user.password } - - if devise_mapping.rememberable? - = f.input :remember_me, as: :boolean, label: 'Se souvenir de moi' - .text-center - = f.submit "Se connecter", class: 'btn btn-primary' + #new-user + = simple_form_for @user, url: user_session_path do |f| + = f.input :email + = f.input :password, label: 'Mot de passe', input_html: { value: @user.password } + - if devise_mapping.rememberable? + = f.input :remember_me, as: :boolean, label: 'Se souvenir de moi' + .text-center + = f.submit "Se connecter", class: 'btn btn-primary' - if @user.email != DemoEmails[:gestionnaire] && @user.email != DemoEmails[:admin] = render "users/shared/links" diff --git a/app/views/users/siret/_pro.html.haml b/app/views/users/siret/_pro.html.haml index 34fe7aaaf..b5686009e 100644 --- a/app/views/users/siret/_pro.html.haml +++ b/app/views/users/siret/_pro.html.haml @@ -2,7 +2,7 @@ .flag = image_tag(image_url(LOGO_NAME)) %br - %h2#titre_procedure.text-info + %h2#titre-procedure.text-info = @procedure.libelle %p diff --git a/app/views/users/siret/index.html.haml b/app/views/users/siret/index.html.haml index a56f21779..c189ce64e 100644 --- a/app/views/users/siret/index.html.haml +++ b/app/views/users/siret/index.html.haml @@ -1,3 +1,3 @@ -.container.center#users_siret_index +.container.center#users-siret-index .row = render partial: 'pro' diff --git a/config/application.rb b/config/application.rb index b3c5dc10c..1c82112d2 100644 --- a/config/application.rb +++ b/config/application.rb @@ -23,6 +23,8 @@ module TPS config.autoload_paths += %W(#{config.root}/lib #{config.root}/app/validators #{config.root}/app/facades) config.assets.paths << Rails.root.join('app', 'assets', 'javascript') + config.assets.paths << Rails.root.join('app', 'assets', 'fonts') + config.assets.precompile += %w(.woff) if Rails.env.production? URL = "https://tps.apientreprise.fr/" diff --git a/config/deploy.rb b/config/deploy.rb index f03e38682..eae817ea8 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -11,7 +11,7 @@ require 'mina/rbenv' # for rbenv support. (http://rbenv.org) # branch - Branch name to deploy. (needed by mina/git) ENV['to'] ||= "staging" -raise "Bad to=#{+ENV['to']}" unless ["staging", "production", "tps_v2"].include?(ENV['to']) +raise "Bad to=#{+ENV['to']}" unless ["staging", "production"].include?(ENV['to']) raise "missing domain, run with 'rake deploy domain=37.187.154.237'" if ENV['domain'].nil? @@ -24,7 +24,8 @@ set :port, 2200 set :deploy_to, '/var/www/tps_dev' -if ENV["to"] == "staging" +case ENV["to"] +when "staging" if ENV['branch'].nil? set :branch, 'staging' else @@ -33,7 +34,7 @@ if ENV["to"] == "staging" set :deploy_to, '/var/www/tps_dev' set :user, 'tps_dev' # Username in the server to SSH to. appname = 'tps_dev' -elsif ENV["to"] == "production" +when "production" if ENV['branch'].nil? set :branch, 'master' else @@ -42,23 +43,10 @@ elsif ENV["to"] == "production" set :deploy_to, '/var/www/tps' set :user, 'tps' # Username in the server to SSH to. appname = 'tps' -elsif ENV["to"] == "tps_v2" - if ENV['branch'].nil? - set :branch, 'staging_v2' - else - set :branch, ENV['branch'] - end - set :deploy_to, '/var/www/tps_v2' - set :user, 'tps_v2' # Username in the server to SSH to. - appname = 'tps_v2' end set :rails_env, ENV["to"] -if ENV["to"] == "tps_v2" - set :rails_env, "staging" -end - # For system-wide RVM install. # set :rvm_path, '/usr/local/rvm/bin/rvm' diff --git a/config/environments/production.rb b/config/environments/production.rb index 79e0eed48..60eaafedd 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -55,7 +55,7 @@ Rails.application.configure do # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) # Use a different cache store in production. - # config.cache_store = :mem_cache_store + config.cache_store = :memory_store # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.action_controller.asset_host = 'http://assets.example.com' diff --git a/config/locales/dynamics/fr.yml b/config/locales/dynamics/fr.yml index 72c3aa0f2..9846ccec1 100644 --- a/config/locales/dynamics/fr.yml +++ b/config/locales/dynamics/fr.yml @@ -23,7 +23,7 @@ fr: dossiers: depositaite: "Dépositaire" - numéro: 'Dossier n°' + numéro: 'Dossier nº ' followers: title: "Personnes suivant l'activité de ce dossier" empty: "Aucune personne ne suit ce dossier" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 5f8a4ad9e..d67a7166c 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -37,13 +37,53 @@ fr: first: Premier number: - currency: - format: - unit: '€' - delimiter: ' ' - separator: ',' - precision: 2 - format: '%n %u' + currency: + format: + delimiter: " " + format: "%n %u" + precision: 2 + separator: "," + significant: false + strip_insignificant_zeros: false + unit: "€" + format: + delimiter: " " + precision: 3 + separator: "," + significant: false + strip_insignificant_zeros: false + human: + decimal_units: + format: "%n %u" + units: + billion: milliard + million: million + quadrillion: million de milliards + thousand: millier + trillion: billion + unit: '' + format: + delimiter: '' + precision: 3 + significant: true + strip_insignificant_zeros: true + storage_units: + format: "%n %u" + units: + byte: + one: octet + other: octets + gb: Go + kb: ko + mb: Mo + tb: To + percentage: + format: + delimiter: '' + format: "%n%" + precision: + format: + delimiter: '' activerecord: errors: models: @@ -149,6 +189,59 @@ fr: extension_white_list_error: "Le format de fichier de la pièce jointe n'est pas valide." procedure_archived: "Cette démarche en ligne a été fermée, il n'est plus possible de déposer de dossier." + date: + abbr_day_names: + - dim + - lun + - mar + - mer + - jeu + - ven + - sam + abbr_month_names: + - + - jan. + - fév. + - mar. + - avr. + - mai + - juin + - juil. + - août + - sept. + - oct. + - nov. + - déc. + day_names: + - dimanche + - lundi + - mardi + - mercredi + - jeudi + - vendredi + - samedi + formats: + default: "%d/%m/%Y" + short: "%e %b" + long: "%e %B %Y" + month_names: + - + - janvier + - février + - mars + - avril + - mai + - juin + - juillet + - août + - septembre + - octobre + - novembre + - décembre + order: + - :day + - :month + - :year datetime: distance_in_words: about_x_hours: diff --git a/config/locales/models/procedure_path/fr.yml b/config/locales/models/procedure_path/fr.yml new file mode 100644 index 000000000..a17306b90 --- /dev/null +++ b/config/locales/models/procedure_path/fr.yml @@ -0,0 +1,8 @@ +fr: + activerecord: + errors: + models: + procedure_path: + attributes: + path: + format: Ce lien n'est pas valide. Il doit comporter au moins 3 caractères, au plus 50 caractères et seuls les caractères a-z, 0-9, '_' et '-' sont autorisés. diff --git a/config/routes.rb b/config/routes.rb index 6f0d9edad..16b0b090a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -95,7 +95,7 @@ Rails.application.routes.draw do post '/siret_informations' => 'dossiers#siret_informations' put '/change_siret' => 'dossiers#change_siret' - get 'procedure_libelle' => 'dossiers#procedure_libelle' + get 'text_summary' => 'dossiers#text_summary' end resource :dossiers end diff --git a/db/migrate/20160901082824_initiated_all_received_mail_for_procedure.rb b/db/migrate/20160901082824_initiated_all_received_mail_for_procedure.rb index 225745646..89e5f03cd 100644 --- a/db/migrate/20160901082824_initiated_all_received_mail_for_procedure.rb +++ b/db/migrate/20160901082824_initiated_all_received_mail_for_procedure.rb @@ -11,11 +11,11 @@ class InitiatedAllReceivedMailForProcedure < ActiveRecord::Migration before_save :default_values def default_values - self.object ||= "[TPS] Accusé de réception pour votre dossier n°--numero_dossier--" + self.object ||= "[TPS] Accusé de réception pour votre dossier nº --numero_dossier--" self.body ||= "Bonjour,

    - Votre administration vous confirme la bonne réception de votre dossier n°--numero_dossier-- complet. Celui-ci sera instruit dans le délais légal déclaré par votre interlocuteur.
    + Votre administration vous confirme la bonne réception de votre dossier nº--numero_dossier-- complet. Celui-ci sera instruit dans le délais légal déclaré par votre interlocuteur.

    En vous souhaitant une bonne journée,
    diff --git a/db/migrate/20170328142700_add_mandatory_column_to_types_de_piece_justificative.rb b/db/migrate/20170328142700_add_mandatory_column_to_types_de_piece_justificative.rb new file mode 100644 index 000000000..46f603b62 --- /dev/null +++ b/db/migrate/20170328142700_add_mandatory_column_to_types_de_piece_justificative.rb @@ -0,0 +1,5 @@ +class AddMandatoryColumnToTypesDePieceJustificative < ActiveRecord::Migration[5.0] + def change + add_column :types_de_piece_justificative, :mandatory, :boolean, default: false + end +end diff --git a/db/migrate/20170414095411_remove_field_limit_for_procedure_paths.rb b/db/migrate/20170414095411_remove_field_limit_for_procedure_paths.rb new file mode 100644 index 000000000..9de4f3a0b --- /dev/null +++ b/db/migrate/20170414095411_remove_field_limit_for_procedure_paths.rb @@ -0,0 +1,5 @@ +class RemoveFieldLimitForProcedurePaths < ActiveRecord::Migration[5.0] + def change + change_column :procedure_paths, :path, :string, limit: nil, null: true, unique: true, index: true + end +end diff --git a/db/schema.rb b/db/schema.rb index 0ff0aa06a..140dccaf6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20170313140834) do +ActiveRecord::Schema.define(version: 20170414095411) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -319,7 +319,7 @@ ActiveRecord::Schema.define(version: 20170313140834) do end create_table "procedure_paths", force: :cascade do |t| - t.string "path", limit: 30 + t.string "path" t.integer "procedure_id" t.integer "administrateur_id" t.index ["path"], name: "index_procedure_paths_on_path", using: :btree @@ -403,6 +403,7 @@ ActiveRecord::Schema.define(version: 20170313140834) do t.integer "procedure_id" t.integer "order_place" t.string "lien_demarche" + t.boolean "mandatory", default: false end create_table "users", force: :cascade do |t| diff --git a/doc/apipie_examples.json b/doc/apipie_examples.json index e14456d96..7010bc322 100644 --- a/doc/apipie_examples.json +++ b/doc/apipie_examples.json @@ -45,6 +45,17 @@ "updated_at": "2008-09-01T08:05:00.000Z", "archived": false, "mandataire_social": false, + "state": "updated", + "simplified_state": "En construction", + "initiated_at": "2017-04-11T12:00:12.000Z", + "received_at": null, + "processed_at": null, + "accompagnateurs": [ + "gestionnaire@apientreprise.fr" + ], + "invites": [ + "nom@domaine.fr" + ], "entreprise": { "siren": "440117620", "capital_social": 537100000, @@ -174,4 +185,4 @@ "recorded": true } ] -} \ No newline at end of file +} diff --git a/spec/controllers/api/v1/dossiers_controller_spec.rb b/spec/controllers/api/v1/dossiers_controller_spec.rb index 463a644c1..be00999ee 100644 --- a/spec/controllers/api/v1/dossiers_controller_spec.rb +++ b/spec/controllers/api/v1/dossiers_controller_spec.rb @@ -115,7 +115,7 @@ describe API::V1::DossiersController do let!(:dossier) { Timecop.freeze(date_creation) { create(:dossier, :with_entreprise, procedure: procedure) } } let(:dossier_id) { dossier.id } let(:body) { JSON.parse(retour.body, symbolize_names: true) } - let(:field_list) { [:id, :created_at, :updated_at, :archived, :mandataire_social, :entreprise, :etablissement, :cerfa, :types_de_piece_justificative, :pieces_justificatives, :champs, :champs_private, :commentaires, :state] } + let(:field_list) { [:id, :created_at, :updated_at, :archived, :mandataire_social, :entreprise, :etablissement, :cerfa, :types_de_piece_justificative, :pieces_justificatives, :champs, :champs_private, :commentaires, :state, :simplified_state, :initiated_at, :processed_at, :received_at, :accompagnateurs, :invites] } subject { body[:dossier] } it 'return REST code 200', :show_in_doc do diff --git a/spec/controllers/root_controller_spec.rb b/spec/controllers/root_controller_spec.rb index 94e83fe2f..474f03dfd 100644 --- a/spec/controllers/root_controller_spec.rb +++ b/spec/controllers/root_controller_spec.rb @@ -33,7 +33,7 @@ describe RootController, type: :controller do subject end - it { expect(response.body).to have_css('#landing') } + it { expect(response.body).to have_css('.landing') } end end @@ -55,31 +55,7 @@ describe RootController, type: :controller do subject end - it { expect(response.body).to have_css('#landing') } - - end - - context 'environment is not development' do - render_views - - before do - Rails.env.stub(:development? => false) - subject - end - - it { expect(response.body).to have_link('Démonstration', href: "https://tps-dev.apientreprise.fr#{ users_sign_in_demo_path }") } - - end - - context 'environment is development' do - render_views - - before do - Rails.env.stub(:development? => true) - subject - end - - it { expect(response.body).to have_link('Démonstration', href: users_sign_in_demo_path) } + it { expect(response.body).to have_css('.landing') } end diff --git a/spec/controllers/users/dossiers_controller_spec.rb b/spec/controllers/users/dossiers_controller_spec.rb index 601b243bc..f479f6eb9 100644 --- a/spec/controllers/users/dossiers_controller_spec.rb +++ b/spec/controllers/users/dossiers_controller_spec.rb @@ -554,27 +554,27 @@ describe Users::DossiersController, type: :controller do end end - describe 'Get #procedure_libelle' do + describe 'Get #text_summary' do let!(:dossier) { create(:dossier, procedure: procedure) } context 'when user is connected' do before { sign_in user } context 'when the dossier exist' do - before { get :procedure_libelle, params: { dossier_id: dossier.id } } + before { get :text_summary, params: { dossier_id: dossier.id } } it 'returns the procedure name' do - expect(JSON.parse(response.body)).to eq('procedureLibelle' => procedure.libelle) + expect(JSON.parse(response.body)).to eq("textSummary" => "Dossier en brouillon répondant à la démarche #{procedure.libelle}, gérée par l'organisme #{procedure.organisation}") end end context 'when the dossier does not exist' do - before { get :procedure_libelle, params: { dossier_id: 666 } } + before { get :text_summary, params: { dossier_id: 666 } } it { expect(response.code).to eq('404') } end end context 'when user is not connected' do - before { get :procedure_libelle, params: { dossier_id: dossier.id } } + before { get :text_summary, params: { dossier_id: dossier.id } } it { expect(response.code).to eq('302') } end end diff --git a/spec/facades/dossiers_list_facades_spec.rb b/spec/facades/dossiers_list_facades_spec.rb index 455550a4a..8713df086 100644 --- a/spec/facades/dossiers_list_facades_spec.rb +++ b/spec/facades/dossiers_list_facades_spec.rb @@ -3,8 +3,8 @@ require 'spec_helper' describe DossiersListFacades do let(:gestionnaire) { create :gestionnaire } - let(:procedure) { create :procedure } - let(:procedure_2) { create :procedure, libelle: 'plop' } + let(:procedure) { create :procedure, libelle: 'Ma procédure' } + let(:procedure_2) { create :procedure, libelle: 'Ma seconde procédure' } let!(:preference) { create :preference_list_dossier, gestionnaire: gestionnaire, @@ -48,14 +48,8 @@ describe DossiersListFacades do it { expect(subject.size).to eq 2 } - it { expect(subject.first[:id]).to eq procedure.id } - it { expect(subject.first[:libelle]).to eq procedure.libelle } - it { expect(subject.first[:unread_notifications]).to eq 0 } - - - it { expect(subject.last[:id]).to eq procedure_2.id } - it { expect(subject.last[:libelle]).to eq procedure_2.libelle } - it { expect(subject.last[:unread_notifications]).to eq 0 } + it { expect(subject.first).to eq({ id: procedure.id, libelle: procedure.libelle, unread_notifications: 0 }) } + it { expect(subject.last).to eq({ id: procedure_2.id, libelle: procedure_2.libelle, unread_notifications: 0 }) } end describe '#active_filter?' do diff --git a/spec/factories/dossier.rb b/spec/factories/dossier.rb index 05e70525c..415e1d58d 100644 --- a/spec/factories/dossier.rb +++ b/spec/factories/dossier.rb @@ -47,6 +47,25 @@ FactoryGirl.define do end end + trait :archived do + archived true + end + + trait :not_archived do + archived false + end + + trait :with_dossier_link do + after(:create) do |dossier, _evaluator| + linked_dossier = create(:dossier) + type_de_champ = dossier.procedure.types_de_champ.find { |t| t.type_champ == 'dossier_link' } + champ = dossier.champs.find { |c| c.type_de_champ == type_de_champ } + + champ.value = linked_dossier.id + champ.save! + end + end + trait :replied do state 'replied' end diff --git a/spec/factories/individual.rb b/spec/factories/individual.rb index c5924d57c..c4b7a1c52 100644 --- a/spec/factories/individual.rb +++ b/spec/factories/individual.rb @@ -1,5 +1,6 @@ FactoryGirl.define do factory :individual do + gender 'M.' nom 'Julien' prenom 'Xavier' birthdate '20/01/1991' diff --git a/spec/factories/mail_templates.rb b/spec/factories/mail_templates.rb index aac0d3615..2f3a72122 100644 --- a/spec/factories/mail_templates.rb +++ b/spec/factories/mail_templates.rb @@ -13,8 +13,8 @@ FactoryGirl.define do end trait :dossier_received do - object "[TPS] Accusé de réception pour votre dossier n°--numero_dossier--" - body "Votre administration vous confirme la bonne réception de votre dossier n°--numero_dossier--" + object "[TPS] Accusé de réception pour votre dossier nº --numero_dossier--" + body "Votre administration vous confirme la bonne réception de votre dossier nº --numero_dossier--" type 'MailReceived' end end diff --git a/spec/factories/procedure.rb b/spec/factories/procedure.rb index 30da5d76d..f38629fc7 100644 --- a/spec/factories/procedure.rb +++ b/spec/factories/procedure.rb @@ -2,7 +2,7 @@ FactoryGirl.define do sequence(:published_path) { |n| "fake_path#{n}" } factory :procedure do lien_demarche 'http://localhost' - libelle 'Demande de subvention' + sequence(:libelle) { |n| "Procedure #{n}" } description "Demande de subvention à l'intention des associations" organisation "Orga SGMAP" direction "direction SGMAP" @@ -61,6 +61,14 @@ FactoryGirl.define do end end + trait :with_dossier_link do + after(:build) do |procedure, _evaluator| + type_de_champ = create(:type_de_champ_public, :type_dossier_link) + + procedure.types_de_champ << type_de_champ + end + end + trait :with_two_type_de_piece_justificative do after(:build) do |procedure, _evaluator| rib = create(:type_de_piece_justificative, :rib, order_place: 1) diff --git a/spec/factories/type_de_champ_public.rb b/spec/factories/type_de_champ_public.rb index 3dad7603b..b1ef85016 100644 --- a/spec/factories/type_de_champ_public.rb +++ b/spec/factories/type_de_champ_public.rb @@ -9,5 +9,10 @@ FactoryGirl.define do trait :checkbox do type_champ 'checkbox' end + + trait :type_dossier_link do + libelle 'Référence autre dossier' + type_champ 'dossier_link' + end end end diff --git a/spec/features/admin/connection_spec.rb b/spec/features/admin/connection_spec.rb index 58b256be7..3966641c9 100644 --- a/spec/features/admin/connection_spec.rb +++ b/spec/features/admin/connection_spec.rb @@ -6,7 +6,7 @@ feature 'Administrator connection' do visit new_administrateur_session_path end scenario 'administrator is on admin loggin page' do - expect(page).to have_css('#form_login.user_connexion_page') + expect(page).to have_css('#form-login.user_connexion_page') end context "admin fills form and log in" do @@ -25,18 +25,18 @@ feature 'Administrator connection' do end scenario 'it displays the menu' do expect(page).to have_css('a#profile') - expect(page).to have_css('#sign_out') + expect(page).to have_css('#sign-out') expect(page).to have_css('a.fa-sign-out') end - context 'when clicking on sign_out' do + context 'when clicking on sign-out' do before do stub_request(:get, "https://api.github.com/repos/sgmap/tps/releases/latest"). to_return(:status => 200, :body => '{"tag_name": "plip", "body": "blabla", "published_at": "2016-02-09T16:46:47Z"}', :headers => {}) - page.find_by_id('sign_out').find('a.fa-sign-out').click + page.find_by_id('sign-out').find('a.fa-sign-out').click end scenario 'admin is redireted to home page' do - expect(page).to have_css('#landing') + expect(page).to have_css('.landing') end end context 'when clicking on profile' do diff --git a/spec/features/admin/procedure_creation_spec.rb b/spec/features/admin/procedure_creation_spec.rb index fbf76005a..8e14bd43a 100644 --- a/spec/features/admin/procedure_creation_spec.rb +++ b/spec/features/admin/procedure_creation_spec.rb @@ -92,7 +92,7 @@ feature 'As an administrateur I wanna create a new procedure', js: true do expect(page).to have_selector('#publish-procedure', visible: true) page.find_by_id('publish-procedure').click - expect(page.find_by_id('procedure_path')['value']).to eq('libelle_de_la_procedure') + expect(page.find_by_id('procedure_path')['value']).to eq('libelle-de-la-procedure') page.find_by_id('publish').click expect(page).to have_selector('.procedure-lien') end diff --git a/spec/features/backoffice/connection_spec.rb b/spec/features/backoffice/connection_spec.rb index 419e14853..603546fb5 100644 --- a/spec/features/backoffice/connection_spec.rb +++ b/spec/features/backoffice/connection_spec.rb @@ -30,7 +30,7 @@ feature 'when gestionnaire come to /backoffice and is not authenticated' do page.click_on 'Se connecter' end scenario 'he is redirected to /backoffice' do - expect(page).to have_css('#backoffice_index') + expect(page).to have_css('#backoffice-index') end end end diff --git a/spec/features/backoffice/index_show_procedure_spec.rb b/spec/features/backoffice/index_show_procedure_spec.rb index 33add73bd..d24910eca 100644 --- a/spec/features/backoffice/index_show_procedure_spec.rb +++ b/spec/features/backoffice/index_show_procedure_spec.rb @@ -22,28 +22,28 @@ feature 'As an Accompagnateur I can navigate and use each functionnality around context 'On index' do scenario 'Switching between procedures' do - page.all('#procedure_list a').first.click + page.all('#procedure-list a').first.click expect(page).to have_current_path(backoffice_dossiers_procedure_path(id: procedure_1.id.to_s), only_path: true) expect(page.find('#all_dossiers .count').text).to eq('30 dossiers') - page.all('#procedure_list a').last.click + page.all('#procedure-list a').last.click expect(page).to have_current_path(backoffice_dossiers_procedure_path(id: procedure_2.id.to_s), only_path: true) expect(page.find('#all_dossiers .count').text).to eq('22 dossiers') end scenario 'Searching with search bar', js: true do - page.find_by_id('search_area').trigger('click') + page.find_by_id('search-area').trigger('click') fill_in 'q', with: (procedure_1.dossiers.first.id + 14) - page.find_by_id('search_button').click + page.find_by_id('search-button').click page.find_by_id("tr_dossier_#{(procedure_1.dossiers.first.id + 14)}").click expect(page).to have_current_path("/backoffice/dossiers/#{(procedure_1.dossiers.first.id + 14)}") end scenario 'Following dossier' do - page.all('#procedure_list a').first.click + page.all('#procedure-list a').first.click expect(page.all('#follow_dossiers .smart-listing')[0]['data-item-count']).to eq ("0") page.find_by_id('all_dossiers').click - expect(page.all('#dossiers_list a').first.text).to eq('Suivre') - page.all('#dossiers_list a').first.click + expect(page.all('#dossiers-list a').first.text).to eq('Suivre') + page.all('#dossiers-list a').first.click expect(page.all('#follow_dossiers .smart-listing')[0]['data-item-count']).to eq ("1") end diff --git a/spec/features/backoffice/lateral_page_pref_list_dossier_backoffice_spec.rb b/spec/features/backoffice/lateral_page_pref_list_dossier_backoffice_spec.rb index 13c176b46..9a36bf116 100644 --- a/spec/features/backoffice/lateral_page_pref_list_dossier_backoffice_spec.rb +++ b/spec/features/backoffice/lateral_page_pref_list_dossier_backoffice_spec.rb @@ -17,20 +17,20 @@ feature 'usage of pref list dossier lateral panel', js: true do context 'when user enter good credentials' do scenario 'he is redirected to /backoffice' do - expect(page).to have_css('#backoffice_index') + expect(page).to have_css('#backoffice-index') end scenario 'lateral panel is masked' do - expect(page).to have_css('#pref_list_menu', visible: false) + expect(page).to have_css('#pref-list-menu', visible: false) end context 'when on click on pref list button' do before do - page.click_on 'pref_list_dossier_open_action' + page.click_on 'pref-list-dossier-open-action' end scenario 'lateral panel is appeared' do - expect(page).to have_css('#pref_list_menu') + expect(page).to have_css('#pref-list-menu') end context 'when on click on add attribut button' do @@ -65,12 +65,12 @@ feature 'usage of pref list dossier lateral panel', js: true do context 'when on click on close pref list button' do before do - page.click_on 'pref_list_dossier_close_action' + page.click_on 'pref-list-dossier-close-action' end scenario 'lateral panel is masked' do wait_for_ajax - expect(page).to have_css('#pref_list_menu', visible: false) + expect(page).to have_css('#pref-list-menu', visible: false) end end end diff --git a/spec/features/backoffice/lateral_page_pref_list_dossier_by_procedure_backoffice_spec.rb b/spec/features/backoffice/lateral_page_pref_list_dossier_by_procedure_backoffice_spec.rb index 0255d9a46..9ed134a75 100644 --- a/spec/features/backoffice/lateral_page_pref_list_dossier_by_procedure_backoffice_spec.rb +++ b/spec/features/backoffice/lateral_page_pref_list_dossier_by_procedure_backoffice_spec.rb @@ -17,7 +17,7 @@ feature 'usage of pref list dossier lateral panel by procedure', js: true do context 'when user enter good credentials' do scenario 'he is redirected to /backoffice/dossiers/' do - expect(page).to have_css('#backoffice_index') + expect(page).to have_css('#backoffice-index') end describe 'user navigate to dossiers list by procedure' do @@ -26,17 +26,17 @@ feature 'usage of pref list dossier lateral panel by procedure', js: true do end scenario 'lateral panel is masked' do - expect(page).to have_css('#pref_list_menu', visible: false) + expect(page).to have_css('#pref-list-menu', visible: false) end context 'when on click on pref list button' do before do - page.click_on 'pref_list_dossier_open_action' + page.click_on 'pref-list-dossier-open-action' end scenario 'lateral panel is appeared' do wait_for_ajax - expect(page).to have_css('#pref_list_menu') + expect(page).to have_css('#pref-list-menu') end context 'when on click on add attribut specific at the procedure button' do @@ -66,12 +66,12 @@ feature 'usage of pref list dossier lateral panel by procedure', js: true do context 'when on click on close pref list button' do before do - page.click_on 'pref_list_dossier_close_action' + page.click_on 'pref-list-dossier-close-action' end scenario 'lateral panel is masked' do wait_for_ajax - expect(page).to have_css('#pref_list_menu', visible: false) + expect(page).to have_css('#pref-list-menu', visible: false) end end end diff --git a/spec/features/backoffice/navigate_to_dossier_spec.rb b/spec/features/backoffice/navigate_to_dossier_spec.rb index b7f30467c..b9c2222fa 100644 --- a/spec/features/backoffice/navigate_to_dossier_spec.rb +++ b/spec/features/backoffice/navigate_to_dossier_spec.rb @@ -29,7 +29,7 @@ feature 'on backoffice page', js: true do end scenario 'it redirect to dossier page' do - expect(page).to have_css('#backoffice_dossier_show') + expect(page).to have_css('#backoffice-dossier-show') end end end @@ -45,7 +45,7 @@ feature 'on backoffice page', js: true do end scenario 'it redirect to dossier page' do - expect(page).to have_css('#backoffice_dossier_show') + expect(page).to have_css('#backoffice-dossier-show') end end end diff --git a/spec/features/backoffice/search_file_spec.rb b/spec/features/backoffice/search_file_spec.rb index d91ea8bbf..dc6baeb85 100644 --- a/spec/features/backoffice/search_file_spec.rb +++ b/spec/features/backoffice/search_file_spec.rb @@ -18,10 +18,10 @@ feature 'search file on gestionnaire backoffice' do visit backoffice_dossiers_url page.find_by_id(:q).set terms - page.find_by_id(:search_button).click + page.find_by_id("search-button").click end - it { expect(page).to have_css('#backoffice_search') } + it { expect(page).to have_css('#backoffice-search') } context 'when terms input is empty' do it { expect(page).to have_content('Aucun dossier') } diff --git a/spec/features/description_page/upload_piece_justificative_spec.rb b/spec/features/description_page/upload_piece_justificative_spec.rb index 4f999037c..bd8cffc8a 100644 --- a/spec/features/description_page/upload_piece_justificative_spec.rb +++ b/spec/features/description_page/upload_piece_justificative_spec.rb @@ -9,14 +9,14 @@ feature 'user is on description page' do visit users_dossier_description_path dossier - within('#new_user') do + within('#new-user') do page.find_by_id('user_email').set dossier.user.email page.find_by_id('user_password').set dossier.user.password page.click_on 'Se connecter' end end - it { expect(page).to have_css('#description_page') } + it { expect(page).to have_css('#description-page') } context 'he fill description fields' do before do diff --git a/spec/features/france_connect/france_connect_particulier_spec.rb b/spec/features/france_connect/france_connect_particulier_spec.rb index 01592e8af..1ed8ca15f 100644 --- a/spec/features/france_connect/france_connect_particulier_spec.rb +++ b/spec/features/france_connect/france_connect_particulier_spec.rb @@ -26,7 +26,7 @@ feature 'France Connect Particulier Connexion' do end scenario 'link to France Connect is present' do - expect(page).to have_css('a#btn_fcp') + expect(page).to have_css('a#btn-fcp') end context 'and click on france connect link' do @@ -49,7 +49,7 @@ feature 'France Connect Particulier Connexion' do context 'when is the first connexion' do before do - page.find_by_id('btn_fcp').click + page.find_by_id('btn-fcp').click end scenario 'he is redirected to france connect particulier page' do expect(page).to have_content('Nouvelle connexion') @@ -70,7 +70,7 @@ feature 'France Connect Particulier Connexion' do context 'when is not the first connexion' do before do create(:user, france_connect_information: france_connect_information) - page.find_by_id('btn_fcp').click + page.find_by_id('btn-fcp').click end scenario 'he is redirected to user dossiers page' do @@ -83,11 +83,11 @@ feature 'France Connect Particulier Connexion' do before do allow_any_instance_of(FranceConnectParticulierClient).to receive(:authorization_uri).and_return(france_connect_particulier_callback_path(code: code)) allow(FranceConnectService).to receive(:retrieve_user_informations_particulier) { raise Rack::OAuth2::Client::Error.new(500, error: 'Unknown') } - page.find_by_id('btn_fcp').click + page.find_by_id('btn-fcp').click end scenario 'he is redirected to login page' do - expect(page).to have_css('a#btn_fcp') + expect(page).to have_css('a#btn-fcp') end scenario 'error message is displayed' do diff --git a/spec/features/users/complete_demande_spec.rb b/spec/features/users/complete_demande_spec.rb index 6554a4004..2f1eb1d42 100644 --- a/spec/features/users/complete_demande_spec.rb +++ b/spec/features/users/complete_demande_spec.rb @@ -12,21 +12,21 @@ feature 'user path for dossier creation' do end scenario 'he is redirected on login page' do - expect(page).to have_css('#login_user') + expect(page).to have_css('#login-user') expect(page).to have_css('#logo_procedure') - expect(page).to have_css('#titre_procedure') + expect(page).to have_css('#titre-procedure') end context 'user sign_in' do before do - within('#new_user') do + within('#new-user') do page.find_by_id('user_email').set user.email page.find_by_id('user_password').set user.password page.click_on 'Se connecter' end end scenario 'redirects to siret page' do - expect(page).to have_css('#dossier_siret') + expect(page).to have_css('#dossier-siret') end context 'sets siret' do before do @@ -40,12 +40,12 @@ feature 'user path for dossier creation' do stub_request(:get, "https://api-dev.apientreprise.fr/v1/associations/#{siret}?token=#{SIADETOKEN}") .to_return(status: 404, body: '') - page.find_by_id('dossier_siret').set siret + page.find_by_id('dossier-siret').set siret page.click_on 'Valider' end scenario 'user is on page recap info entreprise' do - expect(page).to have_css('#recap_info_entreprise') + expect(page).to have_css('#recap-info-entreprise') end context 'when user would like change siret' do @@ -54,7 +54,7 @@ feature 'user path for dossier creation' do end scenario 'redirects to siret page' do - expect(page).to have_css('#dossier_siret') + expect(page).to have_css('#dossier-siret') end end @@ -64,7 +64,7 @@ feature 'user path for dossier creation' do page.find_by_id('etape_suivante').trigger('click') end scenario 'user is on description page' do - expect(page).to have_css('#description_page') + expect(page).to have_css('#description-page') end context 'user fill and validate description page' do before do @@ -72,7 +72,7 @@ feature 'user path for dossier creation' do page.find_by_id('suivant').trigger('click') end scenario 'user is on recap page' do - expect(page).to have_css('#users_recapitulatif_dossier_show') + expect(page).to have_css('#users-recapitulatif-dossier-show') end end end diff --git a/spec/features/users/dossier_creation_spec.rb b/spec/features/users/dossier_creation_spec.rb index 4adf0e190..34715a567 100644 --- a/spec/features/users/dossier_creation_spec.rb +++ b/spec/features/users/dossier_creation_spec.rb @@ -45,7 +45,7 @@ feature 'As a User I wanna create a dossier' do login_as user, scope: :user visit commencer_path(procedure_path: procedure_with_siret.path) expect(page).to have_current_path(users_dossier_path(procedure_with_siret.dossiers.last.id.to_s), only_path: true) - fill_in 'dossier_siret', with: siret + fill_in 'dossier-siret', with: siret stub_request(:get, "https://api-dev.apientreprise.fr/v2/etablissements/#{siret}?token=#{SIADETOKEN}") .to_return(status: 200, body: File.read('spec/support/files/etablissement.json')) stub_request(:get, "https://api-dev.apientreprise.fr/v2/entreprises/#{siren}?token=#{SIADETOKEN}") @@ -54,9 +54,9 @@ feature 'As a User I wanna create a dossier' do .to_return(status: 200, body: File.read('spec/support/files/exercices.json')) stub_request(:get, "https://api-dev.apientreprise.fr/v1/associations/#{siret}?token=#{SIADETOKEN}") .to_return(status: 404, body: '') - page.find_by_id('dossier_siret').set siret + page.find_by_id('dossier-siret').set siret page.find_by_id('submit-siret').trigger('click') - expect(page).to have_css('#recap_info_entreprise') + expect(page).to have_css('#recap-info-entreprise') find(:css, "#dossier_autorisation_donnees[value='1']").set(true) page.find_by_id('etape_suivante').trigger('click') expect(page).to have_current_path(users_dossier_carte_path(procedure_with_siret.dossiers.last.id.to_s), only_path: true) diff --git a/spec/features/users/dossier_edition_spec.rb b/spec/features/users/dossier_edition_spec.rb index 4dc3ccee7..5aca700d9 100644 --- a/spec/features/users/dossier_edition_spec.rb +++ b/spec/features/users/dossier_edition_spec.rb @@ -3,8 +3,8 @@ require 'spec_helper' feature 'As a User I want to edit a dossier I own' do let(:user) { create(:user) } - let(:procedure_for_individual) { create(:procedure, :published, :for_individual, :with_type_de_champ, :with_two_type_de_piece_justificative) } - let!(:dossier) { create(:dossier, :with_entreprise, :for_individual, procedure: procedure_for_individual, user: user, autorisation_donnees: true, state: 'initiated') } + let(:procedure_for_individual) { create(:procedure, :published, :for_individual, :with_type_de_champ, :with_two_type_de_piece_justificative, :with_dossier_link) } + let!(:dossier) { create(:dossier, :with_entreprise, :for_individual, :with_dossier_link, procedure: procedure_for_individual, user: user, autorisation_donnees: true, state: 'initiated') } before "Create dossier and visit root path" do login_as user, scope: :user @@ -14,7 +14,7 @@ feature 'As a User I want to edit a dossier I own' do context 'After sign_in, I can navigate through dossiers indexes and edit a dossier' do scenario 'After sign_in, I can see dossiers "à traiter" (default), and other indexes' do - expect(page.find('#a_traiter')['class'] ).to eq('active procedure_list_element') + expect(page.find('#a_traiter')['class'] ).to eq('active procedure-list-element') page.find_by_id('brouillon').click page.find_by_id('a_traiter').click page.find_by_id('en_instruction').click @@ -23,7 +23,7 @@ feature 'As a User I want to edit a dossier I own' do end scenario 'Getting a dossier, I want to create a new message on', js: true do - page.find_by_id('tr_dossier_' + Dossier.last.id.to_s).click + page.find_by_id('tr_dossier_' + dossier.id.to_s).click expect(page).to have_current_path(users_dossier_recapitulatif_path(Dossier.first.id.to_s), only_path: true) page.find_by_id('open-message').click page.execute_script("$('#texte_commentaire').data('wysihtml5').editor.setValue('Contenu du nouveau message')") @@ -34,12 +34,17 @@ feature 'As a User I want to edit a dossier I own' do scenario 'On the same dossier, I want to edit informations', js: true do page.find_by_id('tr_dossier_' + dossier.id.to_s).click expect(page).to have_current_path(users_dossier_recapitulatif_path(dossier.id.to_s), only_path: true) + + # Linked Dossier + linked_dossier_id = dossier.champs.find { |c| c.type_de_champ.type_champ == 'dossier_link' }.value + expect(page).to have_link("Dossier #{linked_dossier_id}") + page.find_by_id('maj_infos').trigger('click') expect(page).to have_current_path(users_dossier_description_path(dossier.id.to_s), only_path: true) - fill_in "champs_#{dossier.champs.first.id.to_s}", with: 'Contenu du champ 1' + fill_in "champs_#{dossier.champs.order(:id).first.id.to_s}", with: 'Contenu du champ 1' page.find_by_id('modification_terminee').click expect(page).to have_current_path(users_dossier_recapitulatif_path(dossier.id.to_s), only_path: true) - expect(page.find("#champ-#{dossier.champs.first.id}-value").text).to eq('Contenu du champ 1') + expect(page.find("#champ-#{dossier.champs.order(:id).first.id}-value").text).to eq('Contenu du champ 1') end end end diff --git a/spec/features/users/dossier_index_spec.rb b/spec/features/users/dossier_index_spec.rb index 4d6ec1464..913efcf79 100644 --- a/spec/features/users/dossier_index_spec.rb +++ b/spec/features/users/dossier_index_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -xfeature 'As a User I want to sort and paginate dossiers', js: true do +feature 'As a User I want to sort and paginate dossiers', js: true do let(:user) { create(:user) } let(:procedure_for_individual) { create(:procedure, :published, :for_individual) } @@ -24,30 +24,30 @@ xfeature 'As a User I want to sort and paginate dossiers', js: true do scenario 'Using sort' do visit "/users/dossiers?dossiers_smart_listing[sort][id]=asc" - expect(page.all(:css, '#dossiers_list tr')[1].text.split(" ").first).to eq(user.dossiers.first.id.to_s) - expect(page.all(:css, '#dossiers_list tr')[2].text.split(" ").first).to eq(user.dossiers.second.id.to_s) + expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq(user.dossiers.first.id.to_s) + expect(page.all(:css, '#dossiers-list tr')[2].text.split(" ").first).to eq(user.dossiers.second.id.to_s) visit "/users/dossiers?dossiers_smart_listing[sort][id]=desc" - expect(page.all(:css, '#dossiers_list tr')[1].text.split(" ").first).to eq((user.dossiers.first.id + 50).to_s) - expect(page.all(:css, '#dossiers_list tr')[2].text.split(" ").first).to eq((user.dossiers.first.id + 49).to_s) + expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq((user.dossiers.first.id + 50).to_s) + expect(page.all(:css, '#dossiers-list tr')[2].text.split(" ").first).to eq((user.dossiers.first.id + 49).to_s) visit "/users/dossiers?dossiers_smart_listing[sort][id]=asc" - expect(page.all(:css, '#dossiers_list tr')[1].text.split(" ").first).to eq(user.dossiers.first.id.to_s) - expect(page.all(:css, '#dossiers_list tr')[2].text.split(" ").first).to eq(user.dossiers.second.id.to_s) + expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq(user.dossiers.first.id.to_s) + expect(page.all(:css, '#dossiers-list tr')[2].text.split(" ").first).to eq(user.dossiers.second.id.to_s) end scenario 'Using pagination' do visit "/users/dossiers?dossiers_smart_listing[sort][id]=asc" - expect(page.all(:css, '#dossiers_list tr')[1].text.split(" ").first).to eq(user.dossiers.first.id.to_s) + expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq(user.dossiers.first.id.to_s) page.find('.next_page a').trigger('click') wait_for_ajax - expect(page.all(:css, '#dossiers_list tr')[1].text.split(" ").first).to eq((user.dossiers.first.id + 10).to_s) + expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq((user.dossiers.first.id + 10).to_s) page.find('.next_page a').trigger('click') wait_for_ajax - expect(page.all(:css, '#dossiers_list tr')[1].text.split(" ").first).to eq((user.dossiers.first.id + 20).to_s) + expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq((user.dossiers.first.id + 20).to_s) page.find('.prev a').trigger('click') wait_for_ajax page.find('.prev a').trigger('click') wait_for_ajax - expect(page.all(:css, '#dossiers_list tr')[1].text.split(" ").first).to eq((user.dossiers.first.id).to_s) + expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq((user.dossiers.first.id).to_s) end end diff --git a/spec/features/users/drawing_a_zone_with_freedraw_spec.rb b/spec/features/users/drawing_a_zone_with_freedraw_spec.rb index 57633a08b..1ecc5a0ee 100644 --- a/spec/features/users/drawing_a_zone_with_freedraw_spec.rb +++ b/spec/features/users/drawing_a_zone_with_freedraw_spec.rb @@ -12,11 +12,11 @@ feature 'drawing a zone with freedraw' do end scenario 'he is redirected to login page' do - expect(page).to have_css('#login_user') + expect(page).to have_css('#login-user') end scenario 'he logs in and he is redirected to carte page', vcr: { cassette_name: 'drawing_a_zone_with_freedraw_redirected_to_carte_page' } do - within('#new_user') do + within('#new-user') do page.find_by_id('user_email').set user.email page.find_by_id('user_password').set user.password page.click_on 'Se connecter' @@ -45,7 +45,7 @@ feature 'drawing a zone with freedraw' do let(:module_api_carto) { create(:module_api_carto) } scenario 'he is redirect to user dossiers index' do - expect(page).to have_css('#users_index') + expect(page).to have_css('#users-index') end scenario 'alert message is present' do diff --git a/spec/features/users/list_dossiers_spec.rb b/spec/features/users/list_dossiers_spec.rb index 1ae783994..7a5236f12 100644 --- a/spec/features/users/list_dossiers_spec.rb +++ b/spec/features/users/list_dossiers_spec.rb @@ -1,33 +1,37 @@ require 'spec_helper' -feature 'user access to the list of his dossier' do +describe 'user access to the list of his dossier' do let(:user) { create(:user) } let!(:last_updated_dossier) { create(:dossier, :with_entreprise, user: user, state: 'replied')} let!(:dossier1) { create(:dossier, :with_entreprise, user: user, state: 'replied') } let!(:dossier2) { create(:dossier, :with_entreprise) } + let!(:dossier_archived) { create(:dossier, :with_entreprise, user: user, state: 'replied') } before do - dossier1.update_column(:updated_at, "19/07/2052 15:35".to_time) - dossier1.procedure.update_column(:libelle, 'PLOP') - last_updated_dossier.procedure.update_column(:libelle, 'PLIP') + last_updated_dossier.update_column(:updated_at, "19/07/2052 15:35".to_time) visit new_user_session_path - within('#new_user') do + within('#new-user') do page.find_by_id('user_email').set user.email page.find_by_id('user_password').set user.password page.click_on 'Se connecter' end end - scenario 'the list of dossier is displayed' do + + it 'the list of dossier is displayed' do expect(page).to have_content(dossier1.procedure.libelle) expect(page).not_to have_content(dossier2.procedure.libelle) end - scenario 'the list must be order by last updated' do + it 'the list must be order by last updated' do expect(page.body).to match(/#{last_updated_dossier.procedure.libelle}.*#{dossier1.procedure.libelle}/m) end - scenario 'the state of dossier is displayed' do + it 'should list archived dossier' do + expect(page).to have_content(dossier_archived.procedure.libelle) + end + + it 'the state of dossier is displayed' do expect(page).to have_css("#dossier_#{dossier1.id}_state") end @@ -36,7 +40,7 @@ feature 'user access to the list of his dossier' do page.find("#tr_dossier_#{dossier1.id}").click end scenario 'user is redirected to dossier page' do - expect(page).to have_css('#users_recapitulatif_dossier_show') + expect(page).to have_css('#users-recapitulatif-dossier-show') end end end diff --git a/spec/features/users/onglets_link_spec.rb b/spec/features/users/onglets_link_spec.rb index 7454df1e4..a3fef2dc3 100644 --- a/spec/features/users/onglets_link_spec.rb +++ b/spec/features/users/onglets_link_spec.rb @@ -27,7 +27,7 @@ feature 'on click on tabs button' do end scenario 'it redirect to users dossier termine' do - expect(page).to have_css('#users_index') + expect(page).to have_css('#users-index') end end @@ -38,7 +38,7 @@ feature 'on click on tabs button' do end scenario 'it redirect to users dossier termine' do - expect(page).to have_css('#users_index') + expect(page).to have_css('#users-index') end end @@ -49,7 +49,7 @@ feature 'on click on tabs button' do end scenario 'it redirect to users dossier termine' do - expect(page).to have_css('#users_index') + expect(page).to have_css('#users-index') end end @@ -60,7 +60,7 @@ feature 'on click on tabs button' do end scenario 'it redirect to users dossier invites' do - expect(page).to have_css('#users_index') + expect(page).to have_css('#users-index') end end end diff --git a/spec/features/users/start_demande_spec.rb b/spec/features/users/start_demande_spec.rb index e3b8014b0..a908412a8 100644 --- a/spec/features/users/start_demande_spec.rb +++ b/spec/features/users/start_demande_spec.rb @@ -11,11 +11,11 @@ feature 'user arrive on siret page' do visit new_users_dossiers_path(procedure_id: procedure.id) end scenario 'he is redirected to login page' do - expect(page).to have_css('#login_user') + expect(page).to have_css('#login-user') end context 'when he enter login information' do before do - within('#new_user') do + within('#new-user') do page.find_by_id('user_email').set user.email page.find_by_id('user_password').set user.password page.click_on 'Se connecter' @@ -35,12 +35,12 @@ feature 'user arrive on siret page' do stub_request(:get, "https://api-dev.apientreprise.fr/v1/associations/#{siret}?token=#{SIADETOKEN}") .to_return(status: 404, body: '') - page.find_by_id('dossier_siret').set siret + page.find_by_id('dossier-siret').set siret page.click_on 'Valider' end scenario 'he is redirected to recap info entreprise page' do wait_for_ajax - expect(page).to have_css('#recap_info_entreprise') + expect(page).to have_css('#recap-info-entreprise') end end end diff --git a/spec/mailers/notification_mailer_spec.rb b/spec/mailers/notification_mailer_spec.rb index 0f9aeba80..4c8f26fc1 100644 --- a/spec/mailers/notification_mailer_spec.rb +++ b/spec/mailers/notification_mailer_spec.rb @@ -19,6 +19,6 @@ RSpec.describe NotificationMailer, type: :mailer do it { expect(subject.body).to match('Un nouveau message est disponible dans votre espace TPS.') } it { expect(subject.body).to include("Pour le consulter, merci de vous rendre sur #{users_dossier_recapitulatif_url(dossier_id: dossier.id)}") } - it { expect(subject.subject).to eq("Nouveau message pour votre dossier TPS N°#{dossier.id}") } + it { expect(subject.subject).to eq("Nouveau message pour votre dossier TPS nº #{dossier.id}") } end end diff --git a/spec/models/concern/mail_template_concern_spec.rb b/spec/models/concern/mail_template_concern_spec.rb index b82d78117..96f997ff4 100644 --- a/spec/models/concern/mail_template_concern_spec.rb +++ b/spec/models/concern/mail_template_concern_spec.rb @@ -8,7 +8,7 @@ describe MailTemplateConcern do it 'works' do initiated_mail.object = '[TPS] --numero_dossier-- --libelle_procedure-- --lien_dossier--' expected = - "[TPS] #{dossier.id} Demande de subvention " + + "[TPS] #{dossier.id} #{dossier.procedure.libelle} " + "http://localhost:3000/users/dossiers/#{dossier.id}/recapitulatif" expect(initiated_mail.object_for_dossier(dossier)).to eq(expected) diff --git a/spec/models/dossier_spec.rb b/spec/models/dossier_spec.rb index 63092998b..576949f7b 100644 --- a/spec/models/dossier_spec.rb +++ b/spec/models/dossier_spec.rb @@ -418,23 +418,23 @@ describe Dossier do let(:procedure_admin) { create(:procedure, administrateur: admin) } let(:procedure_admin_2) { create(:procedure, administrateur: admin_2) } + let!(:dossier) { create(:dossier, procedure: procedure_admin, state: 'draft') } + let!(:dossier2) { create(:dossier, procedure: procedure_admin, state: 'initiated') } #nouveaux + let!(:dossier3) { create(:dossier, procedure: procedure_admin, state: 'initiated') } #nouveaux + let!(:dossier4) { create(:dossier, procedure: procedure_admin, state: 'replied') } #en_attente + let!(:dossier5) { create(:dossier, procedure: procedure_admin, state: 'updated') } #a_traiter + let!(:dossier6) { create(:dossier, procedure: procedure_admin, state: 'received') } #a_instruire + let!(:dossier7) { create(:dossier, procedure: procedure_admin, state: 'received') } #a_instruire + let!(:dossier8) { create(:dossier, procedure: procedure_admin, state: 'closed') } #termine + let!(:dossier9) { create(:dossier, procedure: procedure_admin, state: 'refused') } #termine + let!(:dossier10) { create(:dossier, procedure: procedure_admin, state: 'without_continuation') } #termine + let!(:dossier11) { create(:dossier, procedure: procedure_admin_2, state: 'closed') } #termine + let!(:dossier12) { create(:dossier, procedure: procedure_admin, state: 'initiated', archived: true) } #a_traiter #archived + let!(:dossier13) { create(:dossier, procedure: procedure_admin, state: 'replied', archived: true) } #en_attente #archived + let!(:dossier14) { create(:dossier, procedure: procedure_admin, state: 'closed', archived: true) } #termine #archived + before do create :assign_to, gestionnaire: gestionnaire, procedure: procedure_admin - - create(:dossier, procedure: procedure_admin, state: 'draft') - create(:dossier, procedure: procedure_admin, state: 'initiated') #nouveaux - create(:dossier, procedure: procedure_admin, state: 'initiated') #nouveaux - create(:dossier, procedure: procedure_admin, state: 'replied') #en_attente - create(:dossier, procedure: procedure_admin, state: 'updated') #a_traiter - create(:dossier, procedure: procedure_admin, state: 'received') #a_instruire - create(:dossier, procedure: procedure_admin, state: 'received') #a_instruire - create(:dossier, procedure: procedure_admin, state: 'closed') #termine - create(:dossier, procedure: procedure_admin, state: 'refused') #termine - create(:dossier, procedure: procedure_admin, state: 'without_continuation') #termine - create(:dossier, procedure: procedure_admin_2, state: 'closed') #termine - create(:dossier, procedure: procedure_admin, state: 'initiated', archived: true) #a_traiter #archived - create(:dossier, procedure: procedure_admin, state: 'replied', archived: true) #en_attente #archived - create(:dossier, procedure: procedure_admin, state: 'closed', archived: true) #termine #archived end describe '#nouveaux' do @@ -455,19 +455,13 @@ describe Dossier do it { expect(subject.size).to eq(1) } end - describe '#a_instruire' do - subject { gestionnaire.dossiers.a_instruire } + describe '#en_instruction' do + subject { gestionnaire.dossiers.en_instruction } it { expect(subject.size).to eq(2) } - end - - describe '#termine' do - subject { gestionnaire.dossiers.termine } - - it { expect(subject.size).to eq(3) } + it { expect(subject).to include(dossier6, dossier7) } end end - end describe '#cerfa_available?' do @@ -546,45 +540,6 @@ describe Dossier do it { expect(subject.count).to eq(EntrepriseSerializer.new(Entreprise.new).as_json.count + EtablissementSerializer.new(Etablissement.new).as_json.count) } end - describe '#export_default_columns' do - let(:procedure) { create(:procedure) } - let(:dossier) { create(:dossier, :with_entreprise, user: user, procedure: procedure) } - subject { dossier.export_default_columns } - - it { expect(subject[:archived]).to eq('false') } - it { expect(subject[:etablissement_siret]).to eq('44011762001530') } - it { expect(subject[:etablissement_siege_social]).to eq('true') } - it { expect(subject[:etablissement_naf]).to eq('4950Z') } - it { expect(subject[:etablissement_libelle_naf]).to eq('Transports par conduites') } - it { expect(subject[:etablissement_adresse]).to eq('GRTGAZ IMMEUBLE BORA 6 RUE RAOUL NORDLING 92270 BOIS COLOMBES') } - it { expect(subject[:etablissement_numero_voie]).to eq('6') } - it { expect(subject[:etablissement_type_voie]).to eq('RUE') } - it { expect(subject[:etablissement_nom_voie]).to eq('RAOUL NORDLING') } - it { expect(subject[:etablissement_complement_adresse]).to eq('IMMEUBLE BORA') } - it { expect(subject[:etablissement_code_postal]).to eq('92270') } - it { expect(subject[:etablissement_localite]).to eq('BOIS COLOMBES') } - it { expect(subject[:etablissement_code_insee_localite]).to eq('92009') } - it { expect(subject[:entreprise_siren]).to eq('440117620') } - it { expect(subject[:entreprise_capital_social]).to eq('537100000') } - it { expect(subject[:entreprise_numero_tva_intracommunautaire]).to eq('FR27440117620') } - it { expect(subject[:entreprise_forme_juridique]).to eq("SA à conseil d'administration (s.a.i.)") } - it { expect(subject[:entreprise_forme_juridique_code]).to eq('5599') } - it { expect(subject[:entreprise_nom_commercial]).to eq('GRTGAZ') } - it { expect(subject[:entreprise_raison_sociale]).to eq('GRTGAZ') } - it { expect(subject[:entreprise_siret_siege_social]).to eq('44011762001530') } - it { expect(subject[:entreprise_code_effectif_entreprise]).to eq('51') } - it { expect(subject[:entreprise_date_creation]).to eq('Thu, 28 Jan 2016 10:16:29 UTC +00:0') } - it { expect(subject[:entreprise_nom]).to be_nil } - it { expect(subject[:entreprise_prenom]).to be_nil } - - context 'when dossier does not have enterprise' do - let(:dossier) { create(:dossier, user: user, procedure: procedure) } - subject { dossier.export_default_columns } - - it { expect(subject[:archived]).to eq('false') } - end - end - context 'when dossier is followed' do let(:procedure) { create(:procedure, :with_type_de_champ) } let(:gestionnaire) { create(:gestionnaire) } @@ -598,7 +553,11 @@ describe Dossier do subject { dossier.export_headers } it { expect(subject).to include(:description) } - it { expect(subject.count).to eq(DossierProcedureSerializer.new(dossier).attributes.count + dossier.procedure.types_de_champ.count + dossier.export_entreprise_data.count) } + it { expect(subject).to include(:individual_gender) } + it { expect(subject).to include(:individual_nom) } + it { expect(subject).to include(:individual_prenom) } + it { expect(subject).to include(:individual_birthdate) } + it { expect(subject.count).to eq(DossierTableExportSerializer.new(dossier).attributes.count + dossier.procedure.types_de_champ.count + dossier.export_entreprise_data.count) } end describe '#data_with_champs' do @@ -613,8 +572,23 @@ describe Dossier do it { expect(subject[6]).to eq(date1) } it { expect(subject[7]).to eq(date2) } it { expect(subject[8]).to eq(date3) } - it { expect(subject[9]).to eq(dossier.followers_gestionnaires_emails) } - it { expect(subject.count).to eq(DossierProcedureSerializer.new(dossier).attributes.count + dossier.procedure.types_de_champ.count + dossier.export_entreprise_data.count) } + it { expect(subject[9]).to be_a_kind_of(String) } + it { expect(subject[10]).to be_nil } + it { expect(subject[11]).to be_nil } + it { expect(subject[12]).to be_nil } + it { expect(subject[13]).to be_nil } + it { expect(subject.count).to eq(DossierTableExportSerializer.new(dossier).attributes.count + dossier.procedure.types_de_champ.count + dossier.export_entreprise_data.count) } + + context 'dossier for individual' do + let(:dossier_with_individual) { create(:dossier, :for_individual, user: user, procedure: procedure) } + + subject { dossier_with_individual.data_with_champs } + + it { expect(subject[10]).to eq(dossier_with_individual.individual.gender) } + it { expect(subject[11]).to eq(dossier_with_individual.individual.prenom) } + it { expect(subject[12]).to eq(dossier_with_individual.individual.nom) } + it { expect(subject[13]).to eq(dossier_with_individual.individual.birthdate) } + end end describe "#full_data_string" do @@ -631,6 +605,10 @@ describe Dossier do dossier.processed_at, gestionnaire.email, nil, + nil, + nil, + nil, + nil, "44011762001530", "true", "4950Z", @@ -664,66 +642,6 @@ describe Dossier do end end - describe '#Dossier.to_csv' do - let!(:procedure) { create(:procedure) } - let!(:dossier) { create(:dossier, :with_entreprise, user: user, procedure: procedure, ) } - - subject do - dossier_hash = {} - dossier_splitted = Dossier.to_csv.split("\n").map { |cell| cell.split(",") } - index = 0 - dossier_splitted[0].each do |column| - dossier_hash.store(column.to_sym, dossier_splitted[1][index]) - index = index + 1 - end - dossier_hash - end - - it { expect(subject[:archived]).to eq('false') } - it { expect(subject[:etablissement_siret]).to eq('44011762001530') } - it { expect(subject[:etablissement_siege_social]).to eq('true') } - it { expect(subject[:etablissement_naf]).to eq('4950Z') } - it { expect(subject[:etablissement_libelle_naf]).to eq('Transports par conduites') } - it { expect(subject[:etablissement_adresse]).to eq('GRTGAZ IMMEUBLE BORA 6 RUE RAOUL NORDLING 92270 BOIS COLOMBES') } - it { expect(subject[:etablissement_numero_voie]).to eq('6') } - it { expect(subject[:etablissement_type_voie]).to eq('RUE') } - it { expect(subject[:etablissement_nom_voie]).to eq('RAOUL NORDLING') } - it { expect(subject[:etablissement_complement_adresse]).to eq('IMMEUBLE BORA') } - it { expect(subject[:etablissement_code_postal]).to eq('92270') } - it { expect(subject[:etablissement_localite]).to eq('BOIS COLOMBES') } - it { expect(subject[:etablissement_code_insee_localite]).to eq('92009') } - it { expect(subject[:entreprise_siren]).to eq('440117620') } - it { expect(subject[:entreprise_capital_social]).to eq('537100000') } - it { expect(subject[:entreprise_numero_tva_intracommunautaire]).to eq('FR27440117620') } - it { expect(subject[:entreprise_forme_juridique]).to eq("SA à conseil d'administration (s.a.i.)") } - it { expect(subject[:entreprise_forme_juridique_code]).to eq('5599') } - it { expect(subject[:entreprise_nom_commercial]).to eq('GRTGAZ') } - it { expect(subject[:entreprise_raison_sociale]).to eq('GRTGAZ') } - it { expect(subject[:entreprise_siret_siege_social]).to eq('44011762001530') } - it { expect(subject[:entreprise_code_effectif_entreprise]).to eq('51') } - it { expect(subject[:entreprise_date_creation]).to eq('2016-01-28 10:16:29 UTC') } - it { expect(subject[:entreprise_nom]).to be_nil } - it { expect(subject[:entreprise_prenom]).to be_nil } - end - - describe '#Dossier.to_xlsx' do - let!(:procedure) { create(:procedure) } - let!(:dossier) { create(:dossier, :with_entreprise, user: user, procedure: procedure) } - - subject { Dossier.to_xlsx } - - it { expect(subject).is_a?(String) } - end - - describe '#Dossier.to_ods' do - let!(:procedure) { create(:procedure) } - let!(:dossier) { create(:dossier, :with_entreprise, user: user, procedure: procedure) } - - subject { Dossier.to_ods } - - it { expect(subject).is_a?(String) } - end - describe '#reset!' do let!(:dossier) { create :dossier, :with_entreprise, autorisation_donnees: true } let!(:rna_information) { create :rna_information, entreprise: dossier.entreprise } @@ -891,38 +809,24 @@ describe Dossier do end end - describe '#followers_gestionnaires_emails' do + describe "#text_summary" do + let(:procedure) { create(:procedure, libelle: "Démarche", organisation: "Organisation") } - context 'when there is no follower' do - let(:dossier) { create(:dossier, follows: []) } + context 'when the dossier has been initiated' do + let(:dossier) { create :dossier, procedure: procedure, state: 'initiated', initiated_at: "31/12/2010".to_date } - subject { dossier.followers_gestionnaires_emails } + subject { dossier.text_summary } - it { is_expected.to eq "" } + it { is_expected.to eq("Dossier déposé le 31/12/2010, sur la démarche Démarche, gérée par l'organisme Organisation") } end - let(:gestionnaire) { create(:gestionnaire) } - let(:follow) { create(:follow, gestionnaire: gestionnaire) } + context 'when the dossier has not been initiated' do + let(:dossier) { create :dossier, procedure: procedure, state: 'draft' } - context 'when there is 1 follower' do - let(:dossier) { create(:dossier, follows: [follow]) } + subject { dossier.text_summary } - subject { dossier.followers_gestionnaires_emails } - - it { is_expected.to eq gestionnaire.email } + it { is_expected.to eq("Dossier en brouillon répondant à la démarche Démarche, gérée par l'organisme Organisation") } end - - let(:gestionnaire2) { create :gestionnaire} - let(:follow2) { create(:follow, gestionnaire: gestionnaire2) } - - context 'when there is 2 followers' do - let(:dossier) { create(:dossier, follows: [follow, follow2]) } - - subject { dossier.followers_gestionnaires_emails } - - it { is_expected.to eq "#{gestionnaire.email} #{gestionnaire2.email}" } - end - end describe '#update_state_dates' do diff --git a/spec/models/gestionnaire_spec.rb b/spec/models/gestionnaire_spec.rb index 1d1ed1320..a9c88fa92 100644 --- a/spec/models/gestionnaire_spec.rb +++ b/spec/models/gestionnaire_spec.rb @@ -272,6 +272,37 @@ describe Gestionnaire, type: :model do it { is_expected.to be_nil } end end + end + describe '#dossiers_with_notifications_count' do + subject { gestionnaire.dossiers_with_notifications_count } + + context 'when there is no notifications' do + it { is_expected.to eq(0) } + end + + context 'when there is one notification for one dossier' do + let(:notification){ create(:notification, already_read: false) } + let!(:follow){ create(:follow, dossier: notification.dossier, gestionnaire: gestionnaire) } + + it { is_expected.to eq(1) } + end + + context 'when there are many notifications for one dossier' do + let(:notification){ create(:notification, already_read: false) } + let(:notification2){ create(:notification, already_read: false, dossier: notification.dossier) } + let!(:follow){ create(:follow, dossier: notification.dossier, gestionnaire: gestionnaire) } + + it { is_expected.to eq(1) } + end + + context 'when there are many notifications for many dossiers' do + let(:notification){ create(:notification, already_read: false) } + let(:notification2){ create(:notification, already_read: false) } + let!(:follow){ create(:follow, dossier: notification.dossier, gestionnaire: gestionnaire) } + let!(:follow2){ create(:follow, dossier: notification2.dossier, gestionnaire: gestionnaire) } + + it { is_expected.to eq(2) } + end end end diff --git a/spec/models/preference_list_dossier_spec.rb b/spec/models/preference_list_dossier_spec.rb index 76abc8441..c54163e12 100644 --- a/spec/models/preference_list_dossier_spec.rb +++ b/spec/models/preference_list_dossier_spec.rb @@ -26,7 +26,7 @@ describe PreferenceListDossier do describe 'dossier_id' do subject { super()[:dossier_id] } - it { expect(subject[:libelle]).to eq 'N°' } + it { expect(subject[:libelle]).to eq 'Nº' } it { expect(subject[:table]).to be_nil } it { expect(subject[:attr]).to eq 'id' } it { expect(subject[:attr_decorate]).to eq 'id' } diff --git a/spec/models/procedure_path_spec.rb b/spec/models/procedure_path_spec.rb index fa7ceb7d4..dfb268291 100644 --- a/spec/models/procedure_path_spec.rb +++ b/spec/models/procedure_path_spec.rb @@ -24,14 +24,26 @@ describe ProcedurePath do let(:path) { '' } it { expect{procedure_path}.to raise_error ActiveRecord::RecordInvalid } end - context 'when path is invalid' do + context 'when path contains spaces' do let(:path) { 'Demande de subvention' } it { expect{procedure_path}.to raise_error ActiveRecord::RecordInvalid } end - context 'when path is valid' do - let(:path) { 'ma_super_procedure' } + context 'when path contains alphanumerics and underscores' do + let(:path) { 'ma_super_procedure_1' } it { expect{procedure_path}.not_to raise_error } end + context 'when path contains dashes' do + let(:path) { 'ma-super-procedure' } + it { expect{procedure_path}.not_to raise_error } + end + context 'when path is too long' do + let(:path) { 'ma-super-procedure-12345678901234567890123456789012345678901234567890' } + it { expect{procedure_path}.to raise_error ActiveRecord::RecordInvalid } + end + context 'when path is too short' do + let(:path) { 'pr' } + it { expect{procedure_path}.to raise_error ActiveRecord::RecordInvalid } + end end end diff --git a/spec/models/procedure_spec.rb b/spec/models/procedure_spec.rb index 6c4b16ba6..7a5717d99 100644 --- a/spec/models/procedure_spec.rb +++ b/spec/models/procedure_spec.rb @@ -284,4 +284,12 @@ describe Procedure do it_behaves_like "export is empty" end end + + describe '#default_path' do + let(:procedure){ create(:procedure, libelle: 'A long libelle with àccênts, blabla coucou hello un deux trois voila') } + + subject { procedure.default_path } + + it { is_expected.to eq('a-long-libelle-with-accents-blabla-coucou-hello-un') } + end end diff --git a/spec/serializers/dossier_table_export_serializer_spec.rb b/spec/serializers/dossier_table_export_serializer_spec.rb new file mode 100644 index 000000000..3373ecbed --- /dev/null +++ b/spec/serializers/dossier_table_export_serializer_spec.rb @@ -0,0 +1,34 @@ +require 'spec_helper' + +describe DossierTableExportSerializer do + + describe '#emails_accompagnateurs' do + + let(:gestionnaire){ create(:gestionnaire) } + let(:follow) { create(:follow, gestionnaire: gestionnaire) } + + subject { DossierTableExportSerializer.new(dossier).emails_accompagnateurs } + + context 'when there is no accompagnateurs' do + let(:dossier) { create(:dossier, follows: []) } + + it { is_expected.to eq('') } + end + + context 'when there one accompagnateur' do + let(:dossier) { create(:dossier, follows: [follow]) } + + it { is_expected.to eq(gestionnaire.email) } + end + + context 'when there is 2 followers' do + let(:gestionnaire2) { create :gestionnaire} + let(:follow2) { create(:follow, gestionnaire: gestionnaire2) } + let(:dossier) { create(:dossier, follows: [follow, follow2]) } + + it { is_expected.to eq "#{gestionnaire.email} #{gestionnaire2.email}" } + end + + end + +end diff --git a/spec/services/champs_service_spec.rb b/spec/services/champs_service_spec.rb index 4e8ce53a1..67f4c04d1 100644 --- a/spec/services/champs_service_spec.rb +++ b/spec/services/champs_service_spec.rb @@ -1,15 +1,15 @@ require 'spec_helper' describe ChampsService do - describe 'save_champs' do - let!(:champ) { Champ.create(value: 'toto', type_de_champ: TypeDeChamp.new) } - let!(:champ_mandatory_empty) { Champ.create(type_de_champ: TypeDeChamp.new(libelle: 'mandatory', mandatory: true)) } - let!(:champ_datetime) do - champ_datetime = TypeDeChamp.new(type_champ: 'datetime') - Champ.create(type_de_champ: champ_datetime) - end - let!(:champs) { [champ, champ_mandatory_empty, champ_datetime] } + let!(:champ) { Champ.create(value: 'toto', type_de_champ: TypeDeChamp.new) } + let!(:champ_mandatory_empty) { Champ.create(type_de_champ: TypeDeChamp.new(libelle: 'mandatory', mandatory: true)) } + let!(:champ_datetime) do + champ_datetime = TypeDeChamp.new(type_champ: 'datetime') + Champ.create(type_de_champ: champ_datetime) + end + let!(:champs) { [champ, champ_mandatory_empty, champ_datetime] } + describe 'save_champs' do before :each do params_hash = { champs: { @@ -19,31 +19,22 @@ describe ChampsService do time_hour: { "'#{champ_datetime.id}'" => '12' }, time_minute: { "'#{champ_datetime.id}'" => '24' } } - @errors = ChampsService.save_champs(champs, params_hash, check_mandatory) + ChampsService.save_champs(champs, params_hash) champs.each(&:reload) end - context 'check_mandatory is true' do - let(:check_mandatory) { true } - it 'saves the changed champ' do - expect(champ.value).to eq('yop') - end - - it 'parses and save the date' do - expect(champ_datetime.value).to eq('d 12:24') - end - - it 'adds error for the missing mandatory champ' do - expect(@errors).to match([{ message: 'Le champ mandatory doit être rempli.' }]) - end + it 'saves the changed champ' do + expect(champ.value).to eq('yop') end - context 'check_mandatory is false' do - let(:check_mandatory) { false } + it 'parses and save the date' do + expect(champ_datetime.value).to eq('d 12:24') + end + end - it 'does not add errors' do - expect(@errors).to match([]) - end + describe 'build_error_message' do + it 'adds error for the missing mandatory champ' do + expect(ChampsService.build_error_messages(champs)).to match(['Le champ mandatory doit être rempli.']) end end end diff --git a/spec/services/dossiers_list_gestionnaire_service_spec.rb b/spec/services/dossiers_list_gestionnaire_service_spec.rb index e568ae0da..d45293868 100644 --- a/spec/services/dossiers_list_gestionnaire_service_spec.rb +++ b/spec/services/dossiers_list_gestionnaire_service_spec.rb @@ -345,4 +345,36 @@ describe DossiersListGestionnaireService do end end end + + describe 'state filter methods' do + let!(:procedure) { create :procedure } + let!(:dossier) { create(:dossier, procedure: procedure, state: 'draft') } + let!(:dossier2) { create(:dossier, procedure: procedure, state: 'initiated') } #nouveaux + let!(:dossier3) { create(:dossier, procedure: procedure, state: 'initiated') } #nouveaux + let!(:dossier4) { create(:dossier, procedure: procedure, state: 'replied') } #en_attente + let!(:dossier5) { create(:dossier, procedure: procedure, state: 'updated') } #a_traiter + let!(:dossier6) { create(:dossier, procedure: procedure, state: 'received') } #a_instruire + let!(:dossier7) { create(:dossier, procedure: procedure, state: 'received') } #a_instruire + let!(:dossier8) { create(:dossier, procedure: procedure, state: 'closed') } #termine + let!(:dossier9) { create(:dossier, procedure: procedure, state: 'refused') } #termine + let!(:dossier10) { create(:dossier, procedure: procedure, state: 'without_continuation') } #termine + let!(:dossier11) { create(:dossier, procedure: procedure, state: 'closed') } #termine + let!(:dossier12) { create(:dossier, procedure: procedure, state: 'initiated', archived: true) } #a_traiter #archived + let!(:dossier13) { create(:dossier, procedure: procedure, state: 'replied', archived: true) } #en_attente #archived + let!(:dossier14) { create(:dossier, procedure: procedure, state: 'closed', archived: true) } #termine #archived + + describe '#termine' do + subject { DossiersListGestionnaireService.new(gestionnaire, liste, procedure).termine } + + it { expect(subject.size).to eq(4) } + it { expect(subject).to include(dossier8, dossier9, dossier10, dossier11) } + end + + describe '#a_instruire' do + subject { DossiersListGestionnaireService.new(gestionnaire, liste, procedure).a_instruire } + + it { expect(subject.size).to eq(2) } + it { expect(subject).to include(dossier6, dossier7) } + end + end end diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb index df7fe448b..6a6cc4762 100644 --- a/spec/services/notification_service_spec.rb +++ b/spec/services/notification_service_spec.rb @@ -22,8 +22,4 @@ describe NotificationService do end end end - - describe 'text_for_notif' do - pending - end end diff --git a/spec/services/pieces_justificatives_service_spec.rb b/spec/services/pieces_justificatives_service_spec.rb new file mode 100644 index 000000000..0e6704515 --- /dev/null +++ b/spec/services/pieces_justificatives_service_spec.rb @@ -0,0 +1,92 @@ +require 'spec_helper' + +describe PiecesJustificativesService do + let(:user) { create(:user) } + let(:safe_file) { true } + + before :each do + allow(ClamavService).to receive(:safe_file?).and_return(safe_file) + end + + let(:hash) { {} } + let!(:tpj_not_mandatory) do + TypeDePieceJustificative.create(libelle: 'not mandatory', mandatory: false) + end + let!(:tpj_mandatory) do + TypeDePieceJustificative.create(libelle: 'justificatif', mandatory: true) + end + let(:procedure) { Procedure.create(types_de_piece_justificative: tpjs) } + let(:dossier) { Dossier.create(procedure: procedure) } + let(:errors) { PiecesJustificativesService.upload!(dossier, user, hash) } + let(:tpjs) { [tpj_not_mandatory] } + + describe 'self.upload!' do + context 'when no params are given' do + it { expect(errors).to eq([]) } + end + + context 'when there is something wrong with file save' do + let(:hash) do + { + "piece_justificative_#{tpj_not_mandatory.id}" => + double(path: '', original_filename: 'filename') + } + end + + it { expect(errors).to match(["le fichier filename (not mandatory) n'a pas pu être sauvegardé"]) } + end + + context 'when a virus is provided' do + let(:safe_file) { false } + let(:hash) do + { + "piece_justificative_#{tpj_not_mandatory.id}" => + double(path: '', original_filename: 'bad_file') + } + end + + it { expect(errors).to match(['bad_file : virus détecté']) } + end + + context 'when a regular file is provided' do + let(:content) { double(path: '', original_filename: 'filename') } + let(:hash) do + { + "piece_justificative_#{tpj_not_mandatory.id}" => + content + } + end + + before :each do + expect(PiecesJustificativesService).to receive(:save_pj) + .with(content, dossier, tpj_not_mandatory, user) + .and_return(nil) + end + + it 'is saved' do + expect(errors).to match([]) + end + end + end + + describe 'missing_pj_error_messages' do + let(:errors) { PiecesJustificativesService.missing_pj_error_messages(dossier) } + let(:tpjs) { [tpj_mandatory] } + + context 'when no params are given' do + it { expect(errors).to match(['La pièce jointe justificatif doit être fournie.']) } + end + + context 'when the piece justificative is provided' do + before :each do + # we are messing around piece_justificative + # because directly doubling carrierwave params seems complicated + + piece_justificative_double = double(type_de_piece_justificative: tpj_mandatory) + expect(dossier).to receive(:pieces_justificatives).and_return([piece_justificative_double]) + end + + it { expect(errors).to match([]) } + end + end +end diff --git a/spec/services/render_partial_service_spec.rb b/spec/services/render_partial_service_spec.rb index ea94d3d5a..a8eee209c 100644 --- a/spec/services/render_partial_service_spec.rb +++ b/spec/services/render_partial_service_spec.rb @@ -16,8 +16,4 @@ describe RenderPartialService do it { is_expected.to eq 'layouts/left_panels/left_panel_'+controller.to_s.parameterize + '_' + method.to_s } end - - describe 'left_panel_exist?' do - pending - end end diff --git a/spec/views/backoffice/dossiers/show.html.html_spec.rb b/spec/views/backoffice/dossiers/show.html.html_spec.rb index 4003a65ef..865cb28ef 100644 --- a/spec/views/backoffice/dossiers/show.html.html_spec.rb +++ b/spec/views/backoffice/dossiers/show.html.html_spec.rb @@ -20,7 +20,7 @@ describe 'backoffice/dossiers/show.html.haml', type: :view do it 'button Modifier les document est present' do expect(rendered).not_to have_content('Modifier les documents') - expect(rendered).not_to have_css('#UploadPJmodal') + expect(rendered).not_to have_css('#upload-pj-modal') end it 'enterprise informations are present' do @@ -28,7 +28,7 @@ describe 'backoffice/dossiers/show.html.haml', type: :view do end it 'dossier informations are present' do - expect(rendered).to have_selector('#infos_dossier') + expect(rendered).to have_selector('#infos-dossiers') end context 'edit link are present' do diff --git a/spec/views/users/description/champs/_dossier_link.html.haml_spec.rb b/spec/views/users/description/champs/_dossier_link.html.haml_spec.rb index a61f09532..970ab4a43 100644 --- a/spec/views/users/description/champs/_dossier_link.html.haml_spec.rb +++ b/spec/views/users/description/champs/_dossier_link.html.haml_spec.rb @@ -7,6 +7,14 @@ describe 'users/description/champs/dossier_link.html.haml', type: :view do render 'users/description/champs/dossier_link.html.haml', champ: champ end + context 'in all cases' do + let!(:champ) { create(:champ, type_de_champ: type_champ, value: nil) } + + it 'should render an input for the dossier link' do + expect(rendered).to have_css("input[type=number][placeholder='Numéro de dossier']") + end + end + context 'When no dossier is provided' do let!(:champ) { create(:champ, type_de_champ: type_champ, value: nil) } diff --git a/spec/views/users/description/champs/_render_list_champs.html.haml_spec.rb b/spec/views/users/description/champs/_render_list_champs.html.haml_spec.rb index 17ca6d9d3..b5a74ed58 100644 --- a/spec/views/users/description/champs/_render_list_champs.html.haml_spec.rb +++ b/spec/views/users/description/champs/_render_list_champs.html.haml_spec.rb @@ -33,7 +33,7 @@ describe 'users/description/champs/render_list_champs.html.haml', type: :view do render 'users/description/champs/render_list_champs.html.haml', champs: Champ.all, order_place: 0 end - it 'should render a number input with the right data-attribute' do + it 'should render the _dossier_link partial' do expect(view).to render_template(partial: 'users/description/champs/_dossier_link', locals: { champ: champ }) end diff --git a/spec/views/users/recapitulatif/show.html.haml_spec.rb b/spec/views/users/recapitulatif/show.html.haml_spec.rb index 3503fad53..ccef84120 100644 --- a/spec/views/users/recapitulatif/show.html.haml_spec.rb +++ b/spec/views/users/recapitulatif/show.html.haml_spec.rb @@ -17,19 +17,13 @@ describe 'users/recapitulatif/show.html.haml', type: :view do end it 'la section infos dossier est présente' do - expect(rendered).to have_selector('#infos_dossier') + expect(rendered).to have_selector('#infos-dossiers') end it 'le flux de commentaire est présent' do expect(rendered).to have_selector('#messages') end - it 'le numéro de dossier est présent' do - pending 'move to test layout' - expect(rendered).to have_selector('#dossier_id') - expect(rendered).to have_content(dossier_id) - end - describe 'les liens de modifications' do context 'lien description' do it 'le lien vers description est présent' do @@ -73,7 +67,7 @@ describe 'users/recapitulatif/show.html.haml', type: :view do it 'button Modifier les document est present' do expect(rendered).to have_content('Modifier les documents') - expect(rendered).to have_css('#UploadPJmodal') + expect(rendered).to have_css('#upload-pj-modal') end end diff --git a/spec/views/users/sessions/new.html.haml_spec.rb b/spec/views/users/sessions/new.html.haml_spec.rb index 6e1dbeec9..cc7880f45 100644 --- a/spec/views/users/sessions/new.html.haml_spec.rb +++ b/spec/views/users/sessions/new.html.haml_spec.rb @@ -18,8 +18,8 @@ describe 'users/sessions/new.html.haml', type: :view do render end - it { expect(rendered).to have_selector('#form_login #logo_procedure') } - it { expect(rendered).to have_selector('#form_login #titre_procedure') } + it { expect(rendered).to have_selector('#form-login #logo_procedure') } + it { expect(rendered).to have_selector('#form-login #titre-procedure') } it { expect(rendered).to have_content(dossier.procedure.libelle) } it { expect(rendered).to have_content(dossier.procedure.description) } end @@ -29,6 +29,6 @@ describe 'users/sessions/new.html.haml', type: :view do render end - it { expect(rendered).to have_selector('#form_login #logo_tps') } + it { expect(rendered).to have_selector('#form-login #logo_tps') } end end diff --git a/spec/views/users/siret/index.html.haml_spec.rb b/spec/views/users/siret/index.html.haml_spec.rb index 49de45ecc..e489bec08 100644 --- a/spec/views/users/siret/index.html.haml_spec.rb +++ b/spec/views/users/siret/index.html.haml_spec.rb @@ -21,7 +21,7 @@ describe 'users/siret/index.html.haml', type: :view do end it 'le titre de la procédure' do - expect(rendered).to have_selector('#titre_procedure') + expect(rendered).to have_selector('#titre-procedure') end context 'stockage de l\'ID de la procédure dans un champs hidden' do