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: '{% trans "Edit your document text." %}'},
178 {name: 'sourceEditor', text: '{% trans "View the xml code of your document." %}'},
179 {name: 'history', text: '{% trans "Here you can view the change history." %}'},
180 {name: 'switchToHeader', text: '{% trans "Place the mouse cursor at the end of the line after which you want to add a new header, and press Enter. Click “header” to switch the new paragraph into a header." %}'},
181 {name: 'switchToParagraph', text: '{% trans "Use this option to switch a header to a paragraph." %}'},
182 {name: 'switchToImage', text: '{% trans "Add graphics to your document. Click “image” to make a frame, then click this frame to insert an image file (JPG, PNG, GIF, SVG)." %}'},
183 {name: 'switchToVideo', text: '{% trans "Add a video material to your document to make it more attractive. Paste the http link from a YouTube channel." %}'},
184 {name: 'toggleBulletList', text: '{% trans "Select this option to create a bullet list. Press Enter to add another item. To end the list, place the cursor at the end of the last item, and press Enter twice." %}'},
185 {name: 'toggleEnumList', text: '{% trans "Create numbered lists. To end the list, set the cursor at the end of the last item, and press Enter twice." %}'},
186 {name: 'emphasis', text: '{% trans "Emphasize some text by using boldface. To turn it off, click the specific word and then click “emphasis”." %}'},
187 {name: 'cite', text: '{% trans "Select some text and click “cite” to make it italic. To turn it off, set the cursor on the specific word then click “cite” again." %}'},
188 {name: 'link', text: '{% trans "Paste the link and select it, or select text and click “link” to add a hyperlink or to link additional materials (ODT, DOC, PDF)." %}'},
189 {name: 'showMetadataEditor', text: '{% trans "Here you can review and edit metadata. In “Attachments” you can add or change the cover of your document." %}'},
190 {name: 'preview', text: '{% trans "Review your document before publication." %}'},
191 {name: 'attachments', text: '{% trans "Here you can add other important materials to this document (audio files, JPG, PNG, ODT, PDF etc.)" %}'},
192 {name: 'draft', text: '{% trans "Select this option if you do not like your unsaved changes. Warning! Dropped changes will be lost and they cannot be restored." %}'},
193 {name: 'comment', text: '{% trans "If you work on a document with a group, you can leave comments on each line of the document. Your comment will appear as a “bubble” on the left." %}'},
194 {name: 'save', text: '{% trans "Click “Save” to save all the changes in your document. Remember to select the appropriate stage of the work on the document (Draft, Comments, Comments review, Proofreading, Publication)." %}'},
195 {name: 'mainpage', text: '{% trans "Click on the MIL/PEER logo to open the home page in a new window." %}'},
196 {name: 'exit', text: '{% trans "“Exit” will take you to the main page." %}'}
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);
228 <div id="tuton"></div>
229 <div id="editor_root"></div>