diff --git a/budget/api.py b/budget/api.py index 9d41b3c..4ca04f2 100644 --- a/budget/api.py +++ b/budget/api.py @@ -2,7 +2,7 @@ from flask import * from models import db, Project, Person, Bill -from forms import (ProjectForm, EditProjectForm, MemberForm, BillForm, +from forms import (ProjectForm, EditProjectForm, MemberForm, BillForm, get_billform_for) from utils import for_all_methods @@ -12,6 +12,7 @@ from werkzeug import Response api = Blueprint("api", __name__, url_prefix="/api") + def check_project(*args, **kwargs): """Check the request for basic authentication for a given project. @@ -134,8 +135,8 @@ class BillHandler(object): project_resource = RESTResource( name="project", - route="/projects", - app=api, + route="/projects", + app=api, actions=["add", "update", "delete", "get"], handler=ProjectHandler()) diff --git a/budget/static/delete.png b/budget/static/delete.png new file mode 100644 index 0000000..aa786a3 Binary files /dev/null and b/budget/static/delete.png differ diff --git a/budget/static/deleter.png b/budget/static/deleter.png new file mode 100644 index 0000000..04a23f3 Binary files /dev/null and b/budget/static/deleter.png differ diff --git a/budget/static/edit.png b/budget/static/edit.png new file mode 100644 index 0000000..02662fc Binary files /dev/null and b/budget/static/edit.png differ diff --git a/budget/static/main.css b/budget/static/main.css index 9505e88..830ef98 100644 --- a/budget/static/main.css +++ b/budget/static/main.css @@ -130,14 +130,12 @@ div.topbar ul.secondary-nav { padding-right: 75px; } .bill-actions { padding-top: 2px; padding-bottom: 2px; + text-align: center; } -.edit img { - height: 24px; -} - -.delete img { - height: 24px; +.edit img, .delete img{ + height: 16px; + margin-right: 5px; } .balance-value{ @@ -159,3 +157,30 @@ tr.payer_line .balance-name{ color:green; 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; +} diff --git a/budget/static/pen.png b/budget/static/pen.png deleted file mode 100644 index f486e40..0000000 Binary files a/budget/static/pen.png and /dev/null differ diff --git a/budget/static/reactivate.png b/budget/static/reactivate.png new file mode 100644 index 0000000..54c60c0 Binary files /dev/null and b/budget/static/reactivate.png differ diff --git a/budget/static/scissors.png b/budget/static/scissors.png deleted file mode 100644 index 2a40f0b..0000000 Binary files a/budget/static/scissors.png and /dev/null differ diff --git a/budget/templates/list_bills.html b/budget/templates/list_bills.html index 0cbf583..8754569 100644 --- a/budget/templates/list_bills.html +++ b/budget/templates/list_bills.html @@ -40,9 +40,10 @@ $('#cancel-form').click(hide_form); // ask for confirmation before removing an user - $('a.remove').each(function(){ + $('.action').each(function(){ $(this).hide(); - $(this).click(function(){ + var link = $(this).find('a'); + link.click(function(){ if ($(this).hasClass("confirm")){ return true; } @@ -54,9 +55,9 @@ // display the remove button on mouse over (and hide them per default) $('.balance tr').hover(function(){ - $(this).find('.remove').show(); + $(this).find('.action').show(); }, function(){ - $(this).find('.remove').hide(); + $(this).find('.action').hide(); }); $.datepicker.setDefaults({'dateFormat': 'yy-mm-dd'}); @@ -98,7 +99,11 @@