Skip to content

Commit add7bad

Browse files
peterkoscbaudouinjrJeremyRudmanhoundci-botcicadaenjoyer
authored
develop <- 2.2 (#559)
* build: Reduces CHECKS attempts to 100 from 300 (#495) * build: Updates GitHub Actions to work on all version branches (#509) * feature: Adds Users & Staff docs (#497) * fix: Resolves job execution failure on nil questionnaires (#529) * feat: Adds event calendar support (#259) * build(deps): Upgrade yarn * build(deps): Upgrade gems * build(deps): Remove obsolete gems * v0.0.0 * build(deps): Update semantic-release * feat(events): add upcoming events page made a page to to view upcoming events in the management tools * feat(events): added page to make new events * added gem.lock * functionally complete calendar calendar has all the features needed need to make it less janky and possible add/remove features based on feedback * feat(events):page to view and make upcoming events created a page to view, make, and delete events. These events contain a title, description, location, owner(s), if it is a public and/or all day event and when it starts and stops. * fix: corrected formating errors and removed all day option made the code comply with houndci-bot requests and removed the all day bool for a event * fix: removed left over allDay refernce * fix: corrected houndci format suggestion * feat(event): added owners as a list of admins only implemented owners in a similar way to message recipients it will only allow for the selection of admin user as the owner(s) of a event. No owners it also allowed. * fix(events): refactored to work with latest 2.0 altered new manage sidebar to include events and fixed bug in event model testing * Fixed issue on desktop * feat(event): removed unneeded form options removed owner and public options from event creation form since they are no longer relevent for the intended purpose of this schedule * Map overflow scroll Signed-off-by: Peter Kos <[email protected]> * Fix scroll issue Signed-off-by: Peter Kos <[email protected]> * Fixed toggle button; fits screen, sidebar width Sidebar width is better Toggle button fills height of navbar Signed-off-by: Peter Kos <[email protected]> * fix: Allows optional assets to be unset * fix(events):added basic testing added the basic tests and renamed "end" to "finish" in event * Fixes test * fix(event): tweak test in attempt to get working * fix(event): got testing to work for some reason there is a flow for how redirects works for a controller. The index goes to the correct redirect but the create does not. * fix(event): fix hound errors and db password error accidently pushed local db password and corrected hound errors * fix(event): fix houndci error i missed * feat: Redesigns OAuth2 portal (#404) * feat: Redesigns OAuth2 portal * fix: Some Hound issues * Changes application verbiage * Fixes ID issue * Fixes table link and sign out button * Peter's wishes * Adds Redis dump files to .gitignore * fix(event): fixed some of the pull request suggestions * Shorten form :) Signed-off-by: Peter Kos <[email protected]> * fix(forms): change size of all forms without textbox changed the style of all forms that don't have a large text area or other aspects of the form that make a full length form perferable. With the exception of those forms all forms are now more narrow * fix(event): implemented pull request changes fixed cancel button and removed blue dot in list. decided to use simple form datetime picker instead of html datetime-local input because firefox does not support it. * fix: Fixes MyMLH branding in config (#412) * feat(settings): Simplifies Config (#409) * feat(settings): Simplifies Config * Resolves Hound issues * Update app/views/manage/configs/index.html.haml Co-authored-by: Peter Kos <[email protected]> * design: Increases the font-weight and reorganizes the page * fix: Hound issues Co-authored-by: Peter Kos <[email protected]> * feat: Adds support for digital-only hackathons (#395) * feat: Adds support for digital-only hackathons * fix: Provides clarity for what is removed from digital hackathons Co-authored-by: Peter Kos <[email protected]> * event(fix): renamed events to schedule and reverted forms change event to schedule on the mangage sidebar and undid change to forms * feat: Adds GitHub Action for releases (#426) * feat: Adds GitHub Action CI testing (#423) * feat: Adds GitHub Action CI testing * fix: Adds sudo * refactor: Changes naming * Removes travis.yml * docs: Adds ruby version comment * fix(event): schedule now shows end time do to issues with "end" being a keyword in rails and what fullcalendar uses for events ending end time was previously not showing up * fix(event): fix houndci complaints * bundle install * fixed styling errors and added check for finish and start time * made finish time optional and made css fixes * fix houndci complaint * fix houndci complaint part 2 * removed finish time requirement in test Co-authored-by: Chris Baudouin, Jr <[email protected]> Co-authored-by: Chris Baudouin, Jr <[email protected]> Co-authored-by: Peter Kos <[email protected]> * fix(sidebar): side bar title now matches sidebar width (#537) * side bar title now matches sidebar width * made sidebar narrower Co-authored-by: Peter Kos <[email protected]> * feature: Allows directors to change user's names (#530) * refactor: Changes register to "Create an Account" (#541) * security: Adds rel="noopener" to all target="_blank" (#494) * security: Adds rel="noopener" to all target="_blank" * feature: Adds additonal rel="noopener" Co-authored-by: Peter Kos <[email protected]> * refactor(Users): Shows user's name on show/edit pages (#483) Co-authored-by: Peter Kos <[email protected]> * fix: Questionnaire agreement read and accept error placement (#525) Co-authored-by: Chris Baudouin, Jr <[email protected]> * fix(agreements): decreased distance between icons (#542) Co-authored-by: Chris Baudouin, Jr <[email protected]> * feat(map): Hides map on mobile and added button to show it (#538) * hide map on mobile and added button to show it * map button text now changes when map is open * fix houndci errors Co-authored-by: Chris Baudouin, Jr <[email protected]> * build(deps): Updates shoulda and shoulda-matchers (#482) * master <- develop (2.1.2) (#472) (#478) * fix(questionnaire): missing information now in correct place (#443) * fix(questionnair): missing information now in correct place it now displays the correct message "Please read & accept" instead of missing information and the notification is now in the correct place * Update app/assets/javascripts/validate.js * Revert "Update app/assets/javascripts/validate.js" This reverts commit bc54783. Signed-off-by: Peter Kos <[email protected]> Co-authored-by: Peter Kos <[email protected]> * fix: Fixes mobile agreements layout bug Signed-off-by: Peter Kos <[email protected]> * feat: Removes semantic-release (#446) * refactor: Moves CI to develop branch (#449) Co-authored-by: Peter Kos <[email protected]> * build: Merges 2.1.2 into develop * fix(hakiri): corrected unescaped model attribute * fix(hakiri): added html_safe to show proper output Co-authored-by: Jeremy Rudman <[email protected]> Co-authored-by: JeremyRudman <[email protected]> * fix: Shows questionnaires_closed_message on registration * feat: Allows agreements to be fully customizable (#465) * feat: Allows agreements to be fully customizable * fix: Fixes broken migrations * fix: Migrations misname issue * feat: Forces agreement links to open in new tab * Agreement validation detection fixed Signed-off-by: Peter Kos <[email protected]> * refactor: Removes old input hint Co-authored-by: Peter Kos <[email protected]> * fix(hakiri): fixed un-escaped regex for vcs link (#467) * fix(hakiri): corrected unescaped model attribute * fix(hakiri): added html_safe to show proper output * fix(hakiri): added \A \z to regex * fix(questionnaire): fixed hakiri error with vcs link regex * fix(questionnaire): fixed houndci commplaint Co-authored-by: Chris Baudouin, Jr <[email protected]> * fix(hakiri): fix hakiri error with user input in html_safe (#475) Co-authored-by: Peter Kos <[email protected]> Co-authored-by: JeremyRudman <[email protected]> Co-authored-by: Chris Baudouin, Jr <[email protected]> Co-authored-by: Jeremy Rudman <[email protected]> Co-authored-by: Peter Kos <[email protected]> Co-authored-by: JeremyRudman <[email protected]> Co-authored-by: Jeremy Rudman <[email protected]> * build(deps): Updates shoulda and shoulda-matchers * Update test/test_helper.rb Co-authored-by: Hound <[email protected]> Co-authored-by: Peter Kos <[email protected]> Co-authored-by: JeremyRudman <[email protected]> Co-authored-by: Jeremy Rudman <[email protected]> Co-authored-by: Hound <[email protected]> * refactor: Hides several dangling dietary restrictions in digital mode (#533) * refactor: Hides several dangling dietary restrictions in digital mode * fix: Hides dietary restrictions form questionnaire overview Co-authored-by: JeremyRudman <[email protected]> * fix: Fixes white space next to sidebar (#544) Co-authored-by: Chris Baudouin, Jr <[email protected]> * feat(schedule): add category field to schedule (#546) * feat(schedule): add category field to schedule * moved event catorgory addition to a seprate migration * add category and location label for schedule display * made label more semantically nice * more code cleanup for events * Update app/assets/javascripts/events.js Co-authored-by: Peter Kos <[email protected]> Co-authored-by: Chris Baudouin, Jr <[email protected]> Co-authored-by: Peter Kos <[email protected]> * fix(events): fixed api to be public and have blank strings be null (#552) * fix(events): fixed api to be public and have blank strings be null * made is so category is null on empty string * build: Moves dependabot to develop branch (#507) * build(deps): Updates Sidekiq to 6.1.3 (#461) * build(deps): Updates Sidekiq to 6.1.2 * build: Updates Sidekiq to 6.1.3 * build: Updates sidekiq-cron * refactor: Removes MLH branding from Stats page, moved stats strings to locales (#460) * refactor: Removes MLH branding from Stats page * fix: Updates stats test paths * refactor: Renames several stats tables Co-authored-by: JeremyRudman <[email protected]> * fix: Fixes RSVP Reminder email being sent to RSVP attendees (#557) * fix: Add CORS for all API requests (#554) * cors * Do it more properly * hound * cors allowed only on non-manage routes * Resource path does not support regex; even tonly * only allow on gets lol Co-authored-by: JeremyRudman <[email protected]> * feat(questionnaire): add country field for questionnaire (#550) * feat(questionnaire): add country field for questionnaire the application now asks for a country to due to MLH requirements * fix houndci complaints * Update app/views/application/_missing_country_notice.html.haml Co-authored-by: Chris Baudouin, Jr. <[email protected]> * added custom error message for missing country for RSVP * fix houndci complaints * Update _missing_country_notice.html.haml Co-authored-by: Chris Baudouin, Jr. <[email protected]> Co-authored-by: Peter Kos <[email protected]> * refactor: defined roles do in role selection and refactored readme (#556) * refactor: defined roles do in role selection and refactored readme * Update README.md Co-authored-by: Peter Kos <[email protected]> * completed questionnaire page on docs (#512) * completed questionnaire page on docs * Update questionnaires.md * Fix various typos Co-authored-by: Peter Kos <[email protected]> Co-authored-by: JeremyRudman <[email protected]> * feature: Allows directors to reset passwords through admin portal (#524) Co-authored-by: JeremyRudman <[email protected]> Co-authored-by: Peter Kos <[email protected]> Co-authored-by: Chris Baudouin, Jr <[email protected]> Co-authored-by: JeremyRudman <[email protected]> Co-authored-by: Chris Baudouin, Jr <[email protected]> Co-authored-by: Jeremy Rudman <[email protected]> Co-authored-by: Hound <[email protected]> Co-authored-by: aag5734 <[email protected]>
1 parent 0f4ab06 commit add7bad

File tree

107 files changed

+1204
-208
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+1204
-208
lines changed

.github/dependabot.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "bundler"
4+
directory: "/"
5+
target-branch: "develop"
6+
schedule:
7+
interval: "daily"
8+
commit-message:
9+
prefix: "build(deps): "
10+
11+
- package-ecosystem: "npm"
12+
directory: "/website"
13+
target-branch: "develop"
14+
schedule:
15+
interval: "daily"
16+
commit-message:
17+
prefix: "build(deps): "

.github/workflows/build.yml

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ on:
1212
branches:
1313
- master
1414
- develop
15+
- '[0-9].[0-9]'
16+
- '[0-9].[0-9].[0-9]'
1517

1618
jobs:
1719
build:

CHECKS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
WAIT=10
2-
ATTEMPTS=300
2+
ATTEMPTS=100
33

44
/users/sign_in Sign in to

Gemfile

+7-3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ gem 'turbolinks', '~> 5'
2525
# gem 'jbuilder', '~> 2.5'
2626
# Use Redis adapter to run Action Cable in production
2727
gem 'redis', '~> 4.0'
28+
# CORS support
29+
gem 'rack-cors'
2830
# Use ActiveModel has_secure_password
2931
# gem 'bcrypt', '~> 3.1.7'
3032

@@ -65,6 +67,8 @@ gem 'jquery-ui-rails'
6567
gem 'selectize-rails'
6668
gem 'highcharts-rails', '~> 6.0'
6769
gem 'bootstrap', '~> 4.3.1'
70+
gem 'fullcalendar-rails'
71+
gem 'momentjs-rails'
6872

6973
# Markdown parsing
7074
gem 'redcarpet'
@@ -76,7 +80,7 @@ gem 'audited', '~> 4.7'
7680

7781
# Background job processing
7882
gem 'sidekiq', '< 7'
79-
gem 'sidekiq-cron', '~> 1.1'
83+
gem 'sidekiq-cron', github: 'codeRIT/sidekiq-cron', branch: 'master'
8084

8185
# Misc support gems
8286
gem 'rails-settings-cached', '~> 0.7.2'
@@ -111,8 +115,8 @@ end
111115

112116
group :test do
113117
gem 'test-unit', '~> 3.0'
114-
gem 'shoulda', '~> 3.5'
115-
gem 'shoulda-matchers', '~> 2.0'
118+
gem 'shoulda', '~> 4.0.0'
119+
gem 'shoulda-matchers', '~> 4.4.0'
116120
gem 'minitest-reporters'
117121
gem 'valid_attribute'
118122
gem 'factory_bot_rails'

Gemfile.lock

+40-24
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
GIT
2+
remote: https://github.com/codeRIT/sidekiq-cron.git
3+
revision: 571d7d74d2828aea2f55381a83f73ac3450e8819
4+
branch: master
5+
specs:
6+
sidekiq-cron (1.2.0)
7+
fugit (~> 1.1)
8+
sidekiq (>= 4.2.1)
9+
110
GEM
211
remote: https://rubygems.org/
312
specs:
@@ -129,7 +138,7 @@ GEM
129138
dotenv (= 2.7.5)
130139
railties (>= 3.2, < 6.1)
131140
errbase (0.2.0)
132-
erubi (1.9.0)
141+
erubi (1.10.0)
133142
erubis (2.7.0)
134143
et-orbi (1.2.4)
135144
tzinfo
@@ -149,9 +158,13 @@ GEM
149158
font-awesome-rails (4.7.0.5)
150159
railties (>= 3.2, < 6.1)
151160
formatador (0.2.5)
152-
fugit (1.3.6)
161+
fugit (1.4.2)
153162
et-orbi (~> 1.1, >= 1.1.8)
154-
raabro (~> 1.3)
163+
raabro (~> 1.4)
164+
fullcalendar-rails (3.9.0.0)
165+
jquery-rails (>= 4.0.5, < 5.0.0)
166+
jquery-ui-rails (>= 5.0.2)
167+
momentjs-rails (>= 2.9.0)
155168
globalid (0.4.2)
156169
activesupport (>= 4.2.0)
157170
groupdate (5.0.0)
@@ -205,7 +218,7 @@ GEM
205218
rb-fsevent (~> 0.9, >= 0.9.4)
206219
rb-inotify (~> 0.9, >= 0.9.7)
207220
ruby_dep (~> 1.2)
208-
loofah (2.7.0)
221+
loofah (2.8.0)
209222
crass (~> 1.0.2)
210223
nokogiri (>= 1.5.9)
211224
lumberjack (1.2.6)
@@ -226,14 +239,16 @@ GEM
226239
builder
227240
minitest (>= 5.0)
228241
ruby-progressbar
242+
momentjs-rails (2.20.1)
243+
railties (>= 3.1)
229244
msgpack (1.3.3)
230245
multi_json (1.15.0)
231246
multi_xml (0.6.0)
232247
multipart-post (2.1.1)
233248
mustache (1.1.1)
234249
mysql2 (0.5.3)
235250
nenv (0.3.0)
236-
nio4r (2.5.3)
251+
nio4r (2.5.4)
237252
nokogiri (1.10.10)
238253
mini_portile2 (~> 2.4.0)
239254
notiffany (0.1.3)
@@ -267,8 +282,10 @@ GEM
267282
public_suffix (4.0.5)
268283
puma (4.3.5)
269284
nio4r (~> 2.0)
270-
raabro (1.3.1)
285+
raabro (1.4.0)
271286
rack (2.2.3)
287+
rack-cors (1.1.1)
288+
rack (>= 2.0.0)
272289
rack-protection (2.0.8.1)
273290
rack
274291
rack-test (1.1.0)
@@ -313,7 +330,7 @@ GEM
313330
rb-inotify (0.10.1)
314331
ffi (~> 1.0)
315332
redcarpet (3.5.0)
316-
redis (4.2.1)
333+
redis (4.2.5)
317334
regexp_parser (1.7.1)
318335
responders (3.0.1)
319336
actionpack (>= 5.0)
@@ -355,20 +372,16 @@ GEM
355372
ruby_http_client (~> 3.4)
356373
sexp_processor (4.15.0)
357374
shellany (0.0.1)
358-
shoulda (3.5.0)
359-
shoulda-context (~> 1.0, >= 1.0.1)
360-
shoulda-matchers (>= 1.4.1, < 3.0)
361-
shoulda-context (1.2.2)
362-
shoulda-matchers (2.8.0)
363-
activesupport (>= 3.0.0)
364-
sidekiq (6.0.7)
375+
shoulda (4.0.0)
376+
shoulda-context (~> 2.0)
377+
shoulda-matchers (~> 4.0)
378+
shoulda-context (2.0.0)
379+
shoulda-matchers (4.4.1)
380+
activesupport (>= 4.2.0)
381+
sidekiq (6.1.3)
365382
connection_pool (>= 2.2.2)
366383
rack (~> 2.0)
367-
rack-protection (>= 2.0.0)
368-
redis (>= 4.1.0)
369-
sidekiq-cron (1.2.0)
370-
fugit (~> 1.1)
371-
sidekiq (>= 4.2.1)
384+
redis (>= 4.2.0)
372385
simple_form (5.0.2)
373386
actionpack (>= 5.0)
374387
activemodel (>= 5.0)
@@ -386,7 +399,7 @@ GEM
386399
sprockets (4.0.2)
387400
concurrent-ruby (~> 1.0)
388401
rack (> 1, < 3)
389-
sprockets-rails (3.2.1)
402+
sprockets-rails (3.2.2)
390403
actionpack (>= 4.0)
391404
activesupport (>= 4.0)
392405
sprockets (>= 3.0.0)
@@ -402,7 +415,7 @@ GEM
402415
turbolinks (5.2.1)
403416
turbolinks-source (~> 5.2)
404417
turbolinks-source (5.2.0)
405-
tzinfo (1.2.7)
418+
tzinfo (1.2.9)
406419
thread_safe (~> 0.1)
407420
uglifier (4.2.0)
408421
execjs (>= 0.3.0, < 3)
@@ -451,6 +464,7 @@ DEPENDENCIES
451464
factory_bot_rails
452465
file_validators
453466
font-awesome-rails (~> 4.0)
467+
fullcalendar-rails
454468
groupdate
455469
guard
456470
guard-minitest
@@ -461,11 +475,13 @@ DEPENDENCIES
461475
jquery-ui-rails
462476
listen (>= 3.0.5, < 3.2)
463477
minitest-reporters
478+
momentjs-rails
464479
mustache (~> 1.0)
465480
mysql2 (>= 0.4.4, < 0.6.0)
466481
omniauth-mlh (~> 0.4.1)
467482
omniauth-rails_csrf_protection
468483
puma (~> 4.3)
484+
rack-cors
469485
rails (~> 5.2.4.4)
470486
rails-controller-testing
471487
rails-settings-cached (~> 0.7.2)
@@ -479,10 +495,10 @@ DEPENDENCIES
479495
selectize-rails
480496
selenium-webdriver
481497
sendgrid-actionmailer
482-
shoulda (~> 3.5)
483-
shoulda-matchers (~> 2.0)
498+
shoulda (~> 4.0.0)
499+
shoulda-matchers (~> 4.4.0)
484500
sidekiq (< 7)
485-
sidekiq-cron (~> 1.1)
501+
sidekiq-cron!
486502
simple_form
487503
simple_spark
488504
simplecov

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,14 @@ $ bin/rails s # short for bin/rails server
108108

109109
6. Visit http://localhost:3000/apply, create an account, and complete an application
110110

111-
7. In another bash window, promote your user to an admin
111+
7. In another bash window, promote your user to a director
112112

113113
```bash
114114
$ cd hackathon-manager
115115
$ bin/rails c # short for bin/rails console
116116
# Wait for the console to start...
117117
Loading development environment (Rails 5.1.1)
118-
irb(main):001:0> User.last.update_attribute(:role, :admin)
118+
irb(main):001:0> User.last.update_attribute(:role, :director)
119119
```
120120

121121
8. Visit http://localhost:3000/manage and set up the hackathon as needed

app/assets/javascripts/application.js

+3
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@
2121
//= require_directory .
2222
//= require_directory ./channels
2323
//= require ./vendor/simplemde.min.js
24+
//= require moment
25+
//= require fullcalendar
26+
//= require fullcalendar/locale-all

app/assets/javascripts/events.js

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
function eventCalendar() {
2+
return $('#calendar').fullCalendar({
3+
defaultView: 'listYear',
4+
buttonText: {
5+
today: 'Today'
6+
},
7+
eventRender: function (event, element, view) {
8+
element.find('.fc-event-dot').css('display', 'none');
9+
if(event.description) {
10+
element.find('.fc-list-item-title').append('<div></div><span style="font-size: 12px">' + event.description + '</span>');
11+
}
12+
if (event.location) {
13+
element.find('.fc-list-item-title').append('<div></div><span style="font-size: 12px"><b>Location: </b>' + event.location + '</span>');
14+
}
15+
if (event.category) {
16+
element.find('.fc-list-item-title').append('<div></div><span style="font-size: 12px"><b>Category: </b>' + event.category + '</span>');
17+
}
18+
},
19+
events: {
20+
url: '/manage/events.json',
21+
success: function (response) {
22+
// due to "end" being a keyword in ruby and what fullcalender uses it is stored as finish and than it is
23+
// converted to "end" when sending it to fullcalendar
24+
response = JSON.parse(JSON.stringify(response).split('"finish":').join('"end":'));
25+
return response;
26+
}
27+
},
28+
eventClick: function (info) {
29+
window.location = 'events/' + info.id;
30+
},
31+
height: 'auto',
32+
});
33+
}
34+
35+
function clearCalendar() {
36+
$('#calendar').fullCalendar('delete');
37+
$('#calendar').html('');
38+
}
39+
40+
document.addEventListener('turbolinks:load', function () {
41+
eventCalendar();
42+
});
43+
document.addEventListener('turbolinks:before-cache', clearCalendar);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
document.addEventListener('turbolinks:load', function () {
2+
$('.map-button').click(function (){
3+
var map = $('#map');
4+
if(map.is(':visible')){
5+
map.hide();
6+
$(this).html('Show Map');
7+
}
8+
else{
9+
map.show();
10+
$(this).html('Hide Map');
11+
}
12+
});
13+
});

app/assets/javascripts/manage/lib/setupDataTables.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ var setupDataTables = function () {
124124
]
125125
});
126126

