diff --git a/Gemfile b/Gemfile index 5f0e763d..5a7ec56c 100644 --- a/Gemfile +++ b/Gemfile @@ -122,6 +122,7 @@ group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug' gem 'rspec-rails', '~> 3.2' + gem 'rspec-steps', '~> 2.1.1' gem 'capybara', '~> 2.5' gem 'poltergeist' gem 'database_cleaner' diff --git a/Gemfile.lock b/Gemfile.lock index 9ccff725..82a4ebe9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -235,6 +235,10 @@ GEM ref (2.0.0) responders (2.3.0) railties (>= 4.2.0, < 5.1) + rspec (3.5.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) rspec-core (3.5.4) rspec-support (~> 3.5.0) rspec-expectations (3.5.0) @@ -251,6 +255,8 @@ GEM rspec-expectations (~> 3.5.0) rspec-mocks (~> 3.5.0) rspec-support (~> 3.5.0) + rspec-steps (2.1.1) + rspec (>= 3.0, < 3.99) rspec-support (3.5.0) rubocop (0.29.1) astrolabe (~> 1.3) @@ -361,6 +367,7 @@ DEPENDENCIES redcarpet ref rspec-rails (~> 3.2) + rspec-steps (~> 2.1.1) rubocop (~> 0.29.1) rubyzip simplecov diff --git a/app/assets/images/banner.jpg b/app/assets/images/banner.jpg new file mode 100644 index 00000000..0ee8403b Binary files /dev/null and b/app/assets/images/banner.jpg differ diff --git a/app/assets/javascripts/events.js b/app/assets/javascripts/events.js index 868a970e..a222b3d2 100644 --- a/app/assets/javascripts/events.js +++ b/app/assets/javascripts/events.js @@ -77,3 +77,21 @@ function flipAllCheckboxes(rootCheckbox, className) { }); } } + +function ajaxUpdateParticipantColor(form, errorMessage) { + if (!window.FormData) + return form.submit(); + + var xhr = new XMLHttpRequest(); + xhr.open(form.method, form.action); + xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + xhr.onload = function() { + if (xhr.status < 200 || xhr.status >= 300) + return alert(errorMessage); + }; + xhr.onerror = function() { + alert(errorMessage); + }; + + xhr.send(new FormData(form)); +} diff --git a/app/assets/javascripts/requests.js b/app/assets/javascripts/requests.js index f57dd3b7..c6084cc0 100644 --- a/app/assets/javascripts/requests.js +++ b/app/assets/javascripts/requests.js @@ -4,8 +4,8 @@ function enableOwlCarousel() { $(".owl-carousel").owlCarousel({ center: false, - item: 2, - autoplay: true, + items: 2, + autoplay: false, loop: true, dots: true, margin: 30, diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index bb1edd0f..730b14c6 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -29,6 +29,11 @@ body, footer, main, .front-section { width: 100%; } +.banner { + background-position: center; + background-size: cover; +} + .m-l-1 { margin-left: 15px; } .m-r-1 { margin-right: 15px; } .m-t-1 { margin-top: 15px; } diff --git a/app/assets/stylesheets/application_letters.css b/app/assets/stylesheets/application_letters.css index a9adeb5b..027365e8 100644 --- a/app/assets/stylesheets/application_letters.css +++ b/app/assets/stylesheets/application_letters.css @@ -31,10 +31,9 @@ ul#eating-habit--list > li { margin-left: 3px; } -.application-details-table.table { - table-layout: fixed; +dl:not(.dl-horizontal) dd { + margin-bottom: 30px; } -.application-details-table.table td, .application-details-table.table th { - border: none; - padding: 5px; +dl:not(.dl-horizontal) dt { + margin-bottom: 5px; } diff --git a/app/assets/stylesheets/custom_bootstrap/custom_bootstrap.less b/app/assets/stylesheets/custom_bootstrap/custom_bootstrap.less index 1d482232..0b5b15d2 100644 --- a/app/assets/stylesheets/custom_bootstrap/custom_bootstrap.less +++ b/app/assets/stylesheets/custom_bootstrap/custom_bootstrap.less @@ -74,7 +74,7 @@ @import "twitter/bootstrap/utilities.less"; @import "twitter/bootstrap/responsive-utilities.less"; -body { +body:not(.wsp-home), .wsp-home .banner.front-section { padding-top: 120px; } @@ -142,10 +142,12 @@ a:hover h1, a:hover h2, a:hover h3, a:hover h4 { padding-bottom: 30px; word-wrap: break-word; } + @media (max-width: @screen-sm-max) { h1 { font-size: 5rem; } h2 { font-size: 4rem; } } + @media (max-width: @screen-xs-max) { h1 { font-size: 3.5rem; } h2 { font-size: 2.5rem; } @@ -158,16 +160,34 @@ a:hover h1, a:hover h2, a:hover h3, a:hover h4 { } -.spacer-20 { +.spacer-20 { width: 100%; height: 20px; min-height: 20px; } + +.spacer-30 { + width: 100%; + height: 30px; + min-height: 30px; +} + +.spacer-60 { + width: 100%; + height: 60px; + min-height: 60px; +} + // Fontpage #wsp-welcome { + padding-top: 0px !important; + h1, h4, p { + color: #FFF; + } + ul { list-style: none; float: left; @@ -238,8 +258,6 @@ strong, b { font-weight: 700; } - - @import "multi-select.css"; .image-buttons .btn { @@ -249,7 +267,52 @@ strong, b { background-position: center; border: 3px solid @body-bg; } + .image-buttons .btn.active { border: 3px solid @brand-primary; } + + +#requestGallery { + .panel { + min-height: 500px; + } +} + +.title, .page-title { + font-size: 64px; + line-height: 1; +} + +.line-spacer { + border-bottom: 1px solid @gray-lighter; + margin-top: 0px; + margin-bottom: 30px; + width: 100%; +} + +.events-facts { + ul { + padding-left: 25px; + } +} + +.bottom-align-text { + position: absolute; + bottom: 15px; + right: 0; +} + +.bottom-align-text { + position: absolute; + bottom: 15px; + right: 0; + +} + +.relative-box { + position: relative; + +} + diff --git a/app/assets/stylesheets/events.css b/app/assets/stylesheets/events.css index 50336ff1..98b8495d 100644 --- a/app/assets/stylesheets/events.css +++ b/app/assets/stylesheets/events.css @@ -54,12 +54,45 @@ transition: all 0.5s; } +.event-preview a.btn-success{ + color: #fff; + transition: all 0.5s; +} + +.event-preview a.btn-danger{ + color: #fff; + transition: all 0.5s; +} + +.event-preview a.btn-default{ + color: #000; + transition: all 0.5s; +} + .event-preview a:hover { text-decoration: none; color: #DE6207; transition: all 0.5s; } +.event-preview a.btn-success:hover { + text-decoration: none; + color: #fff; + transition: all 0.5s; +} + +.event-preview a.btn-danger:hover { + text-decoration: none; + color: #fff; + transition: all 0.5s; +} + +.event-preview a.btn-default:hover { + text-decoration: none; + color: #000; + transition: all 0.5s; +} + .front-section:nth-child(even) .event-preview { border-bottom: 1px solid rgba(255, 255, 255, 0.3); } @@ -118,3 +151,12 @@ height: 150px; margin-bottom: 15px; } + +.text-success{ + color: #009600; +} + +#event-date-pickers a.close { + color: #000; +} + diff --git a/app/controllers/agreement_letters_controller.rb b/app/controllers/agreement_letters_controller.rb index 2664dd0b..35999bc6 100644 --- a/app/controllers/agreement_letters_controller.rb +++ b/app/controllers/agreement_letters_controller.rb @@ -18,7 +18,7 @@ def create notice: t("agreement_letters.upload_success") else redirect_to check_application_letter_path(application_letter), - alert: @agreement_letter.errors.messages + alert: @agreement_letter.errors.full_messages end end end diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb index 43375783..2dd095c0 100644 --- a/app/controllers/profiles_controller.rb +++ b/app/controllers/profiles_controller.rb @@ -36,6 +36,7 @@ def create redirect_to edit_user_registration_path, notice: I18n.t('profiles.successful_creation') end else + flash.keep(:event_id) render :new end end diff --git a/app/mailers/portal_mailer.rb b/app/mailers/portal_mailer.rb index 4a7e431d..42f1cc9f 100644 --- a/app/mailers/portal_mailer.rb +++ b/app/mailers/portal_mailer.rb @@ -1,15 +1,19 @@ class PortalMailer < ApplicationMailer - + include ApplicationHelper + # @param recipients [Array] - email addresses of recipients - can be a string of comma separated email adresses too # @param reply_to [Array] - email addresses of recipient of the answer - can be a string of comma separated email adresses too # @param subject [String] - subject of the mail # @param content [String] - content of the mail # @param some_attachments - array of hashes with name and content # @return [ActionMailer::MessageDelivery] a mail object with the given parameters. - def generic_email(recipients, reply_to, subject, content, some_attachments = []) - some_attachments.each do |attachment| + def generic_email(recipients, reply_to, subject, content, attached_files = []) + attached_files.each do | attachment | attachments[attachment[:name]] = attachment[:content] end - mail(to: recipients, reply_to: reply_to, subject: subject, body: content) + mail(to: recipients, reply_to: reply_to, subject: subject) do | format | + format.html { markdown content } + format.text { content } + end end end diff --git a/app/models/agreement_letter.rb b/app/models/agreement_letter.rb index 74d0a5c4..4fad03cf 100644 --- a/app/models/agreement_letter.rb +++ b/app/models/agreement_letter.rb @@ -41,7 +41,7 @@ def save_file(file) true rescue IOError self.destroy - errors.add(:file, I18n.t('agreement_letters.write_failed')) + errors.add(I18n.t('agreement_letters.file_error'), I18n.t('agreement_letters.write_failed')) false end end @@ -51,7 +51,7 @@ def save(*args) if super true else - errors.add(:file, I18n.t('agreement_letters.upload_failed')) + errors.add(I18n.t('agreement_letters.file_error'), I18n.t('agreement_letters.upload_failed')) false end end @@ -67,16 +67,16 @@ def set_path private def valid_file?(file) if !is_file?(file) - errors.add(:file, I18n.t("agreement_letters.not_a_file")) + errors.add(I18n.t('agreement_letters.file_error'), I18n.t("agreement_letters.not_a_file")) false elsif too_big?(file) - errors.add(:file, I18n.t("agreement_letters.file_too_big")) + errors.add(I18n.t('agreement_letters.file_error'), I18n.t("agreement_letters.file_too_big")) false elsif wrong_filetype?(file) - errors.add(:file, I18n.t("agreement_letters.wrong_filetype")) + errors.add(I18n.t('agreement_letters.file_error'), I18n.t("agreement_letters.wrong_filetype")) false elsif unable_to_open?(file) - errors.add(:file, I18n.t("agreement_letters.corrupt_document")) + errors.add(I18n.t('agreement_letters.file_error'), I18n.t("agreement_letters.corrupt_document")) false else true diff --git a/app/views/application/index.html.erb b/app/views/application/index.html.erb index 8913e319..06b30638 100644 --- a/app/views/application/index.html.erb +++ b/app/views/application/index.html.erb @@ -1,5 +1,6 @@ -
+