mirror of
https://github.com/YunoHost-Apps/ihatemoney_ynh.git
synced 2024-09-03 19:26:15 +02:00
commit
64385e0fa3
6 changed files with 36 additions and 31 deletions
|
@ -19,16 +19,14 @@ def select_multi_checkbox(field, ul_class='', **kwargs):
|
||||||
choice_id = u'toggleField'
|
choice_id = u'toggleField'
|
||||||
js_function = u'toggle();'
|
js_function = u'toggle();'
|
||||||
options = dict(kwargs, id=choice_id, onclick=js_function)
|
options = dict(kwargs, id=choice_id, onclick=js_function)
|
||||||
label = _("Select All/None")
|
html.append(u'<p><a id="selectall" onclick="selectall()">%s</a> | <a id="selectnone" onclick="selectnone()">%s</a></p>'% (_("Select all"), _("Select none")))
|
||||||
html.append(u'<li><label for="%s">%s<span>%s</span></label></li>'
|
|
||||||
% (choice_id, '<input %s /> ' % html_params(**options), label))
|
|
||||||
|
|
||||||
for value, label, checked in field.iter_choices():
|
for value, label, checked in field.iter_choices():
|
||||||
choice_id = u'%s-%s' % (field_id, value)
|
choice_id = u'%s-%s' % (field_id, value)
|
||||||
options = dict(kwargs, name=field.name, value=value, id=choice_id)
|
options = dict(kwargs, name=field.name, value=value, id=choice_id)
|
||||||
if checked:
|
if checked:
|
||||||
options['checked'] = 'checked'
|
options['checked'] = 'checked'
|
||||||
html.append(u'<li><label for="%s">%s<span>%s</span></label></li>'
|
html.append(u'<p><label for="%s">%s<span>%s</span></label></p>'
|
||||||
% (choice_id, '<input %s /> ' % html_params(**options), label))
|
% (choice_id, '<input %s /> ' % html_params(**options), label))
|
||||||
html.append(u'</ul>')
|
html.append(u'</ul>')
|
||||||
return u''.join(html)
|
return u''.join(html)
|
||||||
|
@ -189,6 +187,6 @@ class InviteForm(Form):
|
||||||
|
|
||||||
|
|
||||||
class CreateArchiveForm(Form):
|
class CreateArchiveForm(Form):
|
||||||
start_date = DateField(_("Start date"), validators=[Required(), ])
|
name = TextField(_("Name for this archive (optional)"), validators=[])
|
||||||
end_date = DateField(_("End date"), validators=[Required(), ])
|
start_date = DateField(_("Start date"), validators=[Required()])
|
||||||
name = TextField(_("Name for this archive (optional)"))
|
end_date = DateField(_("End date"), validators=[Required()], default=datetime.now)
|
||||||
|
|
|
@ -189,6 +189,10 @@ tr.payer_line .balance-name{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.modal-body {
|
||||||
|
max-height:455px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Fluid Offsets for Boostrap */
|
/* Fluid Offsets for Boostrap */
|
||||||
|
|
||||||
.row-fluid > [class*="span"]:not([class*="offset"]):first-child{margin-left:0;}
|
.row-fluid > [class*="span"]:not([class*="offset"]):first-child{margin-left:0;}
|
||||||
|
|
|
@ -1,17 +1,18 @@
|
||||||
// Add a script to select all or non of the checkboxes in the add_bill form
|
// Add scripts to select all or non of the checkboxes in the add_bill form
|
||||||
function toggle()
|
function selectall()
|
||||||
{
|
{
|
||||||
var els = document.getElementsByName('payed_for');
|
var els = document.getElementsByName('payed_for');
|
||||||
for(var i =0;i<els.length;i++)
|
for(var i =0;i<els.length;i++)
|
||||||
{
|
|
||||||
if(document.getElementById('toggleField').checked)
|
|
||||||
{
|
{
|
||||||
els[i].checked=true;
|
els[i].checked=true;
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
function selectnone()
|
||||||
|
{
|
||||||
|
var els = document.getElementsByName('payed_for');
|
||||||
|
for(var i =0;i<els.length;i++)
|
||||||
{
|
{
|
||||||
els[i].checked=false;
|
els[i].checked=false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{% extends "layout.html" %}
|
{% extends "layout.html" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<table id="bill_table" class="list_bills common-table zebra-striped">
|
<table id="bill_table" class="table table-striped">
|
||||||
<thead><tr><th>{{ _("Project") }}</th><th>{{ _("Number of members") }}</th><th>{{ _("Number of bills") }}</th><th>{{_("Newest bill")}}</th><th>{{_("Oldest bill")}}</th></tr></thead>
|
<thead><tr><th>{{ _("Project") }}</th><th>{{ _("Number of members") }}</th><th>{{ _("Number of bills") }}</th><th>{{_("Newest bill")}}</th><th>{{_("Oldest bill")}}</th></tr></thead>
|
||||||
<tbody>{% for project in projects %}
|
<tbody>{% for project in projects|sort(attribute='name') %}
|
||||||
<tr>
|
<tr class="{{ loop.cycle("odd", "even") }}">
|
||||||
<td>{{ project.name }}</td><td>{{ project.members | count }}</td><td>{{ project.get_bills().count() }}</td>
|
<td>{{ project.name }}</td><td>{{ project.members | count }}</td><td>{{ project.get_bills().count() }}</td>
|
||||||
{% if project.has_bills() %}
|
{% if project.has_bills() %}
|
||||||
<td>{{ project.get_bills().all()[0].date }}</td>
|
<td>{{ project.get_bills().all()[0].date }}</td>
|
||||||
|
@ -14,7 +14,8 @@
|
||||||
<td></td>
|
<td></td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}</tbody>
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
|
@ -108,6 +108,7 @@
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>{{ _("Create an archive") }}</legend>
|
<legend>{{ _("Create an archive") }}</legend>
|
||||||
{{ form.hidden_tag() }}
|
{{ form.hidden_tag() }}
|
||||||
|
{{ input(form.name) }}
|
||||||
{{ input(form.start_date) }}
|
{{ input(form.start_date) }}
|
||||||
{{ input(form.end_date) }}
|
{{ input(form.end_date) }}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
|
@ -389,7 +389,7 @@ def compute_bills():
|
||||||
return render_template("compute_bills.html")
|
return render_template("compute_bills.html")
|
||||||
|
|
||||||
|
|
||||||
@main.route("/<project_id>/archives/create")
|
@main.route("/<project_id>/archives/create", methods=["GET", "POST"])
|
||||||
def create_archive():
|
def create_archive():
|
||||||
form = CreateArchiveForm()
|
form = CreateArchiveForm()
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
|
|
Loading…
Add table
Reference in a new issue