127-
$('.datatable.stats-mlhinfo-applied').DataTable({
127+
$('.datatable.stats-info-applied').DataTable({
128128
order: [1, 'asc'],
129129
columns: [
130130
{ orderable: true, data: 'id', visible: false },
@@ -136,7 +136,7 @@ var setupDataTables = function () {
136136
]
137137
});
138138

139-
$('.datatable.stats-mlhinfo-checkedin').DataTable({
139+
$('.datatable.stats-info-checkedin').DataTable({
140140
order: [1, 'asc'],
141141
columns: [
142142
{ orderable: true, data: 'id', visible: false },

app/assets/javascripts/validate.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ document.addEventListener('turbolinks:load', function() {
1818
switch (types[i]) {
1919
case 'presence':
2020
if (!value || $.trim(value).length < 1) {
21-
if ($(this).parents('.agreement_input')) {
22-
notify('.agreement_input', 'Please read & accept');
21+
if ($(this).hasClass("agreement_input")) {
22+
notify($(this).parent(), 'Please read & accept');
2323
} else {
2424
notify(this, 'Missing Information');
2525
}
@@ -74,7 +74,9 @@ document.addEventListener('turbolinks:load', function() {
7474
.fadeOut(200, function() {
7575
$(this).remove();
7676
});
77-
$(".agreement_input")
77+
// this removes the notification for agreements
78+
$(this)
79+
.parent()
7880
.parent()
7981
.removeClass('field_with_errors')
8082
.find('.error')

app/assets/stylesheets/forms/_forms.sass

+2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ hr
7373
@include css4
7474
color: var(--grey)
7575
.error
76+
display: inline-block
77+
width: 100%
7678
@include css4
7779
background: var(--input--error--background)
7880
color: var(--input--error--text)

0 commit comments

Comments
 (0)