summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--controller.py10
-rw-r--r--templates/pages/constadd.mako4
-rw-r--r--templates/pages/constedit.mako5
3 files changed, 17 insertions, 2 deletions
diff --git a/controller.py b/controller.py
index 55baa09..824c638 100644
--- a/controller.py
+++ b/controller.py
@@ -309,7 +309,15 @@ class ConstEdit (ConstAdd):
def POST(self, id):
exp = ConstExpense.get(id)
self.get_expense = lambda *x: exp
- return ConstAdd.POST(self)
+
+ if "changeB" in web.input():
+ return ConstAdd.POST(self)
+ elif "deleteB" in web.input():
+ web.ctx.orm.delete(exp)
+ raise web.seeother("/const")
+ else:
+ return self.GET(id)
+
class Cat:
def GET(self):
diff --git a/templates/pages/constadd.mako b/templates/pages/constadd.mako
index 68a276f..2c16544 100644
--- a/templates/pages/constadd.mako
+++ b/templates/pages/constadd.mako
@@ -6,7 +6,9 @@
<form name="add_const_expense" method="post">
${form.render()}
- <input type="submit" />
+ <%block name="form_buttons">
+ <input type="submit" name="changeB"/>
+ </%block>
</form>
<%block name="heading">
diff --git a/templates/pages/constedit.mako b/templates/pages/constedit.mako
index 618df2e..7507bf9 100644
--- a/templates/pages/constedit.mako
+++ b/templates/pages/constedit.mako
@@ -3,3 +3,8 @@
<%block name="heading">
Konstante Ausgabe bearbeiten
</%block>
+
+<%block name="form_buttons">
+ <input type="submit" name="changeB" />
+ <input type="submit" name="deleteB" value="Eintrag löschen" />
+</%block>
/others/cgit.git/commit/Makefile?h=v0.9.0.3&id=fdd559abd6e6ec5e522dc5496b2bcabd36d6ba9d&follow=1'>CGIT 0.8.2.1v0.8.2.1Lars Hjemli1-1/+1 2009-03-15Fix doc-related glitches in Makefile and .gitignoreLars Hjemli2-1/+6 2009-03-15ui-snapshot: avoid segfault when no filename is specifiedLars Hjemli1-6/+17 2009-03-15fix segfault when displaying empty blobsEric Wong1-5/+8 2009-02-19Add support for HEAD requestsLars Hjemli2-0/+7 2009-02-19Add support for ETag in 'plain' viewLars Hjemli4-0/+5 2009-02-12ui-tree: escape ascii-text properly in hexdump viewLars Hjemli1-4/+9 2009-02-12Makefile: add doc-related targetsLars Hjemli1-2/+17