django 1.10
[redakcja.git] / apps / wiki / templates / wiki / bootstrap.html
index abb41c0..4e4e947 100644 (file)
@@ -1,4 +1,4 @@
-{% 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">
                     }
                 },
               
-                metadata: [
-                    {key: 'audience', values: [
-                         'gimnazjum',
-                         'liceum',
-                         'master',
-                         'minimum',
-                         'optimum',
-                         'przedszkole',
-                         'sp1-3',
-                         'sp4-6',
-                         'studia'
-                    ]},
-                    {key: 'creator.scenario'},
-                    {key: 'creator.methodologist'},
-                    {key: 'description'},
-                    {key: 'type', values: ['course', 'synthetic', 'project']},
-                    {key: 'subject.curriculum', values: [
-                        '2012/III/ETYKA/c4',
-                        '2012/III/ETYKA/t5',
-                        '2012/III/ETYKA/t9',
-                        '2012/III/ETYKA/t11',
-                        '2012/IV/WOS/c4',
-                        '2012/IV/WOS/c6',
-                        '2012/IV/WOS/t1',
-                        '2012/IV/WOS/t2',
-                        '2012/IV/WOS/t5',
-                        '2012/IV/INFORMATYKA/c5',
-                        '2012/II/POLSKI/C3',
-                        '2012/II/POLSKI/C2',
-                        '2012/II/POLSKI/C1',
-                        '2012/II/PLASTYKA/C1',
-                        '2012/II/PLASTYKA/C2',
-                        '2012/II/PLASTYKA/C3',
-                        '2012/II/ETYKA/C4',
-                        '2012/IV/WOS/c6/roz',
-                        '2012/II/WYCHOWANIE_DO_ZYCIA_W_RODZINIE/T11',
-                        '2012/II/POLSKI/T3',
-                        '2012/II/POLSKI/T5',
-                        '2012/II/POLSKI/T4',
-                        '2012/II/POLSKI/T7',
-                        '2012/II/POLSKI/T9',
-                        '2012/II/POLSKI/T10',
-                        '2012/II/POLSKI/T11',
-                        '2012/II/POLSKI/T12',
-                        '2012/II/POLSKI/T13',
-                        '2012/II/POLSKI/T14',
-                        '2012/II/POLSKI/T15',
-                        '2012/II/POLSKI/T16',
-                        '2012/II/POLSKI/T17',
-                        '2012/II/POLSKI/T18',
-                        '2012/II/PLASTYKA/T1',
-                        '2012/II/PLASTYKA/T2',
-                        '2012/II/PLASTYKA/T3',
-                        '2012/II/POLSKI/T6',
-                        '2012/II/ZAJECIA_KOMPUTEROWE/T6',
-                        '2012/II/ZAJECIA_KOMPUTEROWE/T7',
-                        '2012/II/POLSKI/t1',
-                        '2012/II/ZAJECIA_KOMPUTEROWE/T4',
-                        '2012/II/WYCHOWANIE_DO_ZYCIA_W_RODZINIE/T13',
-                        '2012/II/WYCHOWANIE_DO_ZYCIA_W_RODZINIE/T10',
-                        '2012/IV/WOS/t3',
-                        '2012/IV/WOS/t2/roz',
-                        '2012/IV/INFORMATYKA/t1',
-                        '2012/IV/INFORMATYKA/t7',
-                        '2012/IV/ETYKA/c2',
-                        '2012/IV/ETYKA/t4',
-                        '2012/IV/WOS/t8/roz',
-                        '2012/IV/WOS/c3',
-                        '2012/IV/ETYKA/c1',
-                        '2012/III/POLSKI/c1',
-                        '2012/III/POLSKI/c2',
-                        '2012/III/POLSKI/c3',
-                        '2012/III/PLASTYKA/c1',
-                        '2012/III/PLASTYKA/c2',
-                        '2012/III/PLASTYKA/c3',
-                        '2012/III/WOS/c1',
-                        '2012/III/WOS/c2',
-                        '2012/III/WOS/c3',
-                        '2012/III/WOS/c4',
-                        '2012/III/WOS/c5',
-                        '2012/III/WOS/t1',
-                        '2012/III/WOS/t2',
-                        '2012/III/WOS/t3',
-                        '2012/III/WOS/t4',
-                        '2012/III/WOS/t5',
-                        '2012/III/WOS/t6',
-                        '2012/III/WOS/t9',
-                        '2012/III/WOS/t10',
-                        '2012/III/WOS/t11',
-                        '2012/III/WOS/t24',
-                        '2012/III/WOS/t25',
-                        '2012/III/WOS/t26',
-                        '2012/III/INFORMATYKA/c1',
-                        '2012/III/INFORMATYKA/c2',
-                        '2012/III/INFORMATYKA/c5',
-                        '2012/III/ETYKA/c1',
-                        '2012/III/ETYKA/t1',
-                        '2012/IV/INFORMATYKA/c2',
-                        '2012/IV/INFORMATYKA/c4',
-                        '2012/IV/INFORMATYKA/t2',
-                        '2012/IV/INFORMATYKA/t3',
-                        '2012/IV/INFORMATYKA/t4',
-                        '2012/IV/POLSKI/c1',
-                        '2012/IV/POLSKI/c2',
-                        '2012/IV/POLSKI/c3',
-                        '2012/IV/INFORMATYKA/c2',
-                        '2012/IV/INFORMATYKA/c4',
-                        '2012/IV/INFORMATYKA/t2',
-                        '2012/IV/INFORMATYKA/t3',
-                        '2012/IV/INFORMATYKA/t4',
-                        '2012/IV/POLSKI/c1',
-                        '2012/IV/POLSKI/c2',
-                        '2012/IV/POLSKI/c3',
-                        '2012/IV/WOK/c1',
-                        '2012/IV/WOK/c2',
-                        '2012/IV/WOK/c3',
-                        '2012/IV/ETYKA/t11',
-                        '2012/IV/WOS/c1',
-                        '2012/IV/WOS/t13/roz',
-                        '2012/IV/WOS/c2',
-                        '2012/IV/ETYKA/t6',
-                        '2012/IV/ETYKA/t8',
-                        '2012/II/ZAJECIA_KOMPUTEROWE/c1',
-                        '2012/II/ZAJECIA_KOMPUTEROWE/c2',
-                        '2012/II/ZAJECIA_KOMPUTEROWE/c3',
-                        '2012/II/ZAJECIA_KOMPUTEROWE/c5',
-                        '2012/II/HISTORIA_I_SPOLECZENSTWO/c4',
-                        '2012/II/HISTORIA_I_SPOLECZENSTWO/t1',
-                        '2012/II/HISTORIA_I_SPOLECZENSTWO/t4',
-                        '2012/II/HISTORIA_I_SPOLECZENSTWO/t5',
-                        '2012/II/ETYKA/c1',
-                        '2012/II/ETYKA/c3',
-                        '2012/II/ETYKA/c5',
-                        '2012/II/ETYKA/t2',
-                        '2012/II/ETYKA/t3',
-                        '2012/II/ETYKA/t4',
-                        '2012/II/ETYKA/t5',
-                        '2012/II/ETYKA/t6',
-                        '2012/II/ETYKA/t7',
-                        '2012/IV/WOS/t6',
-                        '2012/IV/WOS/t10/roz',
-                        '2012/IV/WOS/t14/roz',
-                        '2012/IV/WOS/t15/roz',
-                        '2012/IV/WOS/t27/roz',
-                        '2012/IV/WOS/t32/roz',
-                        '2012/IV/WOS/t36/roz',
-                        '2012/IV/INFORMATYKA/c1',
-                        '2012/II/HISTORIA_I_SPOLECZENSTWO/t7'
-                    ]},
-                    {key: 'subject.competence', values: [
-                        'Anonimowość - Bezpieczeństwo w komunikacji i mediach',
-                        'Bezpieczeństwo komunikacji, pracy i transakcji - Bezpieczeństwo w komunikacji i mediach',
-                        'Finansowanie mediów i wybrane sposoby zarabiania w nowych mediach - Ekonomiczne aspekty działania mediów',
-                        'Funkcje komunikatów medialnych - Język mediów',
-                        'Informacja jako dobro ekonomiczne - Ekonomiczne aspekty działania mediów',
-                        'Językowa natura mediów - Język mediów',
-                        'Komunikacja i media jako przedmiot refleksji etycznej - Etyka i wartości w komunikacji i mediach',
-                        'Komunikacja - Relacje w środowisku medialnym',
-                        'Kultura komunikacji medialnej - Język mediów',
-                        'Media a prawa człowieka, obywatela i dziecka - Prawo w komunikacji i mediach',
-                        'Nadzór nad siecią - Bezpieczeństwo w komunikacji i mediach',
-                        'Ochrona danych osobowych - Prawo w komunikacji i mediach',
-                        'Ochrona prywatności i wizerunku - Bezpieczeństwo w komunikacji i mediach',
-                        'Otoczenie - Relacje w środowisku medialnym',
-                        'Podejście krytyczne do informacji - Korzystanie z informacji',
-                        'Polityka medialna - Ekonomiczne aspekty działania mediów',
-                        'Prawa osób niepełnosprawnych - Prawo w komunikacji i mediach',
-                        'Prawa wyłączne i monopole intelektualne - Prawo w komunikacji i mediach',
-                        'Prawo mediów i media publiczne - Prawo w komunikacji i mediach',
-                        'Prawo telekomunikacyjne - Prawo w komunikacji i mediach',
-                        'Prezentowanie - Kreatywne korzystanie z mediów',
-                        'Przetwarzanie - Kreatywne korzystanie z mediów',
-                        'Rodzaje, źródła i praktyka stosowania prawa w kontekście mediów - Prawo w komunikacji i mediach',
-                        'Rynek mediów - Ekonomiczne aspekty działania mediów',
-                        'Tworzenie - Kreatywne korzystanie z mediów',
-                        'Uzależnienia i higiena korzystania z mediów - Bezpieczeństwo w komunikacji i mediach',
-                        'Wizerunek - Relacje w środowisku medialnym',
-                        'Wykorzystanie informacji - Korzystanie z informacji',
-                        'Wyszukiwanie informacji - Korzystanie z informacji',
-                        'Wyzwania etyczne a normy prawa w mediach i komunikacji - Etyka i wartości w komunikacji i mediach',
-                        'Wyzwania etyczne a treści mediów i komunikacji - Etyka i wartości w komunikacji i mediach',
-                        'Wyzwania etyczne w relacjach przez media - Etyka i wartości w komunikacji i mediach',
-                        'Źródła informacji - Korzystanie z informacji'
-                    ]}
-                ],
-
                 documentSummaryView: {
                     title: '{% trans 'Informations about lesson' %}',
                     properties: [
                         {name: 'version', label: '{% trans 'Version' %}'},
-                        {name: 'stage', label: '{% trans 'Stage' %}'},
-                        {name: 'assignment', label: '{% trans 'Assignment' %}'},
+                        {name: 'stage_name', label: '{% trans 'Stage' %}'},
+                        {name: 'assignment', label: '{% trans 'Assignment' %}'}
                     ]
                 },
 
                 plugins: {
-                    core: {templates: {{serialized_templates|safe}}}
+                    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: [
                     [
                     {actionName: 'core.switchToHeader'},
                     {actionName: 'core.switchToParagraph'},
+                    {actionName: 'core.switchToImage'},
+                    {actionName: 'core.switchToVideo'},
                     'core.toggleBulletList', 'core.toggleEnumList'
                     ],
 
                     [
-                        {actionName: 'core.emphasis', actionConfig: {label: 'wyróżnienie'}},
-                        {actionName: 'core.cite', actionConfig: {label: 'cytat'}},
-                        {actionName: 'core.link'}
+                        {actionName: 'core.emphasis', actionConfig: {label: '{% trans "emphasis" %}'}},
+                        {actionName: 'core.cite', actionConfig: {label: '{% trans "cite" %}'}},
+                        {actionName: 'core.link', actionConfig: {label: '{% trans "link" %}'}}
                     ],
                     
-                    ['core.template']
+                    //['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}}{{IMAGE_DIR}}{{slug}}/' + 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 %}
                 Editor.setBootstrappedData('data', data);
                 Editor.start(config);
             };
+
         </script>
+        <div id="tuton"></div>
         <div id="editor_root"></div>
     </body>
 </html>