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:
LeSim 2018-03-29 16:55:54 +02:00 committed by GitHub
commit a489bbeb44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 46 additions and 4 deletions

View file

@ -66,6 +66,10 @@
}
}
.updated-at-col {
width: 110px;
}
.follow-col {
width: 200px;
text-align: right;

View file

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

View file

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

View file

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

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

View file

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

View file

@ -1,3 +1,5 @@
- if dossier.brouillon?
%span.label.brouillon brouillon
- if dossier.en_instruction?
%span.label.instruction en instruction
- elsif dossier.en_construction?

View file

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