Move template sandbox to its own app

Improve UI for the sandbox template textarea.

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-11-11 02:59:26 -04:00
parent 81b1564535
commit 466f15e154
46 changed files with 1784 additions and 81 deletions

View File

@@ -223,15 +223,21 @@ source_lang = en
source_file = mayan/apps/task_manager/locale/en/LC_MESSAGES/django.po source_file = mayan/apps/task_manager/locale/en/LC_MESSAGES/django.po
type = PO type = PO
[mayan-edms.templating-3-0]
file_filter = mayan/apps/templating/locale/<lang>/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] [mayan-edms.user_management-2-0]
file_filter = mayan/apps/user_management/locale/<lang>/LC_MESSAGES/django.po file_filter = mayan/apps/user_management/locale/<lang>/LC_MESSAGES/django.po
source_lang = en source_lang = en
source_file = mayan/apps/user_management/locale/en/LC_MESSAGES/django.po source_file = mayan/apps/user_management/locale/en/LC_MESSAGES/django.po
type = PO type = PO
[mayan-edms.weblink-3-0] [mayan-edms.web_link-3-0]
file_filter = mayan/apps/weblinks/locale/<lang>/LC_MESSAGES/django.po file_filter = mayan/apps/web_links/locale/<lang>/LC_MESSAGES/django.po
source_lang = en 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 type = PO

View File

@@ -17,8 +17,8 @@ APP_LIST = (
'file_metadata', 'linking', 'lock_manager', 'mailer', 'file_metadata', 'linking', 'lock_manager', 'mailer',
'mayan_statistics', 'metadata', 'mirroring', 'motd', 'navigation', 'mayan_statistics', 'metadata', 'mirroring', 'motd', 'navigation',
'ocr', 'permissions', 'platform', 'rest_api', 'smart_settings', 'ocr', 'permissions', 'platform', 'rest_api', 'smart_settings',
'sources', 'storage', 'tags', 'task_manager', 'user_management', 'sources', 'storage', 'tags', 'task_manager', 'templating',
'web_links' 'user_management', 'web_links'
) )
LANGUAGE_LIST = ( LANGUAGE_LIST = (

View File

@@ -30,14 +30,14 @@ from .html_widgets import (
get_instance_link, index_instance_item_link, node_level get_instance_link, index_instance_item_link, node_level
) )
from .links import ( from .links import (
link_document_index_instance_list, link_document_template_sandbox, link_document_index_instance_list, link_document_type_index_templates,
link_document_type_index_templates, link_index_instance_menu, link_index_instance_menu, link_index_instance_rebuild,
link_index_instance_rebuild, link_index_template_setup, link_index_template_setup, link_index_template_create,
link_index_template_create, link_index_template_document_types, link_index_template_document_types, link_index_template_delete,
link_index_template_delete, link_index_template_edit, link_index_template_edit, link_index_template_list,
link_index_template_list, link_index_template_node_tree_view, link_index_template_node_tree_view, link_index_instances_rebuild,
link_index_instances_rebuild, link_index_template_node_create, link_index_template_node_create, link_index_template_node_delete,
link_index_template_node_delete, link_index_template_node_edit link_index_template_node_edit
) )
from .permissions import ( from .permissions import (
permission_document_indexing_create, permission_document_indexing_delete, permission_document_indexing_create, permission_document_indexing_delete,
@@ -185,7 +185,6 @@ class DocumentIndexingApp(MayanAppConfig):
menu_facet.bind_links( menu_facet.bind_links(
links=( links=(
link_document_index_instance_list, link_document_index_instance_list,
link_document_template_sandbox
), sources=(Document,) ), sources=(Document,)
) )
menu_list_facet.bind_links( menu_list_facet.bind_links(

View File

@@ -7,9 +7,6 @@ icon_index = Icon(driver_name='fontawesome', symbol='list-ul')
icon_document_index_instance_list = Icon( icon_document_index_instance_list = Icon(
driver_name='fontawesome', symbol='list-ul' driver_name='fontawesome', symbol='list-ul'
) )
icon_document_template_sandbox = Icon(
driver_name='fontawesome', symbol='flask'
)
icon_document_type_index_templates = icon_index icon_document_type_index_templates = icon_index
icon_index_level_up = Icon( icon_index_level_up = Icon(
driver_name='fontawesomecss', css_classes='fa-level-up-alt fa-rotate-90' driver_name='fontawesomecss', css_classes='fa-level-up-alt fa-rotate-90'

View File

@@ -23,13 +23,6 @@ link_document_index_instance_list = Link(
text=_('Indexes'), view='indexing:document_index_list', 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( link_document_type_index_templates = Link(
args='resolved_object.pk', args='resolved_object.pk',
icon_class_path='mayan.apps.document_indexing.icons.icon_document_type_index_templates', icon_class_path='mayan.apps.document_indexing.icons.icon_document_type_index_templates',

View File

@@ -8,11 +8,10 @@ from .api_views import (
APIIndexTemplateView, APIIndexView APIIndexTemplateView, APIIndexView
) )
from .views import ( from .views import (
DocumentIndexNodeListView, DocumentTemplateSandboxView, DocumentIndexNodeListView, DocumentTypeIndexesView, IndexInstanceNodeView,
DocumentTypeIndexesView, IndexInstanceNodeView, IndexListView, IndexListView, IndexesRebuildView, SetupIndexDocumentTypesView,
IndexesRebuildView, SetupIndexDocumentTypesView, SetupIndexCreateView, SetupIndexCreateView, SetupIndexDeleteView, SetupIndexEditView,
SetupIndexDeleteView, SetupIndexEditView, SetupIndexListView, SetupIndexListView, SetupIndexRebuildView, SetupIndexTreeTemplateListView,
SetupIndexRebuildView, SetupIndexTreeTemplateListView,
TemplateNodeCreateView, TemplateNodeDeleteView, TemplateNodeEditView TemplateNodeCreateView, TemplateNodeDeleteView, TemplateNodeEditView
) )
@@ -84,11 +83,6 @@ urlpatterns_tools = [
regex=r'^instances/rebuild/$', view=IndexesRebuildView.as_view(), regex=r'^instances/rebuild/$', view=IndexesRebuildView.as_view(),
name='rebuild_index_instances' name='rebuild_index_instances'
), ),
url(
regex=r'^documents/(?P<pk>\d+)/sandbox/$',
view=DocumentTemplateSandboxView.as_view(),
name='document_template_sandbox'
),
] ]
urlpatterns = [] urlpatterns = []

View File

@@ -25,9 +25,7 @@ from mayan.apps.documents.permissions import (
from mayan.apps.documents.views import DocumentListView from mayan.apps.documents.views import DocumentListView
from .events import event_index_template_edited from .events import event_index_template_edited
from .forms import ( from .forms import IndexTemplateFilteredForm, IndexTemplateNodeForm
DocumentTemplateSandboxForm, IndexTemplateFilteredForm, IndexTemplateNodeForm
)
from .html_widgets import node_tree from .html_widgets import node_tree
from .icons import icon_index from .icons import icon_index
from .links import link_index_template_create from .links import link_index_template_create
@@ -481,47 +479,3 @@ class IndexesRebuildView(FormView):
def get_post_action_redirect(self): def get_post_action_redirect(self):
return reverse(viewname='common:tools_list') 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
}

View File

@@ -0,0 +1,3 @@
from __future__ import unicode_literals
default_app_config = 'mayan.apps.templating.apps.TemplatingApp'

View File

@@ -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,)
)

View File

@@ -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)

View File

@@ -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

View File

@@ -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'
)

View File

@@ -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',
)

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@@ -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'
)

