Commit a22b576d authored by Jiri Strojil's avatar Jiri Strojil
Browse files

Sorting done

parent 590fbef2
Pipeline #29701 passed with stage
in 35 minutes and 41 seconds
......@@ -13,9 +13,7 @@ class SemesterProcessesController < ApplicationController
@semester_process = SemesterProcess.new(semester: @selected_semester)
@semester_process.build_semester_volunteers(@volunteers)
authorize @semester_process
if params[:sort_by]
@semester_process.semester_process_volunteers.sort_by {|spv| spv.volunteer.full_name}
end
@spvs_sorted = @semester_process.semester_process_volunteers.sort { |spv1, spv2| spv1.volunteer.contact.full_name <=> spv2.volunteer.contact.full_name}
@seme
if EmailTemplate.half_year_process_email.active.any?
template = EmailTemplate.half_year_process_email.active.first.slice(:subject, :body)
......
......@@ -17,10 +17,10 @@
table.table.table-striped
thead:tr
th.limit-width= select_all_rows
th= link_to "Freiwilliger/r", new_semester_process_url(semester: params[:semester],sort: "desc")
th Freiwilliger/r
th Einsatz
tbody
= f.simple_fields_for :semester_process_volunteers do |fv|
= f.simple_fields_for :semester_process_volunteers, @spvs_sorted do |fv|
tr.table-row-selectable
td= fv.input :selected, as: :boolean, label: false
td= link_to fv.object.volunteer.contact.full_name, fv.object.volunteer
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment