Merge pull request #1756 from betagouv/user_ui_mes_dossiers
Première version de la vue des dossiers de l'usager
This commit is contained in:
commit
a489bbeb44
8 changed files with 46 additions and 4 deletions
|
@ -66,6 +66,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
.updated-at-col {
|
||||
width: 110px;
|
||||
}
|
||||
|
||||
.follow-col {
|
||||
width: 200px;
|
||||
text-align: right;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module NewUser
|
||||
class DossiersController < UserController
|
||||
before_action :ensure_ownership!
|
||||
before_action :ensure_ownership!, except: [:index]
|
||||
|
||||
def attestation
|
||||
send_data(dossier.attestation.pdf.read, filename: 'attestation.pdf', type: 'application/pdf')
|
||||
|
@ -83,6 +83,10 @@ module NewUser
|
|||
@dossier = current_user.dossiers.includes(:procedure).find(params[:id])
|
||||
end
|
||||
|
||||
def index
|
||||
@dossiers = current_user.dossiers.includes(:procedure).page([params[:page].to_i, 1].max)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# FIXME: require(:dossier) when all the champs are united
|
||||
|
|
|
@ -110,7 +110,7 @@
|
|||
|
||||
%td.status-col
|
||||
= link_to(gestionnaire_dossier_path(@procedure, dossier), class: 'cell-link') do
|
||||
= render partial: 'status', locals: { dossier: dossier }
|
||||
= render partial: 'shared/dossiers/status', locals: { dossier: dossier }
|
||||
%td.follow-col= render partial: 'dossier_actions', locals: { procedure: @procedure, dossier: dossier, dossier_is_followed: @followed_dossiers_id.include?(dossier.id) }
|
||||
= paginate @dossiers
|
||||
- else
|
||||
|
|
|
@ -29,6 +29,6 @@
|
|||
%td= link_to(dossier.user.email, dossier_linked_path(current_gestionnaire, dossier), class: 'cell-link')
|
||||
%td.status-col
|
||||
= link_to(dossier_linked_path(current_gestionnaire, dossier), class: 'cell-link') do
|
||||
= render partial: 'new_gestionnaire/procedures/status', locals: { dossier: dossier }
|
||||
= render partial: 'shared/dossiers/status', locals: { dossier: dossier }
|
||||
- else
|
||||
%h2 Aucun dossier correspondant à votre recherche n'a été trouvé
|
||||
|
|
31
app/views/new_user/dossiers/index.html.haml
Normal file
31
app/views/new_user/dossiers/index.html.haml
Normal file
|
@ -0,0 +1,31 @@
|
|||
.container
|
||||
%h1.page-title Mes dossiers
|
||||
|
||||
%table.table.dossiers-table.hoverable
|
||||
%thead
|
||||
%tr
|
||||
%th
|
||||
%th.number-col Nº dossier
|
||||
%th Procédure
|
||||
%th.status-col Statut
|
||||
%th.updated-at-col Mis à jour
|
||||
%tbody
|
||||
- @dossiers.each do |dossier|
|
||||
%tr
|
||||
%td.folder-col
|
||||
= link_to(modifier_dossier_path(dossier), class: 'cell-link') do
|
||||
%span.icon.folder
|
||||
%td.number-col
|
||||
= link_to(modifier_dossier_path(dossier), class: 'cell-link') do
|
||||
= dossier.id
|
||||
%td
|
||||
= link_to(modifier_dossier_path(dossier), class: 'cell-link') do
|
||||
= dossier.procedure.libelle
|
||||
%td.status-col
|
||||
= link_to(modifier_dossier_path(dossier), class: 'cell-link') do
|
||||
= render partial: 'shared/dossiers/status', locals: { dossier: dossier }
|
||||
%td.updated-at-col
|
||||
= link_to(modifier_dossier_path(dossier), class: 'cell-link') do
|
||||
= dossier.updated_at.localtime.strftime("%d/%m/%Y")
|
||||
|
||||
= paginate(@dossiers)
|
|
@ -60,6 +60,7 @@
|
|||
%h1 Labels
|
||||
|
||||
%span.label .label
|
||||
%span.label.brouillon .label.brouillon
|
||||
%span.label.instruction .label.instruction
|
||||
%span.label.construction .label.construction
|
||||
%span.label.accepted .label.accepted
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
- if dossier.brouillon?
|
||||
%span.label.brouillon brouillon
|
||||
- if dossier.en_instruction?
|
||||
%span.label.instruction en instruction
|
||||
- elsif dossier.en_construction?
|
|
@ -206,7 +206,7 @@ Rails.application.routes.draw do
|
|||
get "patron" => "root#patron"
|
||||
|
||||
scope module: 'new_user' do
|
||||
resources :dossiers, only: [:update] do
|
||||
resources :dossiers, only: [:index, :update] do
|
||||
member do
|
||||
get 'identite'
|
||||
patch 'update_identite'
|
||||
|
|
Loading…
Reference in a new issue