Add new appearance app to hold all of the base templates, images, icons and external packages related to the frontend and look of the project
This commit is contained in:
@@ -15,12 +15,12 @@ from .permissions import (
|
||||
PERMISSION_SOURCES_SETUP_EDIT, PERMISSION_SOURCES_SETUP_VIEW
|
||||
)
|
||||
|
||||
document_create_multiple = {'text': _('Upload new documents'), 'view': 'sources:document_create_multiple', 'icon': 'main/icons/page_add.png', 'famfam': 'page_add', 'permissions': [PERMISSION_DOCUMENT_CREATE]}
|
||||
document_create_multiple = {'text': _('Upload new documents'), 'view': 'sources:document_create_multiple', 'icon': 'appearance/icons/page_add.png', 'famfam': 'page_add', 'permissions': [PERMISSION_DOCUMENT_CREATE]}
|
||||
document_create_siblings = {'text': _('Clone'), 'view': 'sources:document_create_siblings', 'args': 'object.id', 'famfam': 'page_copy', 'permissions': [PERMISSION_DOCUMENT_CREATE]}
|
||||
|
||||
staging_file_delete = {'text': _('Delete'), 'view': 'sources:staging_file_delete', 'args': ['source.pk', 'object.encoded_filename'], 'famfam': 'delete', 'keep_query': True, 'permissions': [PERMISSION_DOCUMENT_NEW_VERSION, PERMISSION_DOCUMENT_CREATE]}
|
||||
|
||||
setup_sources = {'text': _('Sources'), 'view': 'sources:setup_source_list', 'famfam': 'application_form', 'icon': 'main/icons/application_form.png', 'permissions': [PERMISSION_SOURCES_SETUP_VIEW]}
|
||||
setup_sources = {'text': _('Sources'), 'view': 'sources:setup_source_list', 'famfam': 'application_form', 'icon': 'appearance/icons/application_form.png', 'permissions': [PERMISSION_SOURCES_SETUP_VIEW]}
|
||||
setup_source_create_webform = {'text': _('Add new webform source'), 'view': 'sources:setup_source_create', 'args': '"%s"' % SOURCE_CHOICE_WEB_FORM, 'famfam': 'application_form_add', 'permissions': [PERMISSION_SOURCES_SETUP_CREATE], 'conditional_highlight': lambda context: context.get('source_type') == SOURCE_CHOICE_WEB_FORM and 'source' not in context}
|
||||
setup_source_create_staging_folder = {'text': _('Add new staging folder'), 'view': 'sources:setup_source_create', 'args': '"%s"' % SOURCE_CHOICE_STAGING, 'famfam': 'folder_camera', 'permissions': [PERMISSION_SOURCES_SETUP_CREATE], 'conditional_highlight': lambda context: context.get('source_type') == SOURCE_CHOICE_STAGING and 'source' not in context}
|
||||
setup_source_create_watch_folder = {'text': _('Add new watch folder'), 'view': 'sources:setup_source_create', 'args': '"%s"' % SOURCE_CHOICE_WATCH, 'famfam': 'folder_magnify', 'permissions': [PERMISSION_SOURCES_SETUP_CREATE], 'conditional_highlight': lambda context: context.get('source_type') == SOURCE_CHOICE_WATCH and 'source' not in context}
|
||||
|
||||
+15
-15
@@ -99,7 +99,7 @@ def get_active_tab_links(document=None):
|
||||
|
||||
|
||||
class UploadBaseView(MultiFormView):
|
||||
template_name = 'main/generic_form.html'
|
||||
template_name = 'appearance/generic_form.html'
|
||||
prefixes = {'source_form': 'source', 'document_form': 'document'}
|
||||
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
@@ -129,13 +129,13 @@ class UploadBaseView(MultiFormView):
|
||||
finally:
|
||||
subtemplates_list = [
|
||||
{
|
||||
'name': 'main/generic_multiform_subtemplate.html',
|
||||
'name': 'appearance/generic_multiform_subtemplate.html',
|
||||
'context': {
|
||||
'forms': context['forms'],
|
||||
}
|
||||
},
|
||||
{
|
||||
'name': 'main/generic_list_subtemplate.html',
|
||||
'name': 'appearance/generic_list_subtemplate.html',
|
||||
'context': {
|
||||
'title': _('Files in staging path'),
|
||||
'object_list': staging_filelist,
|
||||
@@ -145,7 +145,7 @@ class UploadBaseView(MultiFormView):
|
||||
]
|
||||
else:
|
||||
subtemplates_list.append({
|
||||
'name': 'main/generic_multiform_subtemplate.html',
|
||||
'name': 'appearance/generic_multiform_subtemplate.html',
|
||||
'context': {
|
||||
'forms': context['forms'],
|
||||
'is_multipart': True
|
||||
@@ -252,7 +252,7 @@ class UploadInteractiveView(UploadBaseView):
|
||||
{
|
||||
'sidebar_subtemplates_list': [
|
||||
{
|
||||
'name': 'main/generic_subtemplate.html',
|
||||
'name': 'appearance/generic_subtemplate.html',
|
||||
'context': {
|
||||
'title': _('Current document type'),
|
||||
'paragraphs': [self.document_type if self.document_type else _('None')],
|
||||
@@ -260,7 +260,7 @@ class UploadInteractiveView(UploadBaseView):
|
||||
}
|
||||
},
|
||||
{
|
||||
'name': 'main/generic_subtemplate.html',
|
||||
'name': 'appearance/generic_subtemplate.html',
|
||||
'context': {
|
||||
'title': _('Current metadata'),
|
||||
'paragraphs': metadata_repr_as_list(decode_metadata_from_url(self.request.GET)),
|
||||
@@ -358,7 +358,7 @@ def staging_file_delete(request, staging_folder_pk, encoded_filename):
|
||||
|
||||
results = get_active_tab_links()
|
||||
|
||||
return render_to_response('main/generic_confirm.html', {
|
||||
return render_to_response('appearance/generic_confirm.html', {
|
||||
'source': staging_folder,
|
||||
'delete_view': True,
|
||||
'object': staging_file,
|
||||
@@ -389,7 +389,7 @@ def setup_source_list(request):
|
||||
]
|
||||
}
|
||||
|
||||
return render_to_response('main/generic_list.html', context,
|
||||
return render_to_response('appearance/generic_list.html', context,
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
|
||||
@@ -413,7 +413,7 @@ def setup_source_edit(request, source_id):
|
||||
else:
|
||||
form = form_class(instance=source)
|
||||
|
||||
return render_to_response('main/generic_form.html', {
|
||||
return render_to_response('appearance/generic_form.html', {
|
||||
'title': _('Edit source: %s') % source,
|
||||
'form': form,
|
||||
'source': source,
|
||||
@@ -449,7 +449,7 @@ def setup_source_delete(request, source_id):
|
||||
'source_type': source.source_type,
|
||||
}
|
||||
|
||||
return render_to_response('main/generic_confirm.html', context,
|
||||
return render_to_response('appearance/generic_confirm.html', context,
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
|
||||
@@ -471,7 +471,7 @@ def setup_source_create(request, source_type):
|
||||
else:
|
||||
form = form_class()
|
||||
|
||||
return render_to_response('main/generic_form.html', {
|
||||
return render_to_response('appearance/generic_form.html', {
|
||||
'title': _('Create new source of type: %s') % cls.class_fullname(),
|
||||
'form': form,
|
||||
'source_type': source_type,
|
||||
@@ -499,7 +499,7 @@ def setup_source_transformation_list(request, source_id):
|
||||
'hide_object': True,
|
||||
}
|
||||
|
||||
return render_to_response('main/generic_list.html', context,
|
||||
return render_to_response('appearance/generic_list.html', context,
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
|
||||
@@ -522,7 +522,7 @@ def setup_source_transformation_edit(request, transformation_id):
|
||||
else:
|
||||
form = SourceTransformationForm(instance=source_transformation)
|
||||
|
||||
return render_to_response('main/generic_form.html', {
|
||||
return render_to_response('appearance/generic_form.html', {
|
||||
'title': _('Edit transformation: %s') % source_transformation,
|
||||
'form': form,
|
||||
'source': source_transformation.content_object,
|
||||
@@ -552,7 +552,7 @@ def setup_source_transformation_delete(request, transformation_id):
|
||||
)
|
||||
return HttpResponseRedirect(redirect_view)
|
||||
|
||||
return render_to_response('main/generic_confirm.html', {
|
||||
return render_to_response('appearance/generic_confirm.html', {
|
||||
'delete_view': True,
|
||||
'transformation': source_transformation,
|
||||
'source': source_transformation.content_object,
|
||||
@@ -588,7 +588,7 @@ def setup_source_transformation_create(request, source_id):
|
||||
else:
|
||||
form = SourceTransformationForm_create()
|
||||
|
||||
return render_to_response('main/generic_form.html', {
|
||||
return render_to_response('appearance/generic_form.html', {
|
||||
'form': form,
|
||||
'source': source,
|
||||
'navigation_object_name': 'source',
|
||||
|
||||
@@ -57,7 +57,7 @@ def staging_file_html_widget(staging_file, click_view=None, page=DEFAULT_PAGE_NU
|
||||
if nolazyload:
|
||||
result.append('<img style="border: 1px solid black;" src="%s" alt="%s" />' % (preview_view, alt_text))
|
||||
else:
|
||||
result.append('<img class="thin_border %s" data-src="%s" src="%s" alt="%s" />' % (image_class, preview_view, static('main/icons/hourglass.png'), alt_text))
|
||||
result.append('<img class="thin_border %s" data-src="%s" src="%s" alt="%s" />' % (image_class, preview_view, static('appearance/icons/hourglass.png'), alt_text))
|
||||
|
||||
if click_view:
|
||||
result.append('</a>')
|
||||
|
||||
@@ -17,7 +17,7 @@ from .models import InteractiveSource
|
||||
|
||||
class DocumentCreateWizard(ViewPermissionCheckMixin, SessionWizardView):
|
||||
form_list = [DocumentTypeSelectForm, MetadataFormSet]
|
||||
template_name = 'main/generic_wizard.html'
|
||||
template_name = 'appearance/generic_wizard.html'
|
||||
extra_context = {}
|
||||
view_permission = PERMISSION_DOCUMENT_CREATE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user