Browse Source

Merge branch 'development' of github.com:bikebike/BikeBike into development

development
LinguaFrancaTranslator 8 years ago
parent
commit
0c90cb7a5b
  1. 67
      Rakefile
  2. 1
      app/assets/images/admin/group_ride.svg
  3. 11
      app/assets/javascripts/main.js
  4. 157
      app/assets/stylesheets/_application.scss
  5. 2
      app/assets/stylesheets/_settings.scss
  6. 12
      app/controllers/conference_administration_controller.rb
  7. 3
      app/controllers/conferences_controller.rb
  8. 2
      app/helpers/admin_helper.rb
  9. 5
      app/views/conference_administration/_group_ride.html.haml
  10. 2
      app/views/registration_steps/_group_ride.html.haml
  11. 4
      app/views/registration_steps/_org_create_address.html.haml
  12. 4
      app/views/registration_steps/_policy.html.haml
  13. 15
      app/views/registration_steps/_review.html.haml
  14. 10
      config/locales/en.yml
  15. 13
      config/sidekiq.yml
  16. 6
      config/sidekiq_preview.yml
  17. 6
      config/sidekiq_production.yml

67
Rakefile

@ -67,28 +67,83 @@ end
task :i18n do
LinguaFranca.test LinguaFranca::TestModes::RECORD do
Rake::Task[:cucumber].execute
Rake::Task['cucumber:run'].execute
end
end
task :css do
ENV['CSS_TEST'] = '1'
Rake::Task[:cucumber].execute
Rake::Task['cucumber:run'].execute
ENV['CSS_TEST'] = nil
end
task :a11y do
ENV['TEST_A11Y'] = '1'
Rake::Task[:cucumber].execute
Rake::Task['cucumber:run'].execute
ENV['TEST_A11Y'] = nil
end
task "cucumber:debug" do
ENV['TEST_DEBUG'] = '1'
Rake::Task[:cucumber].execute
Rake::Task['cucumber:run'].execute
ENV['TEST_DEBUG'] = nil
end
Cucumber::Rake::Task.new(:cucumber) do |t|
t.cucumber_opts = "features --format pretty"
# Cucumber::Rake::Task.new(:cucumber) do |t|
# t.cucumber_opts = "features --format pretty"
# end
namespace :cucumber do
directory 'tmp'
@rerun_file = 'tmp/rerun.txt'
Cucumber::Rake::Task.new(:all) do |task|
task.cucumber_opts = "features --format pretty --format rerun --out tmp/rerun.txt"
end
desc 'Run cucumber features'
task run: :tmp do
retry_on_failure do
run_features
end
clean_up
exit @exit_status
end
def retry_on_failure
rm_rf @rerun_file
@retries = 0
begin
@exit_status = 0
yield
rescue SystemExit => e
@exit_status = e.status
if retry?(exception: e)
@retries += 1
retry
end
end
end
def run_features
if File.exists? @rerun_file
Cucumber::Rake::Task::ForkedCucumberRunner.new(['lib'], Cucumber::BINARY, [
'features',
'--format', 'pretty',
'@tmp/rerun.txt',
'--format', 'rerun',
'--out', 'tmp/rerun.txt'
], true, []).run
else
Rake::Task['cucumber:all'].invoke
end
end
def retry?(exception: nil)
@retries < 2 && !exception.success?
end
def clean_up
rm_rf @rerun_file.pathmap("%d")
end
end

1
app/assets/images/admin/group_ride.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M82.3 58c-1.4 0-2.7.3-4 .7l-3.7-8 .6-1.7h3.4v-2.3h-5.4c.6-.7 1-1.6 1-2.6v-.7L72 33l-.2-.3c-.6-3.2-3.6-5.2-6.7-4.6-3 .7-5 3.6-4.6 6.6v.3l.4 2-6.5 6v.2c-.3.2-.5.5-.6.8H53c-1 0-2.6.4-3.8 1.7l.2-.6v-.2-.7-.7l-2-10.3v-.3c-.7-3.2-3.7-5.2-6.8-4.6-3 .7-5 3.6-4.6 6.6v.3l.5 2-6.7 6v.2c-.3.2-.4.5-.6.8h-.7c-1.3 0-4 .8-5 3.7l-3.4 10.6-2.5-.2C10.8 58 5 64 5 71c0 7 5.7 12.8 12.8 12.8 7 0 12.7-5.7 12.7-12.8 0-5.2-3-9.6-7.6-11.6l1-3c4.8 5.8 7.7 9 9.5 11l.7 3.6 2-.4c1.6 1.3 3.2 1.7 5 1.8l.2 4 4.4-.3-.2-3.8H65.5l.2 4 4.5-.3v-1.2c1.5 5 6.3 8.8 12 8.8 7 0 12.7-5.7 12.7-12.8 0-7-5.7-12.7-12.7-12.7zM27.8 71c0 5.6-4.5 10-10 10-5.6 0-10-4.4-10-10 0-5.5 4.4-10 10-10 .6 0 1 0 1.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Size: 1.7 KiB

11
app/assets/javascripts/main.js

@ -228,6 +228,17 @@
scrollTo.scrollIntoView();
}
}
if (response[i].focus) {
var focusOn = document.querySelector(response[i].focus);
if (focusOn) {
if (typeof focusOn.select === "function" && focusOn.value.length) {
if (focusOn.type == "text" || focusOn.type == "email" || focusOn.type == "phone" || focusOn.tagName == "TEXTAREA") {
focusOn.select();
}
}
focusOn.focus();
}
}
}
}
}

157
app/assets/stylesheets/_application.scss

@ -66,6 +66,7 @@ p {
u {
@include _(text-decoration-color, rgba($black, 0.5));
text-decoration-skip: ink;
}
a {
@ -197,17 +198,21 @@ table, .table {
width: 0.1rem;
}
&#review tbody th {
&#review {
margin: 0 auto;
.table-th {
width: auto;
vertical-align: top;
}
&#review .scroller {
.scroller {
font-size: 0.75em;
max-width: 50em;
max-height: 25em;
overflow: auto;
}
}
&.admin-edit {
width: 100%;
@ -491,6 +496,23 @@ body.expanded-element {
display: table-cell;
}
.responsive-table {
display: block;
.table-td {
padding: 1em;
}
.table-tr, .table-th, .table-td {
display: block;
overflow: auto;
}
.table-tr {
margin-bottom: 1em;
}
}
button,
.button {
@include button;
@ -572,6 +594,7 @@ button,
button {
width: 100%;
height: 10vw;
background-color: $white;
&.during-conference {
@ -579,7 +602,7 @@ button,
}
&.selected {
border: 0.25em solid rgba($colour-2, 0.5);
border: 0.25em solid $selected-colour;
}
}
@ -603,14 +626,19 @@ button,
.buttons {
display: inline-block;
display: flex;
text-align: right;
justify-content: center;
flex-wrap: wrap;
button {
margin: 0 0.333em;
button, .button {
margin: 0.333em;
}
}
button[value="back"] {
float: left;
order: -1;
background-color: $mid-gray;
}
@ -631,41 +659,29 @@ button,
button {
display: block;
width: 100%;
padding: 0 2em;
border: 0.05em solid $black;
background-color: $white;
&.selected {
box-shadow: 0 0 0 0.25em rgba($colour-2, 0.5);
box-shadow: 0 0 0 0.25em $selected-colour;
}
}
}
.registration-step-options {
display: table;
table-layout: fixed;
margin: 0 auto;
.options {
display: table-row;
+ fieldset {
margin: 2em 0;
}
}
button {
display: table-cell;
margin: 0 0.5em;
margin: 0.5em auto;
height: 3em;
&:first-child {
margin-left: 0;
}
&:last-child {
margin-right: 0;
}
}
.check-box-field {
@ -680,8 +696,7 @@ button,
background-color: $white;
input {
display: table-cell;
width: 10em;
width: 100%;
height: 3em;
margin: 0;
font-family: inherit;
@ -692,10 +707,10 @@ button,
}
button {
width: 50%;
width: 100%;
margin: 0;
border: 0;
border-left: inherit;
border-top: inherit;
background-color: lighten($colour-1, 25%);
}
}
@ -744,6 +759,12 @@ ul.menu {
@include font-family(secondary);
}
#step-content {
form {
margin-top: 1em;
}
}
#action-message {
display: none;
text-align: center;
@ -1268,8 +1289,8 @@ input {
content: '+';
border: 0;
font-size: 2.5em;
top: -0.025em;
left: 0.175em;
top: -0.125em;
left: 0.075em;
line-height: 1em;
color: #FFF;
height: 1em;
@ -1645,7 +1666,7 @@ fieldset {
text-align: center;
+ button, + .button {
margin-left: 0.75em;
margin-top: 0.75em;
}
}
@ -3408,6 +3429,11 @@ body.policy .policy-agreement ul {
button, .button {
margin-left: 1em;
height: 2.6em;
+ button, + .button {
margin-top: 0;
margin-left: 0.75em;
}
}
}
}
@ -3768,6 +3794,13 @@ body.policy .policy-agreement ul {
border: 0.1em solid;
}
input[type="radio"] + label {
@include after {
top: -0.025em;
left: 0.175em;
}
}
&.inline {
label {
float: left;
@ -3812,8 +3845,72 @@ body.policy .policy-agreement ul {
@include _(transform, none);
}
}
#main table.calendar {
button {
height: 4em;
}
}
#main .registration-step-options {
display: table;
table-layout: fixed;
.options {
display: table-row;
}
button {
display: table-cell;
margin: 0 0.5em;
width: auto;
&:first-child {
margin-left: 0;
}
&:last-child {
margin-right: 0;
}
}
fieldset {
margin-bottom: 3em;
}
.custom-option {
margin-top: 1em;
input {
display: table-cell;
width: 10em;
}
button {
width: 50%;
border-top: 0;
border-left: inherit;
}
}
}
.responsive-table {
display: table;
.table-tr {
display: table-row;
}
.table-td {
padding: 0.25em 0.5em;
}
.table-th, .table-td {
display: table-cell;
}
}
} // medium
@include breakpoint(large) {
#main {
padding-left: $sidebar-width;
@ -3866,6 +3963,12 @@ body.policy .policy-agreement ul {
margin: 0 auto;
}
}
#main table.calendar {
button {
height: 5em;
}
}
}
@include breakpoint(small, medium) {

2
app/assets/stylesheets/_settings.scss

@ -24,6 +24,8 @@ $green: $colour-5;
$link-colour: darken($colour-1, 13%);
$selected-colour: rgba($blue, 0.5);
@mixin default-box-shadow($direction: top, $distance: 1, $inset: false, $additional-shadow: false) {
@if capable_of(box-shadow) {
$offset: 0.2em;

12
app/controllers/conference_administration_controller.rb

@ -99,6 +99,9 @@ class ConferenceAdministrationController < ApplicationController
def administrate_description
end
def administrate_group_ride
end
def administrate_poster
end
@ -798,6 +801,15 @@ class ConferenceAdministrationController < ApplicationController
return false
end
def admin_update_group_ride
params[:group_ride_info].each do |locale, value|
@this_conference.set_column_for_locale(:group_ride_info, locale, html_value(value))
end
@this_conference.save
set_success_message @admin_step
return false
end
def admin_update_poster
begin
@this_conference.poster = params[:poster]

3
app/controllers/conferences_controller.rb

@ -98,7 +98,8 @@ class ConferencesController < ApplicationController
render json: [{
globalSelector: '#step-content',
html: view_context.step_message + render_to_string(partial: "registration_steps/#{@step}"),
scrollTo: '#action-message .message, #step-content'
scrollTo: '#action-message .message, #step-content',
focus: 'input:not([type="hidden"]), textarea, button.selected'
}]
end
end

2
app/helpers/admin_helper.rb

@ -2,7 +2,7 @@ module AdminHelper
def administration_steps
{
info: [:administrators, :dates, :description, :poster],
info: [:administrators, :dates, :description, :poster, :group_ride],
payment: [:payment_message, :suggested_amounts, :paypal],
registration: [:registration_status, :stats, :registrations, :broadcast],
housing: [:providers, :housing],

5
app/views/conference_administration/_group_ride.html.haml

@ -0,0 +1,5 @@
= columns(medium: 12) do
= admin_update_form do
= translate_textarea :group_ride_info, @this_conference, label: 'articles.conference_registration.headings.admin.edit.group_ride', help: 'articles.conference_registration.paragraphs.admin.edit.group_ride', edit_on: :focus
.actions.right
= button :save, value: :save

2
app/views/registration_steps/_group_ride.html.haml

@ -2,7 +2,7 @@
= columns(medium: 12) do
= registration_step_header_title
- if @info.present?
= @info
= @info.html_safe
- else
= registration_step_header_description
= row do

4
app/views/registration_steps/_org_create_address.html.haml

@ -5,5 +5,5 @@
= textfield :address, @address, required: true, big: true
.multi-field
= textfield :city, @city.city, readonly: true
= textfield :territory, @city.translate_territory, readonly: true
= textfield :country, @city.translate_country, readonly: true
= textfield :territory, @city.translate_territory.html_safe, readonly: true
= textfield :country, @city.translate_country.html_safe, readonly: true

4
app/views/registration_steps/_policy.html.haml

@ -7,8 +7,8 @@
%ul
- policies.each do |term|
%li
- id = "policies[#{term}]"
= check_box_tag(id, 1, (@accepted_policies || {}).include?(term))
- id = "policies_#{term}"
= check_box_tag("policies[#{term}]", 1, (@accepted_policies || {}).include?(term), id: id)
%label.term{for: id}=_"articles.policy.term.#{term.to_s}", :s, 2
= columns(medium: 12) do
%p=_'articles.conference_registration.paragraphs.Confirm_Agreement', :p

15
app/views/registration_steps/_review.html.haml

@ -3,24 +3,24 @@
= columns(medium: 12) do
= save_registration_step do
- if @is_attending
%table#review
.table.responsive-table#review
- @step_data.each do |step, data|
- unless data[:type] == :none
%tr
%th
.table-tr
.table-th
=_"articles.conference_registration.step_names.#{step}"
= button :edit, name: :edit_step, value: step, class: [:unstyled, :edit]
%td
.table-td
- case data[:type]
- when :bool
=_"forms.actions.generic.#{data[:value] ? 'yes' : 'no'}"
- when :list
= data[:value].map { |item| _"#{data[:key]}.#{item}" }.join(_!(", "))
= data[:value].map { |item| _"#{data[:key]}.#{item}" }.join(_!(", ")).html_safe
- when :currency
= (number_to_currency data[:value].to_f, unit: '$')
=_!(data[:currency].to_s).html_safe
- when :date
= date(data[:value].to_date, :long)
= date(data[:value].to_date, :long).html_safe
- when :enum
=_("#{data[:key] || ('forms.labels.generic.' + step.to_s + '.')}#{data[:value]}")
- when :html
@ -29,7 +29,7 @@
- if data[:key].present?
=_"#{data[:key]}.#{data[:value]}"
- else
= data[:value]
= data[:value].to_s.html_safe
- else
%p.centered=_'articles.conference_registration.paragraphs.registration_cancelled', :p
- if @allow_cancel_attendance
@ -43,5 +43,6 @@
%h3=_'articles.workshops.headings.Workshops', :t
%p=_'articles.conference_registration.paragraphs.workshops', :p
.actions.centered
.buttons
= link_to (_'articles.conference_registration.actions.View_Workshops'), workshops_path(@this_conference), class: :button
= link_to (_'actions.workshops.create'), create_workshop_path(@this_conference), class: [:button, :modify]

10
config/locales/en.yml

@ -1234,6 +1234,7 @@ en:
administrators: Error updating organizations
dates: Error updating dates
description: Error saving your conference description
group_ride: Error saving your group ride info
poster: An error occurred uploading your conference poster
payment_message: An error occurred saving your the payment message
suggested_amounts: An error occurred saving your payment amounts
@ -1278,6 +1279,7 @@ en:
dates: Conference dates updated successfully
description: Conference description updated successfully
poster: Conference poster uploaded
group_ride: Group ride info saved
payment_message: Your payment message has been updated
suggested_amounts: Your suggested payment amounts have been updated
paypal: Your paypal information has been updated
@ -1467,6 +1469,7 @@ en:
administrators: Administrators and Organizations
description: Description
poster: Poster
group_ride: Group Ride
Host_Organizations: Host Organizations
External_Administrators: External Administrators
description: These are the basic details about your conference that you will
@ -1476,6 +1479,7 @@ en:
dates: Set your conference start and end dates
description: Modify the text that is displayed on the front page
poster: Upload your conference poster
group_ride: Will you be having a group ride before or after the conference? Describe it here.
administrators: Set the conference host organizations and other members
who have access to these administration tools
Host_Organizations: Select all organizations from known organizations in
@ -1736,6 +1740,7 @@ en:
admin:
edit:
info: Info
group_ride: Group ride description
companion: Companion
paragraphs:
group_ride: There will be a group ride before the conference, do you plan to attend?
@ -1876,6 +1881,7 @@ en:
admin:
edit:
info: This is the copy that is displayed on the front page of the site.
group_ride: Describe your group ride. This info may be used on the conference description, emails, or on the registration form.
schedule:
published: Your scheulde is currently published and viewable on the front-page.
Un-publishing the schedule will remove it from the front-page and show
@ -2072,7 +2078,7 @@ en:
one: You and one other are interested in this workshop
other: You and %{count} others are interested in this workshop
zero: You are interested in this workshop
read_more: More info
read_more: Details
user_settings:
headings:
Your_Account: Account Settings
@ -2182,7 +2188,7 @@ en:
'yes': 'Yes'
'no': 'No'
maybe: Maybe
review: Complete
review: Review
back: Back
upload: Upload
select_file: Select a file

13
config/sidekiq.yml

@ -1,13 +0,0 @@
---
:concurrency: 5
:logfile: log/sidekiq.log
preview:
:pidfile: /home/unicorn/sidekiq_preview.pid
:concurrency: 15
:queues:
- preview
production:
:pidfile: /home/unicorn/sidekiq_production.pid
:concurrency: 15
:queues:
- production

6
config/sidekiq_preview.yml

@ -0,0 +1,6 @@
---
:logfile: log/sidekiq.log
:pidfile: /home/unicorn/sidekiq_preview.pid
:concurrency: 15
:queues:
- preview

6
config/sidekiq_production.yml

@ -0,0 +1,6 @@
---
:logfile: log/sidekiq.log
:pidfile: /home/unicorn/sidekiq_production.pid
:concurrency: 15
:queues:
- production
Loading…
Cancel
Save