mirror of
https://github.com/YunoHost-Apps/ihatemoney_ynh.git
synced 2024-09-03 19:26:15 +02:00
change the icons, simplify some javascript
This commit is contained in:
parent
672f2a1ca1
commit
47010d4cd7
10 changed files with 47 additions and 16 deletions
|
@ -2,7 +2,7 @@
|
||||||
from flask import *
|
from flask import *
|
||||||
|
|
||||||
from models import db, Project, Person, Bill
|
from models import db, Project, Person, Bill
|
||||||
from forms import (ProjectForm, EditProjectForm, MemberForm, BillForm,
|
from forms import (ProjectForm, EditProjectForm, MemberForm, BillForm,
|
||||||
get_billform_for)
|
get_billform_for)
|
||||||
from utils import for_all_methods
|
from utils import for_all_methods
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ from werkzeug import Response
|
||||||
|
|
||||||
api = Blueprint("api", __name__, url_prefix="/api")
|
api = Blueprint("api", __name__, url_prefix="/api")
|
||||||
|
|
||||||
|
|
||||||
def check_project(*args, **kwargs):
|
def check_project(*args, **kwargs):
|
||||||
"""Check the request for basic authentication for a given project.
|
"""Check the request for basic authentication for a given project.
|
||||||
|
|
||||||
|
@ -134,8 +135,8 @@ class BillHandler(object):
|
||||||
|
|
||||||
project_resource = RESTResource(
|
project_resource = RESTResource(
|
||||||
name="project",
|
name="project",
|
||||||
route="/projects",
|
route="/projects",
|
||||||
app=api,
|
app=api,
|
||||||
actions=["add", "update", "delete", "get"],
|
actions=["add", "update", "delete", "get"],
|
||||||
handler=ProjectHandler())
|
handler=ProjectHandler())
|
||||||
|
|
||||||
|
|
BIN
budget/static/delete.png
Normal file
BIN
budget/static/delete.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 274 B |
BIN
budget/static/deleter.png
Normal file
BIN
budget/static/deleter.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 226 B |
BIN
budget/static/edit.png
Normal file
BIN
budget/static/edit.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 258 B |
|
@ -130,14 +130,12 @@ div.topbar ul.secondary-nav { padding-right: 75px; }
|
||||||
.bill-actions {
|
.bill-actions {
|
||||||
padding-top: 2px;
|
padding-top: 2px;
|
||||||
padding-bottom: 2px;
|
padding-bottom: 2px;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.edit img {
|
.edit img, .delete img{
|
||||||
height: 24px;
|
height: 16px;
|
||||||
}
|
margin-right: 5px;
|
||||||
|
|
||||||
.delete img {
|
|
||||||
height: 24px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.balance-value{
|
.balance-value{
|
||||||
|
@ -159,3 +157,30 @@ tr.payer_line .balance-name{
|
||||||
color:green;
|
color:green;
|
||||||
text-indent:5px;
|
text-indent:5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.action {
|
||||||
|
position: absolute;
|
||||||
|
left: 10px;
|
||||||
|
width: 220px;
|
||||||
|
background: #000 ;
|
||||||
|
opacity: 0.6;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.action a, .action a:hover {
|
||||||
|
height: 16px;
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.delete a, .delete a:hover {
|
||||||
|
background: url('deleter.png') left no-repeat;
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.reactivate a, .reactivate a:hover {
|
||||||
|
background: url('reactivate.png') left no-repeat;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
#bill-form > fieldset {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 3.8 KiB |
BIN
budget/static/reactivate.png
Normal file
BIN
budget/static/reactivate.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 259 B |
Binary file not shown.
Before Width: | Height: | Size: 4.2 KiB |
|
@ -40,9 +40,10 @@
|
||||||
$('#cancel-form').click(hide_form);
|
$('#cancel-form').click(hide_form);
|
||||||
|
|
||||||
// ask for confirmation before removing an user
|
// ask for confirmation before removing an user
|
||||||
$('a.remove').each(function(){
|
$('.action').each(function(){
|
||||||
$(this).hide();
|
$(this).hide();
|
||||||
$(this).click(function(){
|
var link = $(this).find('a');
|
||||||
|
link.click(function(){
|
||||||
if ($(this).hasClass("confirm")){
|
if ($(this).hasClass("confirm")){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -54,9 +55,9 @@
|
||||||
|
|
||||||
// display the remove button on mouse over (and hide them per default)
|
// display the remove button on mouse over (and hide them per default)
|
||||||
$('.balance tr').hover(function(){
|
$('.balance tr').hover(function(){
|
||||||
$(this).find('.remove').show();
|
$(this).find('.action').show();
|
||||||
}, function(){
|
}, function(){
|
||||||
$(this).find('.remove').hide();
|
$(this).find('.action').hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
$.datepicker.setDefaults({'dateFormat': 'yy-mm-dd'});
|
$.datepicker.setDefaults({'dateFormat': 'yy-mm-dd'});
|
||||||
|
@ -98,7 +99,11 @@
|
||||||
<td class="balance-value {% if balance[member.id] > 0 %}positive{% elif balance[member.id] < 0 %}negative{% endif %}">
|
<td class="balance-value {% if balance[member.id] > 0 %}positive{% elif balance[member.id] < 0 %}negative{% endif %}">
|
||||||
{% if balance[member.id] > 0 %}+{% endif %}{{ balance[member.id] }}
|
{% if balance[member.id] > 0 %}+{% endif %}{{ balance[member.id] }}
|
||||||
</td>
|
</td>
|
||||||
<td> {% if member.activated %}<a class="remove" href="{{ url_for(".remove_member", member_id=member.id) }}">{{ _("delete") }}</a>{% else %}<a href="{{ url_for(".reactivate", member_id=member.id) }}">{{ _("reactivate") }}</a>{% endif %}</td>
|
{% if member.activated %}
|
||||||
|
<td class="action delete"> <a href="{{ url_for(".remove_member", member_id=member.id) }}">{{ _("delete") }}</a></td>
|
||||||
|
{% else %}
|
||||||
|
<td class="action reactivate"> <a href="{{ url_for(".reactivate", member_id=member.id) }}">{{ _("reactivate") }}</a></td>
|
||||||
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -130,7 +135,7 @@
|
||||||
<td>{{ "%0.2f"|format(bill.amount) }} ({{ "%0.2f"|format(bill.pay_each()) }} {{ _("each") }})</td>
|
<td>{{ "%0.2f"|format(bill.amount) }} ({{ "%0.2f"|format(bill.pay_each()) }} {{ _("each") }})</td>
|
||||||
<td class="bill-actions">
|
<td class="bill-actions">
|
||||||
<a class="edit" href="{{ url_for(".edit_bill", bill_id=bill.id) }}" title="{{ _("edit") }}">
|
<a class="edit" href="{{ url_for(".edit_bill", bill_id=bill.id) }}" title="{{ _("edit") }}">
|
||||||
<img src="{{ url_for("static", filename="pen.png") }}" />
|
<img src="{{ url_for("static", filename="edit.png") }}" />
|
||||||
</a>
|
</a>
|
||||||
<a class="delete" href="{{ url_for(".delete_bill", bill_id=bill.id) }}" title="{{ _("delete") }}">
|
<a class="delete" href="{{ url_for(".delete_bill", bill_id=bill.id) }}" title="{{ _("delete") }}">
|
||||||
<img src="{{ url_for("static", filename="delete.png") }}" />
|
<img src="{{ url_for("static", filename="delete.png") }}" />
|
||||||
|
|
|
@ -18,7 +18,7 @@ are directly handled in the forms module.
|
||||||
|
|
||||||
Basically, this blueprint takes care of the authentication and provides
|
Basically, this blueprint takes care of the authentication and provides
|
||||||
some shortcuts to make your life better when coding (see `pull_project`
|
some shortcuts to make your life better when coding (see `pull_project`
|
||||||
and `add_project_id` for a quick overview
|
and `add_project_id` for a quick overview)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
main = Blueprint("main", __name__)
|
main = Blueprint("main", __name__)
|
||||||
|
|
Loading…
Reference in a new issue