View File

@@ -0,0 +1,28 @@
{% load static %}
{% include 'appearance/generic_form.html' %}
{% block javascript %}
<script>
jQuery(document).ready(function() {
$('#id_template_model_property').change(function(event) {
var $idModelProperty = $(this);
var $idTemplate = $('#id_template_template');
var templateCursorPosition = $idTemplate.prop('selectionStart');
var templateValue = $idTemplate.val();
var propertyText = '{{ ';
propertyText = propertyText + '{{ form.model_variable }}.';
propertyText = propertyText + $idModelProperty.val();
propertyText = propertyText + ' }}';
templateValue = templateValue.slice(0, templateCursorPosition) + propertyText + templateValue.slice(templateCursorPosition);
$idTemplate.val(templateValue);
$idTemplate.focus();
$idTemplate.prop('selectionStart', templateCursorPosition + propertyText.length);
$idTemplate.prop('selectionEnd', templateCursorPosition + propertyText.length);
$('#id_template_model_property option')[0].selected = true;
});
});
</script>
{% endblock javascript %}

View File

View File

@@ -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)

View File

@@ -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<pk>\d+)/sandbox/$',
view=DocumentTemplateSandboxView.as_view(),
name='document_template_sandbox'
),
]

View File

@@ -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'}

View File

@@ -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

View File

@@ -104,6 +104,7 @@ INSTALLED_APPS = (
'mayan.apps.rest_api', 'mayan.apps.rest_api',
'mayan.apps.smart_settings', 'mayan.apps.smart_settings',
'mayan.apps.task_manager', 'mayan.apps.task_manager',
'mayan.apps.templating',
'mayan.apps.user_management', 'mayan.apps.user_management',
# Project apps # Project apps
'mayan.apps.motd', 'mayan.apps.motd',