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>
27 <script src="{% static 'wiki/editor/libs/jquery-1.9.1.min.js' %}"></script>
28 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
30 <link href="{% static 'wiki/build/rng.css' %}" rel="stylesheet">
31 <script src="{% static 'wiki/build/rng.js' %}"></script>
33 <script src="{% static 'js/catalogue/catalogue.js' %}"></script> {# for tutorial #}
36 <script type="text/javascript">
39 rootSelector: '#editor_root',
40 jsonifySentPayload: false,
42 {% if request.user.is_authenticated %}
44 name: '{{request.user.username}}',
45 email: '{{request.user.email}}',
46 id: {{request.user.id}}
66 handlers: ['console', 'sentry']
71 documentSummaryView: {
72 title: '{% trans 'Informations about lesson' %}',
74 {name: 'version', label: '{% trans 'Version' %}'},
75 {name: 'stage_name', label: '{% trans 'Stage' %}'},
76 {name: 'assignment', label: '{% trans 'Assignment' %}'}
82 templates: {{serialized_templates|safe}},
84 {key: 'audience', values: [
85 '3-6', '6-9', '9-12', '12-18', '18+', 'Adults'
92 {key: 'relation.coverimage.url', isFile: true}
98 ['core.undo', 'core.redo'],
101 {actionName: 'core.switchToHeader'},
102 {actionName: 'core.switchToParagraph'},
103 {actionName: 'core.switchToImage'},
104 {actionName: 'core.switchToVideo'},
105 'core.toggleBulletList', 'core.toggleEnumList'
109 {actionName: 'core.emphasis', actionConfig: {label: '{% trans "emphasis" %}'}},
110 {actionName: 'core.cite', actionConfig: {label: '{% trans "cite" %}'}},
111 {actionName: 'core.link', actionConfig: {label: '{% trans "link" %}'}}
116 ['core.showMetadataEditor']
118 'core.insertOrderExercise',
119 'core.insertChoiceSingleExercise',
120 'core.insertChoiceMultiExercise',
121 'core.insertChoiceTrueOrFalseExercise',
122 'core.insertGapsExercise',
123 'core.insertReplaceExercise'
127 documentSaveUrl: function(id) { return '/editor/text/' + id + '/'; },
128 documentHistoryUrl: function(id) { return '/editor/history/' + id + '/'},
129 documentDiffUrl: function(id) { return '/editor/diff/' + id + '/'; },
130 documentRestoreUrl: function(id) { return '/editor/revert/' + id + '/'},
131 documentPublishUrl: '{% url "catalogue_publish" pk %}',
133 documentScheduleUrl: '{% url "catalogue_book_schedule" pk %}',
134 documentForkUrl: '{% url "catalogue_fork" pk %}',
135 documentGalleryUrl: '{% url "catalogue_book_gallery" pk %}',
137 documentAttachmentUrl: function(attachmentName) {
138 return '{{MEDIA_URL}}uploads/{{ pk }}/' + attachmentName;
140 documentUrl: function(id, version) {
141 var url = '{% url 'wiki_editor' pk %}';
143 url = url + '?version=' + version;
147 documentPreviewUrl: function(id) { return '/documents/{{ pk }}/rev' + id + '/preview/' },
148 documentPreviewMainUrl: function() { return '/documents/{{ pk }}/preview/' },
152 {label: '{{forms.text_save.comment.label}}', name: '{{forms.text_save.comment.html_name}}', type: 'textarea'},
153 {label: '{{forms.text_save.stage.label}}', name: '{{forms.text_save.stage.html_name}}', type: 'select', options: [
154 {% for value, text in forms.text_save.stage.field.choices %}
155 {value:'{{value|default:''}}', text:'{{text}}'} {% if not forloop.last %}, {% endif %}
157 ], description: '{{forms.text_save.stage.help_text}}'}
159 content_field_name: '{{forms.text_save.text.html_name}}',
160 version_field_name: '{{forms.text_save.parent_revision.html_name}}'
163 documentRestoreForm: {
165 {label: '{{forms.text_revert.comment.label}}', name: '{{forms.text_revert.comment.html_name}}', type: 'textarea'}
167 version_field_name: '{{forms.text_revert.revision.html_name}}'
170 documentPublishForm: {
173 revision_field_name: '{{forms.text_publish.revision.html_name}}'
177 {name: 'editor', text: 'e'},
178 {name: 'sourceEditor', text: 's'},
179 {name: 'history', text: 's'},
180 {name: 'switchToHeader', text: 's'},
181 {name: 'switchToParagraph', text: 's'},
182 {name: 'switchToImage', text: 's'},
183 {name: 'switchToVideo', text: 's'},
184 {name: 'toggleBulletList', text: 's'},
185 {name: 'toggleEnumList', text: 's'},
186 {name: 'emphasis', text: 's'},
187 {name: 'cite', text: 's'},
188 {name: 'link', text: 's'},
189 {name: 'showMetadataEditor', text: 's'},
190 {name: 'preview', text: 's'},
191 {name: 'attachments', text: 's'},
192 {name: 'draft', text: 's'},
193 {name: 'comment', text: 's'}, // needs to be set manually in comments.html :(
194 {name: 'save', text: 's'},
195 {name: 'mainpage', text: 's'},
196 {name: 'exit', text: 's'}
201 config.documentSaveForm.fields.push(
202 {label: '{{forms.text_save.publishable.label}}', name: '{{forms.text_save.publishable.html_name}}', type: 'checkbox', description: '{{forms.text_save.publishable.help_text}}'}
206 {% if not request.user.is_authenticated %}
207 config.documentSaveForm.fields.push(
208 {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}}'},
209 {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}}'}
212 config.documentRestoreForm.fields.push(
213 {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}}'},
214 {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}}'}
219 var data = {{serialized_document_data}};
222 var editor_init = function(Editor) {
223 Editor.setBootstrappedData('data', data);
224 Editor.start(config);
231 <div id="editor_root"></div>