Merge branch 'master' into adding_ds_store_to_gitignore
This commit is contained in:
commit
3cf44587a7
8 changed files with 35 additions and 24 deletions
|
|
@ -3,7 +3,6 @@ class PaymentsController < ApplicationController
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
load_resource :conference, find_by: :short_title
|
load_resource :conference, find_by: :short_title
|
||||||
authorize_resource :conference_registrations, class: Registration
|
authorize_resource :conference_registrations, class: Registration
|
||||||
before_action :check_amount, only: [:new]
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@payments = current_user.payments
|
@payments = current_user.payments
|
||||||
|
|
@ -11,6 +10,9 @@ class PaymentsController < ApplicationController
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@total_amount_to_pay = Ticket.total_price(@conference, current_user, paid: false)
|
@total_amount_to_pay = Ticket.total_price(@conference, current_user, paid: false)
|
||||||
|
if @total_amount_to_pay.zero?
|
||||||
|
raise CanCan::AccessDenied.new('Nothing to pay for!', :new, Payment)
|
||||||
|
end
|
||||||
@unpaid_ticket_purchases = current_user.ticket_purchases.unpaid.by_conference(@conference)
|
@unpaid_ticket_purchases = current_user.ticket_purchases.unpaid.by_conference(@conference)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -29,11 +31,6 @@ class PaymentsController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_amount
|
|
||||||
@total_amount_to_pay = Ticket.total_price(@conference, current_user, paid: false)
|
|
||||||
redirect_to root_path if @total_amount_to_pay.zero?
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def payment_params
|
def payment_params
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@
|
||||||
%div
|
%div
|
||||||
%a.pull-right.comment-reply-link{ href: '#' } Reply
|
%a.pull-right.comment-reply-link{ href: '#' } Reply
|
||||||
.comment-reply
|
.comment-reply
|
||||||
= semantic_form_for :comment, url: '#{comment_admin_conference_program_event_path(@conference.short_title, comment.commentable_id)}', method: :post do |f|
|
= semantic_form_for :comment, url: comment_admin_conference_program_event_path(@conference.short_title, comment.commentable_id), method: :post do |f|
|
||||||
= f.input :body
|
= f.input :body
|
||||||
%input{ name: 'parent', type: 'hidden', value: '#{comment.id}' }
|
%input{ name: 'parent', type: 'hidden', value: comment.id }
|
||||||
%input{ name: 'authenticity_token', type: 'hidden', value: '#{form_authenticity_token}' }
|
%input{ name: 'authenticity_token', type: 'hidden', value: '#{form_authenticity_token}' }
|
||||||
%button.btn.btn-primary.pull-right{ name: 'button', type: 'submit' } Add Reply
|
%button.btn.btn-primary.pull-right{ name: 'button', type: 'submit' } Add Reply
|
||||||
- comment.children.each do |child|
|
- comment.children.each do |child|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
- if can? :create, Event
|
- if can? :create, Event
|
||||||
=link_to 'Add Event', new_admin_conference_program_event_path(@conference.short_title), class: 'button btn btn-default btn-info'
|
=link_to 'Add Event', new_admin_conference_program_event_path(@conference.short_title), class: 'button btn btn-default btn-info'
|
||||||
- if can? :read, Event
|
- if can? :read, Event
|
||||||
|
.btn-group
|
||||||
.btn-group
|
.btn-group
|
||||||
%button.btn.btn-default.dropdown-toggle{ 'data-toggle' => 'dropdown', type: 'button', class: 'btn btn-success' }
|
%button.btn.btn-default.dropdown-toggle{ 'data-toggle' => 'dropdown', type: 'button', class: 'btn btn-success' }
|
||||||
Export PDF
|
Export PDF
|
||||||
|
|
|
||||||
|
|
@ -32,4 +32,4 @@
|
||||||
= @conference.venue.country_name
|
= @conference.venue.country_name
|
||||||
- if @conference.venue.website
|
- if @conference.venue.website
|
||||||
%br
|
%br
|
||||||
=link_to @conference.venue.website, @conference.venue.website
|
=link_to(h(@conference.venue.website), h(@conference.venue.website)).html_safe
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,15 @@
|
||||||
- content_for(:script_body) do
|
- content_for(:script_body) do
|
||||||
:javascript
|
:javascript
|
||||||
// create a map in the "map" div, set the view to a given place and zoom
|
// create a map in the "map" div, set the view to a given place and zoom
|
||||||
var map = L.map('map', { scrollWheelZoom: false }).setView([#{@conference.venue.latitude}, #{@conference.venue.longitude}], 11);
|
var map = L.map('map', { scrollWheelZoom: false }).setView([#{h(@conference.venue.latitude)}, #{h(@conference.venue.longitude)}], 11);
|
||||||
// add an OpenStreetMap tile layer
|
// add an OpenStreetMap tile layer
|
||||||
L.tileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
L.tileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||||
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',
|
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',
|
||||||
maxZoom: 18
|
maxZoom: 18
|
||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
// add a marker in the given location, attach some popup content to it and open the popup
|
// add a marker in the given location, attach some popup content to it and open the popup
|
||||||
L.marker([#{@conference.venue.latitude}, #{@conference.venue.longitude}]).addTo(map)
|
L.marker([#{h(@conference.venue.latitude)}, #{h(@conference.venue.longitude)}]).addTo(map)
|
||||||
.bindPopup("#{popup}")
|
.bindPopup("#{h(popup)}")
|
||||||
.openPopup();
|
.openPopup();
|
||||||
// Turn scrollwheel on when user clicks
|
// Turn scrollwheel on when user clicks
|
||||||
map.on('focus', function(e) {
|
map.on('focus', function(e) {
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@
|
||||||
|
|
||||||
- content_for :script_head do
|
- content_for :script_head do
|
||||||
:javascript
|
:javascript
|
||||||
var triangle_tcs = tinycolor("#{@conference.color}").monochromatic();
|
var triangle_tcs = tinycolor("#{h(@conference.color)}").monochromatic();
|
||||||
var triangle_colors = triangle_tcs.map(function(t) { return t.toHexString(); });
|
var triangle_colors = triangle_tcs.map(function(t) { return t.toHexString(); });
|
||||||
$(function () {
|
$(function () {
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,11 @@ feature Track do
|
||||||
|
|
||||||
expected = expect do
|
expected = expect do
|
||||||
visit admin_conference_program_tracks_path(conference_id: conference.short_title)
|
visit admin_conference_program_tracks_path(conference_id: conference.short_title)
|
||||||
|
within('#tracks', visible: true) do
|
||||||
click_link 'Delete'
|
page.accept_confirm do
|
||||||
|
find_link('Delete').click
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
expected.to change { Track.count }.by(-1)
|
expected.to change { Track.count }.by(-1)
|
||||||
|
|
@ -53,7 +56,9 @@ feature Track do
|
||||||
|
|
||||||
expected = expect do
|
expected = expect do
|
||||||
visit admin_conference_program_tracks_path(conference_id: conference.short_title)
|
visit admin_conference_program_tracks_path(conference_id: conference.short_title)
|
||||||
click_link 'Edit'
|
within('#tracks', visible: true) do
|
||||||
|
find_link('Edit').trigger('click')
|
||||||
|
end
|
||||||
|
|
||||||
fill_in 'track_name', with: 'Distribution'
|
fill_in 'track_name', with: 'Distribution'
|
||||||
fill_in 'track_short_name', with: 'Distribution'
|
fill_in 'track_short_name', with: 'Distribution'
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ RSpec.configure do |config|
|
||||||
Capybara.javascript_driver = :poltergeist
|
Capybara.javascript_driver = :poltergeist
|
||||||
|
|
||||||
Capybara.register_driver :poltergeist do |app|
|
Capybara.register_driver :poltergeist do |app|
|
||||||
Capybara::Poltergeist::Driver.new(app, phantomjs: Phantomjs.path, js_errors: false)
|
Capybara::Poltergeist::Driver.new(app, phantomjs: Phantomjs.path, js_errors: false, window_size: [1920, 1080])
|
||||||
end
|
end
|
||||||
|
|
||||||
# Includes helpers and connect them to specific types of tests
|
# Includes helpers and connect them to specific types of tests
|
||||||
|
|
@ -82,6 +82,14 @@ RSpec.configure do |config|
|
||||||
# Types of tests (controller, feature, model) will
|
# Types of tests (controller, feature, model) will
|
||||||
# be inferred from subfolder name
|
# be inferred from subfolder name
|
||||||
config.infer_spec_type_from_file_location!
|
config.infer_spec_type_from_file_location!
|
||||||
|
|
||||||
|
# Enable this if you like to see what you're debugging
|
||||||
|
# config.after(:example) do |example|
|
||||||
|
# if example.exception
|
||||||
|
# save_and_open_screenshot
|
||||||
|
# save_and_open_page
|
||||||
|
# end
|
||||||
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
OmniAuth.config.test_mode = true
|
OmniAuth.config.test_mode = true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue