Adding limit (200) for dossier exportation

This commit is contained in:
JC 2016-11-15 17:06:40 +01:00
parent 0ac3c5fc86
commit 23b928f160
4 changed files with 13 additions and 6 deletions

View file

@ -112,6 +112,10 @@ group :test do
gem 'vcr' gem 'vcr'
end end
group :development do
gem 'web-console', '~> 2.0'
end
group :development, :test do group :development, :test do
# gem 'terminal-notifier' # gem 'terminal-notifier'
# gem 'terminal-notifier-guard' # gem 'terminal-notifier-guard'
@ -121,7 +125,6 @@ group :development, :test do
gem 'pry-byebug' gem 'pry-byebug'
# Access an IRB console on exception pages or by using <%= console %> in views # Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring' gem 'spring'

View file

@ -20,10 +20,10 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
def download_dossiers_tps def download_dossiers_tps
if procedure = Procedure.find_by(id: params[:procedure_id]) if procedure = Procedure.find_by(id: params[:procedure_id])
dossiers = DossiersListGestionnaireService.new(current_gestionnaire, nil, procedure).filter_dossiers dossiers = dossiers_list_facade(param_liste).dossiers_to_display
respond_with Dossier.export_full_generation(dossiers, request.format) respond_with Dossier.export_full_generation(dossiers, request.format)
else else
dossiers = DossiersListGestionnaireService.new(current_gestionnaire, nil, nil).filter_dossiers dossiers = dossiers_list_facade(param_liste).dossiers_to_display
respond_to do |format| respond_to do |format|
format.xlsx { render xlsx: dossiers } format.xlsx { render xlsx: dossiers }
format.ods { render ods: dossiers } format.ods { render ods: dossiers }

View file

@ -6,7 +6,10 @@
=t('dynamics.backoffice.title') =t('dynamics.backoffice.title')
%div.dropdown.pull-right#download_menu %div.dropdown.pull-right#download_menu
%button.btn.btn-default.dropdown-toggle#dropdownDownloadMenu{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false} %button.btn.btn-success.dropdown-toggle#dropdownDownloadMenu{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false, class: ('disabled' if (@dossiers.count > 200)) }
- if (@dossiers.count > 200)
= t('dynamics.backoffice.limit_excess_download_all_dossiers')
- else
%i.fa.fa-download %i.fa.fa-download
= t('dynamics.backoffice.download_all_dossiers') = t('dynamics.backoffice.download_all_dossiers')
%span.caret %span.caret

View file

@ -13,6 +13,7 @@ fr:
title: 'Gestion de colonnes affichées' title: 'Gestion de colonnes affichées'
description: 'Ce menu vous permet de choisir les différentes colonnes que vous souhaitez voir apparaître dans votre interface de suivi des dossiers.' description: 'Ce menu vous permet de choisir les différentes colonnes que vous souhaitez voir apparaître dans votre interface de suivi des dossiers.'
download_all_dossiers: 'Télécharger mes dossiers' download_all_dossiers: 'Télécharger mes dossiers'
limit_excess_download_all_dossiers: 'Limite de dossiers fixée à 200 pour le téléchargement'
format_csv: 'Au format CSV' format_csv: 'Au format CSV'
format_xlsx: 'Au format XLSX' format_xlsx: 'Au format XLSX'
format_ods: 'Au format ODS' format_ods: 'Au format ODS'