Skip to content

Commit cb029ef

Browse files
committed
feat: group_order form show a button to my_order_group when insufficient funds
1 parent cd3141c commit cb029ef

File tree

8 files changed

+14
-2
lines changed

8 files changed

+14
-2
lines changed

app/assets/javascripts/ordering.js

+5
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,13 @@ function updateBalance() {
184184
if (balance < minimumBalance) {
185185
bgcolor = '#FF0000';
186186
$('#submit_button').attr('disabled', 'disabled')
187+
$('#submit_button').attr('title', I18n.t('js.ordering.balance_too_low'));
188+
$('#submit_button').css('background-color', '#ABABAB');
189+
$('#account-statement-button').removeClass('hidden');
190+
187191
} else {
188192
$('#submit_button').removeAttr('disabled')
193+
$('#account-statement-button').addClass('hidden');
189194
}
190195
// update bgcolor
191196
for (i in itemTotal) {

app/views/group_orders/_form.html.haml

+3-2
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,9 @@
173173
%td.currency
174174
%strong
175175
%span#new_balance= number_to_currency(old_balance - @group_order.price)
176-
#order-button
176+
%span#order-button
177177
= submit_tag( t('.action_save'), id: 'submit_button', class: 'btn btn-primary' )
178-
#{link_to t('ui.or_cancel'), group_orders_path}
178+
= link_to t('.account_statement'), my_ordergroup_path, class: 'btn btn-secondary btn-small hidden', id: 'account-statement-button'
179+
#{link_to t('ui.or_cancel'), group_orders_path}
179180
%input#total_balance{name: "total_balance", type: "hidden", value: @ordergroup.account_balance - @group_order.price}/
180181
%input{name: "version", type: "hidden", value: @version}/

config/locales/de.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,7 @@ de:
10541054
notfound: Fehlerhafte URL, das ist nicht Deine Bestellung.
10551055
form:
10561056
action_save: Bestellung speichern
1057+
account_statement: Kontostand
10571058
new_funds: Neuer Kontostand
10581059
price: Preis
10591060
reset_article_search: Suche zurücksetzen

config/locales/en.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,7 @@ en:
10541054
notfound: Incorrect URL, this is not your order.
10551055
form:
10561056
action_save: Save order
1057+
account_statement: Account Statement
10571058
new_funds: New account balance
10581059
price: Price
10591060
reset_article_search: Reset search

config/locales/es.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,7 @@ es:
10451045
notfound: Enlace incorrecto, este no es tu pedido
10461046
form:
10471047
action_save: Guardar pedido
1048+
account_statement: Estado de cuenta
10481049
new_funds: Nuevo balance de cuenta
10491050
price: Precio
10501051
reset_article_search: Reinicia la búsqueda

config/locales/fr.yml

+1
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,7 @@ fr:
669669
notfound: ' Mauvaise adresse, ce n''est pas ta commande.'
670670
form:
671671
action_save: Enregistrer ta commande
672+
account_statement: Relevé de compte
672673
new_funds: Nouveau solde
673674
price: Prix
674675
reset_article_search: Réinitialiser la recherche

config/locales/nl.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,7 @@ nl:
10451045
notfound: Foute URL, dit is niet jouw bestelling.
10461046
form:
10471047
action_save: Bestelling opslaan
1048+
account_statement: Rekeningafschrift
10481049
new_funds: Nieuw tegoed
10491050
price: Prijs
10501051
reset_article_search: Alles tonen

config/locales/tr.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,7 @@ tr:
10441044
notfound: Yanlış URL, bu sizin siparişiniz değil.
10451045
form:
10461046
action_save: Siparişi kaydet
1047+
account_statement: Hesap Özeti
10471048
new_funds: Yeni hesap bakiyesi
10481049
price: Fiyat
10491050
reset_article_search: Arama sıfırla

0 commit comments

Comments
 (0)