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 $('iframe').load(function() {
32 $($('iframe').contents()).scroll(function() {
33 var percentScrolled = $('body', this).scrollTop() / $('body', this).height();
34 $('#images-wrap').scrollTop(percentScrolled * $('#images').height());
38 addEditorButton('utwór', function(text) { return '<utwor>' + text + '</utwor>'; });
39 addEditorButton('akap', function(text) { return '<akap>' + text + '</akap>'; });
41 $('#images').lazyload('.image-box', {threshold: 600});
45 {% endblock extrahead %}
47 {% block breadcrumbs %}<a href="{% url file_list %}">Platforma Redakcyjna</a> ❯ plik {{ hash }}{% endblock breadcrumbs %}
49 {% block maincontent %}
50 <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>
52 <div id="images-wrap">
54 <p>Aby zobaczyć obrazki wybierz folder z obrazkami powyżej.</p>
57 <form action="." method="post" accept-charset="utf-8">
58 {# <div id="buttons"></div> #}
59 <textarea id="id_text" name="text" style="width:50%; height:480px">{{ form.text.field.initial }}</textarea>
60 {{ form.user.errors }}
61 <p>Użytkownik: {{ form.user }}</p>
62 {{ form.commit_message.errors }}
63 <p>Opis zmian: {{ form.commit_message }} <input type="submit" value="Zapisz"/></p>
65 {% endblock maincontent %}