Changeset 701dc2 in indico
- Timestamp:
- 06/09/10 17:32:00 (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, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, d9941f8582b36b24821a11ea5ba16fda6a457fb1
- Children:
- 2f05ce
- Parents:
- 5c80b9
- git-author:
- Ian Rolewicz <ian.rolewicz@…> (05/11/10 10:20:39)
- git-committer:
- Jose Benito <jose.benito.gonzalez@…> (06/09/10 17:32:00)
- Files:
-
- 1 added
- 13 edited
-
doc/guides/UserGuide/Conferences.rst (modified) (1 diff)
-
indico/MaKaC/services/implementation/category.py (modified) (8 diffs)
-
indico/MaKaC/webinterface/pages/category.py (modified) (3 diffs)
-
indico/MaKaC/webinterface/rh/categoryDisplay.py (modified) (7 diffs)
-
indico/MaKaC/webinterface/rh/categoryMod.py (modified) (51 diffs)
-
indico/MaKaC/webinterface/tpls/CategoryCreation.tpl (modified) (2 diffs)
-
indico/MaKaC/webinterface/tpls/ConferenceCreation.tpl (modified) (4 diffs)
-
indico/MaKaC/webinterface/tpls/EventSetProtection.tpl (added)
-
indico/MaKaC/webinterface/tpls/MeetingCreation.tpl (modified) (5 diffs)
-
indico/MaKaC/webinterface/tpls/SimpleEventCreation.tpl (modified) (4 diffs)
-
indico/htdocs/css/Default.css (modified) (1 diff)
-
indico/htdocs/js/indico/Core/Widgets/Base.js (modified) (1 diff)
-
indico/htdocs/js/indico/Management/Users.js (modified) (1 diff)
-
indico/htdocs/js/indico/Management/eventCreation.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/guides/UserGuide/Conferences.rst
r62a512 r701dc2 29 29 the page. You will be presented with a form in which you: 30 30 31 1. choose the category where you want to place your conference and 32 2. fill the details of the conference you wish to create. 31 1. choose the category where you want to place your conference 32 2. fill the details of the conference you wish to create 33 3. set the access protection of the conference 33 34 34 35 Once this is done your conference will be created and you will be -
indico/MaKaC/services/implementation/category.py
r521479 r701dc2 16 16 Base class for category 17 17 """ 18 18 19 19 def _checkParams( self ): 20 20 try: … … 22 22 l.setCategory( self._params ) 23 23 self._target = self._categ = l.getObject() 24 except: 24 except: 25 25 #raise ServiceError("ERR-E4", "Invalid category id.") 26 26 self._target = self._categ = conference.CategoryManager().getRoot() … … 33 33 34 34 class CategoryDisplayBase(ProtectedDisplayService, CategoryBase): 35 35 36 36 def _checkParams(self): 37 37 CategoryBase._checkParams(self) 38 38 ProtectedDisplayService._checkParams(self) 39 39 40 40 class GetCategoryList(CategoryDisplayBase): 41 41 … … 83 83 categList.append({"id":cat.getId(), "title":cat.getTitle(), "subcatLength":len(cat.getSubCategoryList()), "final": not cat.hasSubcategories()}) 84 84 return {"parentCateg": 85 {"id":parent.getId(), "title":parent.getTitle()}, 85 {"id":parent.getId(), "title":parent.getTitle()}, 86 86 "currentCateg": 87 {"id":target.getId(), "title":target.getTitle(), "breadcrumb": breadcrumbs}, 87 {"id":target.getId(), "title":target.getTitle(), "breadcrumb": breadcrumbs}, 88 88 "categList":categList, 89 89 "accessAllowed": allowed … … 91 91 92 92 class CanCreateEvent(CategoryDisplayBase): 93 93 """ 94 This service returns whether or not the user can create 95 an event in this category along with the protection of 96 the chosen category. 97 """ 94 98 def _checkProtection( self ): 95 99 self._accessAllowed = False … … 101 105 102 106 def _getAnswer( self ): 107 canCreate = False 108 protection = "public" 109 103 110 if (self._accessAllowed and self._categ.canCreateConference( self._getUser() )): 104 return True 105 return False 111 canCreate = True 112 113 if self._categ.isProtected() : 114 protection = "private" 115 116 return {"canCreate": canCreate, 117 "protection": protection} 106 118 107 119 108 120 class GetPastEventsList(CategoryDisplayBase): 109 121 110 122 def _checkParams(self): 111 123 CategoryDisplayBase._checkParams(self) … … 114 126 115 127 def _getAnswer( self ): 116 128 117 129 allEvents,eventsByMonth = WConferenceList.sortEvents(self._target.getConferenceList()) 118 130 119 131 ## CREATE future events dict and future/past counter 120 132 pastEvents = {} … … 126 138 if month < self._fromDate.month: 127 139 pastEvents.setdefault(year,{})[month] = allEvents[year][month] 128 140 129 141 return WConferenceListEvents(pastEvents, self._aw).getHTML() 130 142 -
indico/MaKaC/webinterface/pages/category.py
r9456a0 r701dc2 1206 1206 vars["roomName"] = vars.get("locationRoom","") 1207 1207 #vars["locator"] = self._categ.getLocator().getWebForm() 1208 vars["categ"] = {"id":"", "title":_("-- please, choose a category --") } 1208 vars["protection"] = "public" 1209 vars["categ"] = {"id":"", "title":_("-- please, choose a category --")} 1209 1210 if self._categ and not self._categ.hasSubcategories(): 1211 if self._categ.isProtected() : 1212 vars["protection"] = "private" 1210 1213 vars["categ"] = {"id":self._categ.getId(), "title":self._categ.getTitle()} 1211 1214 vars["nocategs"] = False … … 1213 1216 vars["nocategs"] = True 1214 1217 rootcateg = CategoryManager().getRoot() 1218 if rootcateg.isProtected(): 1219 vars["protection"] = "private" 1215 1220 vars["categ"] = {"id":rootcateg.getId(), "title":rootcateg.getTitle()} 1216 1221 #vars["event_type"] = "" … … 1633 1638 default_tz = 'UTC' 1634 1639 vars["timezoneOptions"] = TimezoneRegistry.getShortSelectItemsHTML(default_tz) 1640 vars["categTitle"] = self.__target.getTitle() 1641 if self.__target.isProtected() : 1642 vars["categProtection"] = "private" 1643 else : 1644 vars["categProtection"] = "public" 1645 1635 1646 return vars 1636 1647 -
indico/MaKaC/webinterface/rh/categoryDisplay.py
reefc00 r701dc2 240 240 if self._wf: 241 241 self._wfReg.registerFactory( c, self._wf ) 242 avatars, newUsers = self._getPersons() 243 UtilPersons.addToConf(avatars, newUsers, c, self._params.has_key('grant-manager')) 242 243 eventAccessProtection = params.get("eventProtection", "inherit") 244 245 if eventAccessProtection == "private" : 246 c.getAccessController().setProtection(1) 247 elif eventAccessProtection == "public" : 248 c.getAccessController().setProtection(-1) 249 250 avatars, newUsers, allowedAvatars = self._getPersons() 251 UtilPersons.addToConf(avatars, newUsers, allowedAvatars, c, self._params.has_key('grant-manager')) 244 252 if params.get("sessionSlots",None) is not None : 245 253 if params["sessionSlots"] == "enabled" : … … 251 259 252 260 def _getPersons(self): 253 avatars, newUsers =[], []261 cpAvatars, cpNewUsers, auAvatars = [], [], [] 254 262 from MaKaC.services.interface.rpc import json 255 263 chairpersonDict = json.decode(self._params.get("chairperson")) 264 allowedUsersDict = json.decode(self._params.get("allowedUsers")) 256 265 if chairpersonDict: 257 avatars, newUsers, editedAvatars = UserListModificationBase.retrieveUsers({"userList":chairpersonDict}) 266 cpAvatars, cpNewUsers, cpEditedAvatars = UserListModificationBase.retrieveUsers({"userList":chairpersonDict}) 267 if allowedUsersDict : 268 auAvatars, auNewUsers, auEditedAvatars = UserListModificationBase.retrieveUsers({"userList":allowedUsersDict}) 258 269 #raise "avt: %s, newusers: %s, edited: %s"%(map(lambda x:x.getFullName(),avatars), newUsers, editedAvatars) 259 return avatars, newUsers270 return cpAvatars, cpNewUsers, auAvatars 260 271 261 272 def alertCreation(self, confs): … … 325 336 326 337 @staticmethod 327 def addToConf( avatars, newUsers, conf, grantManager):338 def addToConf( avatars, newUsers, accessingAvatars, conf, grantManager): 328 339 329 340 if newUsers : … … 340 351 if not UtilPersons._alreadyDefined(person) : 341 352 #TODO: add to conf 342 UtilPersons._add (conf, person, grantManager)353 UtilPersons._addChair(conf, person, grantManager) 343 354 else : 344 355 #self._errorList.append("%s has been already defined as %s of this conference"%(person.getFullName(),self._typeName)) … … 353 364 if not UtilPersons._alreadyDefined(person): 354 365 #TODO: add to conf 355 UtilPersons._add (conf, person, grantManager)366 UtilPersons._addChair(conf, person, grantManager) 356 367 else : 357 368 #self._errorList.append("%s has been already defined as %s of this conference"%(person.getFullName(),self._typeName)) … … 366 377 # else : 367 378 # self._errorList.append("%s has been already defined as %s of this conference"%(presenter.getFullName(),self._typeName)) 379 380 if accessingAvatars: 381 for person in accessingAvatars : 382 if isinstance(person, user.Avatar) or isinstance(person, user.Group) or isinstance(person, user.CERNGroup): 383 conf.grantAccess(person) 368 384 369 385 @staticmethod … … 380 396 381 397 @staticmethod 382 def _add (conf, chair, grant):398 def _addChair(conf, chair, grant): 383 399 conf.addChair(chair) 384 400 if grant: -
indico/MaKaC/webinterface/rh/categoryMod.py
rbdd862 r701dc2 25 25 import MaKaC.webinterface.urlHandlers as urlHandlers 26 26 import MaKaC.webinterface.pages.category as category 27 from MaKaC.webinterface.user import UserListModificationBase 27 28 from MaKaC.common.Configuration import Config 28 import MaKaC.common.indexes as indexes 29 import MaKaC.common.indexes as indexes 29 30 from MaKaC.common.utils import sortCategoryByTitle 30 31 import MaKaC.conference as conference … … 61 62 class RHCategoryModification( RHCategModifBase ): 62 63 _uh = urlHandlers.UHCategoryModification 63 64 64 65 def _process( self ): 65 66 p = category.WPCategoryModification( self, self._target ) … … 69 70 class RHCategoryDataModif( RHCategModifBase ): 70 71 _uh = urlHandlers.UHCategoryDataModif 71 72 72 73 def _process( self ): 73 74 p = category.WPCategoryDataModification( self, self._target ) … … 80 81 self._target.clearCache() 81 82 self._redirect( urlHandlers.UHCategoryModification.getURL( self._target ) ) 82 83 83 84 class RHCategoryClearConferenceCaches( RHCategModifBase ): 84 85 _uh = urlHandlers.UHCategoryClearConferenceCaches … … 87 88 self._target.clearConferenceCaches() 88 89 self._redirect( urlHandlers.UHCategoryModification.getURL( self._target ) ) 89 90 90 91 class RHCategoryPerformModification( RHCategModifBase ): 91 92 _uh = urlHandlers.UHCategoryPerformModification 92 93 93 94 def _checkParams(self, params): 94 95 RHCategModifBase._checkParams(self, params) 95 96 if params.get("name", "").strip() =="": 96 raise FormValuesError("Please, provide a name for the new subcategory") 97 raise FormValuesError("Please, provide a name for the new subcategory") 97 98 98 99 def _getNewTempFile( self ): … … 101 102 tempFileName = tempfile.mkstemp( suffix="Indico.tmp", dir = tempPath )[1] 102 103 return tempFileName 103 104 104 105 def _saveFileToTemp( self, fd ): 105 106 fileName = self._getNewTempFile() … … 108 109 f.close() 109 110 return fileName 110 111 111 112 def _process( self): 112 113 params = self._getRequestParams() 113 114 114 115 if not "cancel" in params: 115 116 if (params.get("subcats","")): … … 121 122 else: 122 123 modifyConfTZ=False 123 tz = params.get("defaultTimezone", "UTC") 124 tz = params.get("defaultTimezone", "UTC") 124 125 self._target.setTimezone( tz ) 125 126 if modifyConfTZ: … … 150 151 else : 151 152 self._target.setTasksForbidden() 152 153 153 154 self._redirect( urlHandlers.UHCategoryModification.getURL( self._target ) ) 154 155 155 156 156 class RHCategoryTaskOption( RHCategModifBase ): 157 class RHCategoryTaskOption( RHCategModifBase ): 157 158 _uh = urlHandlers.UHCategoryTasksOption 158 159 def _process( self ): 160 161 if self._target.tasksAllowed() : 162 self._target.setTasksForbidden() 159 160 def _process( self ): 161 162 if self._target.tasksAllowed() : 163 self._target.setTasksForbidden() 163 164 else : 164 165 self._target.setTasksAllowed() 165 166 166 167 self._redirect( urlHandlers.UHCategoryModification.getURL( self._target ) ) 167 168 … … 170 171 class RHCategoryAC( RHCategModifBase ): 171 172 _uh = urlHandlers.UHCategModifAC 172 173 173 174 def _process( self ): 174 175 p = category.WPCategModifAC( self, self._target ) 175 176 return p.display() 176 177 177 178 178 179 class RHCategoryTools( RHCategModifBase ): 179 180 _uh = urlHandlers.UHCategModifTools 180 181 181 182 def _process( self ): 182 183 p = category.WPCategModifTools( self, self._target ) … … 186 187 class RHCategoryTasks( RHCategModifBase ): 187 188 _uh = urlHandlers.UHCategModifTasks 188 189 189 190 def _process( self ): 190 191 p = category.WPCategModifTasks( self, self._target ) … … 193 194 class RHCategoryFiles( RHCategModifBase ): 194 195 _uh = urlHandlers.UHCategModifFiles 195 196 def _process( self ): 196 197 def _process( self ): 197 198 p = category.WPCategoryModifExistingMaterials( self, self._target ) 198 199 return p.display() 199 200 200 201 201 202 class RHAddMaterial( RHCategModifBase ): 202 203 _uh = urlHandlers.UHCategoryAddMaterial 203 204 204 205 def _checkParams( self, params ): 205 206 RHCategModifBase._checkParams(self, params) … … 217 218 class RHCategoryTasksAction( RHCategModifBase ): 218 219 _uh = urlHandlers.UHCategModifTasksAction 219 220 def _process( self ): 221 params = self._getRequestParams() 222 220 221 def _process( self ): 222 params = self._getRequestParams() 223 223 224 if params.get("accessVisibility","") == _("PRIVATE") : 224 225 self._target.setTasksPrivate() … … 227 228 else : 228 229 pass 229 230 230 231 if params.get("commentVisibility","") == _("PRIVATE") : 231 232 self._target.setTasksCommentPrivate() … … 234 235 else : 235 236 pass 236 237 237 238 if params.get("taskAccessAction","") == "Add": 238 239 chosen = params.get("accessChosen",None) … … 249 250 else : 250 251 pass 251 252 252 253 if params.get("taskCommentAction","") == "Add": 253 254 chosen = params.get("commentChosen",None) 254 if chosen is not None and chosen != "" : 255 if chosen is not None and chosen != "" : 255 256 person = self._findPerson(chosen) 256 257 if person is not None : … … 264 265 else : 265 266 pass 266 267 267 268 268 269 if params.get("taskManagerAction","") == "Add": 269 270 chosen = params.get("managerChosen",None) 270 if chosen is not None and chosen != "" : 271 if chosen is not None and chosen != "" : 271 272 person = self._findPerson(chosen) 272 if person is not None : 273 if person is not None : 273 274 self._target.addTasksManager(person) 274 275 elif params.get("taskManagerAction","") == "New": … … 280 281 else : 281 282 pass 282 283 283 284 284 285 p = category.WPCategModifTasks( self, self._target ) 285 286 return p.display() 286 287 287 def _findPerson(self, idString): 288 def _findPerson(self, idString): 288 289 if idString is None or idString == "" : 289 290 return None … … 292 293 elif idString[0] == "a" : 293 294 return self._target.getTasksAccessPerson(int(idString[1:])) 294 295 295 296 index = idString.find("-") 296 297 eventId = idString[1:index] 297 298 personId = idString[index+1:] 298 299 299 300 if idString[0] == "h" : 300 301 return self._target.getConferenceById(eventId).getChairById(personId) … … 303 304 elif idString[0] == "p" : 304 305 return self._target.getConferenceById(eventId).getParticipation().getParticipantById(personId) 305 306 306 307 return None 307 308 308 309 class RHCategoryCreation( RHCategModifBase ): 309 310 _uh = urlHandlers.UHCategoryCreation 310 311 311 312 def _process( self ): 312 313 p = category.WPCategoryCreation( self, self._target ) … … 316 317 class RHCategoryPerformCreation( RHCategModifBase ): 317 318 _uh = urlHandlers.UHCategoryPerformCreation 318 319 319 320 def _checkParams(self, params): 320 321 RHCategModifBase._checkParams(self, params) … … 325 326 params = self._getRequestParams() 326 327 if not ("cancel" in params): 327 nc = self._target.newSubCategory() 328 nc = self._target.newSubCategory() 328 329 nc.setTimezone( params.get("defaultTimezone")) 329 330 nc.setName( params.get("name", "") ) … … 331 332 nc.setDefaultStyle("simple_event",params.get("defaultSimpleEventStyle", "") ) 332 333 nc.setDefaultStyle("meeting",params.get("defaultMeetingStyle", "") ) 334 335 categAccessProtection = params.get("categProtection", "inherit") 336 337 if categAccessProtection == "private" : 338 nc.getAccessController().setProtection(1) 339 allowedUsers = self._getAllowedUsers(params) 340 if allowedUsers : 341 for person in allowedUsers : 342 if isinstance(person, user.Avatar) or isinstance(person, user.Group) or isinstance(person, user.CERNGroup): 343 nc.grantAccess(person) 344 elif categAccessProtection == "public" : 345 nc.getAccessController().setProtection(-1) 346 333 347 self._redirect( urlHandlers.UHCategoryModification.getURL( self._target ) ) 348 349 350 def _getAllowedUsers(self, params): 351 352 auAvatars = [] 353 from MaKaC.services.interface.rpc import json 354 allowedUsersDict = json.decode(params.get("allowedUsers")) 355 if allowedUsersDict : 356 auAvatars, auNewUsers, auEditedAvatars = UserListModificationBase.retrieveUsers({"allowedUserList":allowedUsersDict}, "allowedUserList") 357 358 return auAvatars 334 359 335 360 336 361 #class RHCategoryRemoveSubItems( RHCategModifBase ): 337 362 # _uh = urlHandlers.UHCategoryPerformCreation 338 # 363 # 339 364 # def _checkParams( self, params ): 340 365 # RHCategModifBase._checkParams( self, params ) … … 353 378 # for confId in confIdList: 354 379 # self._confs.append( ch.getById( confId ) ) 355 # 380 # 356 381 # def _process( self ): 357 382 # if self._cancel: … … 361 386 362 387 class _ActionSubCategDeletion: 363 388 364 389 def __init__( self, rh, target, selCategs ): 365 390 self._rh = rh 366 391 self._target = target 367 392 self._categs = selCategs 368 393 369 394 def askConfirmation( self, params ): 370 395 p = category.WPSubCategoryDeletion( self._rh, self._target ) … … 390 415 391 416 class _ActionSubCategMove: 392 417 393 418 def __init__( self, rh, newpos, oldpos ): 394 419 self._rh = rh 395 420 self._newpos = int(newpos) 396 421 self._oldpos = int(oldpos) 397 422 398 423 def askConfirmation( self, params ): 399 424 return "" … … 409 434 410 435 class _ActionSubCategReallocation: 411 436 412 437 def __init__( self, rh, target, selCategs ): 413 438 self._rh = rh 414 439 self._target = target 415 440 self._categs = selCategs 416 441 417 442 def askConfirmation( self, params ): 418 443 p = category.WPCategoryReallocation( self._rh, self._target ) … … 421 446 422 447 def perform( self ): 423 #check if the current user has modification privileges on the 448 #check if the current user has modification privileges on the 424 449 # destination category 425 450 if not self._target.canModify( self._rh.getAW() ): 426 451 raise MaKaCError( _("cannot reallocate selected categoried to the selected destination because you are not authorised to modify the destination category")) 427 452 for categ in self._categs: 428 categ.move( self._target ) 453 categ.move( self._target ) 429 454 430 455 431 456 class RHCategoryActionSubCategs( RHCategModifBase ): 432 457 _uh = urlHandlers.UHCategoryActionSubCategs 433 458 434 459 def _checkParams( self, params ): 435 460 RHCategModifBase._checkParams( self, params ) … … 451 476 self._confirmation = 1 452 477 self._action = _ActionSortCategories( self ) 453 478 454 479 def _process( self ): 455 480 if not self._categs: … … 466 491 467 492 class _ActionConferenceDeletion: 468 493 469 494 def __init__( self, rh,target, selConfs,): 470 495 self._rh = rh … … 476 501 event.delete() 477 502 478 503 479 504 def askConfirmation( self, params ): 480 505 p = category.WPConferenceDeletion( self._rh, self._target ) … … 482 507 483 508 class _ActionConferenceReallocation: 484 509 485 510 def __init__( self, rh, srcCateg, selConfs, target): 486 511 self._rh = rh … … 488 513 self._confs = selConfs 489 514 self._target=target 490 515 491 516 def askConfirmation( self, params ): 492 517 p = category.WPConferenceReallocation( self._rh, self._categ ) … … 495 520 496 521 def perform( self, confs ): 497 #ToDo: check if the current user can create conferences on the 522 #ToDo: check if the current user can create conferences on the 498 523 # destination category 499 524 if self._confs == []: … … 506 531 class RHCategoryActionConferences( RHCategModifBase ): 507 532 _uh = urlHandlers.UHCategoryActionConferences 508 533 509 534 def _checkParams( self, params ): 510 535 RHCategModifBase._checkParams( self, params ) … … 524 549 self._srcCateg = cm.getById( params["srcCategId"] ) 525 550 self._action = _ActionConferenceReallocation( self, self._srcCateg, self._confs, self._target ) 526 551 527 552 def _process( self ): 528 553 if self._confirmation: … … 537 562 class RHCategorySelectManagers( RHCategModifBase ): 538 563 _uh = urlHandlers.UHCategorySelectManagers 539 564 540 565 def _process( self ): 541 566 p = category.WPCategorySelectManagers( self, self._target ) … … 545 570 class RHCategoryAddManagers( RHCategModifBase ): 546 571 _uh = urlHandlers.UHCategoryAddManagers 547 572 548 573 def _process( self ): 549 574 params = self._getRequestParams() … … 558 583 class RHCategoryRemoveManagers( RHCategModifBase ): 559 584 _uh = urlHandlers.UHCategoryRemoveManagers 560 585 561 586 def _process( self ): 562 587 params = self._getRequestParams() … … 571 596 class RHCategorySetVisibility( RHCategModifBase ): 572 597 _uh = urlHandlers.UHCategorySetVisibility 573 598 574 599 def _process( self ): 575 600 params = self._getRequestParams() … … 581 606 self._target.setProtection( -1 ) 582 607 self._redirect( urlHandlers.UHCategModifAC.getURL( self._target ) ) 583 608 584 609 585 610 class RHCategorySelectAllowed( RHCategModifBase ): 586 611 _uh = urlHandlers.UHCategorySelectAllowed 587 612 588 613 def _process( self ): 589 614 p = category.WPCategorySelectAllowed( self, self._target ) … … 593 618 class RHCategoryAddAllowed( RHCategModifBase ): 594 619 _uh = urlHandlers.UHCategoryAddAllowed 595 620 596 621 def _process( self ): 597 622 params = self._getRequestParams() … … 605 630 class RHCategoryRemoveAllowed( RHCategModifBase ): 606 631 _uh = urlHandlers.UHCategoryRemoveAllowed 607 632 608 633 def _process( self ): 609 634 params = self._getRequestParams() … … 618 643 class RHCategoryAddDomains( RHCategModifBase ): 619 644 _uh = urlHandlers.UHCategoryAddDomain 620 645 621 646 def _process( self ): 622 647 params = self._getRequestParams() … … 630 655 class RHCategoryRemoveDomains( RHCategModifBase ): 631 656 _uh = urlHandlers.UHCategoryRemoveDomain 632 657 633 658 def _process( self ): 634 659 params = self._getRequestParams() … … 654 679 class RHCategorySelectConfCreators( RHCategModifBase ): 655 680 _uh = urlHandlers.UHCategorySelectConfCreators 656 681 657 682 def _process( self ): 658 683 p = category.WPCategorySelectConfCreators( self, self._target ) … … 662 687 class RHCategoryAddConfCreators( RHCategModifBase ): 663 688 _uh = urlHandlers.UHCategoryAddConfCreators 664 689 665 690 def _process( self ): 666 691 params = self._getRequestParams() … … 677 702 class RHCategoryRemoveConfCreators( RHCategModifBase ): 678 703 _uh = urlHandlers.UHCategoryRemoveConfCreators 679 704 680 705 def _process( self ): 681 706 params = self._getRequestParams() … … 689 714 class RHCategorySetNotifyCreation( RHCategModifBase ): 690 715 _uh = urlHandlers.UHCategorySetNotifyCreation 691 716 692 717 def _process( self ): 693 718 params = self._getRequestParams() … … 697 722 class RHCategoryDeletion( RHCategModifBase ): 698 723 _uh = urlHandlers.UHCategoryDeletion 699 724 700 725 def _checkParams( self, params ): 701 726 RHCategModifBase._checkParams( self, params ) … … 704 729 self._cancel = True 705 730 self._confirmation = params.has_key("confirm") 706 731 707 732 def _perform( self ): 708 733 self._target.delete(1) 709 734 710 735 def _process( self ): 711 736 if self._cancel: -
indico/MaKaC/webinterface/tpls/CategoryCreation.tpl
r9033fd r701dc2 1 1 2 <form action="%(postURL)s" method="POST">2 <form id="categCreationForm" action="%(postURL)s" method="POST"> 3 3 %(locator)s 4 4 <table class="groupTable"> … … 29 29 </tr> 30 30 <tr> 31 <td nowrap class="dataCaptionTD"><span class="dataCaptionFormat"><%= _("Protection")%></span></td> 32 <td class="blacktext"> 33 <div> 34 <% if categProtection == 'public' : %> 35 <% color = "#128F33" %> 36 <% end %> 37 <% else : %> 38 <% color = "#B02B2C" %> 39 <% end %> 40 <span id="inheritRadioButtonWrapper" class="categProtectionRadioEntry"> 41 <input type="radio" id="inheritRadioButton" class="eventProtectionRadioButton" name="categProtection" value='inherit' onclick="hideUserList();" checked/><label for="inheritRadioButton"><span id="inheritRadioEntryKey" style="color:<%= color %>;"><%= _("Same as for parent category '") %><span id="radioCategTitle"><%= categTitle %></span>'</span> : <span id="radioCategProtection" style="font-weight: bold;"><%= categProtection %></span> <%= _("for the moment, but it may change") %> </label> 42 </span> 43 <span id="privateRadioButtonWrapper" class='categProtectionRadioEntry'> 44 <input type="radio" id="privateRadioButton" class="eventProtectionRadioButton" name="categProtection" value='private' onclick="showUserList();"/><label for="privateRadioButton"><span style="color: #B02B2C"><%= _("Private") %></span><%= _(" : Can only be viewed by you and users/groups chosen by you from the list of users") %></label> 45 </span> 46 <span id="allowedUserListInfo" class="allowedUserListInfo" style="display: none;"> 47 <em><%= _("Please fill in the list below with the users/groups that will be granted access to this category. You can always do so later, once the category is created, through the category protection settings.") %></em> 48 </span> 49 <div id="userListWrapper"> 50 </div> 51 <% if categProtection != 'public' : %> 52 <span id="publicRadioButtonWrapper" class='categProtectionRadioEntry'> 53 <input type="radio" id="publicRadioButton" class="eventProtectionRadioButton" name="categProtection" value='public' onclick="hideUserList();"/><label for="publicRadioButton"><span style="color: #128F33"><%= _("Public") %></span><%= _(" : Can be viewed by everyone") %></label> 54 </span> 55 <% end %> 56 </div> 57 <input type="hidden" value="" id="allowedUsers" name="allowedUsers"/> 58 </td> 59 </tr> 60 <tr> 31 61 <td> </td> 32 62 <td> 33 <input type="submit" class="btn" name="OK" value="<%= _(" ok")%>">34 <input type="submit" class="btn" name="cancel" value="<%= _(" cancel")%>">63 <input type="submit" class="btn" name="OK" value="<%= _("Create Sub-Category")%>"> 64 <input type="submit" class="btn" name="cancel" value="<%= _("Cancel")%>"> 35 65 </td> 36 66 </tr> 37 67 </table> 38 68 </form> 69 70 <script type="text/javascript"> 71 72 // ---- List of users allowed to view the event 73 74 var allowedUsersList = new UserListField( 75 'allowedUserListDiv', 'allowedUserList', 76 null, true, null, 77 true, true, null, null, 78 false, false, true, 79 userListNothing, userListNothing, userListNothing); 80 81 // ---- When the private radio button is selected, display the list of users 82 83 var hideUserList = function() { 84 $E('userListWrapper').dom.style.padding = ""; 85 $E('userListWrapper').set(''); 86 $E('allowedUserListInfo').dom.style.display = "none"; 87 } 88 89 var showUserList = function() { 90 $E('userListWrapper').dom.style.padding = "6px 26px"; 91 $E('userListWrapper').set(allowedUsersList.draw()); 92 $E('allowedUserListInfo').dom.style.display = ""; 93 } 94 95 function injectValuesInForm(form, action) { 96 form.observeEvent('submit', function() { 97 if (action) { 98 return action(); 99 } 100 }); 101 }; 102 103 // ---- On Load 104 IndicoUI.executeOnLoad(function() { 105 injectValuesInForm($E('categCreationForm'),function() { 106 $E('allowedUsers').set(Json.write(allowedUsersList.getUsers())); 107 }); 108 }); 109 110 </script> -
indico/MaKaC/webinterface/tpls/ConferenceCreation.tpl
rc728c4 r701dc2 99 99 </tr> 100 100 </table> 101 102 <% includeTpl('EventSetProtection', eventType='conference') %> 103 101 104 <table class="groupTable" style="background-color: #ECECEC; border-top: 1px dashed #777777;"> 102 105 <tr> … … 155 158 156 159 // ----- Categ Chooser 157 var categoryChooserHandler = function(categ ){160 var categoryChooserHandler = function(categ, protection){ 158 161 $E("createCategId").set(categ.id); 159 162 $E("categTitle").set(categ.title); 160 163 $E("buttonCategChooser").set("Change...") 161 164 IndicoUI.Effect.highLightBackground("categTitle"); 165 166 updateProtectionChooser(categ.title, protection); 162 167 }; 163 168 … … 176 181 $E("buttonCategChooser").set("<%= _("Change...")%>"); 177 182 } 183 184 protectionChooserExecOnLoad("<%=categ["id"]%>", "<%=protection%>"); 178 185 179 186 var startDate = IndicoUI.Widgets.Generic.dateField(true,null,['sDay', 'sMonth', 'sYear','sHour', 'sMinute']) … … 206 213 }else { 207 214 $E('chairperson').set(Json.write(uf.getUsers())); 215 injectFromProtectionChooser(); 208 216 } 209 217 }); -
indico/MaKaC/webinterface/tpls/MeetingCreation.tpl
rc728c4 r701dc2 94 94 </td></tr> 95 95 </table> 96 97 <% includeTpl('EventSetProtection', eventType='meeting') %> 98 96 99 <table class="groupTable" style="background-color: #ECECEC; border-top: 1px dashed #777777;"> 97 100 <tr> … … 151 154 152 155 // ----- Categ Chooser 153 var categoryChooserHandler = function(categ ){156 var categoryChooserHandler = function(categ, protection){ 154 157 $E("createCategId").set(categ.id); 155 158 $E("categTitle").set(categ.title); 156 $E("buttonCategChooser").set("<%= _("Change...")%>") 159 $E("buttonCategChooser").set("<%= _("Change...")%>"); 157 160 IndicoUI.Effect.highLightBackground("categTitle"); 158 }; 161 162 updateProtectionChooser(categ.title, protection); 163 164 }; 159 165 160 166 var openCategoryChooser = function() { … … 163 169 } 164 170 171 165 172 // ---- On Load 166 173 IndicoUI.executeOnLoad(function() … … 171 178 $E("buttonCategChooser").set("<%= _("Change...")%>"); 172 179 } 180 181 protectionChooserExecOnLoad("<%= categ["id"] %>", "<%= protection %>"); 173 182 174 183 var startDate = IndicoUI.Widgets.Generic.dateField(true,null,['sDay', 'sMonth', 'sYear','sHour', 'sMinute']); … … 201 210 }else { 202 211 $E('chairperson').set(Json.write(uf.getUsers())); 212 injectFromProtectionChooser(); 203 213 } 204 214 }); -
indico/MaKaC/webinterface/tpls/SimpleEventCreation.tpl
rc728c4 r701dc2 96 96 </table> 97 97 98 <% includeTpl('EventSetProtection', eventType='lecture') %> 99 98 100 <table class="groupTable" style="background-color: #ECECEC; border-top: 1px dashed #777777;"> 99 101 <tr> … … 135 137 136 138 // ----- Categ Chooser 137 var categoryChooserHandler = function(categ ){139 var categoryChooserHandler = function(categ, protection){ 138 140 $E("createCategId").set(categ.id); 139 141 $E("categTitle").set(categ.title); 140 142 $E("buttonCategChooser").set("<%= _("Change...")%>") 141 143 IndicoUI.Effect.highLightBackground("categTitle"); 144 145 updateProtectionChooser(categ.title, protection); 142 146 }; 143 147 … … 160 164 } 161 165 166 protectionChooserExecOnLoad("<%=categ["id"]%>", "<%=protection%>"); 167 162 168 injectValuesInForm($E('eventCreationForm'),function() { 163 169 if (!verifyDates()) { … … 172 178 }else { 173 179 $E('chairperson').set(Json.write(uf.getUsers())); 180 injectFromProtectionChooser(); 174 181 } 175 182 }); -
indico/htdocs/css/Default.css
r0d5340 r701dc2 3194 3194 } 3195 3195 3196 div.accessProtection { 3197 padding: 10px; 3198 font-size: 16px; 3199 } 3200 3201 span.eventProtectionRadioEntry { 3202 display: block; 3203 padding-left: 50px; 3204 padding-bottom: 5px; 3205 } 3206 3207 span.eventProtectionRadioEntry label, span.categProtectionRadioEntry label { 3208 font-weight: normal; 3209 padding-left: 5px; 3210 } 3211 3212 span.protectionRadioInfo { 3213 display: block; 3214 padding: 20px; 3215 } 3216 3217 input.eventProtectionRadioButton { 3218 padding-right: 5px; 3219 } 3220 3221 span.categProtectionRadioEntry { 3222 display: block; 3223 padding-bottom: 5px; 3224 } 3225 3226 div.userListWrapper { 3227 padding-left: 63px; 3228 } 3229 3230 div.userListWrapper div { 3231 padding: 6px; 3232 } 3233 3234 div.userListDiv , div.allowedUserListDiv{ 3235 width: 320px; 3236 height: 200px; 3237 border: 1px solid #CCCCCC; 3238 overflow: auto; 3239 } 3240 3241 ul.userList, ul.allowedUserList { 3242 padding-left: 0; 3243 margin: 0; 3244 list-style-type: none; 3245 display: block; 3246 border: medium none; 3247 3248 } 3249 3250 ul.userList li , ul.allowedUserList li { 3251 display: block; 3252 line-height: 28px; 3253 margin: 0 0 0; 3254 padding-left: 5px; 3255 vertical-align: middle; 3256 } 3257 3258 ul.allowedUserList li { 3259 line-height: 21px; 3260 } 3261 3262 ul.userList li:hover, ul.allowedUserList li:hover { 3263 background-color: #ECECEC; 3264 } 3265 3266 span.userListInfo { 3267 display: block; 3268 padding-left: 70px; 3269 } 3270 3271 span.allowedUserListInfo { 3272 display: block; 3273 padding-left: 27px; 3274 } 3275 3196 3276 .bannerTitle 3197 3277 { -
indico/htdocs/js/indico/Core/Widgets/Base.js
red6cf2 r701dc2 681 681 if (value == SourceState.Loaded) { 682 682 canvas.set(self.drawContent(content)); 683 } else if(value == SourceState.Committing){684 self.runIndicator(canvas);683 } else if(value == SourceState.Loading || value == SourceState.Committing){ 684 self.runIndicator(canvas); 685 685 } else if (value == SourceState.Error) { 686 686 self._error(self.source.error.get()); -
indico/htdocs/js/indico/Management/Users.js
r92af92 r701dc2 1560 1560 * @param {Function} editProcess A function that will be called when a user is edited. 1561 1561 * @param {Function} removeProcess A function that will be called when a user is removed. 1562 * @param {Boolean} showToggleFavouriteButtons. false by default. If true, favouritize buttons will not be shown.1563 1562 */ 1564 1563 function(userDivStyle, userListStyle, -
indico/htdocs/js/indico/Management/eventCreation.js
rf25f07 r701dc2 157 157 _returnChoice: function(categ) { 158 158 if (!this.creationControl) { 159 this.owner.closeHandler(categ );159 this.owner.closeHandler(categ, 'public'); 160 160 } else { 161 161 var self = this; … … 166 166 if (value == SourceState.Loaded) { 167 167 if (self.owner) { 168 if (!src.get() ) {168 if (!src.get()["canCreate"]) { 169 169 var popup = new ErrorPopup($T("Creation forbidden"), [$T("You do not have permissions to create events in that category")], ""); 170 170 popup.open(); 171 171 }else{ 172 self.owner.closeHandler(self.resultCateg );172 self.owner.closeHandler(self.resultCateg, src.get()["protection"]); 173 173 } 174 174 self.killProgress(); … … 204 204 }, 205 205 206 closeHandler: function(categ ) {207 this.handler(categ );206 closeHandler: function(categ, protection) { 207 this.handler(categ, protection); 208 208 }, 209 209 … … 266 266 var self = this; 267 267 268 var handler = function(categ ) {268 var handler = function(categ, protection) { 269 269 self.categ = categ; 270 self.protection = protection 270 271 self.close(); 271 self.categoryChooserHandler(categ );272 self.categoryChooserHandler(categ, protection); 272 273 }; 273 274 var catChooserWidget = new CategoryChooserWidget(self.categ, handler, self.creationControl);
Note: See TracChangeset
for help on using the changeset viewer.
