-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unify alert CSS and update/prune existing alerts
- Loading branch information
Showing
10 changed files
with
77 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,35 @@ | ||
.alert { | ||
padding: 10px; | ||
color: black; | ||
text-align: center; | ||
margin-bottom: 0px; | ||
} | ||
|
||
.alert.alert-success { | ||
background: rgba(0, 128, 0, 0.25); | ||
} | ||
&.alert-admin { | ||
margin-top: 30px; | ||
} | ||
|
||
.alert.alert-notice { | ||
background: rgba(255, 255, 0, 0.25); | ||
} | ||
&.alert-success { | ||
color: #3c763d; | ||
background-color: #dff0d8; | ||
border-color: darken(adjust-hue(#dff0d8, -10), 5%); | ||
} | ||
|
||
&.alert-info, &.alert-notice { | ||
color: #31708f; | ||
background-color: #d9edf7; | ||
border-color: darken(adjust-hue(#d9edf7, -10), 7%); | ||
} | ||
|
||
.alert.alert-error { | ||
background: rgba(255, 0, 0, 0.25); | ||
} | ||
&.alert-warning { | ||
background: rgba(255, 255, 0, 0.25); | ||
color: #8a6d3b; | ||
background: #fcf8e3; | ||
border-color: darken(adjust-hue(#fcf8e3, -10), 5%); | ||
} | ||
|
||
&.alert-danger, &.alert-error, &.alert-alert { | ||
color: #a94442; | ||
background: #f2dede; | ||
border-color: darken(adjust-hue(#f2dede, -10), 5%); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,18 +17,18 @@ def admin_website | |
|
||
def admin_processor_setup | ||
if request.post? | ||
flash.now[:error] = "Invalid credentials" and return if params[:ct_prod_api_key].blank? || params[:ct_prod_api_secret].blank? | ||
flash.now[:error] = "Missing API credentials" and return if params[:ct_prod_api_key].blank? || params[:ct_prod_api_secret].blank? | ||
if @settings.activate_payments(params[:ct_prod_api_key], params[:ct_prod_api_secret]) | ||
flash.now[:success] = "Your payment processor is all set up!" | ||
else | ||
flash.now[:error] = "Invalid credentials" | ||
flash.now[:error] = "Could not activate payment processing. Please double-check your API credentials." | ||
end | ||
end | ||
end | ||
|
||
def create_admin_bank_account | ||
if params[:ct_bank_id].blank? | ||
flash = { :error => "Looks like you have JavaScript disabled. JavaScript is required for bank account setup." } | ||
flash = { :warning => "Looks like you have JavaScript disabled. JavaScript is required for bank account setup." } | ||
else | ||
begin | ||
bank = { | ||
|
@@ -46,7 +46,7 @@ def create_admin_bank_account | |
|
||
def admin_bank_account | ||
unless @settings.payments_activated? | ||
redirect_to admin_processor_setup_url, flash: { error: "Please set up your payment processor before providing your bank details" } and return | ||
redirect_to admin_processor_setup_url, flash: { info: "Please set up your payment processor before providing your bank details" } and return | ||
end | ||
@bank = {} | ||
begin | ||
|
@@ -66,14 +66,14 @@ def delete_admin_bank_account | |
begin | ||
response = Crowdtilt.get('/users/' + @ct_admin_id + '/banks/default') | ||
rescue => exception | ||
flash = { :error => "No default bank account" } | ||
flash = { :warning => "No default bank account" } | ||
else | ||
begin | ||
Crowdtilt.delete('/users/' + @ct_admin_id + '/banks/' + response['bank']['id']) | ||
rescue => exception | ||
flash = { :error => "An error occurred, please contact [email protected]: #{exception.message}" } | ||
else | ||
flash = { :info => "Bank account deleted successfully" } | ||
flash = { :success => "Bank account deleted successfully" } | ||
end | ||
end | ||
redirect_to admin_bank_account_url, :status => 303, :flash => flash | ||
|
@@ -114,7 +114,7 @@ def admin_notification_setup | |
if current_user.update_attributes(params[:user]) | ||
flash.now[:success] = "Notification settings saved!" | ||
else | ||
flash.now[:error] = "There was an error saving your notification settings. Please try again!" | ||
flash.now[:error] = "Could not save notification settings. Please try again!" | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<% admin = false if local_assigns[:admin].nil? %> | ||
<% flash.to_hash().slice(:success, :info, :notice, :warning, :error, :alert).each do |key, value| %> | ||
<% if !value.blank? %><div class="alert <%= 'alert-admin' if admin %> alert-<%= key %>"><%= value %></div><% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters