Usager UI: simple dossier index

This commit is contained in:
simon lehericey 2018-03-28 15:02:37 +02:00
parent 48ddb4cfb6
commit b2f04e2503
4 changed files with 41 additions and 2 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

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

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