diff --git a/app/models/conference.rb b/app/models/conference.rb index bc67ffc8..edddb909 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -9,7 +9,8 @@ class Conference < ActiveRecord::Base :questions_attributes, :question_ids, :answers_attributes, :answer_ids, :difficulty_levels_attributes, :use_difficulty_levels, :use_vpositions, :use_vdays, :vdays_attributes, :vpositions_attributes, :use_volunteers, - :media_id, :media_type, :color, :description, :registration_description + :media_id, :media_type, :color, :description, + :registration_description, :ticket_description has_paper_trail diff --git a/app/models/supporter_level.rb b/app/models/supporter_level.rb index e51c1be5..02c56f61 100644 --- a/app/models/supporter_level.rb +++ b/app/models/supporter_level.rb @@ -2,5 +2,5 @@ class SupporterLevel < ActiveRecord::Base belongs_to :conference has_many :supporter_registrations - attr_accessible :conference, :title, :url + attr_accessible :conference, :title, :url, :description, :ticket_price end diff --git a/app/views/admin/conference/edit.html.haml b/app/views/admin/conference/edit.html.haml index 300eefce..d920ba1f 100644 --- a/app/views/admin/conference/edit.html.haml +++ b/app/views/admin/conference/edit.html.haml @@ -15,6 +15,7 @@ = f.input :registration_start_date, :as => :string, :input_html => { :id => "conference-reg-start-datepicker", :readonly => "readonly" } = f.input :registration_end_date, :as => :string, :input_html => { :id => "conference-reg-end-datepicker", :readonly => "readonly" } = f.input :registration_description, hint: 'This description will appear in registration segment of the splash' + = f.input :ticket_description, hint: 'This will appear in the Tickets segment of the splash' = f.inputs :name => "Media" do - if !@conference.logo.blank? diff --git a/app/views/admin/supporter_levels/_supporter_level_fields.html.erb b/app/views/admin/supporter_levels/_supporter_level_fields.html.erb index ec793dc7..899efdac 100644 --- a/app/views/admin/supporter_levels/_supporter_level_fields.html.erb +++ b/app/views/admin/supporter_levels/_supporter_level_fields.html.erb @@ -2,6 +2,9 @@ <%= f.inputs do %> <%= f.input :title%> <%= f.input :url %> + <%= f.input :description %> + <%= f.input :ticket_price, hint: 'Please enter price with currency symbol. + For example, $200,₹300' %> <%= remove_association_link :supporter_level, f %> <% end %> diff --git a/app/views/conference/_registration.html.haml b/app/views/conference/_registration.html.haml index 5a0ba8e3..5f52422b 100644 --- a/app/views/conference/_registration.html.haml +++ b/app/views/conference/_registration.html.haml @@ -10,3 +10,5 @@ %h4 Registration period #{ date_string(@conference.registration_start_date, @conference.registration_end_date) } - if @conference.registration_open? = link_to "Register for #{@conference.short_title}", register_conference_path(@conference.short_title), :class =>"btn btn-success btn-lg", target: '_blank' + - if @conference.use_supporter_levels? + = render 'tickets' diff --git a/app/views/conference/_tickets.html.haml b/app/views/conference/_tickets.html.haml new file mode 100644 index 00000000..2fcfbf72 --- /dev/null +++ b/app/views/conference/_tickets.html.haml @@ -0,0 +1,15 @@ +%div.row + %h3 Tickets + -if !@conference.ticket_description.blank? + %p #{ @conference.ticket_description } + - @conference.supporter_levels.each do |s| + %div.col-md-6 + - if !s.title.blank? + %h4 #{ s.title } + -if !s.description.blank? + %p #{ s.description } + - if !s.url.blank? + %div.btn-group + = link_to "Buy Ticket", s.url, class: 'btn btn-success', target: '_blank' + - if !s.ticket_price.blank? + = button_tag "#{s.ticket_price}", class: 'btn btn-success' diff --git a/app/views/layouts/_admin_sidebar.html.haml b/app/views/layouts/_admin_sidebar.html.haml index 11cebd56..3f573ef7 100644 --- a/app/views/layouts/_admin_sidebar.html.haml +++ b/app/views/layouts/_admin_sidebar.html.haml @@ -45,6 +45,9 @@ %ul.nav.nav-stacked.nav-pills.small.collapse.subNav %li{:class=> active_nav_li(admin_conference_rooms_path(@conference.short_title))} = link_to 'Rooms', admin_conference_rooms_path(@conference.short_title) + %li{ class: active_nav_li(admin_conference_supporter_levels_path(@conference.short_title)) } + = link_to(admin_conference_supporter_levels_path(@conference.short_title)) do + Supporter Levels %li{:class=> active_nav_li(admin_conference_emails_path(@conference.short_title))} = link_to(admin_conference_emails_path(@conference.short_title)) do %span.glyphicon.glyphicon-envelope diff --git a/db/migrate/20140529133052_add_ticket_description_to_conference.rb b/db/migrate/20140529133052_add_ticket_description_to_conference.rb new file mode 100644 index 00000000..ccb610d9 --- /dev/null +++ b/db/migrate/20140529133052_add_ticket_description_to_conference.rb @@ -0,0 +1,5 @@ +class AddTicketDescriptionToConference < ActiveRecord::Migration + def change + add_column :conferences, :ticket_description, :text + end +end diff --git a/db/migrate/20140529133228_add_description_to_supporter_level.rb b/db/migrate/20140529133228_add_description_to_supporter_level.rb new file mode 100644 index 00000000..4473c851 --- /dev/null +++ b/db/migrate/20140529133228_add_description_to_supporter_level.rb @@ -0,0 +1,5 @@ +class AddDescriptionToSupporterLevel < ActiveRecord::Migration + def change + add_column :supporter_levels, :description, :text + end +end diff --git a/db/migrate/20140529133339_add_ticket_price_to_supporter_level.rb b/db/migrate/20140529133339_add_ticket_price_to_supporter_level.rb new file mode 100644 index 00000000..c7ac5002 --- /dev/null +++ b/db/migrate/20140529133339_add_ticket_price_to_supporter_level.rb @@ -0,0 +1,5 @@ +class AddTicketPriceToSupporterLevel < ActiveRecord::Migration + def change + add_column :supporter_levels, :ticket_price, :string + end +end