Skip to content

Commit

Permalink
Fixe design interface instructeur
Browse files Browse the repository at this point in the history
  • Loading branch information
kara22 committed Dec 18, 2024
1 parent a4bebce commit 82831bf
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
4 changes: 2 additions & 2 deletions app/assets/stylesheets/procedure_list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
}

.notifications {
top: 3px;
right: 18px;
top: 10px;
right: 30px;
}
}
}
Expand Down
11 changes: 6 additions & 5 deletions app/helpers/tabs_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def tab_i18n_key_from_status(status)
when 'tous'
'views.instructeurs.dossiers.tab_steps.total' # i18n-tasks-use t('views.instructeurs.dossiers.tab_steps.total')
when 'supprimes'
'pluralize.dossiers_supprimes'
'instructeurs.dossiers.labels.dossiers_supprimes'
when 'expirant'
'pluralize.dossiers_close_to_expiration'
when 'archives'
Expand All @@ -22,21 +22,22 @@ def tab_i18n_key_from_status(status)
end
end

def tab_item(label, url, active: false, badge: nil, notification: false)
def tab_item(label, url, active: false, badge: nil, notification: false, icon: nil)
render partial: 'shared/tab_item', locals: {
label: label,
url: url,
active: active,
badge: badge,
notification: notification
notification: notification,
icon: icon
}
end

def dynamic_tab_item(label, url_or_urls, badge: nil, notification: false)
def dynamic_tab_item(label, url_or_urls, badge: nil, notification: false, icon: nil)
urls = [url_or_urls].flatten
url = urls.first
active = urls.any? { |u| current_page?(u) }

tab_item(label, url, active: active, badge: badge, notification: notification)
tab_item(label, url, active: active, badge: badge, notification: notification, icon: icon)
end
end
6 changes: 3 additions & 3 deletions app/views/instructeurs/procedures/_list.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
.center.fr-text--bold.fr-text--sm
= number_with_html_delimiter(dossier_count)
.center.fr-text--xs
= t('pluralize.case', count: dossier_count)
= t('instructeurs.dossiers.labels.total')

- if p.procedure_expires_when_termine_enabled
%li.fr-btn.fr-btn--tertiary.flex.justify-center.fr-enlarge-link.fr-mb-1w
Expand All @@ -56,13 +56,13 @@
%li.fr-btn.fr-btn--tertiary.flex.justify-center.fr-enlarge-link.fr-mb-1w
= link_to(instructeur_procedure_path(p, statut: 'archives')) do
.center.fr-text--bold.fr-text--sm
%span.fr-icon-folder-2-line
%span.fr-icon-folder-2-line.fr-icon--sm
.center.fr-text--xs
= t('instructeurs.dossiers.labels.to_archive')

%li.fr-btn.fr-btn--tertiary.flex.justify-center.fr-enlarge-link.fr-mb-1w
= link_to(instructeur_procedure_path(p, statut: 'supprimes')) do
.center.fr-text--bold.fr-text--sm
%span.fr-icon-delete-line
%span.fr-icon-delete-line.fr-icon--sm
.center.fr-text--xs
= t('instructeurs.dossiers.labels.dossiers_supprimes')
12 changes: 6 additions & 6 deletions app/views/instructeurs/procedures/_tabs.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@
active: statut == 'tous',
badge: number_with_html_delimiter(tous_count))

= tab_item(t(tab_i18n_key_from_status('supprimes'), count: supprimes_count),
instructeur_procedure_path(procedure, statut: 'supprimes'),
active: statut == 'supprimes',
badge: number_with_html_delimiter(supprimes_count))

- if procedure.procedure_expires_when_termine_enabled
= tab_item(t(tab_i18n_key_from_status('expirant'), count: expirant_count),
instructeur_procedure_path(procedure, statut: 'expirant'),
Expand All @@ -36,4 +31,9 @@
= tab_item(t(tab_i18n_key_from_status('archives'), count: archives_count),
instructeur_procedure_path(procedure, statut: 'archives'),
active: statut == 'archives',
badge: number_with_html_delimiter(archives_count))
icon: 'fr-icon-archive-line')

= tab_item(t(tab_i18n_key_from_status('supprimes'), count: supprimes_count),
instructeur_procedure_path(procedure, statut: 'supprimes'),
active: statut == 'supprimes',
icon: 'fr-icon-delete-line')
2 changes: 2 additions & 0 deletions app/views/shared/_tab_item.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
= link_to(url, 'aria-selected': active ? true : nil, class: 'fr-tabs__tab', role: 'tab' ) do
- if badge.present?
%span.fr-badge.fr-badge--blue-ecume.fr-mr-1w= badge
- if icon.present?
%span.fr-icon--sm.fr-mr-1w{ class: icon, "aria-hidden": true }
= label
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,7 @@ en:
to_follow: to follow
to_archive: to archive
dossiers_supprimes: trash
total: total
france_connect:
particulier:
choose_email:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ fr:
to_follow: à suivre
to_archive: à archiver
dossiers_supprimes: corbeille
total: dossiers
total: au total
administrateurs:
activate:
new:
Expand Down

0 comments on commit 82831bf

Please sign in to comment.