1 {% extends "base.html" %}
4 <script src="/static/js/jquery.fieldselection.js" type="text/javascript" charset="utf-8"></script>
5 <script src="/static/js/jquery.lazyload.js" type="text/javascript" charset="utf-8"></script>
6 <script src="/static/js/codemirror/codemirror.js" type="text/javascript" charset="utf-8"></script>
7 <!-- <script src="/static/js/edit_area_full.js" type="text/javascript" charset="utf-8"></script>-->
8 <script type="text/javascript" charset="utf-8">
9 function addEditorButton(label, fn) {
10 $('<button type="button">' + label + '</button>').click(function(event) {
11 var text = $('#id_text').getSelection().text;
12 $('#id_text').replaceSelection(fn(text));
13 event.preventDefault();
14 }).appendTo('#buttons');
18 $('#id_folders').change(function() {
19 $('#images').load('/images/' + $('#id_folders').val() + '/', function() {
20 $('#images').data('lastScroll', -1000);
24 var editor = CodeMirror.fromTextArea("id_text", {
25 parserfile: 'parsexml.js',
26 path: "/static/js/codemirror/",
27 stylesheet: "/static/css/xmlcolors.css",
28 parserConfig: {useHTMLKludges: false}
31 addEditorButton('utwór', function(text) { return '<utwor>' + text + '</utwor>'; });
32 addEditorButton('akap', function(text) { return '<akap>' + text + '</akap>'; });
34 $('#images').lazyload('.image-box', {threshold: 600});
37 {% endblock extrahead %}
39 {% block breadcrumbs %}<a href="{% url file_list %}">Platforma Redakcyjna</a> ❯ plik {{ hash }}{% endblock breadcrumbs %}
41 {% block maincontent %}
42 <div id="tabs"><a href="{% url file_xml hash %}" class="active">Źródło</a><a href="{% url file_html hash %}">HTML</a> <div style="padding: 3px; margin-left: 10px">{{ image_folders_form.folders }}</div><div style="clear: both; height: 0; width: 0"> </div></div>
45 <p>Aby zobaczyć obrazki wybierz folder z obrazkami powyżej.</p>
47 <form action="." method="post" accept-charset="utf-8">
48 {# <div id="buttons"></div> #}
49 <textarea id="id_text" name="text" style="width:50%; height:480px">{{ form.text.field.initial }}</textarea>
50 {{ form.user.errors }}
51 <p>Użytkownik: {{ form.user }}</p>
52 {{ form.commit_message.errors }}
53 <p>Opis zmian: {{ form.commit_message }} <input type="submit" value="Zapisz"/></p>
55 {% endblock maincontent %}