source: indico/indico/MaKaC/webinterface/tpls/EventModifMainData.tpl @ f25f07

burotelhello-world-walkthroughipv6new-webexprov-dual-interfacev0.97-seriesv0.98-seriesv0.98.2v0.98.3v0.98b1v0.98b2v0.99v1.0v1.1
Last change on this file since f25f07 was f25f07, checked in by Pedro Ferreira <jose.pedro.ferreira@…>, 4 years ago

[FIXED] Dates - data sent to server in ISO8601

  • So that everything remains consistent (we were receiving in ISO8601 and sending in %d/%m/%Y;
  • Some things (i.e. collaboration...) still sending %d/%m/%Y (not using ParameterManager?) on server side;
  • Added to Data.js some functions to convert between different date formats (show they be moved somewhere else?);
  • Started the 'unified widget' for start/end date - still some checks to do;
  • Property mode set to 100644
File size: 10.0 KB
Line 
1<%!
2
3# maybe all of this should be moved to the W* class?
4
5from MaKaC.fossils.conference import IConferenceMinimalFossil
6import MaKaC.webinterface.webFactoryRegistry as webFactoryRegistry
7import MaKaC.webinterface.urlHandlers as urlHandlers
8from xml.sax.saxutils import escape
9
10wr = webFactoryRegistry.WebFactoryRegistry()
11typeList = { "conference" : "conference" }
12for fact in wr.getFactoryList():
13    val = fact.getId()
14   
15    if val == 'simple_event':
16        val = 'lecture'
17   
18    typeList[fact.getId()] = val
19
20visibilityList = {}
21topcat = confObj.getOwnerList()[0]
22level = 0       
23visibilityList[0] = 'Nowhere'
24while topcat:
25    level += 1                       
26    if topcat.getId() != "0":
27        from MaKaC.common.TemplateExec import truncateTitle
28        visibilityList[level] = truncateTitle(topcat.getName(), 50)
29    topcat = topcat.getOwner()       
30visibilityList[999] = 'Everywhere'     
31
32numRows = 12
33
34
35favoriteRooms = confObj.getFavoriteRooms();
36
37%>
38<div class="groupTitle"><%= _("General Settings")%></div>
39
40<tr>
41    <td class="dataCaptionTD">
42        <span class="dataCaptionFormat"><%= _("Title")%></span>
43    </td>
44    <td class="blacktext" style="width:100%">
45        <span id="inPlaceEditTitle"><%=title %></span>
46    </td>
47    <td rowspan="<%=numRows%>" style="vertical-align: bottom;">
48        <form action=<%= dataModificationURL %> method="post">
49            <input type="submit" class="btn" value="modify"/>
50        </form>
51    </td>
52</tr>
53<tr>
54    <td class="dataCaptionTD">
55        <span class="dataCaptionFormat"><%= _("Description")%></span>
56    </td>
57    <td>
58        <div class="blacktext" id="inPlaceEditDescription"><%=description %></span>
59    </td>
60</tr>
61<tr>
62    <td class="dataCaptionTD">
63        <span class="dataCaptionFormat"><%= _("Place")%></span>
64    </td>
65    <td class="blacktext" id="inPlaceEditLocation">
66        <strong><%= _("Location:")%> </strong>
67        <span id="inPlaceEditLocationName"><%=locationName %></span>
68        <br/>
69        <strong><%= _("Address:")%> </strong>
70        <span id="inPlaceEditLocationAddress"><%=locationAddress %></span>
71        <br/>
72        <strong><%= _("Room:")%> </strong>
73        <span id="inPlaceEditLocationRoom"><%=locationRoom %></span>
74        <div id="inPlaceEditLocation_Menu">
75        </div>
76    </td>
77</tr>
78<tr>
79    <td class="dataCaptionTD">
80        <span class="dataCaptionFormat"><%= _("Start/End date")%></span>
81    </td>
82    <td class="blacktext">
83        <span id="inPlaceEditStartEndDate"><%=startDate %> <strong>to</strong> <%= endDate %></span>
84    </td>
85</tr>
86<!-- Fermi timezone awareness -->
87<tr>
88    <td class="dataCaptionTD">
89        <span class="dataCaptionFormat"><%= _("Timezone")%></span>
90    </td>
91    <td class="blacktext">
92        <%=timezone%>
93    </td>
94</tr>
95<!-- Fermi timezone awareness(end) -->
96<% if evtType == 'conference':%>
97<tr>
98    <td class="dataCaptionTD">
99        <span class="dataCaptionFormat"><%= _("Additional info")%></span>
100    </td>
101    <td class="blacktext">
102        <span id="inPlaceEditAdditionalInfo"><%=contactInfo%></span>
103    </td>
104</tr>
105<%end%>
106<tr>
107    <td class="dataCaptionTD">
108        <span class="dataCaptionFormat"><%= _("Support email")%></span>
109    </td>
110    <td class="blacktext">
111        <span id="inPlaceEditSupportEmail"><%=supportEmail %></span>
112    </td>
113</tr>
114<% if evtType == 'lecture':%>
115<tr>
116    <td class="dataCaptionTD">
117        <span class="dataCaptionFormat"><%= _("Organisers")%></span>
118    </td>
119    <td class="blacktext">
120        <span id="inPlaceEditOrganiserText"><%=confObj.getOrgText() %></span>
121    </td>
122</tr>
123<% end %>
124<tr>
125    <td class="dataCaptionTD">
126        <span class="dataCaptionFormat"><%= _("Default style")%></span>
127    </td>
128    <td class="blacktext">
129        <span id="inPlaceEditDefaultStyle"><%=defaultStyle %></span>
130    </td>
131</tr>
132<tr>
133    <td class="dataCaptionTD">
134        <span class="dataCaptionFormat"><%= _("Visibility")%></span>
135    </td>
136    <td class="blacktext">
137        <span id="inPlaceEditVisibility"><%=visibility %></span>
138    </td>
139</tr>
140<tr>
141    <td class="dataCaptionTD">
142        <span class="dataCaptionFormat"><%= _("Event type")%></span>
143    </td>
144    <td class="blacktext">
145        <span id="inPlaceEditType"><%=eventType %></span>
146    </td>
147</tr>
148<tr>
149    <td class="dataCaptionTD">
150        <span class="dataCaptionFormat"><%= _("Keywords")%></span>
151    </td>
152    <td class="blacktext">
153        <%if keywords: %><pre><%= keywords %></pre>
154        <%end %>
155    </td>
156</tr>
157
158<tr>
159    <% if Config.getInstance().getShortEventURL() != "": %>
160      <td class="dataCaptionTD">
161        <span class="dataCaptionFormat"><%= _("Short display URL")%></span>   
162      </td>     
163      <% if shortURL == "" : %>   
164        <td class="blacktext"><em><%= _("There is not any short url yet. Click \"Modify\" to setup.")%></em></td>     
165      <% end %>
166      <% else : %>
167      <td class="blacktext"><%=shortURL%></td>
168      <% end %>
169    <% end %>
170</tr>
171
172
173<tr>
174    <td colspan="3" class="horizontalLine">
175        &nbsp;
176    </td>
177</tr>
178<tr>
179    <td class="dataCaptionTD">
180        <span class="dataCaptionFormat"><%if evtType == 'lecture': %> <%= _("Speakers")%><%end %><%else: %> <%= _("Chairpersons")%><%end %></span>
181    </td>
182    <td colspan="2">
183        <table width="100%">
184            <tr>
185                <td class="blacktext" style="width: 100%">
186                    <form action=<%= remChairsURL %> method="post">
187                        <input type="hidden" name="selChair" value="" />
188                        <ul class="UIPeopleList">
189                            <% for chair in chairs: %>
190                                <li class="UIPerson">
191                                    <a href="<%= urlHandlers.UHConfModChairEdit.getURL(chair) %>" class="nameLink">
192                                        <%= escape (chair.getFullName()) %>
193                                    </a>
194                                    <input type="image" class="UIRowButton2" onclick="removeItem(<%=chair.getId()%>, this.form);return false;"  title="<%= _("Remove this person from the list")%>" src="<%= systemIcon("remove") %>" />
195                                </li>
196                            <% end %>
197                        </ul>
198                    </form>
199                </td>
200                <td>
201                    <table>
202                        <tr>
203                            <td>
204                                <form action=<%= newChairURL %> method="POST">
205                                    <input type="submit" class="btn" value="new">
206                                </form>
207                            </td>
208                            <td>
209                                <form action=<%= searchChairURL %> method="POST">
210                                    <input type="submit" class="btn" value="search">
211                                </form>
212                            </td>
213                        </tr>
214                    </table>
215                </td>
216            </tr>
217        </table>
218    </td>
219</tr>
220<tr>
221    <td colspan="3" class="horizontalLine">&nbsp;</td>
222</tr>
223
224<script type="text/javascript">
225function removeItem(number, form)
226{
227    form.selChair.value = number;
228    form.submit();
229}
230
231var confFossile = <%= jsonEncode(confObj.fossilize(IConferenceMinimalFossil, tz=confObj.getTimezone())) %>;
232
233<%= macros.genericField(macros.FIELD_TEXT, 'inPlaceEditTitle', 'event.main.changeTitle', {'conference': "%s"%conferenceId}, preCache=True, rh=self._rh) %>
234
235<%= macros.genericField(macros.FIELD_TEXT, 'inPlaceEditSupportEmail', 'event.main.changeSupportEmail', {'conference': "%s"%conferenceId}, preCache=True, rh=self._rh) %>
236
237<% if evtType == 'lecture':%>
238    <%= macros.genericField(macros.FIELD_TEXT, 'inPlaceEditOrganiserText', 'event.main.changeOrganiserText', {'conference': "%s"%conferenceId}, preCache=True, rh=self._rh) %>
239<% end %>
240
241<%  from MaKaC.common import info %>
242
243<%= macros.genericField(macros.FIELD_SELECT, 'inPlaceEditDefaultStyle', 'event.main.changeDefaultStyle', {'conference': "%s"%conferenceId}, preCache=True, rh=self._rh, options=info.HelperMaKaCInfo.getMaKaCInfoInstance().getStyleManager().getStylesheetListForEventType(confObj.getType())) %>
244
245<%= macros.genericField(macros.FIELD_SELECT, 'inPlaceEditVisibility', 'event.main.changeVisibility', {'conference': "%s"%conferenceId}, preCache=True, rh=self._rh, options=visibilityList) %>
246
247<%= macros.genericField(macros.FIELD_SELECT, 'inPlaceEditType', 'event.main.changeType', {'conference': "%s"%conferenceId}, preCache=True, rh=self._rh, options=typeList) %>
248
249$E('inPlaceEditStartEndDate').set(new StartEndDateWidget('event.main.changeDates', <%= jsonEncode({'conference': "%s"%conferenceId}) %>, {'startDate': confFossile.startDate, 'endDate': confFossile.endDate}).draw());
250
251<%= macros.genericField(macros.FIELD_RICHTEXT, 'inPlaceEditDescription', 'event.main.changeDescription', {'conference': "%s"%conferenceId}, preCache=True, rh=self._rh, options=(400,200)) %>
252
253<% if evtType == 'conference':%>
254    <%= macros.genericField(macros.FIELD_RICHTEXT, 'inPlaceEditAdditionalInfo', 'event.main.changeAdditionalInfo', {'conference': "%s"%conferenceId}, preCache=True, rh=self._rh, options=(400,200)) %>
255<% end %>
256
257// Room parameters widget
258var context = new WidgetEditableContext();
259
260$E('inPlaceEditLocation').set([
261  WidgetEditable(
262    IndicoUI.Widgets.roomParamsShow,
263    function(target, source){
264        var info = $O(source.get().getAll());
265        var rbWidget = new RoomBookingWidget(Indico.Data.Locations, info, null, nullRoomInfo(info), <%= favoriteRooms %>);
266        target.set(rbWidget.draw())
267        return {
268          activate: function(){},
269          save: function(){
270            // force the observers to be called,
271            // since objects look immutable to presentation,
272            // as references are compared
273            source.set($O(info.getAll()));
274          },
275          stop: function(){
276            bind.detach(target);
277          }
278        };
279    }
280  )(IndicoUtil.cachedRpcValue(Indico.Urls.JsonRpcService, 'event.main.changeBooking',{conference: '<%= conferenceId %>'}, $O(<%= offlineRequest(self._rh,'event.main.changeBooking',{'conference': "%s"%conferenceId})%>)), context),
281    IndicoUI.Aux.defaultEditMenu(context)]);
282
283
284</script>
Note: See TracBrowser for help on using the repository browser.