Groupe instructeur show
This commit is contained in:
parent
2749c00ce3
commit
733e83cc54
6 changed files with 54 additions and 1 deletions
|
@ -0,0 +1,6 @@
|
||||||
|
.groupe-instructeur {
|
||||||
|
.actions {
|
||||||
|
width: 200px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,6 +12,16 @@ module NewAdministrateur
|
||||||
.order(:label)
|
.order(:label)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
@procedure = procedure
|
||||||
|
@groupe_instructeur = groupe_instructeur
|
||||||
|
@instructeurs = groupe_instructeur
|
||||||
|
.instructeurs
|
||||||
|
.page(params[:page])
|
||||||
|
.per(ITEMS_PER_PAGE)
|
||||||
|
.order(:email)
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def procedure
|
def procedure
|
||||||
|
@ -20,5 +30,9 @@ module NewAdministrateur
|
||||||
.includes(:groupe_instructeurs)
|
.includes(:groupe_instructeurs)
|
||||||
.find(params[:procedure_id])
|
.find(params[:procedure_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def groupe_instructeur
|
||||||
|
procedure.groupe_instructeurs.find(params[:id])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,5 +15,6 @@
|
||||||
- @groupes_instructeurs.each do |group|
|
- @groupes_instructeurs.each do |group|
|
||||||
%tr
|
%tr
|
||||||
%td= group.label
|
%td= group.label
|
||||||
|
%td.actions= link_to "voir", procedure_groupe_instructeur_path(@procedure, group)
|
||||||
|
|
||||||
= paginate @groupes_instructeurs
|
= paginate @groupes_instructeurs
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
= render partial: 'new_administrateur/breadcrumbs',
|
||||||
|
locals: { steps: [link_to('Démarches', admin_procedures_path),
|
||||||
|
link_to(@procedure.libelle, admin_procedure_path(@procedure)),
|
||||||
|
link_to('Groupes d’instructeurs', procedure_groupe_instructeurs_path(@procedure)),
|
||||||
|
@groupe_instructeur.label] }
|
||||||
|
|
||||||
|
.container.groupe-instructeur
|
||||||
|
.rename_form_block
|
||||||
|
.flex.baseline-start
|
||||||
|
%h1 Groupe « #{@groupe_instructeur.label} »
|
||||||
|
|
||||||
|
.card
|
||||||
|
.card-title Gestion des instructeurs
|
||||||
|
|
||||||
|
%table.table.mt-2
|
||||||
|
%thead
|
||||||
|
%tr
|
||||||
|
%th{ colspan: 2 } Instructeurs affectés
|
||||||
|
%tbody
|
||||||
|
- @instructeurs.each do |instructeur|
|
||||||
|
%tr
|
||||||
|
%td= instructeur.email
|
||||||
|
|
||||||
|
= paginate @instructeurs
|
|
@ -350,7 +350,7 @@ Rails.application.routes.draw do
|
||||||
get 'annotations'
|
get 'annotations'
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :groupe_instructeurs, only: [:index]
|
resources :groupe_instructeurs, only: [:index, :show]
|
||||||
|
|
||||||
resources :administrateurs, controller: 'procedure_administrateurs', only: [:index, :create, :destroy]
|
resources :administrateurs, controller: 'procedure_administrateurs', only: [:index, :create, :destroy]
|
||||||
|
|
||||||
|
|
|
@ -24,4 +24,12 @@ describe NewAdministrateur::GroupeInstructeursController, type: :controller do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe '#show' do
|
||||||
|
context 'of a group I belong to' do
|
||||||
|
before { get :show, params: { procedure_id: procedure.id, id: gi_1_1.id } }
|
||||||
|
|
||||||
|
it { expect(response).to have_http_status(:ok) }
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue