7eca642d518c53e581c8862a17f4611b044e23ed
[redakcja.git] / platforma / templates / explorer / editor.html
1 {% extends "base.html" %}
2 {% load i18n %}
3
4 {% block extrahead %}
5         <link rel="stylesheet" href="{{STATIC_URL}}css/jquery.modal.css" type="text/css" media="screen" charset="utf-8">
6         <link rel="stylesheet" href="{{STATIC_URL}}css/html.css" type="text/css" charset="utf-8">
7         <link rel="stylesheet" href="{{STATIC_URL}}css/toolbar.css" type="text/css" charset="utf-8">
8         <link rel="stylesheet" href="{{STATIC_URL}}css/autumn.css" type="text/css" media="screen" title="Autumn colors" charset="utf-8">
9         
10         <script type="text/javascript" charset="utf-8">
11             var documentInfo = {
12                 docID: '{{ fileid }}',
13                 userID: '{{ euser }}',
14                 docURL: '{% url document_view fileid %}{% if euser %}?user={{ euser|urlencode }}{% endif %}',
15                 toolbarURL: '{% url toolbar_buttons %}',                
16                 staticURL: '{{ STATIC_URL }}'
17             }           
18                 
19         </script>
20         
21         {# Libraries #}
22         <script src="{{STATIC_URL}}js/lib/codemirror/codemirror.js" type="text/javascript" charset="utf-8"></script>
23         <script src="{{STATIC_URL}}js/lib/jquery.modal.js" type="text/javascript" charset="utf-8"></script>
24         <script src="{{STATIC_URL}}js/lib/jquery.json.js" type="text/javascript" charset="utf-8"></script>
25         
26         {# Scriptlets #}
27         <script src="{{STATIC_URL}}js/button_scripts.js" type="text/javascript" charset="utf-8"></script>
28         
29         {# App and views #}
30         <script src="{{STATIC_URL}}js/app.js" type="text/javascript" charset="utf-8"></script>
31         <script src="{{STATIC_URL}}js/messages.js" type="text/javascript" charset="utf-8"></script>
32         <script src="{{STATIC_URL}}js/views/view.js" type="text/javascript" charset="utf-8"></script>
33         <script src="{{STATIC_URL}}js/views/flash.js" type="text/javascript" charset="utf-8"></script>
34         <script src="{{STATIC_URL}}js/views/editor.js" type="text/javascript" charset="utf-8"></script>
35         <script src="{{STATIC_URL}}js/views/button_toolbar.js" type="text/javascript" charset="utf-8"></script>
36         <script src="{{STATIC_URL}}js/views/split.js" type="text/javascript" charset="utf-8"></script>
37         <script src="{{STATIC_URL}}js/views/xml.js" type="text/javascript" charset="utf-8"></script>
38         <script src="{{STATIC_URL}}js/views/html.js" type="text/javascript" charset="utf-8"></script>
39         <script src="{{STATIC_URL}}js/views/gallery.js" type="text/javascript" charset="utf-8"></script>
40         <script src="{{STATIC_URL}}js/views/panel_container.js" type="text/javascript" charset="utf-8"></script>
41         
42         <script src="{{STATIC_URL}}js/models.js" type="text/javascript" charset="utf-8"></script>
43         
44         {# JavaScript templates #}
45         <script type="text/html" charset="utf-8" id="panel-container-view-template">
46                 <div class="panel-main-toolbar">
47                 <p><select>
48                         <option value="empty" selected="selected"> ---- </option>
49                         <% for (panel in panels) { %>
50                         <option value="<%= panel %>"><%= panel %></option>
51                         <% }; %>
52                 </select> <button class="refresh">{% trans "Refresh panel"  %}</button></p>
53                 </div>
54                 <div class="content-view"></div>
55         </script>
56         
57         <script type="text/html" charset="utf-8" id="xml-view-template">
58                 <div class="xmlview-toolbar"></div>
59                 <div class="xmlview">
60                         
61                 </div>
62         </script>
63         
64         <script type="text/html" charset="utf-8" id="html-view-template">
65                 <div class="htmlview-toolbar">
66                     <a class="html-print-link" href="print" ui:baseref="{% url file_print fileid %}" target="_new">{% trans "Print version"  %}</a>
67                     <button class="html-add-theme" type="button">Oznacz fragment motywem</button>
68                     <button class="html-add-annotation" type="button">Dodaj przypis</button>
69                 </div>
70                 
71                 <div class="htmlview">
72                 </div>
73         </script>       
74
75         <script type="text/html" charset="utf-8" id="flash-view-template">
76                 <div class="flashview">
77                 <% if (shownMessage) { %>
78                         <p style="margin: 0; padding: 0.2em 0.5em; line-height: 1.8em" class="<%= shownMessage.type %>"><%= shownMessage.text %></p>
79                 <% } %>
80                 </div>
81         </script>
82         
83     <script type="text/html" charset="utf-8" id="image-gallery-view-template">
84         <div class="image-gallery-view-template">
85
86         <div class="image-gallery-header">
87         <p>
88         <button type="button" class="image-gallery-prev-button">
89         <img alt="PPrevious" src="{{STATIC_URL}}/icons/go-previous.png" width="16" height="16" />
90         </button>
91
92         <input type="input" class="image-gallery-current-page"
93             size="5" value="<%= (currentPage + 1) %>" />
94
95
96         <button type="button" class="image-gallery-next-button">
97         <img alt="{% trans 'Next page'  %}" src="{{STATIC_URL}}/icons/go-next.png" width="16" height="16" />
98         </button>
99
100         <button type="button" class="image-gallery-zoom-in">
101             <img alt="{% trans 'Zoom in'  %}" src="{{STATIC_URL}}/icons/zoom_in.png" width="16" height="16" />
102         </button>
103         <button type="button" class="image-gallery-zoom-out">
104             <img alt="{% trans 'Zoom out'  %}" src="{{STATIC_URL}}/icons/zoom_out.png" width="16" height="16" />
105         </button>
106         <button type="button" class="image-gallery-zoom-reset">
107             <img alt="{% trans 'Reset zoom'  %}" src="{{STATIC_URL}}/icons/zoom.png" width="16" height="16" />
108         </button>
109         </p>
110         </div>
111
112         <div class="image-gallery-page-list">
113             <% for(var i=0; i < model.data.length; i++) { %>
114                 <div class="image-gallery-page-container"
115                     ui:model="<%= model.data[i] %>"
116                     ui:width="480"
117                     ui:height="752"
118                 ></div>
119             <% }; %>
120         </div>
121         
122         </div>
123         </script>
124         
125         <script type="text/html" charset="utf-8" id="image-gallery-empty-template">
126             <div class="image-gallery-empty-template">
127             <div class="empty-gallery-info">Galeria dla tego dokumentu nie istnieje i/lub jest pusta.</div>
128             
129             {% if user.is_superuser %}
130             <div class="choose-gallery">
131                 <p>Dołącz galerię do dokumentu:</p>
132                 <p>{{ gallery_form.subpath }} <input class="choose-gallery-button" type="submit" value="Dołącz"></p>
133             </div>
134             {% endif %}
135         </div>
136         </script>
137         
138         <script type="text/html" charset="utf-8" id="button-toolbar-view-template">
139                 <div class="buttontoolbarview panel-toolbar">
140                         <div class="buttontoolbarview-tabs toolbar-tabs-container toolbar-buttons-container">
141                         <% for (var i=0; i < buttons.length; i++) { %>
142                                 <button type="button" class="buttontoolbarview-tab" ui:groupindex="<%= i %>"><%= buttons[i].name %></button>
143                         <% }; %>
144                         </div>
145                         <div class="buttontoolbarview-groups ">
146                         <% for (var i=0; i < buttons.length; i++) { %>
147                                 <div class="buttontoolbarview-group toolbar-buttons-container" ui:groupIndex="<%= i %>" style="display: none">
148                                         <% for (var j=0; j < buttons[i].buttons.length; j++) { %>
149                                                 <% if (buttons[i].buttons[j].scriptlet_id) { %>
150                                                 <button type="button" class="buttontoolbarview-button"
151                                                     title="<%= buttons[i].buttons[j].tooltip %>"
152                                                     hotkey="<%= buttons[i].buttons[j].key %>"
153                                                     ui:hotkey_mod="<%= buttons[i].buttons[j].key_mod %>"
154                                                     ui:groupindex="<%= i %>" ui:buttonindex="<%= j %>">
155                                                         <%= buttons[i].buttons[j].label %>
156                                                 </button>
157                                                 <% } %>
158                                         <% } %>
159                                 </div>
160                         <% }; %>
161                         </div>
162                 </div>
163         </script>
164 {% endblock extrahead %}
165
166 {% block breadcrumbs %}<a href="{% url file_list %}">Platforma</a> &gt; {{euser}} &gt; {{ fileid }}{% endblock breadcrumbs %}
167
168 {% block header-toolbar %}
169     <a href="http://stigma.nowoczesnapolska.org.pl/platforma-hg/ksiazki/log/tip/{{ fileid }}.xml" target="_new" >{% trans 'History'  %}</a>
170         <button id="action-merge">{% trans 'Push' %}</button>
171         <button id="action-update">{% trans 'Pull' %}</button>
172         <button id="action-commit">{% trans 'Save' %}</button>
173         <button id="action-quick-save">{% trans 'Quick save' %}</button>
174 {% endblock %}
175
176 {% block maincontent %}    
177     
178
179     <div id="splitview">
180         <div id="left-panel-container" class='panel-container'></div>
181         <div id="right-panel-container" class='panel-container'></div>
182     </div>
183
184     <div id="commit-dialog" class="jqmWindow" style="display:none">
185         <form action="" method="POST">
186             <label for="message">Commit message:</label>
187             
188             <textarea cols="60" rows="10" name="message" class="commit-message"></textarea>
189             <div class="error-messages-box"> </div>
190
191             <fieldset class="related-issues-fields" >
192                 <legend>Related issues</legend>
193                 <div class="loading-box" style="display: none;">
194                     <p>Loading related issues...</p>
195                 </div>
196                 <div class="container-box">No related issues.</div>
197             </fieldset>
198             <p>
199                <input type="button" value="Save" class="save-button" />
200                <input type="button" value="Cancel" class="cancel-button" />               
201             </p>
202         </form>
203     </div>
204
205     <div id="theme-edit-dialog" class="jqmWindow" style="display:none">
206         <div class="data-area">        
207         <table class="theme-multi-list">
208             <tbody class="unknown-themes">
209                 <tr class="header"><th colspan="5">Unknown themes</th></tr>
210             </tbody>
211             
212             <tbody>
213                 <tr><th colspan="5">Themes in the database</th></tr>
214             {% regroup availble_themes by first_letter as grouped_themes %}
215
216             {% for letter in grouped_themes %}
217             <tr><th colspan="5" class="letter-heading">{{ letter.grouper }}</th></tr>
218
219             {% for theme in letter.list %}
220             {% if forloop.first %}
221             <tr>
222             {% else %}
223             {% if forloop.counter0|divisibleby:"5" %}
224                 </tr><tr>
225             {% endif %}
226             {% endif %}            
227             <td width="18%"><label><input class="theme-list-item" type="checkbox" value="{{theme.name}}"/>{{ theme.name }}</label></td>
228             {% if forloop.last %}
229             </tr>
230             {% endif %}
231             {% endfor %}
232             
233             {% endfor %}
234             </tbody>
235         </table>
236         </div>
237         <p class="action-area">
238             <input type="button" value="Accept" class="save-button" />
239             <input type="button" value="Cancel" class="cancel-button" />
240             <span class="error-messages-inline-box"></span>
241         </p>
242     </div>
243     
244     <div id="split-dialog" class="jqmWindow" style="display:none">
245         <div class="container-box"> </div>
246         <div class="loading-box" style="display: none;">
247             <p>Loading dialog contents...</p>
248             <!-- <p><button type="button" class="dialog-close-button">Close</button></p> -->
249         </div>
250         <div class="fatal-error-box" style="display: none;">
251             <p>Server error, while loading dialog :(</p>
252             <p><button type="button" class="dialog-close-button">Close</button></p>
253         </div>
254     </div>
255 {% endblock maincontent %}
256
257 {% block extrabody %}
258         <div style="position: absolute; left: 35%; right: 35%; top: 0; height: 20px; z-index: 0" id="flashview"></div>
259 {% endblock %}