Implements configurable start and end hour of the dayused in schedule
This commit is contained in:
parent
7000e63700
commit
7fa6d5277d
5 changed files with 22 additions and 1 deletions
|
|
@ -43,6 +43,8 @@ There are a couple of environment variables you can set to configure OSEM.
|
|||
| OSEM_GITHUB_KEY | *string* | OMNIAUTH Developer Key for GitHub
|
||||
| OSEM_GITHUB_SECRET | *string* | OMNIAUTH Developer Secret for GitHub
|
||||
| OSEM_SCHEDULE_CELL_SIZE | *integer* | Schedule timeslot size to use (in minutes), should be greater than zero, should be divisor of 60
|
||||
| OSEM_SCHEDULE_START_HOUR | *integer* | Schedule start hour, should be greater than zero
|
||||
| OSEM_SCHEDULE_END_HOUR | *integer* | Schedule end hour, should be greater than zero
|
||||
| OSEM_SMTP_ADDRESS | smtp.opensuse.org | The smtp server to use
|
||||
| OSEM_SMTP_PORT | *int* | The port on the smtp server
|
||||
| OSEM_SMTP_USERNAME | *string* | The user for the smtp server
|
||||
|
|
|
|||
8
app.json
8
app.json
|
|
@ -58,6 +58,14 @@
|
|||
"description": "Schedule timeslot size in minutes",
|
||||
"required": false
|
||||
},
|
||||
"OSEM_SCHEDULE_START_HOUR": {
|
||||
"description": "Schedule start hour",
|
||||
"required": false
|
||||
},
|
||||
"OSEM_SCHEDULE_END_HOUR": {
|
||||
"description": "Schedule end hour",
|
||||
"required": false
|
||||
},
|
||||
"RACK_ENV": {
|
||||
"required": false
|
||||
},
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ class Schedule < ActiveRecord::Base
|
|||
|
||||
has_paper_trail ignore: [:updated_at], meta: { conference_id: :conference_id }
|
||||
|
||||
START_HOUR = (ENV['OSEM_SCHEDULE_START_HOUR']).nil? ? 9 : ENV['OSEM_SCHEDULE_START_HOUR'].to_i
|
||||
END_HOUR = (ENV['OSEM_SCHEDULE_END_HOUR']).nil? ? 18 : ENV['OSEM_SCHEDULE_END_HOUR'].to_i
|
||||
|
||||
private
|
||||
|
||||
def conference_id
|
||||
|
|
|
|||
|
|
@ -3,13 +3,15 @@
|
|||
/ use smaller cell heights for more compact grids
|
||||
- cell_height = compact_grid ? 32 : 58
|
||||
- date_event_schedules = @event_schedules.select{ |e| e.start_time.to_date.eql? date }
|
||||
- start_hour = Schedule::START_HOUR
|
||||
- end_hour = Schedule::END_HOUR
|
||||
.row
|
||||
- @rooms.each do |room|
|
||||
.col-md-2.col-xs-6
|
||||
.room-name
|
||||
- room_date_event_schedules = date_event_schedules.select{ |e| e.room == room }
|
||||
= room.name
|
||||
- (9*cells_per_hour..18*cells_per_hour).each do |slot|
|
||||
- (start_hour*cells_per_hour..end_hour*cells_per_hour).each do |slot|
|
||||
- hour = slot / cells_per_hour
|
||||
- minutes = (EventType::LENGTH_STEP * (slot % cells_per_hour)).to_s.rjust(2, '0')
|
||||
- time = "#{hour}:#{minutes}"
|
||||
|
|
|
|||
|
|
@ -56,3 +56,9 @@ OSEM_ICHAIN_ENABLED=false
|
|||
|
||||
# Schedule grid parameters, cell size in minutes
|
||||
OSEM_SCHEDULE_CELL_SIZE=15
|
||||
|
||||
# Schedule start hour
|
||||
OSEM_SCHEDULE_START_HOUR=9
|
||||
|
||||
# Schedule end hour
|
||||
OSEM_SCHEDULE_END_HOUR=18
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue