Commit b2143b21 authored by Jiri Strojil's avatar Jiri Strojil

Adjusted logic

parent 51ac03d0
Pipeline #33039 failed with stage
in 35 minutes and 40 seconds
......@@ -124,7 +124,7 @@ class SemesterProcessVolunteersController < ApplicationController
if params[:semester]
@selected_semester = Semester.parse(params[:semester])
else
@selected_semester = @semester.previous
@selected_semester = @semester.current
params[:semester] = Semester.to_s(@selected_semester)
end
end
......
......@@ -112,7 +112,7 @@ class Semester
# running semester where in now
def current
@current ||= Semester.semester_range_from_start(
Semester.semester_start_time(@context)
Semester.semester_start_time(@context.advance(months: 4))
)
end
......@@ -173,4 +173,11 @@ class Semester
[Semester.i18n_t(semester, short: false), to_s(semester)]
end
end
def existing_collection(count = 6)
collection(count) do |semester|
next unless Semester.new.current == semester || Semester.taken_semesters.include?(semester)
[Semester.i18n_t(semester, short: false), to_s(semester)]
end
end
end
......@@ -6,5 +6,5 @@
span.caret aria-hidden='true'
ul.dropdown-menu
li
-@semester.collection.each do |name, semester_code|
-@semester.existing_collection.each do |name, semester_code|
li= link_to name[0..15], semester_process_volunteers_path(semester: semester_code)
Markdown is supported
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