Skip to content
Snippets Groups Projects
Unverified Commit 568d82d5 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

reorder roles & people in role

parent 79afbe08
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,8 @@ class Admin::Education::Program::Role::PeopleController < Admin::Education::Prog
load_and_authorize_resource :role, class: Education::Program::Role, through: :program
load_and_authorize_resource class: Education::Program::Role::Person, through: :role
include Admin::Reorderable
def new
breadcrumb
end
......
class Admin::Education::Program::RolesController < Admin::Education::Program::ApplicationController
load_and_authorize_resource class: Education::Program::Role, through: :program
include Admin::Reorderable
def show
breadcrumb
end
......
<% if people.any? %>
<table class="table">
<table class="table table-sortable">
<thead>
<tr>
<th><%= Education::Program::Role::Person.model_name.human %></th>
<th></th>
</tr>
</thead>
<tbody>
<tbody data-reorder-url="<%= reorder_admin_education_program_role_people_path(program_id: @program.id, role_id: @role.id) %>">
<% people.each do |person| %>
<tr>
<tr class="handle" data-id="<%= person.id %>">
<td>
<%= link_to_if can?(:read, person.person),
person.person,
......
<table class="table">
<table class="table table-sortable">
<thead>
<tr>
<th><%= Education::Program::Role.model_name.human %></th>
......@@ -6,9 +6,9 @@
<th></th>
</tr>
</thead>
<tbody>
<tbody data-reorder-url="<%= reorder_admin_education_program_roles_path(program_id: @program.id) %>">
<% roles.each do |role| %>
<tr>
<tr class="handle" data-id="<%= role.id %>">
<td>
<%= link_to_if can?(:read, role),
role,
......
......@@ -3,7 +3,15 @@ namespace :education do
resources :schools
resources :programs do
resources :roles, controller: 'program/roles', except: :index do
resources :people, controller: 'program/role/people', except: [:index, :show, :edit, :update]
resources :people, controller: 'program/role/people', except: [:index, :show, :edit, :update] do
collection do
post :reorder
end
end
collection do
post :reorder
end
end
resources :teachers, controller: 'program/teachers', except: [:index, :show]
collection do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment