Example #1
0
def delete(identifier):
    item = Menu.get(int(identifier))
    if not item: return mismatch()
    headline = localize("administration", "menus.delete_headline")
    text = localize("administration", "menus.delete_description") % (item.name)
    message = localize("administration", "menus.delete_success")
    return delete_form(item, headline, text, message, "/menus")
Example #2
0
def update_entry(identifier):
    item = Blog.get(int(identifier))
    if not item: return mismatch()
    ownership = (item.author == g.user)
    if access(request.path, g.role.id, ownership) != 1: return forbidden()
    return update_form(FormBlog(obj=item), item, "Updated blog entry.",
                       "/blog/%s" % (identifier))
Example #3
0
def update(identifier):
    item = Rule.get(int(identifier))
    if not item: return mismatch()
    form = FormRule(obj=item)
    form.role_id.choices = [(role.id, role.name) for role in Role.all()]
    headline = localize("administration", "rules.update_headline")
    message = localize("administration", "rules.update_success")
    return update_form(item, form, headline, message, "/rules")
Example #4
0
def delete_entry(identifier):
    item = Blog.get(int(identifier))
    if not item: return mismatch()
    ownership = (item.author == g.user)
    if access(request.path, g.role.id, ownership) != 1: return forbidden()
    headline = "%s löschen?" % (item.title)
    text = "Menü %s wirklich löschen?" % (item.title)
    return delete_form(item, headline, text, "Deleted blog entry.", "/blog",
                       "/blog/%s" % (identifier))
Example #5
0
def update(identifier):
    item = Menu.get(int(identifier))
    if not item: return mismatch()
    headline = localize("administration", "menus.update_headline")
    message = localize("administration", "menus.update_success")
    return update_form(item, FormMenu(obj=item), headline, message, "/menus")