Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
aoz-003
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
aoz-003
Commits
361c33b8
Commit
361c33b8
authored
Dec 18, 2018
by
Jiri Strojil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New preselection
parent
30a46220
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
semester.rb
app/services/semester.rb
+21
-4
No files found.
app/services/semester.rb
View file @
361c33b8
...
...
@@ -16,6 +16,21 @@ class Semester
11
=>
2
}.
freeze
SEMESTER_PRESELECTION_MAP
=
{
1
=>
2
,
2
=>
2
,
3
=>
2
,
4
=>
1
,
5
=>
1
,
6
=>
1
,
7
=>
1
,
8
=>
1
,
9
=>
1
,
10
=>
2
,
11
=>
2
,
12
=>
2
,
}.
freeze
class
<<
self
def
parse
(
string
)
return
unless
string
...
...
@@ -116,10 +131,12 @@ class Semester
)
end
def
preselect_semester
(
offset
=
-
4
.
months
)
Semester
.
semester_range_from_start
(
Semester
.
semester_start_time
(
@context
+
offset
)
)
def
preselect_semester
if
SEMESTER_PRESELECTION_MAP
[
@context
.
month
]
==
Semester
.
number
(
current
)
current
else
previous
end
end
# params:
...
...
Write
Preview
Markdown
is supported
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