diff --git a/app/controllers/extranet/persons_controller.rb b/app/controllers/extranet/persons_controller.rb new file mode 100644 index 0000000000000000000000000000000000000000..21739b53db2207eb31d3aca551be1408f5106274 --- /dev/null +++ b/app/controllers/extranet/persons_controller.rb @@ -0,0 +1,12 @@ +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 diff --git a/app/views/admin/education/cohorts/_education_cohort.json.jbuilder b/app/views/admin/education/cohorts/_education_cohort.json.jbuilder deleted file mode 100644 index ace1ee5325090fb5a9e73f3e39bd47649b3f2664..0000000000000000000000000000000000000000 --- a/app/views/admin/education/cohorts/_education_cohort.json.jbuilder +++ /dev/null @@ -1,2 +0,0 @@ -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) diff --git a/app/views/admin/education/cohorts/index.json.jbuilder b/app/views/admin/education/cohorts/index.json.jbuilder deleted file mode 100644 index 757fffcecb4ddaefa32c834aa44f4632f7b7bf90..0000000000000000000000000000000000000000 --- a/app/views/admin/education/cohorts/index.json.jbuilder +++ /dev/null @@ -1 +0,0 @@ -json.array! @education_cohorts, partial: "education_cohorts/education_cohort", as: :education_cohort diff --git a/app/views/admin/education/cohorts/show.json.jbuilder b/app/views/admin/education/cohorts/show.json.jbuilder deleted file mode 100644 index 8729cfa0b92b796974b2cdad4905634df0fdcd12..0000000000000000000000000000000000000000 --- a/app/views/admin/education/cohorts/show.json.jbuilder +++ /dev/null @@ -1 +0,0 @@ -json.partial! "education_cohorts/education_cohort", education_cohort: @education_cohort diff --git a/app/views/extranet/cohorts/show.html.erb b/app/views/extranet/cohorts/show.html.erb index 80c570517c0ef4f4bc151bdf02748440a1696fc5..85133b9747dbb33d017467133a0367c7987cefd3 100644 --- a/app/views/extranet/cohorts/show.html.erb +++ b/app/views/extranet/cohorts/show.html.erb @@ -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> diff --git a/app/views/extranet/persons/index.html.erb b/app/views/extranet/persons/index.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..aedc4001a0bebdfb7f74ed963f67d682ba5dfd9c --- /dev/null +++ b/app/views/extranet/persons/index.html.erb @@ -0,0 +1,20 @@ +<% 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' %> diff --git a/app/views/extranet/persons/show.html.erb b/app/views/extranet/persons/show.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..aa7949ff28a324ad432e1f4d90381aabfab140fa --- /dev/null +++ b/app/views/extranet/persons/show.html.erb @@ -0,0 +1,3 @@ +<% content_for :title, @person %> + +<h1><%= @person %></h1> diff --git a/config/navigation.rb b/config/navigation.rb index 39f93342cace8caa601aed22da5f0324b024415a..b79410e8c5304c9231905b572fff81f574402881 100644 --- a/config/navigation.rb +++ b/config/navigation.rb @@ -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