Adjusted donation state
This commit is contained in:
@@ -7,15 +7,15 @@ class ChargesController < ApplicationController
|
|||||||
begin
|
begin
|
||||||
@amount = Float(@amount).round(2)
|
@amount = Float(@amount).round(2)
|
||||||
rescue
|
rescue
|
||||||
flash[:error] = 'Bitte geben sie einen Betrag in CHF ein.'
|
flash[:danger] = 'Bitte geben sie einen Betrag in CHF ein.'
|
||||||
redirect_to donation_path
|
redirect_to donation_path
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@amount = (@amount * 100).to_i # Must be an integer!
|
@amount = (@amount * 100).to_i # Must be an integer!
|
||||||
|
|
||||||
if @amount < 500
|
if @amount < 1000
|
||||||
flash[:error] = 'Ihre Spende muss mindestens 5.- CHF betragen.'
|
flash[:danger] = 'Ihre Spende muss mindestens 10.- CHF betragen.'
|
||||||
redirect_to donation_path
|
redirect_to donation_path
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -15,66 +15,68 @@ javascript:
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
h2 Spendenbarometer
|
h2 Spendenbarometer
|
||||||
b Aktueller Stand: 93'000 CHF
|
b Aktueller Stand: 101'250 CHF
|
||||||
.row
|
.row
|
||||||
.col-xs-12
|
.col-xs-12
|
||||||
.progress-target style="width: 20%"
|
.progress-target style="width: 20%"
|
||||||
= link_to "Variante C:", collection_concept_path
|
= link_to "Variante C:", collection_concept_path
|
||||||
br
|
br
|
||||||
| 100'000 CHF
|
| 100'000 CHF
|
||||||
|
|
||||||
.progress-target style="width: 30%"
|
.progress-target style="width: 30%"
|
||||||
= link_to "Variante B:", collection_concept_path
|
= link_to "Variante B:", collection_concept_path
|
||||||
br
|
br
|
||||||
| 250'000 CHF
|
| 250'000 CHF
|
||||||
|
|
||||||
.progress-target style="width: 48%"
|
.progress-target style="width: 48%"
|
||||||
= link_to "Variante A:", collection_concept_path
|
= link_to "Variante A:", collection_concept_path
|
||||||
br
|
br
|
||||||
| 500'000 CHF
|
| 500'000 CHF
|
||||||
|
|
||||||
.progress
|
.progress
|
||||||
.progress-bar.progress-bar-success role="progressbar" aria-valuenow="93000" aria-valuemin="0" aria-valuemax="500000" style="width: 18.6%"
|
.progress-bar.progress-bar-success role="progressbar" aria-valuenow="101250" aria-valuemin="0" aria-valuemax="500000" style="width: 20.6%"
|
||||||
|
|
||||||
p Detailliertere Informationen, wie dieses Geld eingesetzt wird, findest du unter <a href="#{collection_concept_path}">«Wie macht man eine Volksinitiative?»</a>
|
p Detailliertere Informationen, wie dieses Geld eingesetzt wird, findest du unter <a href="#{collection_concept_path}">«Wie macht man eine Volksinitiative?»</a>
|
||||||
|
|
||||||
h2 Via Kreditkarte online spenden
|
h2 Via Kreditkarte online spenden
|
||||||
= form_tag charges_path do
|
= form_tag charges_path do
|
||||||
= hidden_field_tag(:stripeToken)
|
= hidden_field_tag(:stripeToken)
|
||||||
- if flash[:error].present?
|
#error_explanation.text-danger.hidden
|
||||||
#error_explanation.text-danger
|
= flash[:error] if flash[:error].present?
|
||||||
= flash[:error]
|
|
||||||
.row
|
.row
|
||||||
.col-xs12.col-md-5
|
.col-xs12.col-md-5
|
||||||
button.donatebox.btn.btn-success onclick="donate(20)" 20 .-
|
button.donatebox.btn.btn-success onclick="donate(20)" 20 .-
|
||||||
button.donatebox.btn.btn-success onclick="donate(50)" 50 .-
|
button.donatebox.btn.btn-success onclick="donate(50)" 50 .-
|
||||||
button.donatebox.btn.btn-success onclick="donate(100)" 100 .-
|
button.donatebox.btn.btn-success onclick="donate(100)" 100 .-
|
||||||
button.donatebox.btn.btn-success onclick="donate(200)" 200 .-
|
button.donatebox.btn.btn-success onclick="donate(200)" 200 .-
|
||||||
|
button.donatebox.btn.btn-success onclick="donate(500)" 500 .-
|
||||||
|
button.donatebox.btn.btn-success onclick="donate(1000)" 1000 .-
|
||||||
|
|
||||||
.col-xs12.col-md-6
|
.col-xs12.col-md-6
|
||||||
.form-group
|
.form-group
|
||||||
strong oder einen eigenen Betrag
|
strong oder einen eigenen Betrag
|
||||||
.form-group
|
.form-group
|
||||||
.input-group
|
.input-group
|
||||||
.input-group-addon CHF
|
.input-group-addon CHF
|
||||||
= text_field_tag(:amount, 50 , class: 'form-control')
|
= text_field_tag(:amount, 100 , class: 'form-control')
|
||||||
|
|
||||||
.form-group
|
.form-group
|
||||||
button#donateButton.btn.btn-success Spenden übermitteln
|
button#donateButton.btn.btn-success Spenden übermitteln
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
h2 Mit Bitcoin und Bitcoin Cash spenden
|
h2 Mit Bitcoin und Bitcoin Cash spenden
|
||||||
.row
|
.row
|
||||||
.col-md-6.col-xs-12
|
.col-md-6.col-xs-12
|
||||||
p
|
p
|
||||||
= image_tag '1LaYbTiCjhrUhxrQ9D5BQUfxPmRqJ7Q3gG.png', alt: 'Bitcoin Adresse: 1LaYbTiCjhrUhxrQ9D5BQUfxPmRqJ7Q3gG', width: '150', class: 'pull-right'
|
= image_tag '1LaYbTiCjhrUhxrQ9D5BQUfxPmRqJ7Q3gG.png', alt: 'Bitcoin Adresse: 1LaYbTiCjhrUhxrQ9D5BQUfxPmRqJ7Q3gG', width: '150', class: 'pull-right'
|
||||||
div
|
div
|
||||||
| Gerne nehmen wir auch Spenden via Bitcoin unter folgender Adresse entgegen:
|
| Gerne nehmen wir auch Spenden via Bitcoin unter folgender Adresse entgegen:
|
||||||
br
|
br
|
||||||
strong 1LaYbTiCjhrUhxrQ9D5BQUfxPmRqJ7Q3gG
|
strong 1LaYbTiCjhrUhxrQ9D5BQUfxPmRqJ7Q3gG
|
||||||
.col-md-6.col-xs-12
|
.col-md-6.col-xs-12
|
||||||
p
|
p
|
||||||
= image_tag '1LVGcneFcYqCkhDFNsnhWb6x7cCHHxakg9.png', alt: 'Bitcoin Cash Adresse: 1LVGcneFcYqCkhDFNsnhWb6x7cCHHxakg9', width: '150', class: 'pull-right'
|
= image_tag '1LVGcneFcYqCkhDFNsnhWb6x7cCHHxakg9.png', alt: 'Bitcoin Cash Adresse: 1LVGcneFcYqCkhDFNsnhWb6x7cCHHxakg9', width: '150', class: 'pull-right'
|
||||||
div
|
div
|
||||||
| Oder Bitcoin Cash unter folgender Adresse:
|
| Oder Bitcoin Cash unter folgender Adresse:
|
||||||
@@ -89,17 +91,17 @@ h2 Per Überweisung spenden
|
|||||||
dt Postkonto:
|
dt Postkonto:
|
||||||
dd 87-091354-3, Verein Legalize it!, Postfach 2159, 8031 Zürich
|
dd 87-091354-3, Verein Legalize it!, Postfach 2159, 8031 Zürich
|
||||||
dt IBAN:
|
dt IBAN:
|
||||||
dd CH02 0900 0000 8709 1354 3
|
dd CH02 0900 0000 8709 1354 3
|
||||||
dt Zahlungszweck:
|
dt Zahlungszweck:
|
||||||
dd Spende Initiative
|
dd Spende Initiative
|
||||||
.col-md-5.col-xs-12
|
.col-md-5.col-xs-12
|
||||||
= link_to asset_path('Einzahlungsschein_Spende_Initiative.pdf') do
|
= link_to asset_path('Einzahlungsschein_Spende_Initiative.pdf') do
|
||||||
= image_tag('Einzahlungsschein_Spende_Initiative.jpg', class:'img-responsive', alt: 'Einzahlungsschein Spende initiative')
|
= image_tag('Einzahlungsschein_Spende_Initiative.jpg', class:'img-responsive', alt: 'Einzahlungsschein Spende initiative')
|
||||||
|
|
||||||
|
|
||||||
p
|
p
|
||||||
b Wir würden uns freuen, wenn ihr das macht und uns finanziell unter die Arme greift.
|
b Wir würden uns freuen, wenn ihr das macht und uns finanziell unter die Arme greift.
|
||||||
|
|
||||||
p Danke, dein Verein Legalize it!
|
p Danke, dein Verein Legalize it!
|
||||||
|
|
||||||
javascript:
|
javascript:
|
||||||
@@ -121,10 +123,12 @@ javascript:
|
|||||||
amount = parseFloat(amount);
|
amount = parseFloat(amount);
|
||||||
|
|
||||||
if (isNaN(amount)) {
|
if (isNaN(amount)) {
|
||||||
|
$('#error_explanation').toggleClass('hidden')
|
||||||
$('#error_explanation').html('<p>Bitte geben sie einen Betrag in CHF ein.</p>');
|
$('#error_explanation').html('<p>Bitte geben sie einen Betrag in CHF ein.</p>');
|
||||||
}
|
}
|
||||||
else if (amount < 5.00) {
|
else if (amount < 10.00) {
|
||||||
$('#error_explanation').html('<p>Ihre Spende muss mindestens 5.- CHF betragen.</p>');
|
$('#error_explanation').toggleClass('hidden')
|
||||||
|
$('#error_explanation').html('<p>Ihre Spende muss mindestens 10.- CHF betragen.</p>');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
amount = amount * 100; // Needs to be an integer!
|
amount = amount * 100; // Needs to be an integer!
|
||||||
|
|||||||
Reference in New Issue
Block a user