- <% @dates.each do |date| %>
-
-
-
- | Time |
- <% @rooms.each do |room| %>
- <%= room.name %> |
- <% end %>
-
-
- <% span = {} %>
- <% @rooms.each do |room| %>
- <% span[room.id] = 1 %>
- <% end %>
-
- <% conf_start = DateTime.parse("#{date} 09:00") %>
- <% conf_end = DateTime.parse("#{date} 19:00") %>
-
- <% while conf_start < conf_end %>
- <%-
- start_hour = conf_start.hour
- start_min = conf_start.min %>
-
-
- |
- <%= conf_start.strftime("%H:%M") %>
- |
-
- <% @rooms.each do |room| %>
- <% events_for_date = @events.find_all {|e| e.room_id == room.id && e.start_time && e.start_time.to_date == date } %>
- <% event = events_for_date.find_all{|e| e.start_time.hour == start_hour && e.start_time.min == start_min } %>
- <% if !event.empty? %>
-
- <% span[room.id] = event[0].event_type.length / 15 %>
-
- <%- if speaker = event[0].speakers.first %>
- <%= image_tag speaker.gravatar_url, :class => "img-circle pull-right",
- :alt => speaker.name,
- :title => speaker.name,
- :style => "padding:8px;" %>
- <%- end %>
-
-
- <%= event[0].title %>
- <% unless event[0].subtitle.blank? %>
-
- <%= event[0].subtitle %>
-
- <% end %>
-
-
-
-
- <%= "#{speaker.name}" %>
-
- <% if event[0].track%>
-
-
- <%= event[0].track.name %>
-
- <% end -%>
- |
- <% span[room.id] = span[room.id] + 1 %>
- <% elsif span[room.id] > 1 %>
-
- <% span[room.id] = ( span[room.id] - 1 ) if span[room.id] > 1 %>
- <% end %>
- <% if span[room.id] == 1 %>
-
-
- |
- <% end %>
- <%end %>
-
- <% conf_start += 15.minutes %>
- <%end %>
-
-
+
+
+
Schedule for <%= @conference.title %>
+
+ <% @dates.each do |date| %>
+ - >
+ <%= link_to date, "#" + "#{date}", "data-toggle" => "tab" %>
+
<% end %>
-
-
+
+
+
+ <% @dates.each do |date| %>
+
+
+
+ | Time |
+ <% @rooms.each do |room| %>
+ <%= room.name %> |
+ <% end %>
+
+
+ <% span = {} %>
+ <% @rooms.each do |room| %>
+ <% span[room.id] = 1 %>
+ <% end %>
+
+ <% conf_start = DateTime.parse("#{date} 09:00") %>
+ <% conf_end = DateTime.parse("#{date} 19:00") %>
+
+ <% while conf_start < conf_end %>
+ <%-
+ start_hour = conf_start.hour
+ start_min = conf_start.min %>
+
+
+ |
+ <%= conf_start.strftime("%H:%M") %>
+ |
+
+ <% @rooms.each do |room| %>
+ <% events_for_date = @events.find_all {|e| e.room_id == room.id && e.start_time && e.start_time.to_date == date } %>
+ <% event = events_for_date.find_all{|e| e.start_time.hour == start_hour && e.start_time.min == start_min } %>
+ <% if !event.empty? %>
+
+ <% span[room.id] = event[0].event_type.length / 15 %>
+
+ <%- if speaker = event[0].speakers.first %>
+ <%= image_tag speaker.gravatar_url, :class => "img-circle pull-right",
+ :alt => speaker.name,
+ :title => speaker.name,
+ :style => "padding:8px;" %>
+ <%- end %>
+
+
+ <%= event[0].title %>
+ <% unless event[0].subtitle.blank? %>
+
+ <%= event[0].subtitle %>
+
+ <% end %>
+
+
+
+
+ <%= "#{speaker.name}" %>
+
+ <% if event[0].track%>
+
+
+ <%= event[0].track.name %>
+
+ <% end -%>
+ |
+ <% span[room.id] = span[room.id] + 1 %>
+ <% elsif span[room.id] > 1 %>
+
+ <% span[room.id] = ( span[room.id] - 1 ) if span[room.id] > 1 %>
+ <% end %>
+ <% if span[room.id] == 1 %>
+
+
+ |
+ <% end %>
+ <%end %>
+
+ <% conf_start += 15.minutes %>
+ <%end %>
+
+
+ <% end %>
+
+
<%= javascript_tag do %>
jQuery( function($) {
$('tbody tr td[data-href]').addClass('clickable').mouseup(function(e) {
diff --git a/app/views/tickets/index.html.haml b/app/views/tickets/index.html.haml
index 435019c5..bf916484 100644
--- a/app/views/tickets/index.html.haml
+++ b/app/views/tickets/index.html.haml
@@ -1,37 +1,38 @@
-.row
- .col-sm-12.col-md-10.col-md-offset-1
- %h1
- Tickets
- %p.lead
- Please buy a ticket if you want to support
- %b
- = @conference.title
- !
- =form_tag(conference_ticket_purchases_path, method: :post) do |f|
- %table.table.table-hover
- %thead
- %tr
- %th Ticket
- %th Quantity
- %th Price
- %th Total
- %tbody
- - @conference.tickets.each do |ticket|
- = render partial: 'ticket', f: f, locals: {ticket: ticket}
- %tr
- %td
- %td
- %td.col-sm-1.col-md-1.text-center
- %h4
- Total
- %td.col-sm-1.col-md-1.text-center
- %h4
- %strong
- %span{id: 'total_price'}
- 0
- .pull-right
- = button_tag(type: 'submit', class: 'btn btn-success btn-lg') do
- Support
- %i.fa.fa-shopping-cart
- = link_to 'Continue without a Ticket!', conference_conference_registrations_path(@conference.short_title),
- class: 'btn btn-danger btn-sm'
+.container
+ .row
+ .col-md-12
+ .page-header
+ %h1
+ Tickets
+ %p.lead
+ Please buy a ticket to support
+ %b
+ = @conference.title
+ =form_tag(conference_ticket_purchases_path, method: :post) do |f|
+ %table.table.table-hover
+ %thead
+ %tr
+ %th Ticket
+ %th Quantity
+ %th Price
+ %th Total
+ %tbody
+ - @conference.tickets.each do |ticket|
+ = render partial: 'ticket', f: f, locals: {ticket: ticket}
+ %tr
+ %td
+ %td
+ %td.col-sm-1.col-md-1.text-center
+ %h4
+ Total
+ %td.col-sm-1.col-md-1.text-center
+ %h4
+ %strong
+ %span{id: 'total_price'}
+ 0
+ .pull-right
+ = button_tag(type: 'submit', class: 'btn btn-success btn-lg') do
+ Support
+ %i.fa.fa-shopping-cart
+ = link_to 'Continue without a Ticket!', conference_conference_registrations_path(@conference.short_title),
+ class: 'btn btn-danger btn-sm'
diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml
index 572e12fc..d235fb5d 100644
--- a/app/views/users/edit.html.haml
+++ b/app/views/users/edit.html.haml
@@ -1,8 +1,11 @@
-%h1 Edit your profile
-.row
- .col-md-12
- = semantic_form_for(@user, url: user_path(@user.id)) do |f|
- = f.inputs name: 'Profile' do
+.container
+ .row
+ .col-md-12
+ .page-header
+ %h1 Edit your profile
+ .row
+ .col-md-12
+ = semantic_form_for(@user, url: user_path(@user.id)) do |f|
= f.input :name, as: :string
= f.input :nickname, as: :string
= f.input :affiliation, as: :string,
@@ -14,4 +17,4 @@
words. Biographies are limited to 150 words.
%br
%br
- = f.action :submit, as: :button, label: 'Update', button_html: {class: 'btn btn-primary'}
+ = f.action :submit, as: :button, label: 'Update', button_html: {class: 'btn btn-primary'}
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
index 7ba218bf..9755310d 100644
--- a/app/views/users/show.html.haml
+++ b/app/views/users/show.html.haml
@@ -1,16 +1,24 @@
-%h1
- = @user.name
-%h4
- = @user.biography
-
-- if @user.events.confirmed.any?
- %h3
- = "#{@user.name} presents #{pluralize(@user.events.confirmed.count, 'Event')}:"
- %ul.list-unstyled
- - @user.events.confirmed.each do |event|
- %li
- %h4
- = link_to event.title, conference_proposal_path(event.conference.short_title, event.id)
- %strong
- at
- = event.conference.title
\ No newline at end of file
+.container
+ .row
+ .col-md-12
+ .page-header
+ %h1
+ = image_tag(current_user.gravatar_url(size: '48'), title: "Yo #{current_user.name}!", :alt => '')
+ = @user.name
+ %small
+ = @user.nickname
+ %p
+ = @user.biography
+ .row
+ .col-md-12
+ - if @user.events.confirmed.any?
+ %h3
+ = "#{@user.name} presents #{pluralize(@user.events.confirmed.count, 'Event')}:"
+ %ul.list-unstyled
+ - @user.events.confirmed.each do |event|
+ %li
+ %h4
+ = link_to event.title, conference_proposal_path(event.conference.short_title, event.id)
+ %strong
+ at
+ = event.conference.title
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index 1886fdc0..7caa0366 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -48,7 +48,12 @@ Osem::Application.routes.draw do
resources :tracks, only: [:show, :update, :index]
- resources :sponsorship_levels, only: [:show, :update, :index]
+ resources :sponsorship_levels, except: [:show] do
+ member do
+ patch :up
+ patch :down
+ end
+ end
resources :sponsors, only: [:show, :update, :index]
diff --git a/db/migrate/20141113134103_add_position_to_sponsorship_level.rb b/db/migrate/20141113134103_add_position_to_sponsorship_level.rb
new file mode 100644
index 00000000..5663d3e6
--- /dev/null
+++ b/db/migrate/20141113134103_add_position_to_sponsorship_level.rb
@@ -0,0 +1,5 @@
+class AddPositionToSponsorshipLevel < ActiveRecord::Migration
+ def change
+ add_column :sponsorship_levels, :position, :integer
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 39af7835..f1d20fc4 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20141109172204) do
+ActiveRecord::Schema.define(version: 20141113134103) do
create_table "ahoy_events", force: true do |t|
t.uuid "visit_id"
@@ -423,6 +423,7 @@ ActiveRecord::Schema.define(version: 20141109172204) do
t.integer "conference_id"
t.datetime "created_at"
t.datetime "updated_at"
+ t.integer "position"
end
create_table "subscriptions", force: true do |t|
diff --git a/spec/features/rooms_spec.rb b/spec/features/rooms_spec.rb
index 322db098..f725ce5b 100644
--- a/spec/features/rooms_spec.rb
+++ b/spec/features/rooms_spec.rb
@@ -11,22 +11,22 @@ feature Room do
visit admin_conference_rooms_path(
conference_id: conference.short_title)
- expect(page.has_content?('Room Name')).to be false
- expect(page.has_content?('100')).to be false
+ expect(page.has_no_table?('#rooms')).to be true
# Add room
click_link 'New Room'
- fill_in 'room_name', with: 'Room Name'
+ fill_in 'room_name', with: 'Auditorium'
fill_in 'room_size', with: '100'
click_button 'Create Room'
# Validations
expect(flash).to eq('Room successfully created.')
-
- expect(page.has_content?('Room Name')).to be true
- expect(page.has_content?('100')).to be true
+ within('table#rooms') do
+ expect(page.has_content?('Auditorium')).to be true
+ expect(page.assert_selector('tr', count: 2)).to be true
+ end
end
scenario 'updates a room', feature: true, js: true do
@@ -35,17 +35,19 @@ feature Room do
visit edit_admin_conference_room_path(
conference_id: conference.short_title, id: room.id)
- fill_in 'room_name', with: 'Room Name'
+ fill_in 'room_name', with: 'Auditorium'
fill_in 'room_size', with: '100'
click_button 'Update Room'
# Validations
expect(flash).to eq('Room successfully updated.')
- expect(page.has_content?('Room Name')).to be true
- expect(page.has_content?('100')).to be true
+ within('table#rooms') do
+ expect(page.has_content?('Auditorium')).to be true
+ expect(page.assert_selector('tr', count: 2)).to be true
+ end
room.reload
- expect(room.name).to eq('Room Name')
+ expect(room.name).to eq('Auditorium')
expect(room.size).to eq(100)
end
end
diff --git a/spec/features/sponsorship_level_spec.rb b/spec/features/sponsorship_level_spec.rb
index 229cb926..9df66e9a 100644
--- a/spec/features/sponsorship_level_spec.rb
+++ b/spec/features/sponsorship_level_spec.rb
@@ -5,37 +5,51 @@ feature SponsorshipLevel do
let!(:organizer_role) { create(:organizer_role, resource: conference) }
let!(:organizer) { create(:user, role_ids: [organizer_role.id]) }
- shared_examples 'sponsorship levels' do
- scenario 'adds and updates sponsorship level', feature: true, js: true do
-
+ shared_examples 'sponsorship_levels' do
+ scenario 'adds a sponsorship level', feature: true, js: true do
sign_in organizer
visit admin_conference_sponsorship_levels_path(
conference_id: conference.short_title)
- # Add sponsorship level
- click_link 'Add sponsorship_level'
- expect(page.all('div.nested-fields').count == 1).to be true
- page.
- find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) input').
- set('Example sponsorship level')
+ expect(page.has_no_table?('#sponsorship_levels')).to be true
- click_button 'Update Conference'
+ # Add SponsorshipLevel
+ click_link 'New Sponsorship Level'
+
+ fill_in 'sponsorship_level_title', with: 'Platin'
+
+ click_button 'Create Sponsorship level'
# Validations
- expect(flash).to eq('Sponsorship levels were successfully updated.')
- expect(find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) input').
- value).to eq('Example sponsorship level')
+ expect(flash).to eq('Sponsorship level successfully created.')
+ within('table#sponsorship_levels') do
+ expect(page.has_content?('Platin')).to be true
+ expect(page.assert_selector('tr', count: 2)).to be true
+ end
+ end
- # Remove sponsorship level
- click_link 'Remove sponsorship_level'
- expect(page.all('div.nested-fields').count == 0).to be true
- click_button 'Update Conference'
- expect(flash).to eq('Sponsorship levels were successfully updated.')
- expect(page.all('div.nested-fields').count == 0).to be true
+ scenario 'updates a sponsorship level', feature: true, js: true do
+ level = create(:sponsorship_level, conference_id: conference.id)
+ sign_in organizer
+ visit edit_admin_conference_sponsorship_level_path(
+ conference_id: conference.short_title, id: level.id)
+
+ fill_in 'sponsorship_level_title', with: 'Gold'
+
+ click_button 'Update Sponsorship level'
+
+ # Validations
+ expect(flash).to eq('Sponsorship level successfully updated.')
+ within('table#sponsorship_levels') do
+ expect(page.has_content?('Gold')).to be true
+ expect(page.assert_selector('tr', count: 2)).to be true
+ end
+ level.reload
+ expect(level.title).to eq('Gold')
end
end
describe 'organizer' do
- it_behaves_like 'sponsorship levels'
+ it_behaves_like 'sponsorship_levels'
end
end
diff --git a/spec/views/conference/show.html.haml_spec.rb b/spec/views/conference/show.html.haml_spec.rb
index 4203834b..43f28b21 100644
--- a/spec/views/conference/show.html.haml_spec.rb
+++ b/spec/views/conference/show.html.haml_spec.rb
@@ -5,9 +5,9 @@ describe 'conference/show.html.haml' do
@conference = create(:conference)
@conference.splashpage = create(:splashpage,
- banner_description: 'Lorem Ipsum',
- sponsor_description: 'Lorem Ipsum Dolor',
- registration_description: 'Lorem Ipsum Dolor',
+ banner_description: 'Banner Description',
+ sponsor_description: 'Sponsor Description',
+ registration_description: 'Registration Description',
include_registrations: true,
include_program: true,
include_sponsors: true,
@@ -19,13 +19,13 @@ describe 'conference/show.html.haml' do
include_lodgings: true)
@conference.contact.update(sponsor_email: 'example@example.com',
- facebook: 'http://www.fbexample.com',
- googleplus: 'http://www.google-example.com',
+ facebook: 'http://facebook.com',
+ googleplus: 'http://google.com',
instagram: 'http://instagram.com',
twitter: 'http://twitter.com')
@conference.registration_period = create(:registration_period,
- start_date: Date.today,
+ start_date: Date.yesterday,
end_date: Date.tomorrow)
@conference.call_for_papers = create(:call_for_papers, conference: @conference,
@@ -43,8 +43,8 @@ describe 'conference/show.html.haml' do
end
it 'renders banner component' do
- expect(view.content_for(:splash)).to include("#{@conference.splashpage.banner_description}")
- expect(view.content_for(:splash)).to include("#{@conference.short_title}")
+ expect(rendered).to match(/#{@conference.splashpage.banner_description}/)
+ expect(rendered).to match(/#{@conference.short_title}/)
end
it 'renders program partial' do
@@ -52,45 +52,43 @@ describe 'conference/show.html.haml' do
end
it 'renders registration partial' do
- expect(view.content_for(:splash)).to include("#{@conference.splashpage.registration_description}")
expect(view).to render_template(partial: 'conference/_registration')
end
it 'renders call_for_papers partial' do
- expect(view.content_for(:splash)).to include("#{@conference.call_for_papers.description}")
+ expect(rendered).to match(/#{@conference.call_for_papers.description}/)
end
it 'renders sponsors partial' do
- expect(view).to render_template(partial: 'conference/_sponsor')
- expect(view.content_for(:splash)).to include('Lorem Ipsum Dolor')
- expect(view.content_for(:splash)).to include('example@example.com')
- expect(view.content_for(:splash)).to include('Platin')
- expect(view.content_for(:splash)).to include('Example sponsor')
- expect(view.content_for(:splash)).to include('http://www.example.com')
- expect(view.content_for(:splash)).to include('Lorem Ipsum Dolor')
- expect(view.content_for(:splash)).to include('rails.jpg')
+ expect(view).to render_template(partial: 'conference/_sponsors')
+ expect(rendered).to match(/example@example.com/)
+ expect(rendered).to match(/Platin/)
+ expect(rendered).to match(/Example sponsor/)
+ expect(rendered).to match(/www.example.com/)
+ expect(rendered).to match(/Lorem Ipsum Dolor/)
+ expect(rendered).to match(/rails.jpg/)
end
it 'renders social media partial' do
expect(view).to render_template('conference/_social_media')
- expect(view.content_for(:splash)).to include('http://www.fbexample.com')
- expect(view.content_for(:splash)).to include('http://www.google-example.com')
- expect(view.content_for(:splash)).to include('http://instagram.com')
- expect(view.content_for(:splash)).to include('http://twitter.com')
+ expect(rendered).to match(/facebook.com/)
+ expect(rendered).to match(/google.com/)
+ expect(rendered).to match(/instagram.com/)
+ expect(rendered).to match(/twitter.com/)
end
it 'renders location partial' do
expect(view).to render_template(partial: 'conference/_location')
- expect(view.content_for(:splash)).to include('Suse Office')
- expect(view.content_for(:splash)).to include('Maxfeldstrasse 5 \n90409 Nuremberg')
- expect(view.content_for(:splash)).to include('www.opensuse.org')
- expect(view.content_for(:splash)).to include('Lorem Ipsum Dolor')
+ expect(rendered).to match(/Suse Office/)
+ expect(rendered).to match(/Maxfeldstrasse 5/)
+ expect(rendered).to match(/www.opensuse.org/)
+ expect(rendered).to match(/Lorem Ipsum Dolor/)
end
it 'renders lodging partial' do
expect(view).to render_template(partial: 'conference/_lodging')
- expect(view.content_for(:splash)).to include('Example Hotel')
- expect(view.content_for(:splash)).to include('Lorem Ipsum Dolor')
- expect(view.content_for(:splash)).to include('http://www.example.com')
+ expect(rendered).to match(/Example Hotel/)
+ expect(rendered).to match(/Lorem Ipsum Dolor/)
+ expect(rendered).to match(/www.example.com/)
end
end