Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Integration with bookings

  • Loading branch information...
commit 46ea64ed47674f375d3692b6c0340f7814b32dd1 1 parent a9e2529
@carboes authored
View
1  app/models/event_option.rb
@@ -9,6 +9,7 @@ class EventOption < ActiveRecord::Base
#has_friendly_id :name, :use_slug => true
+ #TODO: remove
def summary
summary = name
summary += " - #{ticket_price}" if ticket_price?
View
10 app/views/admin/events/_event_option.haml
@@ -2,9 +2,9 @@
%table
%thead
%tr
- %td Option Name
- %td Option Price
- %td Minimum Deposit
+ %td Name
+ %td Price
+ %td Min. deposit
%tbody
- f.fields_for :event_options do |builder|
%tr
@@ -12,8 +12,8 @@
= builder.text_field :name
%td
&pound;
- = builder.text_field :ticket_price
+ = builder.text_field :ticket_price, :size => 4
%td
&pound;
- = builder.text_field :min_deposit
+ = builder.text_field :min_deposit, :size => 4
View
7 app/views/admin/events/_form.html.erb
@@ -88,8 +88,13 @@
</div>
<div class='field'>
+ <%= f.label :code -%>
+ <%= f.text_field :code -%>
+ </div>
+
+ <div class='field'>
<%= f.label :ticket_link -%>
- <%= f.text_field :ticket_link, :class => 'larger wide' -%>
+ <%= f.text_field :ticket_link, :class => 'larger wide' -%> (if external)
</div>
<div class='field'>
View
47 app/views/events/_event.haml
@@ -3,22 +3,36 @@
- archive ||= false
- category ||= false
-= div_for event, :'data-id' => event.id, :class => 'individual_event clearfix' do
+.event.bookable.clearfix{:'data-id' => event.id}
+
%section.event_image
= image_fu event.image
- %p
- %button.book{:'data-id' => event.id, :'data-name' => event.title, :'data-type' => 'event'} Book now
+ %p.booking_item{:'data-id' => event.id, :'data-name' => event.title, :'data-type' => 'event'}
+ %button.book Book now
+ %button.unbook Remove
+ %button.added Added
+
+ %h4 Fees:
+ - if event.ticket_price?
+ %p
+ = number_to_currency event.ticket_price, :unit => '£'
+ - unless event.event_options.empty?
+ %ul
+ - event.event_options.each do |event_option|
+ %li
+ = event_option.name
+ = number_to_currency event_option.ticket_price, :unit => '£'
+
= render :partial => '/calendar/event', :locals => { :gc_link => event.gc_link }
+
%section.event_info
- /- unless individual
%h2
- = event.title#link_to , event
+ = event.title
%h3
= event.subtitle
- /%section
= raw event.description
.event_details.clearfix
@@ -39,24 +53,9 @@
%br
= event.map_location.postcode
- /%section.price
- - if event.ticket_price?
- %p
- %label Cost:
- = number_to_currency event.ticket_price
-
- / = render :partial => '/map_locations/map_single', :locals => {:map_location => event.map_location}
-
-
+
+ = render :partial => '/shared/social_media'
- / - if individual
- / %section#share_this_event
- / %ul
- / %li.facebook
- / %script{src:'http://connect.facebook.net/en_US/all.js#xfbml=1'}
- / %fb:like{href: request.url, layout: "box_count", show_faces: false, width: 55, font:""}
- / %li.twitter
- / %a.twitter-share-button{href:"http://twitter.com/share", :'data-count' => "vertical"}Tweet
- / %script{src:'http://platform.twitter.com/widgets.js', type: "text/javascript"}
+ = render :partial => '/map_locations/map_single', :locals => {:map_location => event.map_location}
View
22 app/views/events/_sidebar.haml
@@ -7,9 +7,7 @@
- content_for :body_content_right do
#events_sidebar
-
- = render :partial => '/bookings/cart'
-
+ /= render :partial => '/bookings/cart'
%aside.sidebar_module.rss
%h3 RSS
= link_to "Subscribe", events_path(:format => :rss)
@@ -19,7 +17,7 @@
%aside.sidebar_module.events
%ul
- @upcoming_events.each do |event|
- %li.clearfix{:'data-id' => event.id}
+ %li.clearfix{:'data-id' => event.id, class: (selected_event == event) ? 'selected' : ''}
/.image
= image_fu event.image, "60x80#c"
/.caption
@@ -40,14 +38,14 @@
/ %li
/ = link_to category.name+'s', category_events_path(category)
- - unless controller.action_name == "index" or controller.action_name == "archive"
- %aside.sidebar_module.other_events
- %h2
- = t('.other')
- %ul#events
- - @other_events.each do |event|
- %li
- = link_to event.title, event_url(event)
+ / - unless controller.action_name == "index" or controller.action_name == "archive"
+ / %aside.sidebar_module.other_events
+ / %h2
+ / = t('.other')
+ / %ul#events
+ / - @other_events.each do |event|
+ / %li
+ / = link_to event.title, event_url(event)
.panel
%h2 Archives
%aside.sidebar_module.archives
View
5 app/views/events/index.haml
@@ -3,8 +3,7 @@
= javascript_include_tag '/javascripts/compiled/controllers/bookings.js'
- content_for :stylesheets do
- /= stylesheet_link_tag 'refinerycms-events'
-
+ = stylesheet_link_tag 'refinerycms-events'
/- content_for :body_content_left do
/ #featured_events.events
@@ -15,6 +14,6 @@
/ %h2 All Events
/= render :partial => 'event', :collection => @events
-= render 'events/sidebar'
+= render :partial => 'sidebar', :locals => { :selected_event => nil }
= render :partial => "/shared/content_page"
View
6 app/views/events/show.haml
@@ -6,8 +6,10 @@
- content_for :body_content_title do
/= @event.title
+
- content_for :body_content_left do
- #events.bookings
+ #events
= render :partial => 'event', :locals => { :event => @event, :individual => true }
-= render 'events/sidebar'
+
+= render :partial => 'sidebar', :locals => { :selected_event => @event }
= render :partial => "/shared/content_page"
Please sign in to comment.
Something went wrong with that request. Please try again.