Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
aoz-003
Commits
a22b576d
Commit
a22b576d
authored
Oct 29, 2018
by
Jiri Strojil
Browse files
Sorting done
parent
590fbef2
Pipeline
#29701
passed with stage
in 35 minutes and 41 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/controllers/semester_processes_controller.rb
View file @
a22b576d
...
...
@@ -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
)
...
...
app/views/semester_processes/_form.html.slim
View file @
a22b576d
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment