Merge branch 'master' into master

This commit is contained in:
Michael Ball 2021-04-15 20:29:54 -07:00 committed by GitHub
commit eaf13b1b69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 80 additions and 69 deletions

View file

@ -9,6 +9,7 @@ on:
jobs: jobs:
linters: linters:
continue-on-error: true
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
OSEM_RUBY_VERSION: 2.6.6 OSEM_RUBY_VERSION: 2.6.6
@ -16,11 +17,12 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1 - uses: ruby/setup-ruby@v1
with: with:
ruby-version: 2.6 ruby-version: 2.6.6
bundler-cache: true bundler-cache: true
- run: bundle exec rubocop - run: bundle exec rubocop
- run: bundle exec haml-lint app/views - run: bundle exec haml-lint app/views
spec: spec:
continue-on-error: true
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: spec name: spec
env: env:
@ -34,7 +36,7 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1 - uses: ruby/setup-ruby@v1
with: with:
ruby-version: 2.6 ruby-version: 2.6.6
bundler-cache: true bundler-cache: true
- name: Prepare spec - name: Prepare spec
run: | run: |

View file

@ -139,8 +139,8 @@ gem 'prawn-rails'
gem 'rqrcode' gem 'rqrcode'
# to render XLS spreadsheets # to render XLS spreadsheets
gem 'axlsx', git: 'https://github.com/randym/axlsx.git' gem 'caxlsx'
gem 'axlsx_rails' gem 'caxlsx_rails'
gem 'sentry-delayed_job' gem 'sentry-delayed_job'
gem 'sentry-rails' gem 'sentry-rails'

View file

@ -1,37 +1,27 @@
GIT
remote: https://github.com/randym/axlsx.git
revision: c593a08b2a929dac7aa8dc418b55e26b4c49dc34
specs:
axlsx (3.0.0.pre)
htmlentities (~> 4.3, >= 4.3.4)
mimemagic (~> 0.3)
nokogiri (~> 1.8, >= 1.8.2)
rubyzip (~> 1.2, >= 1.2.1)
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
remote: https://rails-assets.org/ remote: https://rails-assets.org/
specs: specs:
Ascii85 (1.0.3) Ascii85 (1.0.3)
actioncable (5.2.4.5) actioncable (5.2.5)
actionpack (= 5.2.4.5) actionpack (= 5.2.5)
nio4r (~> 2.0) nio4r (~> 2.0)
websocket-driver (>= 0.6.1) websocket-driver (>= 0.6.1)
actionmailer (5.2.4.5) actionmailer (5.2.5)
actionpack (= 5.2.4.5) actionpack (= 5.2.5)
actionview (= 5.2.4.5) actionview (= 5.2.5)
activejob (= 5.2.4.5) activejob (= 5.2.5)
mail (~> 2.5, >= 2.5.4) mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
actionpack (5.2.4.5) actionpack (5.2.5)
actionview (= 5.2.4.5) actionview (= 5.2.5)
activesupport (= 5.2.4.5) activesupport (= 5.2.5)
rack (~> 2.0, >= 2.0.8) rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3) rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2) rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.4.5) actionview (5.2.5)
activesupport (= 5.2.4.5) activesupport (= 5.2.5)
builder (~> 3.1) builder (~> 3.1)
erubi (~> 1.4) erubi (~> 1.4)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
@ -41,20 +31,20 @@ GEM
activemodel (>= 4.1, < 6.2) activemodel (>= 4.1, < 6.2)
case_transform (>= 0.2) case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3) jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
activejob (5.2.4.5) activejob (5.2.5)
activesupport (= 5.2.4.5) activesupport (= 5.2.5)
globalid (>= 0.3.6) globalid (>= 0.3.6)
activemodel (5.2.4.5) activemodel (5.2.5)
activesupport (= 5.2.4.5) activesupport (= 5.2.5)
activerecord (5.2.4.5) activerecord (5.2.5)
activemodel (= 5.2.4.5) activemodel (= 5.2.5)
activesupport (= 5.2.4.5) activesupport (= 5.2.5)
arel (>= 9.0) arel (>= 9.0)
activestorage (5.2.4.5) activestorage (5.2.5)
actionpack (= 5.2.4.5) actionpack (= 5.2.5)
activerecord (= 5.2.4.5) activerecord (= 5.2.5)
marcel (~> 0.3.1) marcel (~> 1.0.0)
activesupport (5.2.4.5) activesupport (5.2.5)
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2) i18n (>= 0.7, < 2)
minitest (~> 5.1) minitest (~> 5.1)
@ -82,9 +72,6 @@ GEM
awesome_nested_set (3.4.0) awesome_nested_set (3.4.0)
activerecord (>= 4.0.0, < 7.0) activerecord (>= 4.0.0, < 7.0)
aws_cf_signer (0.1.3) aws_cf_signer (0.1.3)
axlsx_rails (0.5.2)
actionpack (>= 3.1)
axlsx (>= 2.0.1)
bcrypt (3.1.16) bcrypt (3.1.16)
bindex (0.6.0) bindex (0.6.0)
bootstrap-sass (3.4.1) bootstrap-sass (3.4.1)
@ -118,6 +105,14 @@ GEM
fastimage fastimage
case_transform (0.2) case_transform (0.2)
activesupport activesupport
caxlsx (3.1.0)
htmlentities (~> 4.3, >= 4.3.4)
marcel (~> 1.0)
nokogiri (~> 1.10, >= 1.10.4)
rubyzip (>= 1.3.0, < 3)
caxlsx_rails (0.6.2)
actionpack (>= 3.1)
caxlsx (>= 3.0)
chartkick (3.4.2) chartkick (3.4.2)
childprocess (3.0.0) childprocess (3.0.0)
chronic (0.10.2) chronic (0.10.2)
@ -249,7 +244,7 @@ GEM
httparty (0.18.1) httparty (0.18.1)
mime-types (~> 3.0) mime-types (~> 3.0)
multi_xml (>= 0.5.2) multi_xml (>= 0.5.2)
i18n (1.8.9) i18n (1.8.10)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
i18n_data (0.8.0) i18n_data (0.8.0)
icalendar (2.7.1) icalendar (2.7.1)
@ -293,20 +288,19 @@ GEM
lumberjack (1.0.12) lumberjack (1.0.12)
mail (2.7.1) mail (2.7.1)
mini_mime (>= 0.1.1) mini_mime (>= 0.1.1)
marcel (0.3.3) marcel (1.0.0)
mimemagic (~> 0.3.2)
method_source (0.8.2) method_source (0.8.2)
mime-types (3.3.1) mime-types (3.3.1)
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
mime-types-data (3.2021.0225) mime-types-data (3.2021.0225)
mimemagic (0.3.10) mimemagic (0.4.3)
nokogiri (~> 1) nokogiri (~> 1)
rake rake
mina (1.2.3) mina (1.2.3)
open4 (~> 1.3.4) open4 (~> 1.3.4)
rake rake
mini_magick (4.9.5) mini_magick (4.9.5)
mini_mime (1.0.2) mini_mime (1.0.3)
mini_portile2 (2.5.0) mini_portile2 (2.5.0)
minitest (5.14.4) minitest (5.14.4)
momentjs-rails (2.20.1) momentjs-rails (2.20.1)
@ -326,7 +320,7 @@ GEM
nenv (0.3.0) nenv (0.3.0)
netrc (0.11.0) netrc (0.11.0)
nio4r (2.5.7) nio4r (2.5.7)
nokogiri (1.11.1) nokogiri (1.11.2)
mini_portile2 (~> 2.5.0) mini_portile2 (~> 2.5.0)
racc (~> 1.4) racc (~> 1.4)
notiffany (0.1.1) notiffany (0.1.1)
@ -433,18 +427,18 @@ GEM
ruby-openid (>= 2.1.8) ruby-openid (>= 2.1.8)
rack-test (1.1.0) rack-test (1.1.0)
rack (>= 1.0, < 3) rack (>= 1.0, < 3)
rails (5.2.4.5) rails (5.2.5)
actioncable (= 5.2.4.5) actioncable (= 5.2.5)
actionmailer (= 5.2.4.5) actionmailer (= 5.2.5)
actionpack (= 5.2.4.5) actionpack (= 5.2.5)
actionview (= 5.2.4.5) actionview (= 5.2.5)
activejob (= 5.2.4.5) activejob (= 5.2.5)
activemodel (= 5.2.4.5) activemodel (= 5.2.5)
activerecord (= 5.2.4.5) activerecord (= 5.2.5)
activestorage (= 5.2.4.5) activestorage (= 5.2.5)
activesupport (= 5.2.4.5) activesupport (= 5.2.5)
bundler (>= 1.3.0) bundler (>= 1.3.0)
railties (= 5.2.4.5) railties (= 5.2.5)
sprockets-rails (>= 2.0.0) sprockets-rails (>= 2.0.0)
rails-assets-bootstrap (3.3.6) rails-assets-bootstrap (3.3.6)
rails-assets-jquery (>= 1.9.1, < 3) rails-assets-jquery (>= 1.9.1, < 3)
@ -478,9 +472,9 @@ GEM
rails-i18n (5.1.3) rails-i18n (5.1.3)
i18n (>= 0.7, < 2) i18n (>= 0.7, < 2)
railties (>= 5.0, < 6) railties (>= 5.0, < 6)
railties (5.2.4.5) railties (5.2.5)
actionpack (= 5.2.4.5) actionpack (= 5.2.5)
activesupport (= 5.2.4.5) activesupport (= 5.2.5)
method_source method_source
rake (>= 0.8.7) rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0) thor (>= 0.19.0, < 2.0)
@ -681,8 +675,6 @@ DEPENDENCIES
annotate annotate
autoprefixer-rails autoprefixer-rails
awesome_nested_set awesome_nested_set
axlsx!
axlsx_rails
bootstrap-sass (~> 3.4.0) bootstrap-sass (~> 3.4.0)
bootstrap-switch-rails (~> 3.0.0) bootstrap-switch-rails (~> 3.0.0)
bootstrap3-datetimepicker-rails (~> 4.17.47) bootstrap3-datetimepicker-rails (~> 4.17.47)
@ -691,6 +683,8 @@ DEPENDENCIES
capybara capybara
carrierwave carrierwave
carrierwave-bombshelter carrierwave-bombshelter
caxlsx
caxlsx_rails
chartkick chartkick
climate_control climate_control
cloudinary cloudinary

