This commit is contained in:
Kara Diaby 2021-11-24 10:35:34 +01:00
parent 24ba7b6633
commit 2103f09be1
4 changed files with 22 additions and 5 deletions

View file

@ -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;
}
}

View file

@ -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)

View file

@ -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)

View file

@ -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')