add FieldSet.allow_continue, updated template
This commit is contained in:
parent
49a3aaa6bd
commit
7ab44b764e
3 changed files with 10 additions and 0 deletions
|
@ -80,6 +80,7 @@ class FieldSet(formalchemy.FieldSet):
|
|||
self.route_name = route_name or (self.class_name + 's')
|
||||
self.url_action = url_action or url(self.route_name)
|
||||
self.url_cancel = url_cancel or url(self.route_name)
|
||||
self.allow_continue = kwargs.pop('allow_continue', False)
|
||||
|
||||
def get_display_text(self):
|
||||
return unicode(self.model)
|
||||
|
|
|
@ -390,8 +390,10 @@ div.field-couple div.field select {
|
|||
width: 320px;
|
||||
}
|
||||
|
||||
/* unbound checkbox field, e.g. 'add another' */
|
||||
div.checkbox {
|
||||
margin: 15px 0px;
|
||||
padding-left: 3px;
|
||||
}
|
||||
|
||||
table.fieldset tbody tr {
|
||||
|
|
|
@ -35,6 +35,13 @@
|
|||
|
||||
% endfor
|
||||
|
||||
% if fieldset.allow_continue:
|
||||
<div class="checkbox">
|
||||
${h.checkbox('add-another', checked=True)}
|
||||
<label for="add-another">Add another after this one</label>
|
||||
</div>
|
||||
% endif
|
||||
|
||||
<div class="buttons">
|
||||
${h.submit('submit', "Save")}
|
||||
<button type="button" class="cancel">Cancel</button>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue