Update views that used generic_detail to use generic_form in read_only mode. Remove now obsolete generic_detail template
This commit is contained in:
@@ -122,9 +122,10 @@ def acl_detail_for(request, actor, obj):
|
||||
},
|
||||
'access_object': obj,
|
||||
'navigation_object_list': ['object', 'access_object'],
|
||||
'read_only': True,
|
||||
}
|
||||
|
||||
return render_to_response('appearance/generic_detail.html', context,
|
||||
return render_to_response('appearance/generic_form.html', context,
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
|
||||
@@ -434,7 +435,7 @@ def acl_class_acl_detail(request, access_object_class_gid, holder_object_gid):
|
||||
},
|
||||
]
|
||||
|
||||
return render_to_response('appearance/generic_detail.html', {
|
||||
return render_to_response('appearance/generic_form.html', {
|
||||
'object': access_object_class,
|
||||
'subtemplates_list': subtemplates_list,
|
||||
'multi_select_item_properties': {
|
||||
@@ -442,6 +443,7 @@ def acl_class_acl_detail(request, access_object_class_gid, holder_object_gid):
|
||||
'holder_gid': lambda x: actor.gid,
|
||||
'access_object_class_gid': lambda x: access_object_class.gid,
|
||||
},
|
||||
'read_only': True,
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
{% extends 'appearance/base.html' %}
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
{% load subtemplates_tags %}
|
||||
|
||||
{% block title %} :: {% with 'true' as read_only %}{% include 'appearance/calculate_form_title.html' %}{% endwith %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if form %}
|
||||
{% with 'true' as read_only %}
|
||||
{% include 'appearance/generic_form_subtemplate.html' %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
|
||||
<div class="row">
|
||||
{% for subtemplate in subtemplates_list %}
|
||||
|
||||
{% if subtemplate.column_class %}
|
||||
<div class="{{ subtemplate.column_class }}">
|
||||
{% else %}
|
||||
<div class="col-xs-12">
|
||||
{% endif %}
|
||||
{% with "true" as read_only %}
|
||||
{% render_subtemplate subtemplate.name subtemplate.context as rendered_subtemplate %}
|
||||
{{ rendered_subtemplate }}
|
||||
{% endwith %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -96,9 +96,10 @@ class HomeView(TemplateView):
|
||||
class LicenseView(ExtraContextMixin, TemplateView):
|
||||
extra_context = {
|
||||
'form': LicenseForm(),
|
||||
'read_only': True,
|
||||
'title': _('License'),
|
||||
}
|
||||
template_name = 'appearance/generic_detail.html'
|
||||
template_name = 'appearance/generic_form.html'
|
||||
|
||||
|
||||
class MaintenanceMenuView(TemplateView):
|
||||
|
||||
@@ -136,10 +136,11 @@ def document_properties(request, document_id):
|
||||
|
||||
document_properties_form = DocumentPropertiesForm(instance=document, extra_fields=document_fields)
|
||||
|
||||
return render_to_response('appearance/generic_detail.html', {
|
||||
return render_to_response('appearance/generic_form.html', {
|
||||
'form': document_properties_form,
|
||||
'document': document,
|
||||
'object': document,
|
||||
'read_only': True,
|
||||
'title': _('Properties for document: %s') % document,
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
@@ -156,11 +157,12 @@ def document_preview(request, document_id):
|
||||
|
||||
preview_form = DocumentPreviewForm(document=document)
|
||||
|
||||
return render_to_response('appearance/generic_detail.html', {
|
||||
return render_to_response('appearance/generic_form.html', {
|
||||
'document': document,
|
||||
'form': preview_form,
|
||||
'hide_labels': True,
|
||||
'object': document,
|
||||
'read_only': True,
|
||||
'title': _('Preview of document: %s') % document,
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
@@ -177,11 +179,12 @@ def document_content(request, document_id):
|
||||
|
||||
content_form = DocumentContentForm(document=document)
|
||||
|
||||
return render_to_response('appearance/generic_detail.html', {
|
||||
return render_to_response('appearance/generic_form.html', {
|
||||
'document': document,
|
||||
'form': content_form,
|
||||
'hide_labels': True,
|
||||
'object': document,
|
||||
'read_only': True,
|
||||
'title': _('Content of document: %s') % document,
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
@@ -595,13 +598,14 @@ def document_page_view(request, document_page_id):
|
||||
else:
|
||||
zoom_text = ''
|
||||
|
||||
return render_to_response('appearance/generic_detail.html', {
|
||||
return render_to_response('appearance/generic_form.html', {
|
||||
'access_object': document_page.document,
|
||||
'form': document_page_form,
|
||||
'navigation_object_list': ['page'],
|
||||
'page': document_page,
|
||||
'rotation': rotation,
|
||||
'title': ' '.join([base_title, zoom_text]),
|
||||
'read_only': True,
|
||||
'zoom': zoom,
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
@@ -619,11 +623,12 @@ def document_page_text(request, document_page_id):
|
||||
|
||||
document_page_form = DocumentPageForm_text(instance=document_page)
|
||||
|
||||
return render_to_response('appearance/generic_detail.html', {
|
||||
return render_to_response('appearance/generic_form.html', {
|
||||
'access_object': document_page.document,
|
||||
'form': document_page_form,
|
||||
'page': document_page,
|
||||
'navigation_object_list': ['page'],
|
||||
'read_only': True,
|
||||
'title': _('Details for: %s') % document_page,
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ def role_permissions(request, role_id):
|
||||
},
|
||||
]
|
||||
|
||||
return render_to_response('appearance/generic_detail.html', {
|
||||
return render_to_response('appearance/generic_form.html', {
|
||||
'form': form,
|
||||
'object': role,
|
||||
'subtemplates_list': subtemplates_list,
|
||||
|
||||
Reference in New Issue
Block a user