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 function resizePanels() {
24 $('iframe').width($(window).width() - $('#sidebar').outerWidth());
25 $('iframe').height($(window).height() - 100);
26 $('#images-wrap, #toggle-sidebar').height($(window).height() - 100);
29 $('#toggle-sidebar').toggle(function() {
30 $('#images-wrap').width(0);
31 $('#sidebar').width(8);
34 $('#images-wrap').width(480);
35 $('#sidebar').width(488);
39 $(window).resize(function() {
43 var editor = CodeMirror.fromTextArea("id_text", {
44 parserfile: 'parsexml.js',
45 path: "/static/js/codemirror/",
46 stylesheet: "/static/css/xmlcolors.css",
47 parserConfig: {useHTMLKludges: false}
50 $('iframe').load(function() {
51 $($('iframe').contents()).scroll(function() {
52 var percentScrolled = $('body', this).scrollTop() / $('body', this).height();
53 $('#images-wrap').scrollTop(percentScrolled * $('#images').height());
56 setTimeout(function() {resizePanels();}, 10);
59 addEditorButton('utwór', function(text) { return '<utwor>' + text + '</utwor>'; });
60 addEditorButton('akap', function(text) { return '<akap>' + text + '</akap>'; });
62 $('#images').lazyload('.image-box', {threshold: 600});
66 {% endblock extrahead %}
68 {% block breadcrumbs %}<a href="{% url file_list %}">Platforma Redakcyjna</a> ❯ plik {{ hash }}{% endblock breadcrumbs %}
70 {% block maincontent %}
71 <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>
73 <form action="." method="post" accept-charset="utf-8">
76 <div id="images-wrap">
78 <p>Aby zobaczyć obrazki wybierz folder z obrazkami powyżej.</p>
81 <div id="toggle-sidebar"></div>
83 <textarea id="id_text" name="text" width="480px">{{ form.text.field.initial }}</textarea>
87 {{ form.user.errors }} {{ form.commit_message.errors }}
88 <p>Użytkownik: {{ form.user }} Opis zmian: {{ form.commit_message }} <input type="submit" value="Zapisz"/></p>
91 {% endblock maincontent %}