Changeset a749c25d5fae9ffc0b991d488d9abc5c0aabb7de in indico
- Timestamp:
- 01/27/12 15:35:32 (4 months ago)
- Children:
- 4ea669e54b4fc0f87e4bd65500eca6c19a61939e
- Parents:
- a7be1a17914010579dd11191ba7dca4c5ba2ba21
- git-author:
- Alberto Resco Perez <alberto.resco.perez@…> (01/27/12 15:35:32)
- git-committer:
- Jose Benito <jose.benito.gonzalez@…> (02/02/12 17:45:57)
- Location:
- indico/MaKaC
- Files:
-
- 5 edited
-
participant.py (modified) (2 diffs)
-
services/implementation/conference.py (modified) (3 diffs)
-
webinterface/pages/conferences.py (modified) (2 diffs)
-
webinterface/tpls/ConferenceParticipantsSetup.tpl (modified) (2 diffs)
-
webinterface/tpls/events/include/EventDetails.tpl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
indico/MaKaC/participant.py
r9dd174 ra749c2 50 50 self._dateNegotiation = None 51 51 self._displayParticipantList = True 52 self._numMaxParticipants = 0 52 53 53 54 def clone(self, conference, options, eventManager=None): … … 136 137 self.notifyModification() 137 138 139 def getNumMaxParticipants(self): 140 try: 141 return self._numMaxParticipants 142 except AttributeError : 143 self._numMaxParticipants = 0 144 return False 145 146 def setNumMaxParticipants(self, value, responsibleUser = None): 147 self._numMaxParticipants = value 148 logData = { 149 "subject": "Num max of participants.", 150 "value": str(value) 151 } 152 self._conference.getLogHandler().logAction(logData, "participants", responsibleUser) 153 self.notifyModification() 154 155 def isFull(self): 156 if self.getNumMaxParticipants() != 0: 157 return len(self.getParticipantList()) >= self.getNumMaxParticipants() 158 return False 138 159 139 160 def alreadyParticipating(self, participant): -
indico/MaKaC/services/implementation/conference.py
rb7f4ee ra749c2 822 822 return True 823 823 824 class ConferenceParticipantsSetNumMaxParticipants( ConferenceTextModificationBase ): 825 """ 826 Conference num max participants modification 827 """ 828 def _handleSet(self): 829 numMaxPart = self._value 830 if (self._value ==""): 831 raise ServiceError("ERR-E2", _("The value of the maximum numbers of participants cannot be empty.")) 832 try: 833 numMaxPart = int(self._value) 834 except ValueError: 835 raise ServiceError("ERR-E3", _("The value of the maximum numbers of participants has to be a positive number.")) 836 837 self._target.getParticipation().setNumMaxParticipants(int(numMaxPart)) 838 839 840 def _handleGet(self): 841 return self._target.getParticipation().getNumMaxParticipants() 842 824 843 class ConferenceApplyParticipant(ConferenceDisplayBase, ConferenceAddEditParticipantBase): 825 844 … … 832 851 raise NoReportError(_("""This event began on %s, you cannot apply for 833 852 participation after the event began."""%self._conf.getStartDate()), title=_("Event started")) 834 835 if not self._conf.getParticipation().isAllowedForApplying() : 853 participation = self._conf.getParticipation() 854 855 if not participation.isAllowedForApplying() : 836 856 raise NoReportError( _("""Participation in this event is restricted to persons invited. 837 857 If you insist on taking part in this event, please contact the event manager."""), title=_("Application restricted")) 858 if participation.getNumMaxParticipants() > 0 and len(participation.getParticipantList()) >= participation.getNumMaxParticipants(): 859 raise NoReportError( _("""You cannot apply for participation in this event because the maximum numbers of participants has been reached. 860 If you insist on taking part in this event, please contact the event manager."""), title=_("Maximum number of participants reached")) 861 838 862 result = {} 839 863 user = self._getUser() 840 864 pending = self._generateParticipant(user) 841 participation = self._conf.getParticipation()842 865 if participation.alreadyParticipating(pending) != 0: 843 866 raise NoReportError(_("The participant can not be added to the meeting because there is already a participant with the email address '%s'." … … 1558 1581 "participation.allowForApply": ConferenceParticipantsAllowForApplying, 1559 1582 "participation.autopAccept": ConferenceParticipantsAutoAccept, 1583 "participation.setNumMaxParticipants": ConferenceParticipantsSetNumMaxParticipants, 1560 1584 "participation.applyParticipant": ConferenceApplyParticipant, 1561 1585 "participation.addParticipant": ConferenceAddParticipant, -
indico/MaKaC/webinterface/pages/conferences.py
rb7f4ee ra749c2 1076 1076 if (conf.getType() in ("meeting", "simple_event") 1077 1077 and conf.getParticipation().isAllowedForApplying() 1078 and conf.getStartDate() > nowutc()): 1078 and conf.getStartDate() > nowutc() 1079 and not conf.getParticipation().isFull()): 1079 1080 vars['registrationOpen'] = True 1080 1081 evaluation = conf.getEvaluation() … … 3386 3387 vars["allowForApply"] = self._conf.getParticipation().isAllowedForApplying() 3387 3388 vars["autopAccept"] = self._conf.getParticipation().autoAccept() 3389 vars["numMaxParticipants"] = self._conf.getParticipation().getNumMaxParticipants() 3388 3390 return vars 3389 3391 -
indico/MaKaC/webinterface/tpls/ConferenceParticipantsSetup.tpl
r1a8f22 ra749c2 31 31 </td> 32 32 </tr> 33 <tr> 34 <td style="padding-right:15px">${ _("Max No. of participants.")}</td> 35 <td class="blacktext"> 36 <div id="inPlaceEditNumMaxParticipants"></div> 37 </td> 38 </tr> 33 39 </table> 34 40 … … 43 49 $("#inPlaceEditAutoAccept").append($(new RemoteSwitchButton(${"false" if autoAccept else "true"}, 44 50 Html.img({src:imageSrc("enabledSection.png")}), Html.img({src:imageSrc("disabledSection.png")}), "event.participation.autopAccept", "event.participation.autopAccept",{confId:${confId}}).draw().dom)); 51 $("#inPlaceEditNumMaxParticipants").append(new InputEditWidget('event.participation.setNumMaxParticipants', 52 {confId:${confId}}, ${ jsonEncode(numMaxParticipants) }, 0, false, null, function(value){return IndicoUtil.isInteger(value);}, '${_("The value set is not a positive number")}', '${_("Please insert a positive number or 0 for unlimited")}', 53 null).draw().dom); 54 45 55 }); 46 56 </script> -
indico/MaKaC/webinterface/tpls/events/include/EventDetails.tpl
refc9355 ra749c2 6 6 % if conf.getDescription(): 7 7 <tr id="eventDescription"> 8 <td class="leftCol"> Description</td>8 <td class="leftCol">${_("Description")}</td> 9 9 <td>${common.renderDescription(conf.getDescription())}</td> 10 10 </tr> … … 13 13 % if participants: 14 14 <tr id="eventParticipants"> 15 <td class="leftCol"> Participants</td>15 <td class="leftCol">${_("Participants")}</td> 16 16 <td id="eventListParticipants">${participants}</td> 17 17 </tr> … … 22 22 <td class="leftCol"> 23 23 % if webcastOnAirURL: 24 Live Webcast24 ${_("Live Webcast")} 25 25 % elif forthcomingWebcast: 26 Webcast26 ${_("Webcast")} 27 27 % endif 28 28 </td> 29 29 <td> 30 30 % if webcastOnAirURL: 31 <a href="${webcastOnAirURL}" target="_blank"><strong> View the live webcast</strong></a>31 <a href="${webcastOnAirURL}" target="_blank"><strong>${_("View the live webcast")}</strong></a> 32 32 % elif forthcomingWebcast: 33 Please note that this event will be available <em>live</em> via the34 <a href="${forthcomingWebcastURL}" target="_blank"><strong> Webcast Service</strong>.</a>33 ${_("Please note that this event will be available <em>live</em> via the")} 34 <a href="${forthcomingWebcastURL}" target="_blank"><strong>${_("Webcast Service")}</strong>.</a> 35 35 % endif 36 36 </td> … … 40 40 % if len(materials) > 0: 41 41 <tr id="materialList"> 42 <td class="leftCol"> Material</td>42 <td class="leftCol">${_("Material")}</td> 43 43 <td> 44 44 <div class="materialList clearfix"> … … 64 64 % if len(lectures) > 0: 65 65 <tr id="lectureLinks"> 66 <td class="leftCol"> Other occasions</td>66 <td class="leftCol">${_("Other occasions")}</td> 67 67 <td> 68 68 % for lecture in lectures: … … 76 76 % if registrationOpen: 77 77 <tr> 78 <td class="leftCol"> Registration</td>78 <td class="leftCol">${_("Registration")}</td> 79 79 <td> 80 Want to participate?81 <span class="fakeLink" id="applyLink"> Apply here</span>80 ${_("Want to participate?")} 81 <span class="fakeLink" id="applyLink">${_("Apply here")}</span> 82 82 </td> 83 83 </tr> … … 86 86 % if evaluationLink: 87 87 <tr> 88 <td class="leftCol"> Evaluation</td>89 <td><a href="${evaluationLink}"> Evaluate this event</a></td>88 <td class="leftCol">${_("Evaluation")}</td> 89 <td><a href="${evaluationLink}">${_("Evaluate this event")}</a></td> 90 90 </tr> 91 91 % endif … … 93 93 % if conf.getOrgText(): 94 94 <tr> 95 <td class="leftCol"> Organised by</td>95 <td class="leftCol">${_("Organised by")}</td> 96 96 <td>${conf.getOrgText()}</td> 97 97 </tr>
Note: See TracChangeset
for help on using the changeset viewer.
