Changeset 17ba50 in indico
- Timestamp:
- 04/23/12 14:39:56 (13 months ago)
- Branches:
- master, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, d9941f8582b36b24821a11ea5ba16fda6a457fb1
- Children:
- b521ee
- Parents:
- cfc263
- git-author:
- Claude Bossy <claude.bossy@…> (02/29/12 11:40:48)
- git-committer:
- Pedro Ferreira <jose.pedro.ferreira@…> (04/23/12 14:39:56)
- Location:
- indico/MaKaC
- Files:
-
- 5 edited
-
services/implementation/conference.py (modified) (3 diffs)
-
webinterface/tpls/ConfModificationControlFrame.tpl (modified) (1 diff)
-
webinterface/tpls/ConfRegFormPersonalDataDisplay.tpl (modified) (1 diff)
-
webinterface/tpls/DomainControlFrame.tpl (modified) (1 diff)
-
webinterface/wcomponents.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
indico/MaKaC/services/implementation/conference.py
r9fa05f r17ba50 51 51 from MaKaC.participant import Participant 52 52 from MaKaC.common.Configuration import Config 53 import MaKaC.domain as domain 53 54 54 55 import datetime … … 1211 1212 elif isinstance(userToRemove, Avatar) or isinstance(userToRemove, Group) : 1212 1213 self._conf.revokeAccess(userToRemove) 1214 1215 class ConferenceProtectionToggleDomains(ConferenceModifBase): 1216 1217 def _checkParams(self): 1218 ConferenceModifBase._checkParams(self) 1219 pm = ParameterManager(self._params) 1220 self._domainId = pm.extract("domainId", pType=str) 1221 self._add = pm.extract("add", pType=bool) 1222 1223 def _getAnswer(self): 1224 dh = domain.DomainHolder() 1225 if self._add : 1226 self._target.requireDomain( dh.getById( self._domainId ) ) 1227 elif not self._add : 1228 self._target.freeDomain( dh.getById( self._domainId ) ) 1213 1229 1214 1230 class ConferenceProtectionSetAccessKey(ConferenceModifBase): … … 1590 1606 "protection.addAllowedUsers": ConferenceProtectionAddUsers, 1591 1607 "protection.removeAllowedUser": ConferenceProtectionRemoveUser, 1608 "protection.toggleDomains": ConferenceProtectionToggleDomains, 1592 1609 "protection.setAccessKey": ConferenceProtectionSetAccessKey, 1593 1610 "protection.setModifKey": ConferenceProtectionSetModifKey, -
indico/MaKaC/webinterface/tpls/ConfModificationControlFrame.tpl
rd9e5b0 r17ba50 33 33 $E('setModifKey').dom.onsubmit = function(e) { 34 34 var modifKey = $E('modifKey').dom.value; 35 if(modifKey && !confirm( '${_("Please note that it is more secure to make the event private instead of using a modification key.")}')) {35 if(modifKey && !confirm(${_("Please note that it is more secure to make the event private instead of using a modification key.")|n,j})) { 36 36 return false; 37 37 } -
indico/MaKaC/webinterface/tpls/ConfRegFormPersonalDataDisplay.tpl
r81d37ab r17ba50 1 1 <table width="100%" align="left" cellspacing="0"> 2 2 <tr> 3 <td nowrap class="regFormSectionTitle">${ _("Personal data") }</td>3 <td nowrap class="regFormSectionTitle">${ _("Personal data")}</td> 4 4 </tr> 5 5 <tr> -
indico/MaKaC/webinterface/tpls/DomainControlFrame.tpl
rc0de5a r17ba50 1 1 <table class="groupTable"> 2 2 <tr> 3 <td colspan="2"><div class="groupTitle">${ _("Domain control ")}</div></td>3 <td colspan="2"><div class="groupTitle">${ _("Domain control ")}<span id="domainControl"></span></div></td> 4 4 </tr> 5 5 <tr> 6 6 <td nowrap class="titleCellTD"><span class="titleCellFormat">${ _("Allowed domains")}<br><font size="-2">(${ _("if no domain is selected<br>no control is applied")})</font></span></td> 7 7 <td class="blacktext"> 8 <form action="${ removeURL }" method="POST">9 8 ${ locator } 10 <table width="100%"> 11 <tr> 12 <td width="80%"> 9 <table width="auto"> 13 10 ${ domains } 14 </td>15 <td width="20%" align="right" valign="bottom">16 <table>17 <tr>18 <td>19 <input type="submit" class="btn" value="${ _("remove")}">20 </td>21 <td>22 <select name="addDomain">23 <option>${ _("Select")}:24 ${ domainsToAdd }25 </select>26 </td>27 <td>28 <input type="submit" class="btn" value="<- ${ _("add")}<" onClick="if (this.form.addDomain.value=='${ _("Select")}:') { return false; } else { this.form.action='${ addURL }'; }">29 </td>30 </tr>31 </table>32 </td>33 </tr>34 11 </table> 35 </form>36 12 </td> 37 13 </tr> 38 14 </table> 15 <script type="text/javascript"> 16 IndicoUI.executeOnLoad(function(){ 17 if ($(':checkbox:checked').length==0){ 18 $('#domainControl').text(${ _("(disabled)")|n,j}); 19 $('#domainControl').attr('style','color: #B02B2C;'); 20 } 21 else{ 22 $('#domainControl').text(${ _("(enabled)")|n,j}); 23 $('#domainControl').attr('style','color: #128F33;'); 24 } 25 }); 26 var checkId = null; 27 $(':checkbox:not(:checked)').live('change', function(){ 28 checkId = $(this).val(); 29 indicoRequest('event.protection.toggleDomains', { 30 confId: ${conference.getId()}, 31 domainId: $(this).val(), 32 add: false 33 }, 34 function(result, error) { 35 var domain = '#domain'+checkId; 36 if ($(':checkbox:checked').length==0){ 37 $('#domainControl').text(${ _("(disabled)")|n,j}); 38 $('#domainControl').attr('style','color: #B02B2C;'); 39 } 40 $(domain).attr('style','margin-left:10px; color:#B02B2C;'); 41 $(domain).text("saved"); 42 setTimeout(function(){ 43 $(domain).text(""); 44 }, 1000); 45 if(error) { 46 IndicoUtil.errorReport(error); 47 } else{ 48 (new AlertPopup($T('Domain removed'))).open(); 49 } 50 }); 51 }); 52 $(':checkbox:checked').live('change', function(){ 53 checkId = $(this).val(); 54 indicoRequest('event.protection.toggleDomains', { 55 confId: ${conference.getId()}, 56 domainId: $(this).val(), 57 add: true 58 }, 59 function(result, error) { 60 var domain = '#domain'+checkId; 61 if ($(':checkbox:checked').length!=0){ 62 $('#domainControl').text(${ _("(enabled)")|n,j}); 63 $('#domainControl').attr('style','color: #128F33;'); 64 } 65 $(domain).attr('style','margin-left:10px; color:#B02B2C;'); 66 $(domain).text("saved"); 67 setTimeout(function(){ 68 $(domain).text(""); 69 }, 1000); 70 if(error) { 71 IndicoUtil.errorReport(error); 72 } else{ 73 (new AlertPopup($T('Domain added'))).open(); 74 } 75 }); 76 }); 77 </script> -
indico/MaKaC/webinterface/wcomponents.py
r61ed1b r17ba50 2279 2279 vars = WTemplated.getVars( self ) 2280 2280 l = [] 2281 for dom in self._target.getDomainList():2282 l.append("""<input type="checkbox" name="selectedDomain" value="%s"> %s"""%(dom.getId(), dom.getName()))2283 vars["domains"] = "<br>".join(l)2284 l = []2285 2281 for dom in domain.DomainHolder().getList(): 2286 2282 if dom not in self._target.getDomainList(): 2287 l.append("""<option value="%s">%s</option>"""%(dom.getId(), dom.getName())) 2288 vars["domainsToAdd"] = "".join(l) 2283 l.append("""<tr><td><input type="checkbox" name="selectedDomain" value="%s"> %s</td><td><span id="domain%s"></span></td></tr>"""%(dom.getId(), dom.getName(), dom.getId())) 2284 else: 2285 l.append("""<tr><td><input type="checkbox" name="selectedDomain" value="%s" checked> %s</td><td><span id="domain%s"></span></td></tr>"""%(dom.getId(), dom.getName(), dom.getId())) 2286 vars["domains"] = "".join(l) 2289 2287 vars["removeURL"] = self._removeURL 2290 2288 vars["addURL"] = self._addURL 2291 2289 vars["locator"] = self._target.getLocator().getWebForm() 2290 vars["conference"] = self._target 2292 2291 return vars 2293 2292
Note: See TracChangeset
for help on using the changeset viewer.