View file

@ -149,13 +149,23 @@ function word_count(text, divId, maxcount) {
}); });
}; };
function fill_if_empty(text_area, filler) { function replace_defaut_submission_text(input_selector, new_text, valid_defaults) {
let area = $('#' + text_area); let $area = $(input_selector);
let current_text = $area.val();
if (!area.val()) { if (!current_text) {
area.val(filler); $area.val(new_text);
area.trigger('change'); $area.trigger('change');
return;
} }
valid_defaults.some(default_text => {
if (current_text == default_text) {
$area.val(new_text);
$area.trigger('change');
return true;
}
});
} }
/* Wait for the DOM to be ready before attaching events to the elements */ /* Wait for the DOM to be ready before attaching events to the elements */
@ -166,8 +176,13 @@ $( document ).ready(function() {
var max = $selected.data("max-words"); var max = $selected.data("max-words");
var min = $selected.data("min-words"); var min = $selected.data("min-words");
// Set the filler text for the submission text // We replace the default text only if the current field is empty,
fill_if_empty('event_submission_text', $selected.data("instructions")); // or is set to the default text of another event type.
replace_defaut_submission_text(
'#event_submission_text',
$selected.data("instructions"),
$("#event_event_type_id option").toArray().map(e => $(e).data('instructions'))
);
$("#abstract-maximum-word-count").text(max); $("#abstract-maximum-word-count").text(max);
$("#submission-maximum-word-count").text(max); $("#submission-maximum-word-count").text(max);