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 type="text/javascript" charset="utf-8">
8 function addEditorButton(label, fn) {
9 $('<button type="button">' + label + '</button>').click(function(event) {
10 var text = $('#id_text').getSelection().text;
11 $('#id_text').replaceSelection(fn(text));
12 event.preventDefault();
13 }).appendTo('#buttons');
17 $('#id_folders').change(function() {
18 $('#images').load('/images/' + $('#id_folders').val() + '/', function() {
19 $('#images').data('lastScroll', -1000);
23 var editor = CodeMirror.fromTextArea("id_text", {
24 parserfile: 'parsexml.js',
25 path: "/static/js/codemirror/",
26 stylesheet: "/static/css/xmlcolors.css",
27 parserConfig: {useHTMLKludges: false}
30 $('iframe').load(function() {
31 $($('iframe').contents()).scroll(function() {
32 var percentScrolled = $('body', this).scrollTop() / $('body', this).height();
33 $('#images-wrap').scrollTop(percentScrolled * $('#images').height());
37 addEditorButton('utwór', function(text) { return '<utwor>' + text + '</utwor>'; });
38 addEditorButton('akap', function(text) { return '<akap>' + text + '</akap>'; });
40 $('#images').lazyload('.image-box', {threshold: 600});
44 {% endblock extrahead %}
46 {% block breadcrumbs %}<a href="{% url file_list %}">Platforma Redakcyjna</a> ❯ plik {{ hash }}{% endblock breadcrumbs %}
48 {% block maincontent %}
49 <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>
51 <div id="images-wrap">
53 <p>Aby zobaczyć obrazki wybierz folder z obrazkami powyżej.</p>
56 <form action="." method="post" accept-charset="utf-8">
57 {# <div id="buttons"></div> #}
58 <textarea id="id_text" name="text" style="width:50%; height:480px">{{ form.text.field.initial }}</textarea>
59 {{ form.user.errors }}
60 <p>Użytkownik: {{ form.user }}</p>
61 {{ form.commit_message.errors }}
62 <p>Opis zmian: {{ form.commit_message }} <input type="submit" value="Zapisz"/></p>
64 {% endblock maincontent %}