Skip to content
Snippets Groups Projects
Commit 016a3db4 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

front

parent f309332d
No related branches found
No related tags found
No related merge requests found
class Extranet::PersonsController < ApplicationController
load_and_authorize_resource class: University::Person::Alumnus,
through: :current_university,
through_association: :people
def index
@people = @people.ordered.page(params[:page])
end
def show
end
end
json.extract! education_cohort, :id, :university_id, :program_id, :academic_year_id, :name, :created_at, :updated_at
json.url education_cohort_url(education_cohort, format: :json)
json.array! @education_cohorts, partial: "education_cohorts/education_cohort", as: :education_cohort
json.partial! "education_cohorts/education_cohort", education_cohort: @education_cohort
......@@ -2,6 +2,10 @@
<h1><%= @cohort %></h1>
<p><%= @cohort.people.count %></p>
<% @cohort.people.each do |person| %>
<%= link_to person, person %>
<% end %>
<div class="row">
<% @cohort.people.ordered.each do |person| %>
<div class="col-xxl-2 col-md-3">
<%= link_to person, person %>
</div>
<% end %>
</div>
<% content_for :title, University::Person::Alumnus.model_name.human(count: 2) %>
<table class="<%= table_classes %>">
<thead>
<tr>
<th>Name</th>
<th></th>
</tr>
</thead>
<tbody>
<% @people.each do |person| %>
<tr>
<td><%= link_to person, person %></td>
<td></td>
</tr>
<% end %>
</tbody>
</table>
<%= paginate @people, theme: 'bootstrap-5' %>
<% content_for :title, @person %>
<h1><%= @person %></h1>
......@@ -16,5 +16,8 @@ SimpleNavigation::Configuration.run do |navigation|
primary.item :cohorts,
Education::Cohort.model_name.human(count: 2),
education_cohorts_path
primary.item :person,
University::Person::Alumnus.model_name.human(count: 2),
university_persons_path
end
end
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