Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use consistent flash support on all pages #59

Merged
merged 1 commit into from
Jan 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
5 changes: 1 addition & 4 deletions app/assets/stylesheets/hackathon_manager/manage.sass
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.manage
padding-left: 20px
padding-right: 20px
padding-top: 100px
padding-top: 50px

.container-half, .container-full
max-width: none
Expand All @@ -27,14 +27,11 @@
margin: 0

#manageNav
position: absolute
z-index: 1
width: 100%
background: $black
color: $white
padding: 16px 20px 6px
@media(max-width: 840px)
padding-left: 70px
p, a
margin: 0 5px 10px
p
Expand Down
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/_flashes.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- if flash[:notice].present?
.flashes
.container
.form-container
%span.fa.fa-info-circle.flashes__icon
= flash[:notice]
1 change: 1 addition & 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,7 @@
%body
= render "layouts/hackathon_manager/header"
= render "layouts/hackathon_manager/account_nav"
= render "layouts/hackathon_manager/flashes"
#main
%section.section
.container
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/manage/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
\|
= link_to "Sidekiq", sidekiq_web_path
= link_to "Blazer", blazer_path
= render "layouts/hackathon_manager/flashes"
= yield
= render "layouts/hackathon_manager/shared_footer"
3 changes: 0 additions & 3 deletions app/views/manage/dashboard/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
%section.section.manage
%h1.section-title= title "Dashboard"

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

.container.container-full
#map
:javascript
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