-{% load staticfiles %}
+{% load static %}
{% load i18n %}
<!DOCTYPE html>
{% endif %}
</script>
{% endif %}
- <script src="{% url 'django.views.i18n.javascript_catalog' %}"></script>
- <script src="http://cdnjs.cloudflare.com/ajax/libs/ace/1.1.01/ace.js" type="text/javascript" charset="utf-8"></script>
+ <script src="{% url 'javascript_catalog' %}"></script>
{% if DEBUG %}
<link rel="stylesheet/less" type="text/css" href="{% static 'wiki/editor/src/editor/styles/main.less' %}"/>
<script type="text/javascript">less = {relativeUrls: true};</script>
<script src="{% static 'wiki/editor/libs/less-1.3.3.min.js' %}"></script>
<script src="{% static 'wiki/editor/libs/require.js' %}" data-main="{% static 'wiki/editor/src/editor/entrypoint.js' %}" ></script>
+ <script src="{% static 'wiki/editor/libs/jquery-1.9.1.min.js' %}"></script>
+ <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
{% else %}
<link href="{% static 'wiki/build/rng.css' %}" rel="stylesheet">
<script src="{% static 'wiki/build/rng.js' %}"></script>
{% endif %}
+ <script src="{% static 'js/catalogue/catalogue.js' %}"></script> {# for tutorial #}
</head>
<body>
<script type="text/javascript">
},
'console': {
level: 'debug',
- handler: 'console'
+ handler: 'console',
+ formatter: 'simple'
}
},
loggers: {
'': {
level: 'debug',
- handlers: ['sentry', 'console']
+ handlers: ['console', 'sentry']
}
}
},
- metadata: [
- {key: 'creator.expert'},
- {key: 'creator.scenario'},
- {key: 'creator.textbook'},
- {key: 'title'},
- {key: 'relation.isPartOf'},
- {key: 'publisher'},
- {key: 'subject.competence'},
- {key: 'subject.curriculum'},
- {key: 'subject'},
- {key: 'description'},
- {key: 'description.material'},
- {key: 'identifier.url'},
- {key: 'rights'},
- {key: 'rights.license'},
- {key: 'format'},
- {key: 'type'},
- {key: 'date'},
- {key: 'audience'}
-
- ],
-
documentSummaryView: {
title: '{% trans 'Informations about lesson' %}',
properties: [
- {name: 'stage', label: '{% trans 'Stage' %}'},
+ {name: 'version', label: '{% trans 'Version' %}'},
+ {name: 'stage_name', label: '{% trans 'Stage' %}'},
{name: 'assignment', label: '{% trans 'Assignment' %}'}
]
},
+
+ plugins: {
+ core: {
+ templates: {{serialized_templates|safe}},
+ metadata: [
+ {key: 'audience', values: [
+ '3-6', '6-9', '9-12', '12-18', '18+', 'Adults'
+ ]},
+ {key: 'creator'},
+ {key: 'description'},
+ {key: 'publisher'},
+ {key: 'language'},
+ {key: 'rights'},
+ {key: 'relation.coverimage.url', isFile: true}
+ ]
+ }
+ },
+
+ toolbar: [
+ ['core.undo', 'core.redo'],
+
+ [
+ {actionName: 'core.switchToHeader'},
+ {actionName: 'core.switchToParagraph'},
+ {actionName: 'core.switchToImage'},
+ {actionName: 'core.switchToVideo'},
+ 'core.toggleBulletList', 'core.toggleEnumList'
+ ],
+
+ [
+ {actionName: 'core.emphasis', actionConfig: {label: '{% trans "emphasis" %}'}},
+ {actionName: 'core.cite', actionConfig: {label: '{% trans "cite" %}'}},
+ {actionName: 'core.link', actionConfig: {label: '{% trans "link" %}'}}
+ ],
+
+ //['core.template'],
+
+ ['core.showMetadataEditor']
+ /*[
+ 'core.insertOrderExercise',
+ 'core.insertChoiceSingleExercise',
+ 'core.insertChoiceMultiExercise',
+ 'core.insertChoiceTrueOrFalseExercise',
+ 'core.insertGapsExercise',
+ 'core.insertReplaceExercise'
+ ]*/
+ ],
documentSaveUrl: function(id) { return '/editor/text/' + id + '/'; },
documentHistoryUrl: function(id) { return '/editor/history/' + id + '/'},
documentDiffUrl: function(id) { return '/editor/diff/' + id + '/'; },
documentRestoreUrl: function(id) { return '/editor/revert/' + id + '/'},
+ documentPublishUrl: '{% url "catalogue_publish" pk %}',
+
+ documentScheduleUrl: '{% url "catalogue_book_schedule" pk %}',
+ documentForkUrl: '{% url "catalogue_fork" pk %}',
+ documentGalleryUrl: '{% url "catalogue_book_gallery" pk %}',
+
+ documentAttachmentUrl: function(attachmentName) {
+ return '{{MEDIA_URL}}uploads/{{ pk }}/' + attachmentName;
+ },
+ documentUrl: function(id, version) {
+ var url = '{% url 'wiki_editor' pk %}';
+ if(version) {
+ url = url + '?version=' + version;
+ }
+ return url;
+ },
+ documentPreviewUrl: function(id) { return '/documents/{{ pk }}/rev' + id + '/preview/' },
+ documentPreviewMainUrl: function() { return '/documents/{{ pk }}/preview/' },
documentSaveForm: {
fields: [
{label: '{{forms.text_save.comment.label}}', name: '{{forms.text_save.comment.html_name}}', type: 'textarea'},
- {label: '{{forms.text_save.stage_completed.label}}', name: '{{forms.text_save.stage_completed.html_name}}', type: 'select', options: [
- {% for value,text in tags %}
+ {label: '{{forms.text_save.stage.label}}', name: '{{forms.text_save.stage.html_name}}', type: 'select', options: [
+ {% for value, text in forms.text_save.stage.field.choices %}
{value:'{{value|default:''}}', text:'{{text}}'} {% if not forloop.last %}, {% endif %}
{% endfor %}
- ], description: '{{forms.text_save.stage_completed.help_text}}'},
+ ], description: '{{forms.text_save.stage.help_text}}'}
],
content_field_name: '{{forms.text_save.text.html_name}}',
version_field_name: '{{forms.text_save.parent_revision.html_name}}'
{label: '{{forms.text_revert.comment.label}}', name: '{{forms.text_revert.comment.html_name}}', type: 'textarea'}
],
version_field_name: '{{forms.text_revert.revision.html_name}}'
- }
+ },
+
+ documentPublishForm: {
+ fields: [
+ ],
+ revision_field_name: '{{forms.text_publish.revision.html_name}}'
+ },
+
+ tutorial: [
+ {name: 'editor', text: '{% trans "Edit your document text." %}'},
+ {name: 'sourceEditor', text: '{% trans "View the xml code of your document." %}'},
+ {name: 'history', text: '{% trans "Here you can view the change history." %}'},
+ {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." %}'},
+ {name: 'switchToParagraph', text: '{% trans "Use this option to switch a header to a paragraph." %}'},
+ {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)." %}'},
+ {name: 'switchToVideo', text: '{% trans "Add a video material to your document to make it more attractive. Paste the http link from a YouTube channel." %}'},
+ {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." %}'},
+ {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." %}'},
+ {name: 'emphasis', text: '{% trans "Emphasize some text by using boldface. To turn it off, click the specific word and then click “emphasis”." %}'},
+ {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." %}'},
+ {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)." %}'},
+ {name: 'showMetadataEditor', text: '{% trans "Here you can review and edit metadata. In “Attachments” you can add or change the cover of your document." %}'},
+ {name: 'preview', text: '{% trans "Review your document before publication." %}'},
+ {name: 'attachments', text: '{% trans "Here you can add other important materials to this document (audio files, JPG, PNG, ODT, PDF etc.)" %}'},
+ {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." %}'},
+ {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." %}'},
+ {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)." %}'},
+ {name: 'mainpage', text: '{% trans "Click on the MIL/PEER logo to open the home page in a new window." %}'},
+ {name: 'exit', text: '{% trans "“Exit” will take you to the main page." %}'}
+ ]
};
{% if can_pubmark %}
{% endif %}
{% autoescape off%}
- var data = {{serialized_document_data}},
- templates = {{serialized_templates}}
+ var data = {{serialized_document_data}};
{%endautoescape%}
var editor_init = function(Editor) {
Editor.setBootstrappedData('data', data);
- Editor.setBootstrappedData('documentToolbar', templates);
Editor.start(config);
};
+
</script>
+ <div id="tuton"></div>
<div id="editor_root"></div>
</body>
</html>