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/jquery.autoscroll.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 function resizePanels() {
25 $('iframe').width($(window).width() - $('#sidebar').outerWidth());
26 $('iframe').height($(window).height() - 100);
27 $('#images-wrap, #toggle-sidebar').height($(window).height() - 100);
30 $('#toggle-sidebar').toggle(function() {
31 $('#images-wrap').width(480);
32 $('#sidebar').width(488);
35 $('#images-wrap').width(0);
36 $('#sidebar').width(8);
40 $(window).resize(function() {
44 var editor = CodeMirror.fromTextArea("id_text", {
45 parserfile: 'parsexml.js',
46 path: "/static/js/codemirror/",
47 stylesheet: "/static/css/xmlcolors.css",
48 parserConfig: {useHTMLKludges: false}
51 $('iframe').load(function() {
52 $('#images').autoscroll('iframe');
54 setTimeout(function() {resizePanels();}, 10);
57 addEditorButton('utwór', function(text) { return '<utwor>' + text + '</utwor>'; });
58 addEditorButton('akap', function(text) { return '<akap>' + text + '</akap>'; });
60 $('#images-wrap').lazyload('.image-box', {threshold: 640 * 10, scrollTreshold: 640 * 5});
64 {% endblock extrahead %}
66 {% block breadcrumbs %}<a href="{% url file_list %}">Platforma Redakcyjna</a> ❯ plik {{ hash }}{% endblock breadcrumbs %}
68 {% block maincontent %}
69 <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="clear: both; height: 0; width: 0"> </div></div>
71 <form action="." method="post" accept-charset="utf-8">
74 <div id="images-wrap">
76 <p>Aby zobaczyć obrazki wybierz folder poniżej:</p>
77 <p>{{ image_folders_form.folders }}</p>
80 <div id="toggle-sidebar"></div>
82 <textarea id="id_text" name="text" width="480px">{{ form.text.field.initial }}</textarea>
86 {{ form.user.errors }} {{ form.commit_message.errors }}
87 <p>Użytkownik: {{ form.user }} Opis zmian: {{ form.commit_message }} <input type="submit" value="Zapisz"/></p>
90 {% endblock maincontent %}