Tweak CRUD form buttons a little.
Change submit button wording for edit forms, from "Update" to "Save". Also show Cancel as a link instead of button.
This commit is contained in:
parent
8bf292ebac
commit
86507cf660
|
@ -1,9 +1,8 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
# Rattail -- Retail Software Framework
|
# Rattail -- Retail Software Framework
|
||||||
# Copyright © 2010-2012 Lance Edgar
|
# Copyright © 2010-2014 Lance Edgar
|
||||||
#
|
#
|
||||||
# This file is part of Rattail.
|
# This file is part of Rattail.
|
||||||
#
|
#
|
||||||
|
@ -21,11 +20,12 @@
|
||||||
# along with Rattail. If not, see <http://www.gnu.org/licenses/>.
|
# along with Rattail. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
"""
|
"""
|
||||||
FormAlchemy Forms
|
FormAlchemy Forms
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from rattail.core import Object
|
from rattail.core import Object
|
||||||
from pyramid.renderers import render
|
from pyramid.renderers import render
|
||||||
from ..db import Session
|
from ..db import Session
|
||||||
|
@ -40,7 +40,7 @@ class AlchemyForm(Object):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
create_label = "Create"
|
create_label = "Create"
|
||||||
update_label = "Update"
|
update_label = "Save"
|
||||||
|
|
||||||
allow_successive_creates = False
|
allow_successive_creates = False
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
% if form.creating and form.allow_successive_creates:
|
% if form.creating and form.allow_successive_creates:
|
||||||
${h.submit('create_and_continue', form.successive_create_label)}
|
${h.submit('create_and_continue', form.successive_create_label)}
|
||||||
% endif
|
% endif
|
||||||
<button type="button" onclick="location.href = '${form.cancel_url}';">Cancel</button>
|
<a href="${form.cancel_url}">Cancel</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
${h.end_form()}
|
${h.end_form()}
|
||||||
|
|
Loading…
Reference in a new issue