feat(exports): humanize status name

This commit is contained in:
Colin Darie 2023-09-20 14:00:18 +02:00
parent 3af93735a3
commit 307ba68970
No known key found for this signature in database
GPG key ID: 8C76CADD40253590
6 changed files with 42 additions and 15 deletions

View file

@ -1,4 +1,25 @@
module TabsHelper
def tab_i18n_key_from_status(status)
case status
when 'a-suivre'
'views.instructeurs.dossiers.tab_steps.to_follow' # i18n-tasks-use t('views.instructeurs.dossiers.tab_steps.to_follow')
when 'suivis'
'pluralize.followed'
when 'traites'
'pluralize.processed'
when 'tous'
'views.instructeurs.dossiers.tab_steps.total' # i18n-tasks-use t('views.instructeurs.dossiers.tab_steps.total')
when 'supprimes_recemment'
'pluralize.dossiers_supprimes_recemment'
when 'expirant'
'pluralize.dossiers_close_to_expiration'
when 'archives'
'pluralize.archived'
else
fail ArgumentError, "Unknown tab status: #{status}"
end
end
def tab_item(label, url, active: false, badge: nil, notification: false)
render partial: 'shared/tab_item', locals: {
label: label,