diff --git a/apps/common/templates/generic_detail_subtemplate.html b/apps/common/templates/generic_detail_subtemplate.html new file mode 100644 index 0000000000..4db34110a5 --- /dev/null +++ b/apps/common/templates/generic_detail_subtemplate.html @@ -0,0 +1,77 @@ +{% load i18n %} + +{% block javascript %} + +{% endblock %} + +{% block stylesheets %} + +{% endblock %} + +{% block content %} + + {% if form %} + {% with "true" as read_only %} +
+ {% include "generic_form_subtemplate.html" %} +
+ {% endwith %} + {% endif %} + + {% for subtemplate in subtemplates %} + {% include subtemplate %} + {% endfor %} + + {% for form in form_list %} + {% with form.submit_method as submit_method %} + {% with form.striptags as striptags %} + {% with form.title as title %} + {% with form.object as object %} + {% with form.object_name as object_name %} + {% with form.form_action as form_action %} + {% with "true" as read_only %} + {% with form.form as form %} + {% include "generic_form_subtemplate.html" %} + {% endwith %} + + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endfor %} + + + {% for subtemplate in subtemplates_dict %} + {% with subtemplate.title as title %} + {% with subtemplate.object_list as object_list %} + {% with subtemplate.extra_columns as extra_columns %} + {% with subtemplate.hide_object as hide_object %} + {% with subtemplate.main_object as main_object %} + {% with subtemplate.hide_link as hide_link %} + {% with subtemplate.hide_header as hide_header %} + {% include subtemplate.name %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endfor %} +{% endblock %} + diff --git a/apps/common/templates/generic_list.html b/apps/common/templates/generic_list.html index fe71bfc4b6..71aba418b1 100755 --- a/apps/common/templates/generic_list.html +++ b/apps/common/templates/generic_list.html @@ -3,6 +3,56 @@ {% block title %} :: {% blocktrans %}List of {{ title }}{% endblocktrans %}{% endblock %} {#{% block secondary_links %}{{ secondary_links|safe }}{% endblock %}#} + +{% block sidebar %} + {% for subtemplate in sidebar_subtemplates %} +
+ {% include subtemplate %} +
+ {% endfor %} + + {% for subtemplate in sidebar_subtemplates_list %} + {% with subtemplate.title as title %} + {% with subtemplate.object_list as object_list %} + {% with subtemplate.extra_columns as extra_columns %} + {% with subtemplate.hide_object as hide_object %} + {% with subtemplate.main_object as main_object %} + {% with subtemplate.hide_link as hide_link %} + {% with subtemplate.hide_header as hide_header %} + {% with subtemplate.hide_columns as hide_columns %} + {% with "true" as side_bar %} + + {% with subtemplate.submit_method as submit_method %} + {% with subtemplate.striptags as striptags %} + {% with subtemplate.title as title %} + {% with subtemplate.object as object %} + {% with subtemplate.object_name as object_name %} + {% with subtemplate.form_action as form_action %} + {% with subtemplate.form as form %} + + {% include subtemplate.name %} + + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + + + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endwith %} + {% endfor %} +{% endblock %} + {% block content %} {% include "generic_list_subtemplate.html" %} diff --git a/apps/ocr/forms.py b/apps/ocr/forms.py new file mode 100644 index 0000000000..07cf73e458 --- /dev/null +++ b/apps/ocr/forms.py @@ -0,0 +1,16 @@ +from django import forms +from django.utils.translation import ugettext_lazy as _ + +from common.forms import DetailForm + +from models import DocumentQueue + + +class DocumentQueueForm_view(DetailForm): + class Meta: + model = DocumentQueue + exclude = ('name', 'label') + + def __init__(self, *args, **kwargs): + super(DocumentQueueForm_view, self).__init__(*args, **kwargs) + self.fields['state'].widget.attrs['class'] = 'undecorated_list' diff --git a/apps/ocr/views.py b/apps/ocr/views.py index 9000682975..d49e07a747 100755 --- a/apps/ocr/views.py +++ b/apps/ocr/views.py @@ -20,6 +20,7 @@ from tasks import do_document_ocr_task from literals import QUEUEDOCUMENT_STATE_PENDING, \ QUEUEDOCUMENT_STATE_PROCESSING, QUEUEDOCUMENT_STATE_ERROR, \ DOCUMENTQUEUE_STATE_STOPPED, DOCUMENTQUEUE_STATE_ACTIVE +from forms import DocumentQueueForm_view def queue_document_list(request, queue_name='default'): permissions = [PERMISSION_OCR_DOCUMENT] @@ -29,7 +30,7 @@ def queue_document_list(request, queue_name='default'): raise Http404(e) document_queue = get_object_or_404(DocumentQueue, name=queue_name) - + return object_list( request, queryset=document_queue.queuedocument_set.all(), @@ -45,9 +46,15 @@ def queue_document_list(request, queue_name='default'): {'name':'state', 'attribute': lambda x: x.get_state_display()}, {'name':'result', 'attribute':'result'}, ], + 'sidebar_subtemplates_list':[ + { + 'title':_(u'document queue properties'), + 'name':'generic_detail_subtemplate.html', + 'form':DocumentQueueForm_view(instance=document_queue), + }], }, ) - + def queue_document_delete(request, queue_document_id): permissions = [PERMISSION_OCR_DOCUMENT_DELETE] diff --git a/site_media/css/override.css b/site_media/css/override.css index bb1ceff2ef..e0982e24cd 100755 --- a/site_media/css/override.css +++ b/site_media/css/override.css @@ -13,3 +13,7 @@ .nowrap { white-space: nowrap; } + +.undecorated_list { + list-style-type: none; +}