Changeset a89f94 in indico
- Timestamp:
- 08/12/10 15:36:14 (3 years ago)
- Branches:
- master, burotel, hello-world-walkthrough, ipv6, new-webex, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, b8c30da8ebdbdcbd675a873997cc3e95f567de49, 4287315ec967a3da168d83963c14001db8487d53
- Children:
- 4dd389, 84d986
- Parents:
- ae68ec
- git-author:
- Ian Rolewicz <ian.rolewicz@…> (06/29/10 14:46:02)
- git-committer:
- Jose Benito <jose.benito.gonzalez@…> (08/12/10 15:36:14)
- Location:
- indico
- Files:
-
- 2 added
- 16 edited
-
MaKaC/services/implementation/category.py (modified) (2 diffs)
-
MaKaC/services/implementation/conference.py (modified) (6 diffs)
-
MaKaC/services/implementation/contribution.py (modified) (11 diffs)
-
MaKaC/services/implementation/session.py (modified) (2 diffs)
-
MaKaC/webinterface/pages/category.py (modified) (1 diff)
-
MaKaC/webinterface/pages/conferences.py (modified) (1 diff)
-
MaKaC/webinterface/pages/contributions.py (modified) (1 diff)
-
MaKaC/webinterface/pages/sessions.py (modified) (1 diff)
-
MaKaC/webinterface/rh/categoryMod.py (modified) (1 diff)
-
MaKaC/webinterface/rh/conferenceModif.py (modified) (1 diff)
-
MaKaC/webinterface/rh/contribMod.py (modified) (1 diff)
-
MaKaC/webinterface/rh/sessionModif.py (modified) (1 diff)
-
MaKaC/webinterface/tpls/AccessControlFrame.tpl (modified) (2 diffs)
-
MaKaC/webinterface/tpls/AccessControlStatusFrame.tpl (added)
-
MaKaC/webinterface/tpls/ConfAccessControlFrame.tpl (modified) (1 diff)
-
MaKaC/webinterface/tpls/HomeAccessControlStatusFrame.tpl (added)
-
MaKaC/webinterface/wcomponents.py (modified) (3 diffs)
-
htdocs/css/Default.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
indico/MaKaC/services/implementation/category.py
r701dc2 ra89f94 8 8 import MaKaC.conference as conference 9 9 from MaKaC.common.logger import Logger 10 from MaKaC.services.interface.rpc.common import ServiceError 10 from MaKaC.services.interface.rpc.common import ServiceError, ServiceAccessError 11 11 import MaKaC.webinterface.locators as locators 12 12 from MaKaC.webinterface.wcomponents import WConferenceList, WConferenceListEvents 13 from MaKaC.common.fossilize import fossilize 14 from MaKaC.user import PrincipalHolder, Avatar, Group 13 15 14 16 class CategoryBase(object): … … 141 143 return WConferenceListEvents(pastEvents, self._aw).getHTML() 142 144 145 class CategoryProtectionUserList(CategoryModifBase): 146 def _getAnswer(self): 147 #will use IAvatarFossil or IGroupFossil 148 return fossilize(self._categ.getAllowedToAccessList()) 149 150 class CategoryProtectionAddUsers(CategoryModifBase): 151 def _checkParams(self): 152 153 CategoryModifBase._checkParams(self) 154 155 self._usersData = self._params['value'] 156 self._user = self.getAW().getUser() 157 158 def _getAnswer(self): 159 160 for user in self._usersData : 161 162 userToAdd = PrincipalHolder().getById(user['id']) 163 164 if not userToAdd : 165 raise ServiceError("ERR-U0","User does not exist!") 166 167 self._categ.grantAccess(userToAdd) 168 169 class CategoryProtectionRemoveUser(CategoryModifBase): 170 171 def _checkParams(self): 172 CategoryModifBase._checkParams(self) 173 174 self._userData = self._params['value'] 175 176 self._user = self.getAW().getUser() 177 178 def _getAnswer(self): 179 180 userToRemove = PrincipalHolder().getById(self._userData['id']) 181 182 if not userToRemove : 183 raise ServiceError("ERR-U0","User does not exist!") 184 elif isinstance(userToRemove, Avatar) or isinstance(userToRemove, Group) : 185 self._categ.revokeAccess(userToRemove) 143 186 144 187 methodMap = { 145 188 "getCategoryList": GetCategoryList, 146 189 "getPastEventsList": GetPastEventsList, 147 "canCreateEvent": CanCreateEvent 190 "canCreateEvent": CanCreateEvent, 191 "protection.getAllowedUsersList": CategoryProtectionUserList, 192 "protection.addAllowedUsers": CategoryProtectionAddUsers, 193 "protection.removeAllowedUser": CategoryProtectionRemoveUser 148 194 } -
indico/MaKaC/services/implementation/conference.py
r84c86e ra89f94 14 14 from MaKaC.common.PickleJar import DictPickler 15 15 from MaKaC.common import indexes, info 16 from MaKaC.common.fossilize import fossilize 16 17 17 18 from MaKaC.conference import ConferenceHolder … … 26 27 import MaKaC.common.timezoneUtils as timezoneUtils 27 28 from MaKaC.common.contextManager import ContextManager 29 from MaKaC.user import PrincipalHolder, Avatar, Group 28 30 29 31 import datetime … … 34 36 from MaKaC.i18n import _ 35 37 36 from MaKaC.services.interface.rpc.common import ServiceError, Warning, ResultWithWarning, TimingNoReportError 38 from MaKaC.services.interface.rpc.common import ServiceError, Warning, \ 39 ResultWithWarning, TimingNoReportError, ServiceAccessError 37 40 38 41 class ConferenceBase(object): … … 45 48 try: 46 49 self._target = self._conf = ConferenceHolder().getById(self._params["conference"]); 50 except: 51 try: 52 self._target = self._conf = ConferenceHolder().getById(self._params["confId"]); 53 except: 54 raise ServiceError("ERR-E4", "Invalid conference id.") 47 55 if self._target == None: 48 56 Logger.get('rpc.conference').debug('self._target is null') 49 57 raise Exception("Null target.") 50 except:51 raise ServiceError("ERR-E4", "Invalid conference id.")52 58 53 59 … … 649 655 650 656 return p.getHTML(params) 657 658 class ConferenceProtectionUserList(ConferenceModifBase): 659 660 def _getAnswer(self): 661 #will use IAvatarFossil or IGroupFossil 662 return fossilize(self._conf.getAllowedToAccessList()) 663 664 class ConferenceProtectionAddUsers(ConferenceModifBase): 665 666 def _checkParams(self): 667 ConferenceModifBase._checkParams(self) 668 669 self._usersData = self._params['value'] 670 self._user = self.getAW().getUser() 671 672 def _getAnswer(self): 673 674 for user in self._usersData : 675 676 userToAdd = PrincipalHolder().getById(user['id']) 677 678 if not userToAdd : 679 raise ServiceError("ERR-U0","User does not exist!") 680 681 self._conf.grantAccess(userToAdd) 682 683 class ConferenceProtectionRemoveUser(ConferenceModifBase): 684 685 def _checkParams(self): 686 ConferenceModifBase._checkParams(self) 687 688 self._userData = self._params['value'] 689 690 self._user = self.getAW().getUser() 691 692 def _getAnswer(self): 693 694 userToRemove = PrincipalHolder().getById(self._userData['id']) 695 696 if not userToRemove : 697 raise ServiceError("ERR-U0","User does not exist!") 698 elif isinstance(userToRemove, Avatar) or isinstance(userToRemove, Group) : 699 self._conf.revokeAccess(userToRemove) 700 651 701 652 702 methodMap = { … … 670 720 # "getFields": ConferenceGetFields, 671 721 "getFieldsAndContribTypes": ConferenceGetFieldsAndContribTypes, 672 "getParticipationForm": ConferenceParticipationForm 722 "getParticipationForm": ConferenceParticipationForm, 723 "protection.getAllowedUsersList": ConferenceProtectionUserList, 724 "protection.addAllowedUsers": ConferenceProtectionAddUsers, 725 "protection.removeAllowedUser": ConferenceProtectionRemoveUser 673 726 } -
indico/MaKaC/services/implementation/contribution.py
r9033fd ra89f94 4 4 from MaKaC.services.implementation.roomBooking import GetBookingBase 5 5 6 from MaKaC.services.interface.rpc.common import ServiceError 6 from MaKaC.services.interface.rpc.common import ServiceError, ServiceAccessError 7 7 8 8 from MaKaC.common.PickleJar import DictPickler … … 12 12 from MaKaC.services.implementation.base import HTMLModificationBase 13 13 from MaKaC.services.implementation.base import DateTimeModificationBase 14 from MaKaC.common.fossilize import fossilize 15 from MaKaC.user import PrincipalHolder, Avatar, Group 14 16 15 17 class ContributionBase(object): 16 18 17 def _checkParams( self ): 19 def _checkParams( self ): 18 20 try: 19 self._conf = conference.ConferenceHolder().getById(self._params["conference"]); 20 if self._conf == None: 21 raise Exception("Conference id not specified.") 22 except: 23 raise ServiceError("ERR-E4", "Invalid conference id.") 21 self._target = self._conf = conference.ConferenceHolder().getById(self._params["conference"]); 22 except: 23 try: 24 self._target = self._conf = conference.ConferenceHolder().getById(self._params["confId"]); 25 except: 26 raise ServiceError("ERR-E4", "Invalid conference id.") 27 28 if self._conf == None: 29 raise Exception("Conference id not specified.") 24 30 25 31 try: 26 32 self._target = self._contribution = self._conf.getContributionById(self._params["contribution"]) 27 if self._target == None: 28 raise Exception("Contribution id not specified.") 29 except: 30 raise ServiceError("ERR-C0", "Invalid contribution id.") 33 except: 34 try: 35 self._target = self._contribution = self._conf.getContributionById(self._params["contribId"]) 36 except: 37 raise ServiceError("ERR-C0", "Invalid contribution id.") 38 39 if self._target == None: 40 raise Exception("Contribution id not specified.") 31 41 32 42 # create a parameter manager that checks the consistency of passed parameters … … 34 44 35 45 class ContributionDisplayBase(ProtectedDisplayService, ContributionBase): 36 46 37 47 def _checkParams(self): 38 48 ContributionBase._checkParams(self) … … 40 50 41 51 class ContributionModifBase(ContributionBase, ProtectedModificationService): 42 52 43 53 def _checkProtection(self): 44 54 if self._target.getSession() != None: … … 46 56 return 47 57 ProtectedModificationService._checkProtection(self) 48 58 49 59 class ContributionTextModificationBase(TextModificationBase, ContributionBase): 50 60 pass … … 59 69 def _checkParams(self): 60 70 ContributionModifBase._checkParams(self) 61 71 62 72 subcId = self._params.get('subContribution',None) 63 64 self._subCont = self._target.getSubContributionById(subcId) 65 73 74 self._subCont = self._target.getSubContributionById(subcId) 75 66 76 ProtectedModificationService._checkProtection(self) 67 77 68 78 def _getAnswer(self): 69 79 self._subCont.getOwner().removeSubContribution(self._subCont) … … 72 82 def _checkParams(self): 73 83 ContributionModifBase._checkParams(self) 74 84 75 85 # "presenters" and "keywords" are not required. they can be empty 76 86 self._presenters = self._pm.extract("presenters", pType=list, allowEmpty=True) 77 87 self._keywords = self._pm.extract("keywords", pType=list, allowEmpty=True) 78 88 self._description = self._pm.extract("description", pType=str, allowEmpty=True, defaultValue="") 79 80 # these are required 89 90 # these are required 81 91 self._duration = self._pm.extract("duration", pType=int) 82 92 self._title = self._pm.extract("title", pType=str) 83 93 84 94 def __addPresenters(self, subcontrib): 85 95 86 96 # add each presenter 87 97 for presenterValues in self._presenters: 88 89 # magically update a new ContributionParticipation with JSON data, using the DictPickler 98 99 # magically update a new ContributionParticipation with JSON data, using the DictPickler 90 100 presenter = conference.SubContribParticipation() 91 101 DictPickler.update(presenter, presenterValues) 92 102 93 103 subcontrib.newSpeaker(presenter) 94 104 95 105 def _getAnswer(self): 96 106 # create the sub contribution 97 107 sc = self._target.newSubContribution() 98 108 99 109 sc.setTitle( self._title ) 100 110 sc.setDescription( self._description ) … … 102 112 sc.setKeywords('\n'.join(self._keywords)) 103 113 sc.setDuration( self._duration / 60, \ 104 self._duration % 60 ) 105 114 self._duration % 60 ) 115 106 116 self.__addPresenters(sc) 107 117 108 118 # log the event 109 119 logInfo = sc.getLogInfo() … … 111 121 self._target.getConference().getLogHandler().logAction(logInfo, "Timetable/SubContribution", self._getUser()) 112 122 113 #TODO: this class is duplicated. check if the good one is the one before or this one! 123 #TODO: this class is duplicated. check if the good one is the one before or this one! 114 124 class ContributionDeleteSubContribution(ContributionModifBase): 115 125 … … 123 133 'return': None 124 134 } 125 135 126 136 def _checkParams(self): 127 137 ContributionModifBase._checkParams(self) 128 138 129 139 subContId = self._pm.extract("subcontribution", pType=str, allowEmpty=False) 130 140 131 141 self._subContribution = self._contribution.getSubContributionById(subContId) 132 142 133 143 def _getAnswer(self): 134 144 self._subContribution.getOwner().removeSubContribution(self._subContribution) … … 137 147 pass 138 148 149 class ContributionProtectionUserList(ContributionModifBase): 150 151 def _getAnswer(self): 152 #will use IAvatarFossil or IGroupFossil 153 return fossilize(self._contribution.getAllowedToAccessList()) 154 155 class ContributionProtectionAddUsers(ContributionModifBase): 156 157 def _checkParams(self): 158 ContributionModifBase._checkParams(self) 159 160 self._usersData = self._params['value'] 161 self._user = self.getAW().getUser() 162 163 def _getAnswer(self): 164 165 for user in self._usersData : 166 167 userToAdd = PrincipalHolder().getById(user['id']) 168 169 if not userToAdd : 170 raise ServiceError("ERR-U0","User does not exist!") 171 172 self._contribution.grantAccess(userToAdd) 173 174 class ContributionProtectionRemoveUser(ContributionModifBase): 175 176 def _checkParams(self): 177 ContributionModifBase._checkParams(self) 178 179 self._userData = self._params['value'] 180 181 self._user = self.getAW().getUser() 182 183 def _getAnswer(self): 184 185 userToRemove = PrincipalHolder().getById(self._userData['id']) 186 187 if not userToRemove : 188 raise ServiceError("ERR-U0","User does not exist!") 189 elif isinstance(userToRemove, Avatar) or isinstance(userToRemove, Group) : 190 self._contribution.revokeAccess(userToRemove) 191 139 192 methodMap = { 140 193 "addSubContribution": ContributionAddSubContribution, 141 194 "deleteSubContribution": ContributionDeleteSubContribution, 142 "getBooking": ContributionGetBooking 195 "getBooking": ContributionGetBooking, 196 "protection.getAllowedUsersList": ContributionProtectionUserList, 197 "protection.addAllowedUsers": ContributionProtectionAddUsers, 198 "protection.removeAllowedUser": ContributionProtectionRemoveUser 143 199 } -
indico/MaKaC/services/implementation/session.py
r68f9a3 ra89f94 9 9 import MaKaC.conference as conference 10 10 from MaKaC.common.PickleJar import DictPickler 11 from MaKaC.services.interface.rpc.common import ServiceError 11 from MaKaC.services.interface.rpc.common import ServiceError, ServiceAccessError 12 12 from MaKaC.services.implementation import conference as conferenceServices 13 13 import MaKaC.webinterface.locators as locators 14 14 from MaKaC.conference import SessionSlot 15 from MaKaC.common.fossilize import fossilize 16 from MaKaC.user import PrincipalHolder, Avatar, Group 15 17 16 18 class SessionBase(conferenceServices.ConferenceBase): … … 155 157 pass 156 158 159 class SessionProtectionUserList(SessionModifBase): 160 def _getAnswer(self): 161 #will use IAvatarFossil or IGroupFossil 162 return fossilize(self._session.getAllowedToAccessList()) 163 164 class SessionProtectionAddUsers(SessionModifBase): 165 166 def _checkParams(self): 167 SessionModifBase._checkParams(self) 168 169 self._usersData = self._params['value'] 170 self._user = self.getAW().getUser() 171 172 def _getAnswer(self): 173 174 for user in self._usersData : 175 176 userToAdd = PrincipalHolder().getById(user['id']) 177 178 if not userToAdd : 179 raise ServiceError("ERR-U0","User does not exist!") 180 181 self._session.grantAccess(userToAdd) 182 183 class SessionProtectionRemoveUser(SessionModifBase): 184 185 def _checkParams(self): 186 SessionModifBase._checkParams(self) 187 188 self._userData = self._params['value'] 189 190 self._user = self.getAW().getUser() 191 192 def _getAnswer(self): 193 194 userToRemove = PrincipalHolder().getById(self._userData['id']) 195 196 if not userToRemove : 197 raise ServiceError("ERR-U0","User does not exist!") 198 elif isinstance(userToRemove, Avatar) or isinstance(userToRemove, Group) : 199 self._session.revokeAccess(userToRemove) 200 157 201 methodMap = { 158 "getBooking": SessionGetBooking 202 "getBooking": SessionGetBooking, 203 "protection.getAllowedUsersList": SessionProtectionUserList, 204 "protection.addAllowedUsers": SessionProtectionAddUsers, 205 "protection.removeAllowedUser": SessionProtectionRemoveUser 159 206 } -
indico/MaKaC/webinterface/pages/category.py
r645187 ra89f94 1885 1885 def getVars( self ): 1886 1886 vars = wcomponents.WTemplated.getVars( self ) 1887 1887 1888 vars["modifyControlFrame"] = wcomponents.WModificationControlFrame().getHTML(\ 1888 1889 self._categ,\ 1889 1890 vars["addManagersURL"],\ 1890 1891 vars["removeManagersURL"] ) 1892 if self._categ.isRoot() : 1893 type = 'Home' 1894 else : 1895 type = 'Category' 1896 1891 1897 vars["accessControlFrame"] = wcomponents.WAccessControlFrame().getHTML(\ 1892 1898 self._categ,\ 1893 1899 vars["setVisibilityURL"],\ 1894 vars["addAllowedURL"],\ 1895 vars["removeAllowedURL"] ) 1900 type) 1896 1901 if not self._categ.isProtected(): 1897 1902 df = wcomponents.WDomainControlFrame( self._categ ) -
indico/MaKaC/webinterface/pages/conferences.py
rd66a94c ra89f94 3747 3747 ac = wcomponents.WConfAccessControlFrame().getHTML( self.__conf,\ 3748 3748 params["setVisibilityURL"],\ 3749 params["addAllowedURL"],\3750 params["removeAllowedURL"],\3751 3749 params["setAccessKeyURL"] ) 3752 3750 dc = "" -
indico/MaKaC/webinterface/pages/contributions.py
r352fcc ra89f94 989 989 acf=wcomponents.WAccessControlFrame() 990 990 visURL=urlHandlers.UHContributionSetVisibility.getURL() 991 addAlwURL=urlHandlers.UHContributionSelectAllowed.getURL() 992 remAlwURL=urlHandlers.UHContributionRemoveAllowed.getURL() 993 vars["accessControlFrame"]=acf.getHTML(self._contrib,visURL,addAlwURL,remAlwURL) 991 992 if isinstance(self._contrib.getOwner(), conference.Session): 993 vars["accessControlFrame"]=acf.getHTML(self._contrib, visURL, "InSessionContribution") 994 else : 995 vars["accessControlFrame"]=acf.getHTML(self._contrib, visURL, "Contribution") 996 994 997 if not self._contrib.isProtected(): 995 998 df=wcomponents.WDomainControlFrame( self._contrib ) -
indico/MaKaC/webinterface/pages/sessions.py
rd66a94c ra89f94 2024 2024 wc=wcomponents.WAccessControlFrame() 2025 2025 vars["accessControlFrame"]=wc.getHTML(self._session,\ 2026 urlHandlers.UHSessionSetVisibility.getURL(),\ 2027 urlHandlers.UHSessionSelectAllowed.getURL(),\ 2028 urlHandlers.UHSessionRemoveAllowed.getURL()) 2026 urlHandlers.UHSessionSetVisibility.getURL(), 2027 "Session") 2029 2028 if not self._session.isProtected(): 2030 2029 df=wcomponents.WDomainControlFrame(self._session) -
indico/MaKaC/webinterface/rh/categoryMod.py
r701dc2 ra89f94 601 601 if params["visibility"] == "PRIVATE": 602 602 self._target.setProtection( 1 ) 603 elif params["visibility"] == "INHERITING": 604 self._target.setProtection( 0 ) 603 605 elif params["visibility"] == "PUBLIC": 604 self._target.setProtection( 0 ) 605 elif params["visibility"] == "ABSOLUTELY PUBLIC": 606 self._target.setProtection( -1 ) 606 # The 'Home' category is handled as a special case. 607 # We maintain the illusion for the user of it being either 608 # private or public, but actually it can be either private 609 # or inheriting for legacy reasons. 610 if params["type"] == "Home": 611 self._target.setProtection( 0 ) 612 else : 613 self._target.setProtection( -1 ) 607 614 self._redirect( urlHandlers.UHCategModifAC.getURL( self._target ) ) 608 615 -
indico/MaKaC/webinterface/rh/conferenceModif.py
r20f609 ra89f94 1696 1696 if params["visibility"] == "PRIVATE": 1697 1697 self._protectConference = 1 1698 elif params["visibility"] == "INHERITING": 1699 self._protectConference = 0 1698 1700 elif params["visibility"] == "PUBLIC": 1699 self._protectConference = 01700 elif params["visibility"] == "ABSOLUTELY PUBLIC":1701 1701 self._protectConference = -1 1702 1702 -
indico/MaKaC/webinterface/rh/contribMod.py
r6509a2 ra89f94 1430 1430 def _process(self): 1431 1431 params = self._getRequestParams() 1432 privacy = params.get("visibility"," PUBLIC")1432 privacy = params.get("visibility","INHERITING") 1433 1433 self._protect = 0 1434 1434 if privacy == "PRIVATE": 1435 1435 self._protect = 1 1436 elif privacy == "INHERITING": 1437 self._protect = 0 1436 1438 elif privacy == "PUBLIC": 1437 self._protect = 01438 elif privacy == "ABSOLUTELY PUBLIC":1439 1439 self._protect = -1 1440 1440 self._target.setProtection(self._protect) -
indico/MaKaC/webinterface/rh/sessionModif.py
r6b4ff5 ra89f94 1176 1176 def _checkParams( self, params ): 1177 1177 RHSessionModifBase._checkParams( self, params ) 1178 privacy = params.get("visibility"," PUBLIC")1178 privacy = params.get("visibility","INHERITING") 1179 1179 self._protect = 0 1180 1180 if privacy == "PRIVATE": 1181 1181 self._protect = 1 1182 elif privacy == "INHERITING": 1183 self._protect = 0 1182 1184 elif privacy == "PUBLIC": 1183 self._protect = 01184 elif privacy == "ABSOLUTELY PUBLIC":1185 1185 self._protect = -1 1186 1186 -
indico/MaKaC/webinterface/tpls/AccessControlFrame.tpl
r9033fd ra89f94 1 <%! 2 #Special case for categories 3 if isFullyPublic == None : 4 isFullyPublic = True 5 6 %> 1 7 2 8 <table class="groupTable"> … … 4 10 <td colspan="5"><div class="groupTitle"><%= _("Access control")%></div></td> 5 11 </tr> 6 <tr> 7 <td nowrap class="dataCaptionTD"><span class="dataCaptionFormat"><%= _("Current status")%></span></td> 8 <td class="blacktext"> 9 <form action="%(setVisibilityURL)s" method="POST"> 10 %(locator)s 11 <b>%(privacy)s</b><br/> 12 <small> 13 %(changePrivacy)s 14 </small> 15 </form> 16 </td> 17 </tr> 18 <tr> 19 <td nowrap class="dataCaptionTD"><span class="dataCaptionFormat"><%= _("Users allowed to access")%></span></td> 20 <td class="blacktext">%(userTable)s</td> 21 </tr> 12 <% if type == 'Home' : %> 13 <% includeTpl('HomeAccessControlStatusFrame', setPrivacyURL=setPrivacyURL, privacy=privacy, locator = locator) %> 14 <% end %> 15 <% else : %> 16 <% includeTpl('AccessControlStatusFrame', parentName=parentName, privacy=privacy, \ 17 parentPrivacy=parentPrivacy, statusColor = statusColor, parentStatusColor=parentStatusColor, 18 locator=locator, isFullyPublic=isFullyPublic) %> 19 <% end %> 22 20 </table> 23 21 -
indico/MaKaC/webinterface/tpls/ConfAccessControlFrame.tpl
r9033fd ra89f94 5 5 </tr> 6 6 <tr> 7 <td nowrap class="titleCellTD"><span class="titleCellFormat"> <%= _("Current status")%></span></td> 8 <form action="%(setPrivacyURL)s" method="POST"> 9 <td bgcolor="white" width="100%%" valign="top" class="blacktext"> 10 %(locator)s 11 <b>%(privacy)s</b><br/> 12 <small> 13 %(changePrivacy)s 14 </small> 15 </td> 16 </form> 7 <td colspan="5" style="height: 10px"></td> 17 8 </tr> 18 <tr> 19 <td nowrap class="titleCellTD"><span class="titleCellFormat"><%= _("Users allowed to access")%></span></td> 20 <td bgcolor="white" width="100%%" valign="top" class="blueLineBottom">%(userTable)s</td> 21 </tr> 9 <% includeTpl('AccessControlStatusFrame', parentName=parentName, privacy=privacy, \ 10 parentPrivacy=parentPrivacy, statusColor = statusColor, parentStatusColor=parentStatusColor,\ 11 locator=locator, isFullyPublic=isFullyPublic) %> 22 12 <tr> 23 13 <td class="titleCellTD"><span class="titleCellFormat"><%= _("Access key")%></span></td> 24 <td bgcolor="white" width="100%%" valign="top" class="blacktext">25 <form action="%(setAccessKeyURL)s" method="POST">26 %(locator)s27 <input name="accessKey" type="password" size=25 value="%(accessKey)s">28 <input type="submit" class="btn" value="<%= _("change")%>">29 </form>30 </td>14 <td bgcolor="white" width="100%%" valign="top" class="blacktext"> 15 <form action="%(setAccessKeyURL)s" method="POST"> 16 %(locator)s 17 <input name="accessKey" type="password" size=25 value="%(accessKey)s"> 18 <input type="submit" class="btn" value="<%= _("change")%>"> 19 </form> 20 </td> 31 21 </tr> 32 22 </table> -
indico/MaKaC/webinterface/wcomponents.py
r352fcc ra89f94 1822 1822 class WAccessControlFrame(WTemplated): 1823 1823 1824 def getHTML( self, target, setVisibilityURL, addAllowedURL, removeAllowedURL):1824 def getHTML( self, target, setVisibilityURL, type ): 1825 1825 self.__target = target 1826 params = { "setVisibilityURL": setVisibilityURL,\ 1827 "addAllowedURL": addAllowedURL, \ 1828 "removeAllowedURL": removeAllowedURL } 1826 1827 params = { "setPrivacyURL": setVisibilityURL,\ 1828 "target": target,\ 1829 "type": type } 1829 1830 return WTemplated.getHTML( self, params ) 1830 1831 1831 1832 def getVars( self ): 1832 1833 vars = WTemplated.getVars( self ) 1834 1833 1835 if self.__target.getAccessProtectionLevel() == -1: 1834 vars["privacy"] = "ABSOLUTELY PUBLIC%s" % WInlineContextHelp('The object will stay public regardless of the protection of its parent (no more inheritance)').getHTML() 1835 vars["changePrivacy"] = """make it simply <input type="submit" class="btn" name="visibility" value="PUBLIC">%s<br/>""" % WInlineContextHelp('It will then be public by default but will inherit from the potential protection of its parent').getHTML() 1836 vars["changePrivacy"] += """make it <input type="submit" class="btn" name="visibility" value="PRIVATE"> by itself%s<br/>""" % WInlineContextHelp('It will then be private').getHTML() 1836 vars["privacy"] = "PUBLIC" 1837 vars["statusColor"] = "#128F33" 1837 1838 elif self.__target.isItselfProtected(): 1838 vars["privacy"] = "PRIVATE%s" % WInlineContextHelp('The object is private by itself').getHTML() 1839 vars["changePrivacy"] = """make it simply <input type="submit" class="btn" name="visibility" value="PUBLIC">%s<br/>""" % WInlineContextHelp('It will then be public by default but will inherit from the potential protection of its parent').getHTML() 1840 vars["changePrivacy"] += """make it <input type="submit" class="btn" name="visibility" value="ABSOLUTELY PUBLIC">%s""" % WInlineContextHelp('The object will stay public regardless of the protection of its parent').getHTML() 1841 elif self.__target.hasProtectedOwner(): 1842 vars["privacy"] = "PRIVATE by inheritance%s" % WInlineContextHelp('Private because a parent object is private').getHTML() 1843 vars["changePrivacy"] = """make it <input type="submit" class="btn" name="visibility" value="PRIVATE"> by itself%s<br/>""" % WInlineContextHelp('It will then remain private even if the parent object goes public').getHTML() 1844 vars["changePrivacy"] += """make it <input type="submit" class="btn" name="visibility" value="ABSOLUTELY PUBLIC">%s""" % WInlineContextHelp('The object will stay public regardless of the protection of its parent').getHTML() 1845 else: 1846 vars["privacy"] = "PUBLIC%s" % WInlineContextHelp('the object is currently public because its parent is public but might inherit from the potential protection of its parent if it changes one day').getHTML() 1847 vars["changePrivacy"] = """make it <input type="submit" class="btn" name="visibility" value="PRIVATE"> by itself<br/>""" 1848 vars["changePrivacy"] += """make it <input type="submit" class="btn" name="visibility" value="ABSOLUTELY PUBLIC">%s""" % WInlineContextHelp('The object will stay public regardless of the protection of its parent').getHTML() 1839 vars["privacy"] = "PRIVATE" 1840 vars["statusColor"] = "#B02B2C" 1841 else : 1842 vars["privacy"] = "INHERITING" 1843 vars["statusColor"] = "#444444" 1844 1845 vars["isFullyPublic"] = None 1846 1847 if not isinstance(self.__target, Category) : 1848 vars["isFullyPublic"] = self.__target.isFullyPublic() 1849 1850 if isinstance(self.__target, Category) and self.__target.isRoot(): 1851 vars["parentName"] = vars["parentPrivacy"] = vars["parentStatusColor"] = '' 1852 else : 1853 vars["parentName"] = self.__target.getOwner().getTitle() 1854 1855 if self.__target.hasProtectedOwner(): 1856 vars["parentPrivacy"] = "PRIVATE" 1857 vars["parentStatusColor"] = "#B02B2C" 1858 else : 1859 vars["parentPrivacy"] = "PUBLIC" 1860 vars["parentStatusColor"] = "#128F33" 1861 1849 1862 vars["locator"] = self.__target.getLocator().getWebForm() 1850 vars["userTable"] = WPrincipalTable().getHTML( self.__target.getAllowedToAccessList(), self.__target, vars["addAllowedURL"], vars["removeAllowedURL"],selectable=False )1851 1863 1852 1864 return vars … … 1855 1867 class WConfAccessControlFrame(WTemplated): 1856 1868 1857 def getHTML( self, target, setVisibilityURL, addAllowedURL, removeAllowedURL,setAccessKeyURL):1869 def getHTML( self, target, setVisibilityURL, setAccessKeyURL): 1858 1870 self.__target = target 1859 params = { " setPrivacyURL": setVisibilityURL,\1860 " addAllowedURL": addAllowedURL,\1861 " removeAllowedURL": removeAllowedURL,\1862 "setAccessKeyURL": setAccessKeyURL}1871 params = { "target": target,\ 1872 "setPrivacyURL": setVisibilityURL,\ 1873 "setAccessKeyURL": setAccessKeyURL,\ 1874 "type": "Event" } 1863 1875 return WTemplated.getHTML( self, params ) 1864 1876 1865 1877 def getVars( self ): 1866 1878 vars = WTemplated.getVars( self ) 1879 1867 1880 if self.__target.getAccessProtectionLevel() == -1: 1868 vars["privacy"] = "ABSOLUTELY PUBLIC%s" % WInlineContextHelp('The object will stay public regardless of the protection of its parent (no more inheritance)').getHTML() 1869 vars["changePrivacy"] = """make it simply <input type="submit" class="btn" name="visibility" value="PUBLIC">%s<br/>""" % WInlineContextHelp('It will then be public by default but will inherit from the potential protection of its parent').getHTML() 1870 vars["changePrivacy"] += """make it <input type="submit" class="btn" name="visibility" value="PRIVATE"> by itself%s<br/>""" % WInlineContextHelp('It will then be private').getHTML() 1881 vars["privacy"] = "PUBLIC" 1882 vars["statusColor"] = "#128F33" 1871 1883 elif self.__target.isItselfProtected(): 1872 vars["privacy"] = "PRIVATE %s" % WInlineContextHelp('The object is private by itself').getHTML()1873 vars[" changePrivacy"] = """make it simply <input type="submit" class="btn" name="visibility" value="PUBLIC">%s<br/>""" % WInlineContextHelp('It will then be public by default but will inherit from the potential protection of its parent').getHTML()1874 vars["changePrivacy"] += """make it <input type="submit" class="btn" name="visibility" value="ABSOLUTELY PUBLIC">%s""" % WInlineContextHelp('The object will stay public regardless of the protection of its parent').getHTML()1875 elif self.__target.hasProtectedOwner():1876 vars[" privacy"] = "PRIVATE by inheritance%s" % WInlineContextHelp('Private because a parent object is private').getHTML()1877 vars["changePrivacy"] = """make it <input type="submit" class="btn" name="visibility" value="PRIVATE"> by itself%s<br/>""" % WInlineContextHelp('It will then remain private even if the parent object goes public').getHTML() 1878 vars["changePrivacy"] += """make it <input type="submit" class="btn" name="visibility" value="ABSOLUTELY PUBLIC">%s""" % WInlineContextHelp('The object will stay public regardless of the protection of its parent').getHTML()1879 else:1880 if not self.__target.isFullyPublic(): 1881 fullyPublic = " - part of this event is protected"1882 else:1883 fullyPublic = ""1884 vars["privacy"] = "PUBLIC%s%s" % (WInlineContextHelp('the object is currently public because its parent is public but might inherit from the potential protection of its parent if it changes one day').getHTML(), fullyPublic)1885 vars[" changePrivacy"] = """make it <input type="submit" class="btn" name="visibility" value="PRIVATE"> by itself<br/>"""1886 vars[" changePrivacy"] += """make it <input type="submit" class="btn" name="visibility" value="ABSOLUTELY PUBLIC">%s""" % WInlineContextHelp('The object will stay public regardless of the protection of its parent').getHTML()1884 vars["privacy"] = "PRIVATE" 1885 vars["statusColor"] = "#B02B2C" 1886 else : 1887 vars["privacy"] = "INHERITING" 1888 vars["statusColor"] = "#444444" 1889 1890 vars["isFullyPublic"] = self.__target.isFullyPublic() 1891 vars["parentName"] = self.__target.getOwner().getName() 1892 1893 if self.__target.hasProtectedOwner(): 1894 vars["parentPrivacy"] = "PRIVATE" 1895 vars["parentStatusColor"] = "#B02B2C" 1896 else : 1897 vars["parentPrivacy"] = "PUBLIC" 1898 vars["parentStatusColor"] = "#128F33" 1887 1899 1888 1900 vars["locator"] = self.__target.getLocator().getWebForm() 1889 vars["userTable"] = WPrincipalTable().getHTML( self.__target.getAllowedToAccessList(),1890 self.__target,1891 vars["addAllowedURL"],1892 vars["removeAllowedURL"],1893 selectable=False )1894 1901 vars["accessKey"] = self.__target.getAccessKey() 1902 1895 1903 return vars 1896 1904 … … 3587 3595 return tab 3588 3596 3589 class WConfModifAC:3590 3591 def __init__( self, conference ):3592 self.__conf = conference3593 3594 def getHTML( self, params ):3595 ac = WAccessControlFrame().getHTML( self.__conf,\3596 params["setVisibilityURL"],\3597 params["addAllowedURL"],\3598 params["removeAllowedURL"] )3599 dc = ""3600 if not self.__conf.isProtected():3601 dc = "<br>%s"%WDomainControlFrame( self.__conf ).getHTML( \3602 params["addDomainURL"], \3603 params["removeDomainURL"] )3604 mc = WModificationControlFrame().getHTML( self.__conf,\3605 params["addManagersURL"],\3606 params["removeManagersURL"] )3607 return """%s%s<br>%s"""%( ac, dc, mc )3608 3597 3609 3598 #class WTrackModifSubTrack( WTemplated ): -
indico/htdocs/css/Default.css
rf26b79 ra89f94 3305 3305 } 3306 3306 3307 div.ACModifDiv { 3308 color: #333333; 3309 } 3310 3311 div.ACStatusDiv { 3312 font-size: 15px; 3313 padding-bottom: 9px; 3314 } 3315 3316 span.ACStatus { 3317 font-weight: bold; 3318 } 3319 3320 div.ACStatusDescDiv { 3321 color: #777777; 3322 padding-left: 20px; 3323 padding-bottom: 20px; 3324 font-style: italic; 3325 width: 600px; 3326 } 3327 3328 div.ACModifButtonsDiv { 3329 padding-bottom: 20px; 3330 font-size: 12px; 3331 } 3332 3333 div.ACModifButtonEntry { 3334 padding-bottom: 5px; 3335 } 3336 3337 div.ACUserListDiv { 3338 padding-bottom: 20px; 3339 padding-left: 35px; 3340 } 3341 3342 div.ACUserListDiv ul.UIPeopleList { 3343 background-color: #FAFAFA; 3344 border: 1px solid #999999; 3345 min-height: 200px; 3346 width: 550px; 3347 } 3348 3307 3349 .bannerTitle 3308 3350 {
Note: See TracChangeset
for help on using the changeset viewer.
