forked from DGNum/gestioCOF
Ajout de boutons raccourcis pour les comptes et les caisses
This commit is contained in:
parent
c6a24733f3
commit
c12efee413
3 changed files with 32 additions and 2 deletions
|
@ -85,6 +85,12 @@ input[type=number]::-webkit-outer-spin-button {
|
||||||
font-weight:bold;
|
font-weight:bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#account .buttons {
|
||||||
|
position:absolute;
|
||||||
|
bottom:0;
|
||||||
|
right:0;
|
||||||
|
}
|
||||||
|
|
||||||
@media (min-width: 600px) {
|
@media (min-width: 600px) {
|
||||||
#account_form input { font-size:60px; }
|
#account_form input { font-size:60px; }
|
||||||
|
|
||||||
|
@ -151,6 +157,12 @@ input[type=number]::-webkit-outer-spin-button {
|
||||||
padding:0 15px;
|
padding:0 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#checkout_data .buttons {
|
||||||
|
position:absolute;
|
||||||
|
bottom:0;
|
||||||
|
right:0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Second part
|
* Second part
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -36,6 +36,8 @@
|
||||||
<span id="account-promo"></span>
|
<span id="account-promo"></span>
|
||||||
</div>
|
</div>
|
||||||
<div id="account-email" class="data_line"></div>
|
<div id="account-email" class="data_line"></div>
|
||||||
|
<div class="buttons">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -53,6 +55,8 @@
|
||||||
à <span id="checkout-last_statement_at"></span>
|
à <span id="checkout-last_statement_at"></span>
|
||||||
par <span id="checkout-last_statement_by_trigramme"></span>
|
par <span id="checkout-last_statement_by_trigramme"></span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="buttons">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -139,11 +143,12 @@ $(document).ready(function() {
|
||||||
// -----
|
// -----
|
||||||
|
|
||||||
// Initializing
|
// Initializing
|
||||||
|
var account_container = $('#account');
|
||||||
var triInput = $('#id_trigramme')
|
var triInput = $('#id_trigramme')
|
||||||
var triPattern = /^[^a-z]{3}$/
|
var triPattern = /^[^a-z]{3}$/
|
||||||
var account_data = {}
|
var account_data = {}
|
||||||
var account_data_default = {
|
var account_data_default = {
|
||||||
'pk' : 0,
|
'id' : 0,
|
||||||
'name' : '',
|
'name' : '',
|
||||||
'email': '',
|
'email': '',
|
||||||
'is_cof' : '',
|
'is_cof' : '',
|
||||||
|
@ -178,6 +183,12 @@ $(document).ready(function() {
|
||||||
} else {
|
} else {
|
||||||
$('#account').attr('data-balance', 'neg');
|
$('#account').attr('data-balance', 'neg');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var buttons = '';
|
||||||
|
if (account_data['id'] != 0) {
|
||||||
|
buttons += '<a href="/k-fet/accounts/'+account_data['trigramme']+'" class="btn btn-primary" target="_blank" title="Modifier"><span class="glyphicon glyphicon-cog"></span></a>';
|
||||||
|
}
|
||||||
|
account_container.find('.buttons').html(buttons);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear data
|
// Clear data
|
||||||
|
@ -233,6 +244,7 @@ $(document).ready(function() {
|
||||||
// -----
|
// -----
|
||||||
|
|
||||||
// Initializing
|
// Initializing
|
||||||
|
var checkout_container = $('#checkout');
|
||||||
var checkoutInput = $('#id_checkout_select');
|
var checkoutInput = $('#id_checkout_select');
|
||||||
var checkout_data = {}
|
var checkout_data = {}
|
||||||
var checkout_data_default = {
|
var checkout_data_default = {
|
||||||
|
@ -253,6 +265,12 @@ $(document).ready(function() {
|
||||||
for (var elem in checkout_data) {
|
for (var elem in checkout_data) {
|
||||||
$('#checkout-'+elem).text(checkout_data[elem]);
|
$('#checkout-'+elem).text(checkout_data[elem]);
|
||||||
}
|
}
|
||||||
|
var buttons = '';
|
||||||
|
if (checkout_data['id'] !== 0) {
|
||||||
|
buttons += '<a class="btn btn-primary" href="/k-fet/checkouts/'+checkout_data['id']+'/statements/add" title="Effectuer un relevé" target="_blank"><span class="glyphicon glyphicon-euro"></span></a>';
|
||||||
|
buttons += '<a class="btn btn-primary" href="/k-fet/checkouts/'+checkout_data['id']+'" title="Modifier" target="_blank"><span class="glyphicon glyphicon-cog"></span></a>';
|
||||||
|
}
|
||||||
|
checkout_container.find('.buttons').html(buttons);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear data
|
// Clear data
|
||||||
|
|
|
@ -414,7 +414,7 @@ def kpsul(request):
|
||||||
def kpsul_account_data(request):
|
def kpsul_account_data(request):
|
||||||
trigramme = request.POST.get('trigramme', '')
|
trigramme = request.POST.get('trigramme', '')
|
||||||
account = get_object_or_404(Account, trigramme=trigramme)
|
account = get_object_or_404(Account, trigramme=trigramme)
|
||||||
data = { 'pk': account.pk, 'name': account.name, 'email': account.email,
|
data = { 'id': account.pk, 'name': account.name, 'email': account.email,
|
||||||
'is_cof': account.is_cof, 'promo': account.promo,
|
'is_cof': account.is_cof, 'promo': account.promo,
|
||||||
'balance': account.balance, 'is_frozen': account.is_frozen,
|
'balance': account.balance, 'is_frozen': account.is_frozen,
|
||||||
'departement': account.departement, 'nickname': account.nickname,
|
'departement': account.departement, 'nickname': account.nickname,
|
||||||
|
|
Loading…
Reference in a new issue