Skip to content

Commit

Permalink
Use consistent flash support on all pages
Browse files Browse the repository at this point in the history
Fixes #50
  • Loading branch information
sman591 committed Jan 2, 2018
1 parent 535229f commit 1e0529d
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 25 deletions.
1 change: 1 addition & 0 deletions app/assets/stylesheets/hackathon_manager/core.sass
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@import general/mixins
@import general/base
@import general/button
@import general/flashes
@import general/main
@import general/header
@import general/footer
Expand Down
18 changes: 18 additions & 0 deletions app/assets/stylesheets/hackathon_manager/general/_flashes.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.flashes
background: $flashes--background
color: $flashes--text
padding-top: 20px
padding-bottom: 20px
font-weight: 400

opacity: 0
animation: flashesFadeIn 400ms 100ms ease-out forwards

.flashes__icon
margin-right: 0.4em

@keyframes flashesFadeIn
0%
opacity: 0
100%
opacity: 1
6 changes: 6 additions & 0 deletions app/assets/stylesheets/variables.sass
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ $alert--background--error: $red !default
$alert--border--error: $red !default
$alert--text--error: $white_pure !default

/*
* Flashes
*/
$flashes--background: hsl(51, 87%, 94%) !default
$flashes--text: hsl(40, 68%, 20%) !default

/*
* Account header
*/
Expand Down
6 changes: 6 additions & 0 deletions app/views/layouts/hackathon_manager/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
%body
= render "layouts/hackathon_manager/header"
= render "layouts/hackathon_manager/account_nav"
- if flash[:notice].present?
.flashes
.container
.form-container
%span.fa.fa-info-circle.flashes__icon
= flash[:notice]
#main
%section.section
.container
Expand Down
4 changes: 0 additions & 4 deletions app/views/manage/questionnaires/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
- if f.error_notification.present?
= f.error_notification

- if flash[:notice]
#disclaimer
%p= flash[:notice]

.form-inputs
%fieldset
- if @questionnaire&.user&.provider == 'mlh'
Expand Down
3 changes: 0 additions & 3 deletions app/views/manage/questionnaires/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
%span.fa.fa-warning.icon-space-r
Slack invites will be sent upon acceptance.

- if flash[:notice]
#disclaimer= flash[:notice]

%table.questionnaires.datatable.row-border.stripe.hover.order-column{ "data-source" => datatable_manage_questionnaires_path(format: :json) }
%thead
%tr
Expand Down
3 changes: 0 additions & 3 deletions app/views/manage/schools/merge.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
- if f.error_notification.present?
#disclaimer
= f.error_notification
- if flash[:notice]
#disclaimer
= flash[:notice]

%p
You are going to merge
Expand Down
3 changes: 0 additions & 3 deletions app/views/manage/stats/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
%section.section.manage
%h1.section-title= title "Statistics & Info"

- if flash[:notice]
#disclaimer= flash[:notice]

.container.container-full
%h4.dashboard-container-title Dietary Restrictions & Special Needs
%table.stats.datatable.row-border.stripe.hover.order-column{ "data-source" => dietary_special_needs_manage_stats_path(format: :json) }
Expand Down
4 changes: 0 additions & 4 deletions app/views/questionnaires/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
- if f.error_notification.present?
= f.error_notification

- if flash[:notice]
#disclaimer
%p= flash[:notice]

.wizard-stage.wizard-current
- if Rails.configuration.hackathon['disclaimer']
#disclaimer
Expand Down
4 changes: 0 additions & 4 deletions app/views/questionnaires/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
- title "Application"
.form-container
- if flash[:notice]
#disclaimer
%p#notice= flash[:notice]

#disclaimer
%h1.section-title
Application
Expand Down
4 changes: 0 additions & 4 deletions app/views/rsvps/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@

%hr

- if flash[:notice]
.alert
= flash[:notice]

= simple_form_for @questionnaire, url: url_for(controller: "rsvps", action: "update"), html: { "data-validate" => "form" } do |f|
.form-inputs
= f.input :acc_status, as: :radio_buttons, collection: { " Attending!" => "rsvp_confirmed", " Not Attending." => "rsvp_denied" }, label: "Attendance:", required: true
Expand Down

0 comments on commit 1e0529d

Please sign in to comment.