Code cleanups
This commit is contained in:
@@ -10,12 +10,12 @@ from django.utils.translation import ugettext
|
||||
from common.forms import DetailForm
|
||||
from common.widgets import TextAreaDiv
|
||||
|
||||
from .models import (Document, DocumentType,
|
||||
DocumentPage, DocumentPageTransformation, DocumentTypeFilename,
|
||||
DocumentVersion)
|
||||
from .literals import (RELEASE_LEVEL_FINAL, RELEASE_LEVEL_CHOICES,
|
||||
DEFAULT_ZIP_FILENAME)
|
||||
from .widgets import DocumentPageImageWidget, DocumentPagesCarouselWidget
|
||||
from .models import (Document, DocumentType, DocumentPage,
|
||||
DocumentPageTransformation, DocumentTypeFilename,
|
||||
DocumentVersion)
|
||||
from .literals import (DEFAULT_ZIP_FILENAME, RELEASE_LEVEL_CHOICES,
|
||||
RELEASE_LEVEL_FINAL)
|
||||
from .widgets import DocumentPagesCarouselWidget, DocumentPageImageWidget
|
||||
|
||||
|
||||
# Document page forms
|
||||
@@ -234,10 +234,6 @@ class DocumentTypeSelectForm(forms.Form):
|
||||
|
||||
|
||||
class PrintForm(forms.Form):
|
||||
# page_size = forms.ChoiceField(choices=PAGE_SIZE_CHOICES, initial=DEFAULT_PAPER_SIZE, label=_(u'Page size'), required=False)
|
||||
# custom_page_width = forms.CharField(label=_(u'Custom page width'), required=False)
|
||||
# custom_page_height = forms.CharField(label=_(u'Custom page height'), required=False)
|
||||
# page_orientation = forms.ChoiceField(choices=PAGE_ORIENTATION_CHOICES, initial=DEFAULT_PAGE_ORIENTATION, label=_(u'Page orientation'), required=True)
|
||||
page_range = forms.CharField(label=_(u'Page range'), required=False)
|
||||
|
||||
|
||||
|
||||
@@ -6,12 +6,12 @@ from history.permissions import PERMISSION_HISTORY_VIEW
|
||||
|
||||
from .conf.settings import ZOOM_MAX_LEVEL, ZOOM_MIN_LEVEL
|
||||
from .permissions import (PERMISSION_DOCUMENT_PROPERTIES_EDIT,
|
||||
PERMISSION_DOCUMENT_VIEW, PERMISSION_DOCUMENT_DELETE,
|
||||
PERMISSION_DOCUMENT_DOWNLOAD, PERMISSION_DOCUMENT_TRANSFORM,
|
||||
PERMISSION_DOCUMENT_TOOLS, PERMISSION_DOCUMENT_EDIT,
|
||||
PERMISSION_DOCUMENT_VERSION_REVERT, PERMISSION_DOCUMENT_TYPE_EDIT,
|
||||
PERMISSION_DOCUMENT_TYPE_DELETE, PERMISSION_DOCUMENT_TYPE_CREATE,
|
||||
PERMISSION_DOCUMENT_TYPE_VIEW)
|
||||
PERMISSION_DOCUMENT_VIEW, PERMISSION_DOCUMENT_DELETE,
|
||||
PERMISSION_DOCUMENT_DOWNLOAD, PERMISSION_DOCUMENT_TRANSFORM,
|
||||
PERMISSION_DOCUMENT_TOOLS, PERMISSION_DOCUMENT_EDIT,
|
||||
PERMISSION_DOCUMENT_VERSION_REVERT, PERMISSION_DOCUMENT_TYPE_EDIT,
|
||||
PERMISSION_DOCUMENT_TYPE_DELETE, PERMISSION_DOCUMENT_TYPE_CREATE,
|
||||
PERMISSION_DOCUMENT_TYPE_VIEW)
|
||||
|
||||
# Document page links expressions
|
||||
|
||||
|
||||
@@ -19,19 +19,21 @@ from django.utils.timezone import now
|
||||
from django.utils.translation import ugettext
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from converter.api import convert, get_page_count, get_available_transformations_choices
|
||||
from converter.api import (convert, get_page_count,
|
||||
get_available_transformations_choices)
|
||||
from converter.exceptions import UnknownFileFormat
|
||||
from converter.literals import (DEFAULT_ZOOM_LEVEL, DEFAULT_ROTATION,
|
||||
DEFAULT_PAGE_NUMBER)
|
||||
DEFAULT_PAGE_NUMBER)
|
||||
from mimetype.api import get_mimetype
|
||||
|
||||
from .conf.settings import (CHECKSUM_FUNCTION, UUID_FUNCTION,
|
||||
DISPLAY_SIZE, CACHE_PATH, ZOOM_MAX_LEVEL, ZOOM_MIN_LEVEL)
|
||||
from .conf.settings import (CACHE_PATH, CHECKSUM_FUNCTION, DISPLAY_SIZE,
|
||||
UUID_FUNCTION, ZOOM_MAX_LEVEL, ZOOM_MIN_LEVEL)
|
||||
from .exceptions import NewDocumentVersionNotAllowed
|
||||
from .literals import (RELEASE_LEVEL_FINAL, RELEASE_LEVEL_CHOICES,
|
||||
VERSION_UPDATE_MAJOR, VERSION_UPDATE_MINOR, VERSION_UPDATE_MICRO)
|
||||
from .managers import (DocumentPageTransformationManager, RecentDocumentManager,
|
||||
DocumentTypeManager)
|
||||
from .literals import (RELEASE_LEVEL_CHOICES, RELEASE_LEVEL_FINAL,
|
||||
VERSION_UPDATE_MAJOR, VERSION_UPDATE_MICRO,
|
||||
VERSION_UPDATE_MINOR)
|
||||
from .managers import (DocumentPageTransformationManager, DocumentTypeManager,
|
||||
RecentDocumentManager)
|
||||
from .runtime import storage_backend
|
||||
from .utils import document_save_to_temp_dir
|
||||
|
||||
|
||||
@@ -20,15 +20,15 @@ import sendfile
|
||||
|
||||
from acls.models import AccessEntry
|
||||
from common.compressed_files import CompressedFile
|
||||
from common.literals import (PAGE_SIZE_DIMENSIONS,
|
||||
PAGE_ORIENTATION_PORTRAIT, PAGE_ORIENTATION_LANDSCAPE)
|
||||
from common.utils import (pretty_size, parse_range, urlquote,
|
||||
return_diff, encapsulate)
|
||||
from common.literals import (PAGE_ORIENTATION_LANDSCAPE, PAGE_ORIENTATION_PORTRAIT,
|
||||
PAGE_SIZE_DIMENSIONS)
|
||||
from common.utils import (encapsulate, pretty_size, parse_range, return_diff,
|
||||
urlquote)
|
||||
from common.widgets import two_state_template
|
||||
from common.conf.settings import DEFAULT_PAPER_SIZE
|
||||
from converter.exceptions import UnknownFileFormat, UnkownConvertError
|
||||
from converter.literals import (DEFAULT_ZOOM_LEVEL, DEFAULT_ROTATION,
|
||||
DEFAULT_PAGE_NUMBER, DEFAULT_FILE_FORMAT_MIMETYPE)
|
||||
from converter.literals import (DEFAULT_FILE_FORMAT_MIMETYPE, DEFAULT_PAGE_NUMBER,
|
||||
DEFAULT_ROTATION, DEFAULT_ZOOM_LEVEL)
|
||||
from converter.office_converter import OfficeConverter
|
||||
from filetransfers.api import serve_file
|
||||
from history.api import create_history
|
||||
@@ -38,27 +38,27 @@ from rest_api.filters import MayanObjectPermissionsFilter
|
||||
from rest_api.permissions import MayanPermission
|
||||
|
||||
from .events import HISTORY_DOCUMENT_EDITED
|
||||
from .conf.settings import (DISPLAY_SIZE, PREVIEW_SIZE, ZOOM_PERCENT_STEP,
|
||||
ZOOM_MAX_LEVEL, ZOOM_MIN_LEVEL, ROTATION_STEP, RECENT_COUNT)
|
||||
from .conf.settings import (DISPLAY_SIZE, PREVIEW_SIZE, RECENT_COUNT,
|
||||
ROTATION_STEP, ZOOM_PERCENT_STEP, ZOOM_MAX_LEVEL,
|
||||
ZOOM_MIN_LEVEL)
|
||||
from .forms import (DocumentForm_edit, DocumentPropertiesForm,
|
||||
DocumentPreviewForm, DocumentPageForm,
|
||||
DocumentPageTransformationForm, DocumentContentForm,
|
||||
DocumentPageForm_edit, DocumentPageForm_text, PrintForm,
|
||||
DocumentTypeForm, DocumentTypeFilenameForm,
|
||||
DocumentTypeFilenameForm_create, DocumentDownloadForm)
|
||||
DocumentPreviewForm, DocumentPageForm,
|
||||
DocumentPageTransformationForm, DocumentContentForm,
|
||||
DocumentPageForm_edit, DocumentPageForm_text, PrintForm,
|
||||
DocumentTypeForm, DocumentTypeFilenameForm,
|
||||
DocumentTypeFilenameForm_create, DocumentDownloadForm)
|
||||
from .models import (Document, DocumentType, DocumentPage,
|
||||
DocumentPageTransformation, RecentDocument, DocumentTypeFilename,
|
||||
DocumentVersion)
|
||||
DocumentPageTransformation, DocumentTypeFilename,
|
||||
DocumentVersion, RecentDocument)
|
||||
from .permissions import (PERMISSION_DOCUMENT_PROPERTIES_EDIT,
|
||||
PERMISSION_DOCUMENT_VIEW, PERMISSION_DOCUMENT_DELETE,
|
||||
PERMISSION_DOCUMENT_DOWNLOAD, PERMISSION_DOCUMENT_TRANSFORM,
|
||||
PERMISSION_DOCUMENT_TOOLS, PERMISSION_DOCUMENT_EDIT,
|
||||
PERMISSION_DOCUMENT_VERSION_REVERT, PERMISSION_DOCUMENT_TYPE_EDIT,
|
||||
PERMISSION_DOCUMENT_TYPE_DELETE, PERMISSION_DOCUMENT_TYPE_CREATE,
|
||||
PERMISSION_DOCUMENT_TYPE_VIEW)
|
||||
from .runtime import storage_backend
|
||||
PERMISSION_DOCUMENT_VIEW, PERMISSION_DOCUMENT_DELETE,
|
||||
PERMISSION_DOCUMENT_DOWNLOAD, PERMISSION_DOCUMENT_TRANSFORM,
|
||||
PERMISSION_DOCUMENT_TOOLS, PERMISSION_DOCUMENT_EDIT,
|
||||
PERMISSION_DOCUMENT_VERSION_REVERT, PERMISSION_DOCUMENT_TYPE_EDIT,
|
||||
PERMISSION_DOCUMENT_TYPE_DELETE, PERMISSION_DOCUMENT_TYPE_CREATE,
|
||||
PERMISSION_DOCUMENT_TYPE_VIEW)
|
||||
from .serializers import (DocumentImageSerializer, DocumentPageSerializer,
|
||||
DocumentSerializer, DocumentVersionSerializer)
|
||||
DocumentSerializer, DocumentVersionSerializer)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -72,7 +72,8 @@ def document_list(request, object_list=None, title=None, extra_context=None):
|
||||
# If user doesn't have global permission, get a list of document
|
||||
# for which he/she does hace access use it to filter the
|
||||
# provided object_list
|
||||
final_object_list = AccessEntry.objects.filter_objects_by_access(PERMISSION_DOCUMENT_VIEW, request.user, pre_object_list)
|
||||
final_object_list = AccessEntry.objects.filter_objects_by_access(
|
||||
PERMISSION_DOCUMENT_VIEW, request.user, pre_object_list)
|
||||
else:
|
||||
final_object_list = pre_object_list
|
||||
|
||||
@@ -97,10 +98,6 @@ def document_view(request, document_id, advanced=False):
|
||||
except PermissionDenied:
|
||||
AccessEntry.objects.check_access(PERMISSION_DOCUMENT_VIEW, request.user, document)
|
||||
|
||||
# document = get_object_or_404(Document.objects.select_related(), pk=document_id)
|
||||
# Triggers a 404 error on documents uploaded via local upload
|
||||
# TODO: investigate
|
||||
|
||||
RecentDocument.objects.add_document_for_user(request.user, document)
|
||||
|
||||
subtemplates_list = []
|
||||
@@ -189,9 +186,9 @@ def document_delete(request, document_id=None, document_id_list=None):
|
||||
document.delete()
|
||||
# create_history(HISTORY_DOCUMENT_DELETED, data={'user': request.user, 'document': document})
|
||||
messages.success(request, _(u'Document deleted successfully.'))
|
||||
except Exception, e:
|
||||
except Exception as exception:
|
||||
messages.error(request, _(u'Document: %(document)s delete error: %(error)s') % {
|
||||
'document': document, 'error': e
|
||||
'document': document, 'error': exception
|
||||
})
|
||||
|
||||
return HttpResponseRedirect(next)
|
||||
@@ -333,11 +330,11 @@ def document_download(request, document_id=None, document_id_list=None, document
|
||||
content_type='application/zip'
|
||||
)
|
||||
# TODO: DO a redirection afterwards
|
||||
except Exception, e:
|
||||
except Exception as exception:
|
||||
if settings.DEBUG:
|
||||
raise
|
||||
else:
|
||||
messages.error(request, e)
|
||||
messages.error(request, exception)
|
||||
return HttpResponseRedirect(request.META['HTTP_REFERER'])
|
||||
else:
|
||||
try:
|
||||
@@ -350,11 +347,11 @@ def document_download(request, document_id=None, document_id_list=None, document
|
||||
save_as=u'"%s"' % document_versions[0].filename,
|
||||
content_type=document_versions[0].mimetype if document_versions[0].mimetype else 'application/octet-stream'
|
||||
)
|
||||
except Exception, e:
|
||||
except Exception as exception:
|
||||
if settings.DEBUG:
|
||||
raise
|
||||
else:
|
||||
messages.error(request, e)
|
||||
messages.error(request, exception)
|
||||
return HttpResponseRedirect(request.META['HTTP_REFERER'])
|
||||
|
||||
else:
|
||||
@@ -498,9 +495,9 @@ def document_clear_transformations(request, document_id=None, document_id_list=N
|
||||
for transformation in document_page.documentpagetransformation_set.all():
|
||||
transformation.delete()
|
||||
messages.success(request, _(u'All the page transformations for document: %s, have been deleted successfully.') % document)
|
||||
except Exception, e:
|
||||
except Exception as exception:
|
||||
messages.error(request, _(u'Error deleting the page transformations for document: %(document)s; %(error)s.') % {
|
||||
'document': document, 'error': e})
|
||||
'document': document, 'error': exception})
|
||||
|
||||
return HttpResponseRedirect(next)
|
||||
|
||||
@@ -798,28 +795,12 @@ def document_print(request, document_id):
|
||||
if form.cleaned_data['page_range']:
|
||||
hard_copy_arguments['page_range'] = form.cleaned_data['page_range']
|
||||
|
||||
# Compute page width and height
|
||||
# if form.cleaned_data['custom_page_width'] and form.cleaned_data['custom_page_height']:
|
||||
# page_width = form.cleaned_data['custom_page_width']
|
||||
# page_height = form.cleaned_data['custom_page_height']
|
||||
# elif form.cleaned_data['page_size']:
|
||||
# page_width, page_height = dict(PAGE_SIZE_DIMENSIONS)[form.cleaned_data['page_size']]
|
||||
|
||||
# Page orientation
|
||||
# if form.cleaned_data['page_orientation'] == PAGE_ORIENTATION_LANDSCAPE:
|
||||
# page_width, page_height = page_height, page_width
|
||||
|
||||
# hard_copy_arguments['page_width'] = page_width
|
||||
# hard_copy_arguments['page_height'] = page_height
|
||||
|
||||
new_url = [reverse('document_hard_copy', args=[document_id])]
|
||||
if hard_copy_arguments:
|
||||
new_url.append(urlquote(hard_copy_arguments))
|
||||
|
||||
new_window_url = u'?'.join(new_url)
|
||||
new_window_url_name = u'document_hard_copy'
|
||||
# html_redirect = next
|
||||
# messages.success(request, _(u'Preparing document hardcopy.'))
|
||||
else:
|
||||
form = PrintForm()
|
||||
|
||||
@@ -844,11 +825,6 @@ def document_hard_copy(request, document_id):
|
||||
|
||||
RecentDocument.objects.add_document_for_user(request.user, document)
|
||||
|
||||
# arguments, warnings = calculate_converter_arguments(document, size=PRINT_SIZE, file_format=DEFAULT_FILE_FORMAT)
|
||||
|
||||
# Pre-generate
|
||||
# convert_document(document, **arguments)
|
||||
|
||||
# Extract dimension values ignoring any unit
|
||||
page_width = request.GET.get('page_width', dict(PAGE_SIZE_DIMENSIONS)[DEFAULT_PAPER_SIZE][0])
|
||||
page_height = request.GET.get('page_height', dict(PAGE_SIZE_DIMENSIONS)[DEFAULT_PAPER_SIZE][1])
|
||||
@@ -905,15 +881,14 @@ def document_type_edit(request, document_type_id):
|
||||
form.save()
|
||||
messages.success(request, _(u'Document type edited successfully'))
|
||||
return HttpResponseRedirect(next)
|
||||
except Exception, e:
|
||||
messages.error(request, _(u'Error editing document type; %s') % e)
|
||||
except Exception as exception:
|
||||
messages.error(request, _(u'Error editing document type; %s') % exception)
|
||||
else:
|
||||
form = DocumentTypeForm(instance=document_type)
|
||||
|
||||
return render_to_response('generic_form.html', {
|
||||
'title': _(u'edit document type: %s') % document_type,
|
||||
'form': form,
|
||||
# 'object': document_type,
|
||||
'object_name': _(u'document type'),
|
||||
'navigation_object_name': 'document_type',
|
||||
'document_type': document_type,
|
||||
@@ -936,9 +911,9 @@ def document_type_delete(request, document_type_id):
|
||||
Document.objects.filter(document_type=document_type).update(document_type=None)
|
||||
document_type.delete()
|
||||
messages.success(request, _(u'Document type: %s deleted successfully.') % document_type)
|
||||
except Exception, e:
|
||||
except Exception as exception:
|
||||
messages.error(request, _(u'Document type: %(document_type)s delete error: %(error)s') % {
|
||||
'document_type': document_type, 'error': e})
|
||||
'document_type': document_type, 'error': exception})
|
||||
|
||||
return HttpResponseRedirect(next)
|
||||
|
||||
@@ -971,9 +946,9 @@ def document_type_create(request):
|
||||
form.save()
|
||||
messages.success(request, _(u'Document type created successfully'))
|
||||
return HttpResponseRedirect(reverse('document_type_list'))
|
||||
except Exception, e:
|
||||
except Exception as exception:
|
||||
messages.error(request, _(u'Error creating document type; %(error)s') % {
|
||||
'error': e})
|
||||
'error': exception})
|
||||
else:
|
||||
form = DocumentTypeForm()
|
||||
|
||||
@@ -1023,8 +998,8 @@ def document_type_filename_edit(request, document_type_filename_id):
|
||||
document_type_filename.save()
|
||||
messages.success(request, _(u'Document type filename edited successfully'))
|
||||
return HttpResponseRedirect(next)
|
||||
except Exception, e:
|
||||
messages.error(request, _(u'Error editing document type filename; %s') % e)
|
||||
except Exception as exception:
|
||||
messages.error(request, _(u'Error editing document type filename; %s') % exception)
|
||||
else:
|
||||
form = DocumentTypeFilenameForm(instance=document_type_filename)
|
||||
|
||||
@@ -1057,9 +1032,9 @@ def document_type_filename_delete(request, document_type_filename_id):
|
||||
try:
|
||||
document_type_filename.delete()
|
||||
messages.success(request, _(u'Document type filename: %s deleted successfully.') % document_type_filename)
|
||||
except Exception, e:
|
||||
except Exception as exception:
|
||||
messages.error(request, _(u'Document type filename: %(document_type_filename)s delete error: %(error)s') % {
|
||||
'document_type_filename': document_type_filename, 'error': e})
|
||||
'document_type_filename': document_type_filename, 'error': exception})
|
||||
|
||||
return HttpResponseRedirect(next)
|
||||
|
||||
@@ -1101,9 +1076,9 @@ def document_type_filename_create(request, document_type_id):
|
||||
document_type_filename.save()
|
||||
messages.success(request, _(u'Document type filename created successfully'))
|
||||
return HttpResponseRedirect(reverse('document_type_filename_list', args=[document_type_id]))
|
||||
except Exception, e:
|
||||
except Exception as exception:
|
||||
messages.error(request, _(u'Error creating document type filename; %(error)s') % {
|
||||
'error': e})
|
||||
'error': exception})
|
||||
else:
|
||||
form = DocumentTypeFilenameForm_create()
|
||||
|
||||
@@ -1127,8 +1102,8 @@ def document_clear_image_cache(request):
|
||||
try:
|
||||
Document.clear_image_cache()
|
||||
messages.success(request, _(u'Document image cache cleared successfully'))
|
||||
except Exception, msg:
|
||||
messages.error(request, _(u'Error clearing document image cache; %s') % msg)
|
||||
except Exception as exception:
|
||||
messages.error(request, _(u'Error clearing document image cache; %s') % exception)
|
||||
|
||||
return HttpResponseRedirect(previous)
|
||||
|
||||
@@ -1201,8 +1176,8 @@ def document_version_revert(request, document_version_pk):
|
||||
try:
|
||||
document_version.revert()
|
||||
messages.success(request, _(u'Document version reverted successfully'))
|
||||
except Exception, msg:
|
||||
messages.error(request, _(u'Error reverting document version; %s') % msg)
|
||||
except Exception as exception:
|
||||
messages.error(request, _(u'Error reverting document version; %s') % exception)
|
||||
|
||||
return HttpResponseRedirect(previous)
|
||||
|
||||
|
||||
@@ -9,11 +9,10 @@ from django.utils.safestring import mark_safe
|
||||
from django.utils.translation import ugettext
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from converter.literals import (DEFAULT_ZOOM_LEVEL, DEFAULT_ROTATION,
|
||||
DEFAULT_PAGE_NUMBER)
|
||||
from converter.literals import (DEFAULT_PAGE_NUMBER, DEFAULT_ROTATION,
|
||||
DEFAULT_ZOOM_LEVEL)
|
||||
|
||||
from .conf.settings import (THUMBNAIL_SIZE,
|
||||
DISPLAY_SIZE, MULTIPAGE_PREVIEW_SIZE)
|
||||
from .conf.settings import DISPLAY_SIZE, MULTIPAGE_PREVIEW_SIZE, THUMBNAIL_SIZE
|
||||
|
||||
|
||||
class DocumentPageImageWidget(forms.widgets.Widget):
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.contrib import admin
|
||||
|
||||
from dynamic_search.models import RecentSearch
|
||||
from .models import RecentSearch
|
||||
|
||||
|
||||
class RecentSearchAdmin(admin.ModelAdmin):
|
||||
@@ -8,4 +10,5 @@ class RecentSearchAdmin(admin.ModelAdmin):
|
||||
list_display_links = ('user', 'query', 'datetime_created', 'hits')
|
||||
readonly_fields = ('user', 'query', 'datetime_created', 'hits')
|
||||
|
||||
|
||||
admin.site.register(RecentSearch, RecentSearchAdmin)
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
# original code from:
|
||||
# http://www.julienphalip.com/blog/2008/08/16/adding-search-django-site-snap/
|
||||
from __future__ import absolute_import
|
||||
|
||||
import datetime
|
||||
import re
|
||||
import types
|
||||
import datetime
|
||||
|
||||
from django.db.models import Q
|
||||
|
||||
from dynamic_search.conf.settings import LIMIT
|
||||
from .conf.settings import LIMIT
|
||||
|
||||
registered_search_dict = {}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import urlparse
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.db import models
|
||||
from django.utils.encoding import smart_unicode, smart_str
|
||||
from django.utils.encoding import smart_str, smart_unicode
|
||||
from django.utils.timezone import now
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ document_search = SearchModel.get('documents.Document')
|
||||
def results(request, extra_context=None):
|
||||
context = {
|
||||
'query_string': request.GET,
|
||||
# 'hide_header': True,
|
||||
'hide_links': True,
|
||||
'multi_select_as_buttons': True,
|
||||
'search_results_limit': LIMIT,
|
||||
|
||||
@@ -13,7 +13,6 @@ tag_create = {'text': _(u'create new tag'), 'view': 'tag_create', 'famfam': 'tag
|
||||
tag_attach = {'text': _(u'attach tag'), 'view': 'tag_attach', 'args': 'object.pk', 'famfam': 'tag_blue_add', 'permissions': [PERMISSION_TAG_ATTACH]}
|
||||
tag_multiple_attach = {'text': _(u'attach tag'), 'view': 'tag_multiple_attach', 'famfam': 'tag_blue_add'}
|
||||
|
||||
# tag_remove = {'text': _(u'remove tag'), 'view': 'tag_remove', 'args': 'object.pk', 'famfam': 'tag_blue_delete', 'permissions': [PERMISSION_TAG_REMOVE]}
|
||||
multiple_documents_selection_tag_remove = {'text': _(u'remove tag'), 'view': 'multiple_documents_selection_tag_remove', 'famfam': 'tag_blue_delete'}
|
||||
single_document_multiple_tag_remove = {'text': _(u'remove tags'), 'view': 'single_document_multiple_tag_remove', 'args': 'document.id', 'famfam': 'tag_blue_delete', 'permissions': [PERMISSION_TAG_REMOVE]}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from django.utils import unittest
|
||||
|
||||
from .models import Tag, TagProperties
|
||||
from .literals import COLOR_RED
|
||||
from .models import Tag, TagProperties
|
||||
|
||||
|
||||
class TagTestCase(unittest.TestCase):
|
||||
|
||||
Reference in New Issue
Block a user