Dodanie flash messages.
[redakcja.git] / project / templates / explorer / editor.html
1 {% extends "base.html" %}
2
3 {% block extrahead %}
4         <link rel="stylesheet" href="{{STATIC_URL}}css/jquery.modal.css" type="text/css" media="screen" title="no title" charset="utf-8">
5         <link rel="stylesheet" href="{{STATIC_URL}}css/html.css" type="text/css" media="screen" title="no title" charset="utf-8">
6         
7         <script type="text/javascript" charset="utf-8">
8                 var fileId = '{{ fileid }}';
9         </script>
10         
11         {# Libraries #}
12     <script src="{{STATIC_URL}}js/lib/codemirror/codemirror.js" type="text/javascript" charset="utf-8"></script>
13         <script src="{{STATIC_URL}}js/lib/jquery.modal.js" type="text/javascript" charset="utf-8"></script>
14         {# Scriptlets #}
15         <script src="http://localhost:8000/api/toolbar/scriptlets" type="text/javascript" charset="utf-8"></script>
16         
17         {# App and views #}
18         <script src="{{STATIC_URL}}js/app.js" type="text/javascript" charset="utf-8"></script>
19         <script src="{{STATIC_URL}}js/messages.js" type="text/javascript" charset="utf-8"></script>
20         <script src="{{STATIC_URL}}js/views/view.js" type="text/javascript" charset="utf-8"></script>
21         <script src="{{STATIC_URL}}js/views/flash.js" type="text/javascript" charset="utf-8"></script>
22         <script src="{{STATIC_URL}}js/views/editor.js" type="text/javascript" charset="utf-8"></script>
23         <script src="{{STATIC_URL}}js/views/button_toolbar.js" type="text/javascript" charset="utf-8"></script>
24         <script src="{{STATIC_URL}}js/views/split.js" type="text/javascript" charset="utf-8"></script>
25         <script src="{{STATIC_URL}}js/views/xml.js" type="text/javascript" charset="utf-8"></script>
26         <script src="{{STATIC_URL}}js/views/html.js" type="text/javascript" charset="utf-8"></script>
27         <script src="{{STATIC_URL}}js/views/gallery.js" type="text/javascript" charset="utf-8"></script>
28         <script src="{{STATIC_URL}}js/views/panel_container.js" type="text/javascript" charset="utf-8"></script>
29         
30         <script src="{{STATIC_URL}}js/models.js" type="text/javascript" charset="utf-8"></script>
31         
32         {# JavaScript templates #}
33         <script type="text/html" charset="utf-8" id="panel-container-view-template">
34                 <select>
35                         <% for (panel in panels) { %>
36                         <option value="<%= panel %>"><%= panel %></option>
37                         <% }; %>
38                 </select>
39                 <div class="content-view"></div>
40         </script>
41         
42         <script type="text/html" charset="utf-8" id="xml-view-template">
43                 <div class="xmlview-toolbar"></div>
44                 <div class="xmlview">
45                         
46                 </div>
47         </script>
48         
49         <script type="text/html" charset="utf-8" id="html-view-template">
50                 <div class="htmlview">
51                 </div>
52         </script>
53
54         <script type="text/html" charset="utf-8" id="flash-view-template">
55                 <div class="flashview" style="position: relative; margin-left: auto; margin-right: auto; width: 400px; background-color: yellow">
56                 <% if (shownMessage) { %>
57                         <p style="margin: 0; padding: 0.2em 0.5em; line-height: 1.8em" class="<%= shownMessage.type %>"><%= shownMessage.text %></p>
58                 <% } %>
59                 </div>
60         </script>
61         
62     <script type="text/html" charset="utf-8" id="image-gallery-view-template">
63         <div class="image-gallery-view-template">
64
65         <div class="image-gallery-header">
66         <p>
67         <button type="button" class="image-gallery-prev-button">Previous</button>
68         <input type="input" class="image-gallery-current-page" />
69         <button type="button" class="image-gallery-next-button">Next</button>
70         </p>
71         </div>
72
73         <div>
74             <% for(var i=0; i < model.data.length; i++) { %>
75                 <p class="image-gallery-page-container"><%= model.data[i] %></p>
76             <% }; %>
77         </div>
78         
79         </div>
80         </script>
81         
82         <script type="text/html" charset="utf-8" id="button-toolbar-view-template">
83                 <div class="buttontoolbarview">
84                         <div class="buttontoolbarview-tabs">
85                         <% for (var i=0; i < buttons.length; i++) { %>
86                                 <a href="#" class="buttontoolbarview-tab" ui:groupindex="<%= i %>"><%= buttons[i].name %></a>
87                         <% }; %>
88                         </div>
89                         <div class="buttontoolbarview-groups">
90                         <% for (var i=0; i < buttons.length; i++) { %>
91                                 <div class="buttontoolbarview-group" ui:groupIndex="<%= i %>" style="display: none">
92                                         <% for (var j=0; j < buttons[i].buttons.length; j++) { %>
93                                                 <% if (buttons[i].buttons[j].scriptlet_id) { %>
94                                                 <a href="#" class="buttontoolbarview-button" ui:groupindex="<%= i %>" ui:buttonindex="<%= j %>">
95                                                         <%= buttons[i].buttons[j].label %>
96                                                 </a>
97                                                 <% } %>
98                                         <% } %>
99                                 </div>
100                         <% }; %>
101                         </div>
102                 </div>
103         </script>
104 {% endblock extrahead %}
105
106 {% block breadcrumbs %}<a href="{% url file_list %}">Platforma Redakcyjna</a> &gt; {{ fileid }}{% endblock breadcrumbs %}
107
108 {% block message-box %}
109     <div class="msg-info" id="save-waiting"><p>Zapisuję dane na serwerze.</p><p class="data"></p></div>
110     <div class="msg-success" id="save-successful"><p>Zapisano :)</p><p class="data"></p></div>
111     <div class="msg-warning" id="save-warn"><p>Zapisano. Uwagi: (</p><p class="data"></p></div>
112     <div class="msg-error" id="save-error"><p>Błąd przy zapisie.</p> <p class="data"></p></div>
113
114     <div class="msg-success" id="generic-yes"><p class="data"></p></div>
115     <div class="msg-info" id="generic-info"><p class="data"></p></div>
116     <div class="msg-error" id="generic-error"><p class="data"></p></div>
117     
118     <div class="msg-warning" id="not-implemented"><p>Tej funkcji jeszcze nie ma :(</p><p class="data"></p></div>
119     
120 {% endblock %}
121
122 {% block header-toolbar %}
123         <button id="action-merge">Merge</button> <button id="action-update">Update</button> <button id="action-commit">Commit</button> <button id="action-quick-save">Quick Save</button>
124 {% endblock %}
125
126 {% block maincontent %}
127         <div id="splitview">
128                 <div id="left-panel-container" class='panel-container'></div>
129             <div id="right-panel-container" class='panel-container'></div>
130     </div>
131
132
133     <div id="commit-dialog" class="jqmWindow" style="display:none">
134         <form action="{% url file_commit fileid %}" method="POST">
135             <label for="message">Commit message:</label>
136             <textarea cols="60" rows="10" name="message" id="commit-dialog-message"></textarea>
137             <p id="commit-dialog-error-empty-message">Wiadomość nie może być pusta.</p>                
138             <fieldset id="commit-dialog-related-issues" 
139                       ui:ajax-src="http://localhost:3000/publications/issues/{{fileid}}">
140                 <legend>Related issues</legend>
141                 <div class="loading-box" style="display: none;">
142                     <p>Loading related issues...</p>
143                 </div>
144                 <div class="container-box">No related issues.</div>
145             </fieldset>
146             <p>
147                <input type="button" value="Save" id="commit-dialog-save-button" />
148                <input type="reset" value="Cancel" id="commit-dialog-cancel-button" />
149             </p>
150         </form>
151     </div>
152     
153     <div id="split-dialog" class="jqmWindow" style="display:none">
154         <div class="container-box"> </div>
155         <div class="loading-box" style="display: none;">
156             <p>Loading dialog contents...</p>
157             <!-- <p><button type="button" class="dialog-close-button">Close</button></p> -->
158         </div>
159         <div class="fatal-error-box" style="display: none;">
160             <p>Server error, while loading dialog :(</p>
161             <p><button type="button" class="dialog-close-button">Close</button></p>
162         </div>
163     </div>
164 {% endblock maincontent %}
165
166 {% block extrabody %}
167         <div style="position: absolute; left: 0; right: 0; top: 0; height: 20px; z-index: 1000" id="flashview"></div>
168 {% endblock %}