Adds domain support to OSEM
- This is a very basic support. All it affects is the listings on the homepage. Every conference can set a domain, and as long as the request host matches this domain, the conference will be shown on the list - If a conference does not have a domain set (which will be the case for older conferences), such conferences are shown always - Conference creation and edits now have an optional domain field - Also adds corresponding migrations (+index)
This commit is contained in:
parent
945b4aac60
commit
92750a4a2b
8 changed files with 21 additions and 4 deletions
|
|
@ -176,7 +176,7 @@ module Admin
|
|||
private
|
||||
|
||||
def conference_params
|
||||
params.require(:conference).permit(:title, :short_title, :description, :timezone,
|
||||
params.require(:conference).permit(:title, :short_title, :description, :timezone, :domain,
|
||||
:start_date, :end_date, :rooms_attributes, :tracks_attributes,
|
||||
:tickets_attributes, :event_types_attributes,
|
||||
:picture, :picture_cache, :questions_attributes,
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
def get_conferences
|
||||
@conferences =Conference.all
|
||||
domain = request.host
|
||||
@conferences = Conference.get_conferences_to_list(domain, 0)
|
||||
end
|
||||
|
||||
def current_ability
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@ class ConferencesController < ApplicationController
|
|||
load_resource :program, through: :conference, singleton: true, except: :index
|
||||
|
||||
def index
|
||||
@current = Conference.where('end_date >= ?', Date.current).reorder(start_date: :asc)
|
||||
domain = request.host
|
||||
@current = Conference.get_conferences_to_list domain
|
||||
@antiquated = @conferences - @current
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue