8 <script src="http://cdn.ravenjs.com/1.1.7/jquery,native/raven.min.js"></script>
10 Raven.config('{{RAVEN_CONFIG.SENTRY_URL}}', {{RAVEN_CONFIG.SETTINGS|default:'{}'}}).install();
11 {% if request.user.is_authenticated %}
13 name: '{{request.user.username}}',
14 email: '{{request.user.email}}',
15 id: {{request.user.id}}
20 <script src="{% url 'django.views.i18n.javascript_catalog' %}"></script>
23 <link rel="stylesheet/less" type="text/css" href="{% static 'wiki/editor/src/editor/styles/main.less' %}"/>
24 <script type="text/javascript">less = {relativeUrls: true};</script>
25 <script src="{% static 'wiki/editor/libs/less-1.3.3.min.js' %}"></script>
26 <script src="{% static 'wiki/editor/libs/require.js' %}" data-main="{% static 'wiki/editor/src/editor/entrypoint.js' %}" ></script>
28 <link href="{% static 'wiki/build/rng.css' %}" rel="stylesheet">
29 <script src="{% static 'wiki/build/rng.js' %}"></script>
33 <script type="text/javascript">
36 rootSelector: '#editor_root',
37 jsonifySentPayload: false,
39 {% if request.user.is_authenticated %}
41 name: '{{request.user.username}}',
42 email: '{{request.user.email}}',
43 id: {{request.user.id}}
63 handlers: ['console', 'sentry']
68 documentSummaryView: {
69 title: '{% trans 'Informations about lesson' %}',
71 {name: 'version', label: '{% trans 'Version' %}'},
72 {name: 'stage', label: '{% trans 'Stage' %}'},
73 {name: 'assignment', label: '{% trans 'Assignment' %}'},
79 templates: {{serialized_templates|safe}},
81 {key: 'audience', values: [
82 '3-6', '6-9', '9-12', '12-18', '18+', 'Adults'
89 {key: 'relation.coverimage.url', isFile: true}
95 ['core.undo', 'core.redo'],
98 {actionName: 'core.switchToHeader'},
99 {actionName: 'core.switchToParagraph'},
100 {actionName: 'core.switchToImage'},
101 {actionName: 'core.switchToVideo'},
102 'core.toggleBulletList', 'core.toggleEnumList'
106 {actionName: 'core.emphasis', actionConfig: {label: 'emphasis'}},
107 {actionName: 'core.cite', actionConfig: {label: 'cite'}},
108 {actionName: 'core.link'}
113 ['core.showMetadataEditor'],
115 'core.insertOrderExercise',
116 'core.insertChoiceSingleExercise',
117 'core.insertChoiceMultiExercise',
118 'core.insertChoiceTrueOrFalseExercise',
119 'core.insertGapsExercise',
120 'core.insertReplaceExercise'
124 documentSaveUrl: function(id) { return '/editor/text/' + id + '/'; },
125 documentHistoryUrl: function(id) { return '/editor/history/' + id + '/'},
126 documentDiffUrl: function(id) { return '/editor/diff/' + id + '/'; },
127 documentRestoreUrl: function(id) { return '/editor/revert/' + id + '/'},
128 documentPublishUrl: '{% url "catalogue_publish" pk %}',
130 documentScheduleUrl: '{% url "catalogue_book_schedule" pk %}',
131 documentForkUrl: '{% url "catalogue_fork" pk %}',
132 documentGalleryUrl: '{% url "catalogue_book_gallery" pk %}',
134 documentAttachmentUrl: function(attachmentName) {
135 return '{{MEDIA_URL}}uploads/{{ pk }}/' + attachmentName;
137 documentUrl: function(id, version) {
138 var url = '{% url 'wiki_editor' pk %}'
140 url = url + '?version=' + version;
144 documentPreviewUrl: function(id) { return '/documents/{{ pk }}/rev' + id + '/preview/' },
145 documentPreviewMainUrl: function(id) { return '/documents/{{ pk }}/preview/' },
149 {label: '{{forms.text_save.comment.label}}', name: '{{forms.text_save.comment.html_name}}', type: 'textarea'},
150 {label: '{{forms.text_save.stage.label}}', name: '{{forms.text_save.stage.html_name}}', type: 'select', options: [
151 {% for value, text in forms.text_save.stage.field.choices %}
152 {value:'{{value|default:''}}', text:'{{text}}'} {% if not forloop.last %}, {% endif %}
154 ], description: '{{forms.text_save.stage.help_text}}'},
156 content_field_name: '{{forms.text_save.text.html_name}}',
157 version_field_name: '{{forms.text_save.parent_revision.html_name}}'
160 documentRestoreForm: {
162 {label: '{{forms.text_revert.comment.label}}', name: '{{forms.text_revert.comment.html_name}}', type: 'textarea'}
164 version_field_name: '{{forms.text_revert.revision.html_name}}'
167 documentPublishForm: {
170 revision_field_name: '{{forms.text_publish.revision.html_name}}'
176 config.documentSaveForm.fields.push(
177 {label: '{{forms.text_save.publishable.label}}', name: '{{forms.text_save.publishable.html_name}}', type: 'checkbox', description: '{{forms.text_save.publishable.help_text}}'}
181 {% if not request.user.is_authenticated %}
182 config.documentSaveForm.fields.push(
183 {label: '{{forms.text_save.author_name.label}}', name: '{{forms.text_save.author_name.html_name}}', type: 'input', description: '{{forms.text_save.author_name.help_text}}'},
184 {label: '{{forms.text_save.author_email.label}}', name: '{{forms.text_save.author_email.html_name}}', type: 'input', description: '{{forms.text_save.author_email.help_text}}'}
187 config.documentRestoreForm.fields.push(
188 {label: '{{forms.text_revert.author_name.label}}', name: '{{forms.text_revert.author_name.html_name}}', type: 'input', description: '{{forms.text_revert.author_name.help_text}}'},
189 {label: '{{forms.text_revert.author_email.label}}', name: '{{forms.text_revert.author_email.html_name}}', type: 'input', description: '{{forms.text_revert.author_email.help_text}}'}
194 var data = {{serialized_document_data}};
197 var editor_init = function(Editor) {
198 Editor.setBootstrappedData('data', data);
199 Editor.start(config);
206 <div id="editor_root"></div>