d2c5ba83e28165f6083950e356edbf1e30072ffd
[redakcja.git] / project / templates / explorer / editor.html
1 {% extends "base.html" %}
2
3 {% block extrahead %}
4         <script type="text/javascript" charset="utf-8">
5                 var fileId = '{{ fileid }}';
6         </script>
7     <link rel="stylesheet" href="{{STATIC_URL}}css/toolbar.css" type="text/css" />
8     <link rel="stylesheet" href="{{STATIC_URL}}css/jquery.modal.css" type="text/css" />
9     <script src="{{STATIC_URL}}js/lib/jquery.lazyload.js" type="text/javascript" charset="utf-8"></script>
10     <script src="{{STATIC_URL}}js/lib/codemirror/codemirror.js" type="text/javascript" charset="utf-8"></script>
11     <script src="{{STATIC_URL}}js/lib/jquery.wtooltip.js" type="text/javascript" charset="utf-8"></script>
12     <script src="{{STATIC_URL}}js/lib/jquery.json.js" type="text/javascript" charset="utf-8"></script>
13     <script src="{{STATIC_URL}}js/lib/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
14     <script src="{{STATIC_URL}}js/lib/jquery.modal.js" type="text/javascript" charset="utf-8"></script>
15         <script src="{{STATIC_URL}}js/app.js" type="text/javascript" charset="utf-8"></script>
16         <script src="{{STATIC_URL}}js/views/split.js" type="text/javascript" charset="utf-8"></script>
17         <script src="{{STATIC_URL}}js/views/xml.js" type="text/javascript" charset="utf-8"></script>
18         <script src="{{STATIC_URL}}js/views/html.js" type="text/javascript" charset="utf-8"></script>
19         <script src="{{STATIC_URL}}js/views/panel_container.js" type="text/javascript" charset="utf-8"></script>
20     <script src="{{STATIC_URL}}js/editor.js" type="text/javascript" charset="utf-8"></script>
21     <script src="{{STATIC_URL}}js/editor.ui.js" type="text/javascript" charset="utf-8"></script>
22
23         {# JavaScript templates #}
24         <script type="text/html" charset="utf-8" id="panel-container-view-template">
25                 <select>
26                         <% for (var i = 0; i < panels.length; i++) { %>
27                         <option value="<%= i %>"><%= panels[i].name %></option>
28                         <% }; %>
29                 </select>
30                 <div class="content-view"></div>
31         </script>
32         
33         <script type="text/html" charset="utf-8" id="xml-view-template">
34                 <div class="xmlview">
35                 </div>
36         </script>
37         
38         <script type="text/html" charset="utf-8" id="html-view-template">
39                 <p>Hej! Jestem widokiem HTML!</p>
40         </script>
41 {% endblock extrahead %}
42
43 {% block extrabody %}
44     <script type="text/javascript" charset="utf-8">
45     $(function() {
46         {% for scriptlet in scriptlets %}
47         editor.registerScriptlet("{{scriptlet.name}}",
48             function(editor, panel, params) {
49                 {{ scriptlet.code|safe }}
50             });
51         {% endfor %}
52      });  
53     </script>
54 {% endblock extrabody %}
55
56 {% load explorer_tags %}
57
58 {% block breadcrumbs %}<a href="{% url file_list %}">Platforma Redakcyjna</a> &gt; {{ fileid|bookname }}{% endblock breadcrumbs %}
59
60 {% block header-toolbar %}
61 <button type="button" class="requires-save toolbar-button" id="toolbar-button-commit">Merge</button>
62 <button type="button" class="requires-save toolbar-button" id="toolbar-button-update"
63         ui:ajax-action="{% url file_update fileid %}">Update</button>
64 <button type="button" class="provides-save toolbar-button" id="toolbar-button-save" disabled="disabled">Commit</button>
65 <button type="button" class="provides-save toolbar-button" id="toolbar-button-quick-save" disabled="disabled">Quick Save</button>
66 {% endblock %}
67
68 {% block message-box %}
69     <div class="msg-info" id="save-waiting"><p>Zapisuję dane na serwerze.</p><p class="data"></p></div>
70     <div class="msg-success" id="save-successful"><p>Zapisano :)</p><p class="data"></p></div>
71     <div class="msg-warning" id="save-warn"><p>Zapisano. Uwagi: (</p><p class="data"></p></div>
72     <div class="msg-error" id="save-error"><p>Błąd przy zapisie.</p> <p class="data"></p></div>
73
74     <div class="msg-success" id="generic-yes"><p class="data"></p></div>
75     <div class="msg-info" id="generic-info"><p class="data"></p></div>
76     <div class="msg-error" id="generic-error"><p class="data"></p></div>
77     
78     <div class="msg-warning" id="not-implemented"><p>Tej funkcji jeszcze nie ma :(</p><p class="data"></p></div>
79     
80 {% endblock %}
81
82 {% block maincontent %}
83         <div id="splitview">
84                 <div id="left-panel-container" class='panel-container'></div>
85             <div id="right-panel-container" class='panel-container'></div>
86     </div>
87
88
89     <div id="commit-dialog" class="jqmWindow">
90         <form action="{% url file_commit fileid %}" method="POST">
91             <label for="message">Commit message:</label>
92             <textarea cols="60" rows="10" name="message" id="commit-dialog-message"></textarea>
93             <p id="commit-dialog-error-empty-message">Wiadomość nie może być pusta.</p>                
94             <fieldset id="commit-dialog-related-issues" 
95                       ui:ajax-src="http://localhost:3000/publications/issues/{{fileid}}">
96                 <legend>Related issues</legend>
97                 <div class="loading-box" style="display: none;">
98                     <p>Loading related issues...</p>
99                 </div>
100                 <div class="container-box">No related issues.</div>
101             </fieldset>
102             <p>
103                <input type="button" value="Save" id="commit-dialog-save-button" />
104                <input type="reset" value="Cancel" id="commit-dialog-cancel-button" />
105             </p>
106         </form>
107     </div>
108
109     <div id="split-dialog" class="jqmWindow">
110         <div class="container-box"> </div>
111         <div class="loading-box" style="display: none;">
112             <p>Loading dialog contents...</p>
113             <!-- <p><button type="button" class="dialog-close-button">Close</button></p> -->
114         </div>
115         <div class="fatal-error-box" style="display: none;">
116             <p>Server error, while loading dialog :(</p>
117             <p><button type="button" class="dialog-close-button">Close</button></p>
118         </div>
119     </div>
120 {% endblock maincontent %}