Usager UI: simple dossier index
This commit is contained in:
parent
48ddb4cfb6
commit
b2f04e2503
4 changed files with 41 additions and 2 deletions
|
@ -66,6 +66,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.updated-at-col {
|
||||||
|
width: 110px;
|
||||||
|
}
|
||||||
|
|
||||||
.follow-col {
|
.follow-col {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
module NewUser
|
module NewUser
|
||||||
class DossiersController < UserController
|
class DossiersController < UserController
|
||||||
before_action :ensure_ownership!
|
before_action :ensure_ownership!, except: [:index]
|
||||||
|
|
||||||
def attestation
|
def attestation
|
||||||
send_data(dossier.attestation.pdf.read, filename: 'attestation.pdf', type: 'application/pdf')
|
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])
|
@dossier = current_user.dossiers.includes(:procedure).find(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def index
|
||||||
|
@dossiers = current_user.dossiers.includes(:procedure).page([params[:page].to_i, 1].max)
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# FIXME: require(:dossier) when all the champs are united
|
# FIXME: require(:dossier) when all the champs are united
|
||||||
|
|
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)
|
|
@ -206,7 +206,7 @@ Rails.application.routes.draw do
|
||||||
get "patron" => "root#patron"
|
get "patron" => "root#patron"
|
||||||
|
|
||||||
scope module: 'new_user' do
|
scope module: 'new_user' do
|
||||||
resources :dossiers, only: [:update] do
|
resources :dossiers, only: [:index, :update] do
|
||||||
member do
|
member do
|
||||||
get 'identite'
|
get 'identite'
|
||||||
patch 'update_identite'
|
patch 'update_identite'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue