magic-removal: command stuff for stacked inline editing
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1771 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
c017d60d15
commit
4d3374c652
|
@ -141,6 +141,10 @@ input[type=submit].default:active { background-image:url(../img/admin/default-bg
|
||||||
.submit-row input { margin:0 0 0 5px; }
|
.submit-row input { margin:0 0 0 5px; }
|
||||||
.submit-row .float-left { padding-top:.1em; }
|
.submit-row .float-left { padding-top:.1em; }
|
||||||
|
|
||||||
|
/* ACTIONS */
|
||||||
|
.actions { border-bottom:1px solid #eee; text-align:right; }
|
||||||
|
.collection { border-top: 1ex solid #7CA0C7; }
|
||||||
|
|
||||||
/* FORM ROWS */
|
/* FORM ROWS */
|
||||||
.form-row { clear:both; padding:8px 12px; font-size:11px; }
|
.form-row { clear:both; padding:8px 12px; font-size:11px; }
|
||||||
html>body .form-row { border-bottom:1px solid #eee; }
|
html>body .form-row { border-bottom:1px solid #eee; }
|
||||||
|
|
|
@ -12,5 +12,11 @@
|
||||||
{% admin_field_line bound_field %}
|
{% admin_field_line bound_field %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
<div class="item actions">
|
||||||
|
<button class="deletebutton" name="command" value="{{bound_related_object.relation.var_name}}.{{fcw.index}}.delete">Delete</button>
|
||||||
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
<div class="collection actions">
|
||||||
|
<button class="addbutton" name="command" value="{{bound_related_object.relation.var_name}}.add">Add</button>
|
||||||
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
|
@ -7,7 +7,7 @@
|
||||||
<th{{ fw.header_class_attribute }}>{{ fw.field.verbose_name|capfirst }}</th>
|
<th{{ fw.header_class_attribute }}>{{ fw.field.verbose_name|capfirst }}</th>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<td><td>
|
<th><th>
|
||||||
</tr></thead>
|
</tr></thead>
|
||||||
{% for fcw in bound_related_object.form_field_collection_wrappers %}
|
{% for fcw in bound_related_object.form_field_collection_wrappers %}
|
||||||
{% if change %}{% if original_row_needed %}
|
{% if change %}{% if original_row_needed %}
|
||||||
|
@ -31,14 +31,15 @@
|
||||||
{% if bound_related_object.show_url %}<td>
|
{% if bound_related_object.show_url %}<td>
|
||||||
{% if fcw.obj.original %}<a href="/r/{{ fcw.obj.original.content_type_id }}/{{ fcw.obj.original.id }}/">View on site</a>{% endif %}
|
{% if fcw.obj.original %}<a href="/r/{{ fcw.obj.original.content_type_id }}/{{ fcw.obj.original.id }}/">View on site</a>{% endif %}
|
||||||
</td>{% endif %}
|
</td>{% endif %}
|
||||||
<td>
|
<td class="actions item" >
|
||||||
<button class="deletebutton" name="command" value="{{bound_related_object.relation.var_name}}.{{fcw.index}}.delete">Delete</button>
|
<button class="deletebutton" name="command" value="{{bound_related_object.relation.var_name}}.{{fcw.index}}.delete">Delete</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
{% endfor %} </table>
|
{% endfor %} </table>
|
||||||
|
<div class="actions collection">
|
||||||
<button class="addbutton" name="command" value="{{bound_related_object.relation.var_name}}.add">Add</button>
|
<button class="addbutton" name="command" value="{{bound_related_object.relation.var_name}}.add">Add</button>
|
||||||
|
</div>
|
||||||
{% for fcw in bound_related_object.form_field_collection_wrappers %}
|
{% for fcw in bound_related_object.form_field_collection_wrappers %}
|
||||||
{% for bound_field in fcw.bound_fields %}
|
{% for bound_field in fcw.bound_fields %}
|
||||||
{% if bound_field.hidden %}
|
{% if bound_field.hidden %}
|
||||||
|
|
|
@ -139,8 +139,8 @@ class StackedBoundRelatedObject(BoundRelatedObject):
|
||||||
super(StackedBoundRelatedObject, self).__init__(related_object, field_mapping, original)
|
super(StackedBoundRelatedObject, self).__init__(related_object, field_mapping, original)
|
||||||
fields = self.relation.editable_fields()
|
fields = self.relation.editable_fields()
|
||||||
self.field_mappings.fill()
|
self.field_mappings.fill()
|
||||||
self.form_field_collection_wrappers = [FormFieldCollectionWrapper(field_mapping ,fields)
|
self.form_field_collection_wrappers = [FormFieldCollectionWrapper(field_mapping ,fields, i)
|
||||||
for field_mapping in self.field_mappings]
|
for (i,field_mapping) in self.field_mappings.items()]
|
||||||
self.show_url = original and hasattr(self.relation.opts, 'get_absolute_url')
|
self.show_url = original and hasattr(self.relation.opts, 'get_absolute_url')
|
||||||
|
|
||||||
def template_name(self):
|
def template_name(self):
|
||||||
|
|
Loading…
Reference in New Issue