diff --git a/.tx/config b/.tx/config index 2a6a1da730..8058ce8df8 100644 --- a/.tx/config +++ b/.tx/config @@ -223,15 +223,21 @@ source_lang = en source_file = mayan/apps/task_manager/locale/en/LC_MESSAGES/django.po type = PO +[mayan-edms.templating-3-0] +file_filter = mayan/apps/templating/locale//LC_MESSAGES/django.po +source_lang = en +source_file = mayan/apps/templating/locale/en/LC_MESSAGES/django.po +type = PO + [mayan-edms.user_management-2-0] file_filter = mayan/apps/user_management/locale//LC_MESSAGES/django.po source_lang = en source_file = mayan/apps/user_management/locale/en/LC_MESSAGES/django.po type = PO -[mayan-edms.weblink-3-0] -file_filter = mayan/apps/weblinks/locale//LC_MESSAGES/django.po +[mayan-edms.web_link-3-0] +file_filter = mayan/apps/web_links/locale//LC_MESSAGES/django.po source_lang = en -source_file = mayan/apps/weblinks/locale/en/LC_MESSAGES/django.po +source_file = mayan/apps/web_links/locale/en/LC_MESSAGES/django.po type = PO diff --git a/contrib/scripts/process_messages.py b/contrib/scripts/process_messages.py index 22072e5794..7989c2a572 100755 --- a/contrib/scripts/process_messages.py +++ b/contrib/scripts/process_messages.py @@ -17,8 +17,8 @@ APP_LIST = ( 'file_metadata', 'linking', 'lock_manager', 'mailer', 'mayan_statistics', 'metadata', 'mirroring', 'motd', 'navigation', 'ocr', 'permissions', 'platform', 'rest_api', 'smart_settings', - 'sources', 'storage', 'tags', 'task_manager', 'user_management', - 'web_links' + 'sources', 'storage', 'tags', 'task_manager', 'templating', + 'user_management', 'web_links' ) LANGUAGE_LIST = ( diff --git a/mayan/apps/document_indexing/apps.py b/mayan/apps/document_indexing/apps.py index 09b6f3bc8c..71e0bf5b65 100644 --- a/mayan/apps/document_indexing/apps.py +++ b/mayan/apps/document_indexing/apps.py @@ -30,14 +30,14 @@ from .html_widgets import ( get_instance_link, index_instance_item_link, node_level ) from .links import ( - link_document_index_instance_list, link_document_template_sandbox, - link_document_type_index_templates, link_index_instance_menu, - link_index_instance_rebuild, link_index_template_setup, - link_index_template_create, link_index_template_document_types, - link_index_template_delete, link_index_template_edit, - link_index_template_list, link_index_template_node_tree_view, - link_index_instances_rebuild, link_index_template_node_create, - link_index_template_node_delete, link_index_template_node_edit + link_document_index_instance_list, link_document_type_index_templates, + link_index_instance_menu, link_index_instance_rebuild, + link_index_template_setup, link_index_template_create, + link_index_template_document_types, link_index_template_delete, + link_index_template_edit, link_index_template_list, + link_index_template_node_tree_view, link_index_instances_rebuild, + link_index_template_node_create, link_index_template_node_delete, + link_index_template_node_edit ) from .permissions import ( permission_document_indexing_create, permission_document_indexing_delete, @@ -185,7 +185,6 @@ class DocumentIndexingApp(MayanAppConfig): menu_facet.bind_links( links=( link_document_index_instance_list, - link_document_template_sandbox ), sources=(Document,) ) menu_list_facet.bind_links( diff --git a/mayan/apps/document_indexing/icons.py b/mayan/apps/document_indexing/icons.py index bd7f2d71fb..581e31d5e6 100644 --- a/mayan/apps/document_indexing/icons.py +++ b/mayan/apps/document_indexing/icons.py @@ -7,9 +7,6 @@ icon_index = Icon(driver_name='fontawesome', symbol='list-ul') icon_document_index_instance_list = Icon( driver_name='fontawesome', symbol='list-ul' ) -icon_document_template_sandbox = Icon( - driver_name='fontawesome', symbol='flask' -) icon_document_type_index_templates = icon_index icon_index_level_up = Icon( driver_name='fontawesomecss', css_classes='fa-level-up-alt fa-rotate-90' diff --git a/mayan/apps/document_indexing/links.py b/mayan/apps/document_indexing/links.py index 3bbf672f11..6573b0a0dd 100644 --- a/mayan/apps/document_indexing/links.py +++ b/mayan/apps/document_indexing/links.py @@ -23,13 +23,6 @@ link_document_index_instance_list = Link( text=_('Indexes'), view='indexing:document_index_list', ) -link_document_template_sandbox = Link( - args='resolved_object.pk', - icon_class_path='mayan.apps.document_indexing.icons.icon_document_template_sandbox', - permissions=(permission_document_indexing_edit,), - text=_('Sandbox'), - view='indexing:document_template_sandbox', -) link_document_type_index_templates = Link( args='resolved_object.pk', icon_class_path='mayan.apps.document_indexing.icons.icon_document_type_index_templates', diff --git a/mayan/apps/document_indexing/urls.py b/mayan/apps/document_indexing/urls.py index 2172315760..0cdefeeb6c 100644 --- a/mayan/apps/document_indexing/urls.py +++ b/mayan/apps/document_indexing/urls.py @@ -8,11 +8,10 @@ from .api_views import ( APIIndexTemplateView, APIIndexView ) from .views import ( - DocumentIndexNodeListView, DocumentTemplateSandboxView, - DocumentTypeIndexesView, IndexInstanceNodeView, IndexListView, - IndexesRebuildView, SetupIndexDocumentTypesView, SetupIndexCreateView, - SetupIndexDeleteView, SetupIndexEditView, SetupIndexListView, - SetupIndexRebuildView, SetupIndexTreeTemplateListView, + DocumentIndexNodeListView, DocumentTypeIndexesView, IndexInstanceNodeView, + IndexListView, IndexesRebuildView, SetupIndexDocumentTypesView, + SetupIndexCreateView, SetupIndexDeleteView, SetupIndexEditView, + SetupIndexListView, SetupIndexRebuildView, SetupIndexTreeTemplateListView, TemplateNodeCreateView, TemplateNodeDeleteView, TemplateNodeEditView ) @@ -84,11 +83,6 @@ urlpatterns_tools = [ regex=r'^instances/rebuild/$', view=IndexesRebuildView.as_view(), name='rebuild_index_instances' ), - url( - regex=r'^documents/(?P\d+)/sandbox/$', - view=DocumentTemplateSandboxView.as_view(), - name='document_template_sandbox' - ), ] urlpatterns = [] diff --git a/mayan/apps/document_indexing/views.py b/mayan/apps/document_indexing/views.py index 2a57a5e196..4f36c63e94 100644 --- a/mayan/apps/document_indexing/views.py +++ b/mayan/apps/document_indexing/views.py @@ -25,9 +25,7 @@ from mayan.apps.documents.permissions import ( from mayan.apps.documents.views import DocumentListView from .events import event_index_template_edited -from .forms import ( - DocumentTemplateSandboxForm, IndexTemplateFilteredForm, IndexTemplateNodeForm -) +from .forms import IndexTemplateFilteredForm, IndexTemplateNodeForm from .html_widgets import node_tree from .icons import icon_index from .links import link_index_template_create @@ -481,47 +479,3 @@ class IndexesRebuildView(FormView): def get_post_action_redirect(self): return reverse(viewname='common:tools_list') - - -class DocumentTemplateSandboxView(ExternalObjectMixin, FormView): - external_object_class = Document - external_object_permission = permission_document_indexing_create - form_class = DocumentTemplateSandboxForm - - def form_valid(self, form): - path = reverse( - viewname='indexing:document_template_sandbox', - kwargs={'pk': self.external_object.pk} - ) - url = URL( - path=path, query={'template': form.cleaned_data['template']} - ) - - return HttpResponseRedirect(redirect_to=url.to_string()) - - def get_initial(self): - template_string = self.request.GET.get('template') - try: - context = Context( - {'document': self.external_object} - ) - template = Template(template_string=template_string) - result = template.render(context=context) - except TemplateSyntaxError as exception: - result = '' - error_message = _( - 'Template error; %(exception)s' - ) % { - 'exception': exception - } - messages.error(request=self.request, message=error_message) - - return { - 'template': template_string, 'result': result - } - - def get_extra_context(self): - return { - 'object': self.external_object, - 'title': _('Template sandbox for: %s') % self.external_object - } diff --git a/mayan/apps/templating/__init__.py b/mayan/apps/templating/__init__.py new file mode 100644 index 0000000000..d2ccb9657c --- /dev/null +++ b/mayan/apps/templating/__init__.py @@ -0,0 +1,3 @@ +from __future__ import unicode_literals + +default_app_config = 'mayan.apps.templating.apps.TemplatingApp' diff --git a/mayan/apps/templating/apps.py b/mayan/apps/templating/apps.py new file mode 100644 index 0000000000..a60d84fb08 --- /dev/null +++ b/mayan/apps/templating/apps.py @@ -0,0 +1,37 @@ +from __future__ import absolute_import, unicode_literals + +from django.apps import apps +from django.utils.translation import ugettext_lazy as _ + +from mayan.apps.acls.classes import ModelPermission +from mayan.apps.common.apps import MayanAppConfig +from mayan.apps.common.menus import menu_facet + +from .links import link_document_template_sandbox +from .permissions import permission_template_sandbox + + +class TemplatingApp(MayanAppConfig): + app_namespace = 'templating' + app_url = 'templating' + has_tests = True + name = 'mayan.apps.templating' + verbose_name = _('Templating') + + def ready(self): + super(TemplatingApp, self).ready() + Document = apps.get_model( + app_label='documents', model_name='Document' + ) + + ModelPermission.register( + model=Document, permissions=( + permission_template_sandbox, + ) + ) + + menu_facet.bind_links( + links=( + link_document_template_sandbox, + ), sources=(Document,) + ) diff --git a/mayan/apps/templating/fields.py b/mayan/apps/templating/fields.py new file mode 100644 index 0000000000..e71140c895 --- /dev/null +++ b/mayan/apps/templating/fields.py @@ -0,0 +1,14 @@ +from __future__ import absolute_import, unicode_literals + +from django import forms + +from .widgets import TemplateWidget + + +class TemplateField(forms.CharField): + widget = TemplateWidget + + def __init__(self, *args, **kwargs): + self.model = kwargs.pop('model') + self.model_variable = kwargs.pop('model_variable') + super(TemplateField, self).__init__(*args, **kwargs) diff --git a/mayan/apps/templating/forms.py b/mayan/apps/templating/forms.py new file mode 100644 index 0000000000..78ab3e7224 --- /dev/null +++ b/mayan/apps/templating/forms.py @@ -0,0 +1,30 @@ +from __future__ import absolute_import, unicode_literals + +from django import forms +from django.utils.translation import ugettext_lazy as _ + +from .fields import TemplateField + + +class DocumentTemplateSandboxForm(forms.Form): + result = forms.CharField( + help_text=_('Resulting text from the evaluated template.'), + label=_('Result'), required=False, widget=forms.widgets.Textarea( + attrs={'readonly': 'readonly', 'rows': 5} + ) + ) + + def __init__(self, *args, **kwargs): + self.model = kwargs.pop('model') + self.model_variable = kwargs.pop('model_variable') + super(DocumentTemplateSandboxForm, self).__init__(*args, **kwargs) + self.fields['template'] = TemplateField( + help_text=_( + 'The template string to be evaluated. ' + 'Use Django\'s default templating language ' + '(https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)' + ), label=_('Template'), model=self.model, + model_variable=self.model_variable, required=False + ) + self.order_fields(field_order=('template', 'result')) + self.fields['template'].widget.attrs['model'] = self.model diff --git a/mayan/apps/templating/icons.py b/mayan/apps/templating/icons.py new file mode 100644 index 0000000000..e5453bf4d6 --- /dev/null +++ b/mayan/apps/templating/icons.py @@ -0,0 +1,7 @@ +from __future__ import absolute_import, unicode_literals + +from mayan.apps.appearance.classes import Icon + +icon_template_sandbox = Icon( + driver_name='fontawesome', symbol='flask' +) diff --git a/mayan/apps/templating/links.py b/mayan/apps/templating/links.py new file mode 100644 index 0000000000..8f81bbc967 --- /dev/null +++ b/mayan/apps/templating/links.py @@ -0,0 +1,16 @@ +from __future__ import unicode_literals + +from django.utils.translation import ugettext_lazy as _ + +from mayan.apps.navigation.classes import Link + +from .permissions import permission_template_sandbox + + +link_document_template_sandbox = Link( + args='resolved_object.pk', + icon_class_path='mayan.apps.templating.icons.icon_template_sandbox', + permissions=(permission_template_sandbox,), + text=_('Sandbox'), + view='templating:document_template_sandbox', +) diff --git a/mayan/apps/templating/locale/ar/LC_MESSAGES/django.po b/mayan/apps/templating/locale/ar/LC_MESSAGES/django.po new file mode 100644 index 0000000000..ac775e976c --- /dev/null +++ b/mayan/apps/templating/locale/ar/LC_MESSAGES/django.po @@ -0,0 +1,60 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " +"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/bg/LC_MESSAGES/django.po b/mayan/apps/templating/locale/bg/LC_MESSAGES/django.po new file mode 100644 index 0000000000..a2483ad4d4 --- /dev/null +++ b/mayan/apps/templating/locale/bg/LC_MESSAGES/django.po @@ -0,0 +1,59 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/bs_BA/LC_MESSAGES/django.po b/mayan/apps/templating/locale/bs_BA/LC_MESSAGES/django.po new file mode 100644 index 0000000000..78ed332c38 --- /dev/null +++ b/mayan/apps/templating/locale/bs_BA/LC_MESSAGES/django.po @@ -0,0 +1,58 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/cs/LC_MESSAGES/django.po b/mayan/apps/templating/locale/cs/LC_MESSAGES/django.po new file mode 100644 index 0000000000..4afc640f7e --- /dev/null +++ b/mayan/apps/templating/locale/cs/LC_MESSAGES/django.po @@ -0,0 +1,59 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/da_DK/LC_MESSAGES/django.po b/mayan/apps/templating/locale/da_DK/LC_MESSAGES/django.po new file mode 100644 index 0000000000..78ed332c38 --- /dev/null +++ b/mayan/apps/templating/locale/da_DK/LC_MESSAGES/django.po @@ -0,0 +1,58 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/de_DE/LC_MESSAGES/django.po b/mayan/apps/templating/locale/de_DE/LC_MESSAGES/django.po new file mode 100644 index 0000000000..78ed332c38 --- /dev/null +++ b/mayan/apps/templating/locale/de_DE/LC_MESSAGES/django.po @@ -0,0 +1,58 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/el/LC_MESSAGES/django.po b/mayan/apps/templating/locale/el/LC_MESSAGES/django.po new file mode 100644 index 0000000000..a2483ad4d4 --- /dev/null +++ b/mayan/apps/templating/locale/el/LC_MESSAGES/django.po @@ -0,0 +1,59 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/en/LC_MESSAGES/django.po b/mayan/apps/templating/locale/en/LC_MESSAGES/django.po new file mode 100644 index 0000000000..78ed332c38 --- /dev/null +++ b/mayan/apps/templating/locale/en/LC_MESSAGES/django.po @@ -0,0 +1,58 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/es/LC_MESSAGES/django.po b/mayan/apps/templating/locale/es/LC_MESSAGES/django.po new file mode 100644 index 0000000000..a2483ad4d4 --- /dev/null +++ b/mayan/apps/templating/locale/es/LC_MESSAGES/django.po @@ -0,0 +1,59 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/fa/LC_MESSAGES/django.po b/mayan/apps/templating/locale/fa/LC_MESSAGES/django.po new file mode 100644 index 0000000000..3a37b6ca27 --- /dev/null +++ b/mayan/apps/templating/locale/fa/LC_MESSAGES/django.po @@ -0,0 +1,59 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/fr/LC_MESSAGES/django.po b/mayan/apps/templating/locale/fr/LC_MESSAGES/django.po new file mode 100644 index 0000000000..ad8a15a487 --- /dev/null +++ b/mayan/apps/templating/locale/fr/LC_MESSAGES/django.po @@ -0,0 +1,59 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/hu/LC_MESSAGES/django.po b/mayan/apps/templating/locale/hu/LC_MESSAGES/django.po new file mode 100644 index 0000000000..a2483ad4d4 --- /dev/null +++ b/mayan/apps/templating/locale/hu/LC_MESSAGES/django.po @@ -0,0 +1,59 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/id/LC_MESSAGES/django.po b/mayan/apps/templating/locale/id/LC_MESSAGES/django.po new file mode 100644 index 0000000000..3a37b6ca27 --- /dev/null +++ b/mayan/apps/templating/locale/id/LC_MESSAGES/django.po @@ -0,0 +1,59 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/it/LC_MESSAGES/django.po b/mayan/apps/templating/locale/it/LC_MESSAGES/django.po new file mode 100644 index 0000000000..a2483ad4d4 --- /dev/null +++ b/mayan/apps/templating/locale/it/LC_MESSAGES/django.po @@ -0,0 +1,59 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/lv/LC_MESSAGES/django.po b/mayan/apps/templating/locale/lv/LC_MESSAGES/django.po new file mode 100644 index 0000000000..60411a4bd3 --- /dev/null +++ b/mayan/apps/templating/locale/lv/LC_MESSAGES/django.po @@ -0,0 +1,60 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : " +"2);\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/nl_NL/LC_MESSAGES/django.po b/mayan/apps/templating/locale/nl_NL/LC_MESSAGES/django.po new file mode 100644 index 0000000000..78ed332c38 --- /dev/null +++ b/mayan/apps/templating/locale/nl_NL/LC_MESSAGES/django.po @@ -0,0 +1,58 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/pl/LC_MESSAGES/django.po b/mayan/apps/templating/locale/pl/LC_MESSAGES/django.po new file mode 100644 index 0000000000..12706560b8 --- /dev/null +++ b/mayan/apps/templating/locale/pl/LC_MESSAGES/django.po @@ -0,0 +1,61 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n" +"%100<12 || n%100>=14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n" +"%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/pt/LC_MESSAGES/django.po b/mayan/apps/templating/locale/pt/LC_MESSAGES/django.po new file mode 100644 index 0000000000..a2483ad4d4 --- /dev/null +++ b/mayan/apps/templating/locale/pt/LC_MESSAGES/django.po @@ -0,0 +1,59 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/pt_BR/LC_MESSAGES/django.po b/mayan/apps/templating/locale/pt_BR/LC_MESSAGES/django.po new file mode 100644 index 0000000000..ad8a15a487 --- /dev/null +++ b/mayan/apps/templating/locale/pt_BR/LC_MESSAGES/django.po @@ -0,0 +1,59 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/ro_RO/LC_MESSAGES/django.po b/mayan/apps/templating/locale/ro_RO/LC_MESSAGES/django.po new file mode 100644 index 0000000000..78ed332c38 --- /dev/null +++ b/mayan/apps/templating/locale/ro_RO/LC_MESSAGES/django.po @@ -0,0 +1,58 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/ru/LC_MESSAGES/django.po b/mayan/apps/templating/locale/ru/LC_MESSAGES/django.po new file mode 100644 index 0000000000..397aa57dc7 --- /dev/null +++ b/mayan/apps/templating/locale/ru/LC_MESSAGES/django.po @@ -0,0 +1,61 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n" +"%100>=11 && n%100<=14)? 2 : 3);\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/sl_SI/LC_MESSAGES/django.po b/mayan/apps/templating/locale/sl_SI/LC_MESSAGES/django.po new file mode 100644 index 0000000000..78ed332c38 --- /dev/null +++ b/mayan/apps/templating/locale/sl_SI/LC_MESSAGES/django.po @@ -0,0 +1,58 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/tr_TR/LC_MESSAGES/django.po b/mayan/apps/templating/locale/tr_TR/LC_MESSAGES/django.po new file mode 100644 index 0000000000..78ed332c38 --- /dev/null +++ b/mayan/apps/templating/locale/tr_TR/LC_MESSAGES/django.po @@ -0,0 +1,58 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/vi_VN/LC_MESSAGES/django.po b/mayan/apps/templating/locale/vi_VN/LC_MESSAGES/django.po new file mode 100644 index 0000000000..78ed332c38 --- /dev/null +++ b/mayan/apps/templating/locale/vi_VN/LC_MESSAGES/django.po @@ -0,0 +1,58 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/locale/zh/LC_MESSAGES/django.po b/mayan/apps/templating/locale/zh/LC_MESSAGES/django.po new file mode 100644 index 0000000000..78ed332c38 --- /dev/null +++ b/mayan/apps/templating/locale/zh/LC_MESSAGES/django.po @@ -0,0 +1,58 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-11 02:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:19 permissions.py:7 +msgid "Templating" +msgstr "" + +#: forms.py:11 +msgid "Resulting text from the evaluated template." +msgstr "" + +#: forms.py:12 +msgid "Result" +msgstr "" + +#: forms.py:23 +msgid "" +"The template string to be evaluated. Use Django's default templating " +"language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)" +msgstr "" + +#: forms.py:26 +msgid "Template" +msgstr "" + +#: links.py:14 +msgid "Sandbox" +msgstr "" + +#: permissions.py:10 +msgid "Use the template sandbox" +msgstr "" + +#: views.py:46 +#, python-format +msgid "Template error; %(exception)s" +msgstr "" + +#: views.py:59 +#, python-format +msgid "Template sandbox for: %s" +msgstr "" diff --git a/mayan/apps/templating/permissions.py b/mayan/apps/templating/permissions.py new file mode 100644 index 0000000000..eeb207afa9 --- /dev/null +++ b/mayan/apps/templating/permissions.py @@ -0,0 +1,11 @@ +from __future__ import absolute_import, unicode_literals + +from django.utils.translation import ugettext_lazy as _ + +from mayan.apps.permissions import PermissionNamespace + +namespace = PermissionNamespace(label=_('Templating'), name='templating') + +permission_template_sandbox = namespace.add_permission( + label=_('Use the template sandbox'), name='template_sandbox' +) diff --git a/mayan/apps/templating/templates/templating/template_form.html b/mayan/apps/templating/templates/templating/template_form.html new file mode 100644 index 0000000000..413f6eb204 --- /dev/null +++ b/mayan/apps/templating/templates/templating/template_form.html @@ -0,0 +1,28 @@ +{% load static %} + +{% include 'appearance/generic_form.html' %} + +{% block javascript %} + +{% endblock javascript %} diff --git a/mayan/apps/templating/tests/__init__.py b/mayan/apps/templating/tests/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/mayan/apps/templating/tests/test_views.py b/mayan/apps/templating/tests/test_views.py new file mode 100644 index 0000000000..75e4e0278f --- /dev/null +++ b/mayan/apps/templating/tests/test_views.py @@ -0,0 +1,29 @@ +from __future__ import unicode_literals + +from mayan.apps.documents.tests.base import GenericDocumentViewTestCase + +from ..permissions import permission_template_sandbox + + +class DocumentTemplateSandboxViewTestMixin(object): + def _request_document_template_sandbox_view(self): + return self.get( + viewname='templating:document_template_sandbox', + kwargs={'pk': self.test_document.pk} + ) + + +class DocumentTemplateSandboxViewTestCase( + DocumentTemplateSandboxViewTestMixin, GenericDocumentViewTestCase +): + def test_document_template_sanbox_view_no_permissions(self): + response = self._request_document_template_sandbox_view() + self.assertEqual(response.status_code, 404) + + def test_document_template_sanbox_view_with_access(self): + self.grant_access( + obj=self.test_document, permission=permission_template_sandbox + ) + + response = self._request_document_template_sandbox_view() + self.assertEqual(response.status_code, 200) diff --git a/mayan/apps/templating/urls.py b/mayan/apps/templating/urls.py new file mode 100644 index 0000000000..76d38356b6 --- /dev/null +++ b/mayan/apps/templating/urls.py @@ -0,0 +1,13 @@ +from __future__ import unicode_literals + +from django.conf.urls import url + +from .views import DocumentTemplateSandboxView + +urlpatterns = [ + url( + regex=r'^documents/(?P\d+)/sandbox/$', + view=DocumentTemplateSandboxView.as_view(), + name='document_template_sandbox' + ), +] diff --git a/mayan/apps/templating/views.py b/mayan/apps/templating/views.py new file mode 100644 index 0000000000..9ace366118 --- /dev/null +++ b/mayan/apps/templating/views.py @@ -0,0 +1,63 @@ +from __future__ import absolute_import, unicode_literals + +from django.contrib import messages +from django.http import HttpResponseRedirect +from django.template import Context, Template, TemplateSyntaxError +from django.urls import reverse +from django.utils.translation import ugettext_lazy as _ + +from mayan.apps.common.generics import FormView +from mayan.apps.common.http import URL +from mayan.apps.common.mixins import ExternalObjectMixin +from mayan.apps.documents.models import Document + +from .forms import DocumentTemplateSandboxForm +from .permissions import permission_template_sandbox + + +class DocumentTemplateSandboxView(ExternalObjectMixin, FormView): + external_object_class = Document + external_object_permission = permission_template_sandbox + form_class = DocumentTemplateSandboxForm + template_name = 'templating/template_form.html' + + def form_valid(self, form): + path = reverse( + viewname='templating:document_template_sandbox', + kwargs={'pk': self.external_object.pk} + ) + url = URL( + path=path, query={'template': form.cleaned_data['template']} + ) + + return HttpResponseRedirect(redirect_to=url.to_string()) + + def get_initial(self): + template_string = self.request.GET.get('template', '') + try: + context = Context( + {'document': self.external_object} + ) + template = Template(template_string=template_string) + result = template.render(context=context) + except TemplateSyntaxError as exception: + result = '' + error_message = _( + 'Template error; %(exception)s' + ) % { + 'exception': exception + } + messages.error(request=self.request, message=error_message) + + return { + 'template': template_string, 'result': result + } + + def get_extra_context(self): + return { + 'object': self.external_object, + 'title': _('Template sandbox for: %s') % self.external_object + } + + def get_form_extra_kwargs(self): + return {'model': Document, 'model_variable': 'document'} diff --git a/mayan/apps/templating/widgets.py b/mayan/apps/templating/widgets.py new file mode 100644 index 0000000000..84ff7adda4 --- /dev/null +++ b/mayan/apps/templating/widgets.py @@ -0,0 +1,37 @@ +from __future__ import absolute_import, unicode_literals + +from collections import OrderedDict + +from django import forms + +from mayan.apps.common.classes import ModelProperty +from mayan.apps.common.widgets import NamedMultiWidget + + +class TemplateWidget(NamedMultiWidget): + def __init__(self, attrs=None, **kwargs): + widgets = OrderedDict() + + widgets['model_property'] = forms.widgets.Select() + widgets['template'] = forms.widgets.Textarea( + attrs={'rows': 5} + ) + super(TemplateWidget, self).__init__( + widgets=widgets, attrs=attrs, **kwargs + ) + + def decompress(self, value): + choices = ModelProperty.get_choices_for( + model=self.attrs['model'] + ) + self.widgets['model_property'].choices = ( + [('', '----')] + choices + ) + return { + 'model_property': None, 'template': value + } + + def value_from_datadict(self, querydict, files, name): + template = querydict.get('{}_template'.format(name)) + + return template diff --git a/mayan/settings/base.py b/mayan/settings/base.py index 816dc34c77..0c8128a034 100644 --- a/mayan/settings/base.py +++ b/mayan/settings/base.py @@ -104,6 +104,7 @@ INSTALLED_APPS = ( 'mayan.apps.rest_api', 'mayan.apps.smart_settings', 'mayan.apps.task_manager', + 'mayan.apps.templating', 'mayan.apps.user_management', # Project apps 'mayan.apps.motd',