From 2103f09be125f1ef5273d3b84b7864d99b09313d Mon Sep 17 00:00:00 2001 From: Kara Diaby Date: Wed, 24 Nov 2021 10:35:34 +0100 Subject: [PATCH] layout --- app/assets/stylesheets/dossiers_table.scss | 8 ++++++++ app/views/commencer/show.html.haml | 2 +- app/views/instructeurs/procedures/show.html.haml | 7 ++++--- app/views/users/dossiers/_dossier_actions.html.haml | 10 +++++++++- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/dossiers_table.scss b/app/assets/stylesheets/dossiers_table.scss index 32fec296e..7d836033c 100644 --- a/app/assets/stylesheets/dossiers_table.scss +++ b/app/assets/stylesheets/dossiers_table.scss @@ -83,3 +83,11 @@ width: 200px; } } + +.file-hidden-by-user { + background-color: rgba(242, 137, 0, 0.6); + + &:hover { + background-color: rgba(242, 137, 0, 0.6) !important; + } +} diff --git a/app/views/commencer/show.html.haml b/app/views/commencer/show.html.haml index 4eb4840a5..28d78643a 100644 --- a/app/views/commencer/show.html.haml +++ b/app/views/commencer/show.html.haml @@ -11,7 +11,7 @@ = link_to t('views.shared.account.already_user'), commencer_sign_in_path(path: @procedure.path), class: ['button large expand'] - else - - dossiers = current_user.dossiers.where(revision: @revision.draft? ? @revision : @procedure.revisions.where.not(id: @procedure.draft_revision_id)) + - dossiers = current_user.dossiers.where(hidden_by_user_at: nil, revision: @revision.draft? ? @revision : @procedure.revisions.where.not(id: @procedure.draft_revision_id)) - drafts = dossiers.merge(Dossier.state_brouillon) - not_drafts = dossiers.merge(Dossier.state_not_brouillon) diff --git a/app/views/instructeurs/procedures/show.html.haml b/app/views/instructeurs/procedures/show.html.haml index 15d32e1fb..1ab6d2f62 100644 --- a/app/views/instructeurs/procedures/show.html.haml +++ b/app/views/instructeurs/procedures/show.html.haml @@ -100,8 +100,7 @@ %tbody - @projected_dossiers.each do |p| - path = instructeur_dossier_path(@procedure, p.dossier_id) - - %tr + %tr{ class: [p.hidden_by_user_at.present? && "file-hidden-by-user"] } %td.folder-col %a.cell-link{ href: path } %span.icon.folder @@ -113,7 +112,9 @@ - p.columns.each do |column| %td - %a.cell-link{ href: path }= column + %a.cell-link{ href: path } + = column + = "- #{t('views.instructeurs.dossiers.deleted_by_user')}" if p.hidden_by_user_at.present? %td.status-col %a.cell-link{ href: path }= status_badge(p.state) diff --git a/app/views/users/dossiers/_dossier_actions.html.haml b/app/views/users/dossiers/_dossier_actions.html.haml index 27f39af37..6e510222d 100644 --- a/app/views/users/dossiers/_dossier_actions.html.haml +++ b/app/views/users/dossiers/_dossier_actions.html.haml @@ -2,7 +2,8 @@ - has_delete_action = dossier.can_be_deleted_by_user? - has_new_dossier_action = dossier.procedure.accepts_new_dossiers? - has_transfer_action = dossier.user == current_user -- has_actions = has_edit_action || has_delete_action || has_new_dossier_action || has_transfer_action +- has_hide_action = dossier.termine? && dossier.hidden_by_user_at.nil? +- has_actions = has_edit_action || has_delete_action || has_new_dossier_action || has_transfer_action || has_hide_action - if has_actions .dropdown.user-dossier-actions @@ -44,3 +45,10 @@ %span.icon.delete .dropdown-description = t('views.users.dossiers.dossier_action.delete_dossier') + - if has_hide_action + %li + = link_to hide_dossier_dossier_path(dossier), method: :patch do + %span.icon.delete + .dropdown-description + = t('views.users.dossiers.dossier_action.hide_dossier') +