Add tickets to registration segment

This commit is contained in:
Gopesh Tulsyan 2014-05-29 20:23:33 +05:30
parent abfb0884a1
commit e2fd1bbd69
10 changed files with 42 additions and 2 deletions

View file

@ -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

View file

@ -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

View file

@ -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?

View file

@ -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 %>
</div>

View file

@ -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'

View file

@ -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'

View file

@ -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

View file

@ -0,0 +1,5 @@
class AddTicketDescriptionToConference < ActiveRecord::Migration
def change
add_column :conferences, :ticket_description, :text
end
end

View file

@ -0,0 +1,5 @@
class AddDescriptionToSupporterLevel < ActiveRecord::Migration
def change
add_column :supporter_levels, :description, :text
end
end

View file

@ -0,0 +1,5 @@
class AddTicketPriceToSupporterLevel < ActiveRecord::Migration
def change
add_column :supporter_levels, :ticket_price, :string
end
end