Merge 92750a4a2b into 945b4aac60
This commit is contained in:
commit
a82f33fc0e
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
|
||||
|
||||
|
|
|
|||
|
|
@ -499,6 +499,10 @@ class Conference < ActiveRecord::Base
|
|||
result - active_conferences
|
||||
end
|
||||
|
||||
def self.get_conferences_to_list(domain, end_date = Date.current)
|
||||
return Conference.where('end_date >= ? AND (domain = ? OR domain IS NULL)', end_date, domain).reorder(start_date: :asc)
|
||||
end
|
||||
|
||||
##
|
||||
# A list with the three event states submitted, confirmed, unconfirmed with corresponding colors
|
||||
#
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
= semantic_form_for(@conference, :url => admin_conference_path(@conference.short_title),:html => {:multipart => true}) do |f|
|
||||
= f.input :title, :hint => "The full title of the conference, e.g. 'openSUSE Conference 2014'"
|
||||
= f.input :short_title, :hint => "A short title, e.g. 'oSC14', to be used in URLs"
|
||||
= f.input :domain, hint: "Optional domain on which the conference will be visible. This only affects the conference listings."
|
||||
= f.input :description, hint: markdown_hint('A description of the conference.'), input_html: { rows: 5, data: { provide: 'markdown-editable' } }
|
||||
= f.input :color, :hint => "The color will be used eg for the dashboard.", :input_html => {:size => 6, :type => "color"}
|
||||
= f.label 'Conference Logo'
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
input_html: { required: 'required' }
|
||||
= f.input :short_title, hint: "A short and unique handle for your conference, using only lower-case letters, numbers and underscores. This will be used to identify your conference in URLs etc. Example: 'froscon2011'",
|
||||
input_html: { required: 'required' }
|
||||
= f.input :domain, hint: "Optional domain on which the conference will be visible. This only affects the conference listings."
|
||||
= f.inputs 'Scheduling' do
|
||||
= f.input :timezone, as: :time_zone, default: Time.zone.name, hint: 'Please select in what time zone your conference will take place.'
|
||||
= f.input :start_date, as: :string, input_html: { id: 'conference-start-datepicker', required: 'required' }
|
||||
|
|
|
|||
6
db/migrate/20170201193336_add_domain_to_conferences.rb
Normal file
6
db/migrate/20170201193336_add_domain_to_conferences.rb
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
class AddDomainToConferences < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :conferences, :domain, :string
|
||||
add_index :conferences, [:domain]
|
||||
end
|
||||
end
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20160815140302) do
|
||||
ActiveRecord::Schema.define(version: 20170201193336) do
|
||||
|
||||
create_table "ahoy_events", force: :cascade do |t|
|
||||
t.uuid "visit_id", limit: 16
|
||||
|
|
@ -98,8 +98,11 @@ ActiveRecord::Schema.define(version: 20160815140302) do
|
|||
t.text "description"
|
||||
t.integer "registration_limit", default: 0
|
||||
t.string "picture"
|
||||
t.string "domain"
|
||||
end
|
||||
|
||||
add_index "conferences", ["domain"], name: "index_conferences_on_domain"
|
||||
|
||||
create_table "conferences_questions", id: false, force: :cascade do |t|
|
||||
t.integer "conference_id"
|
||||
t.integer "question_id"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue