1 # -*- coding: utf-8 -*-
4 ## This file is part of Indico.
5 ## Copyright (C) 2002 - 2013 European Organization for Nuclear Research (CERN).
7 ## Indico is free software; you can redistribute it and/or
8 ## modify it under the terms of the GNU General Public License as
9 ## published by the Free Software Foundation; either version 3 of the
10 ## License, or (at your option) any later version.
12 ## Indico is distributed in the hope that it will be useful, but
13 ## WITHOUT ANY WARRANTY; without even the implied warranty of
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 ## General Public License for more details.
17 ## You should have received a copy of the GNU General Public License
18 ## along with Indico;if not, see <http://www.gnu.org/licenses/>.
24 from indico
.util
import json
26 from datetime
import timedelta
, datetime
27 from xml
.sax
.saxutils
import quoteattr
, escape
29 import MaKaC
.webinterface
.wcomponents
as wcomponents
30 import MaKaC
.webinterface
.urlHandlers
as urlHandlers
31 import MaKaC
.webinterface
.displayMgr
as displayMgr
32 import MaKaC
.webinterface
.timetable
as timetable
33 import MaKaC
.webinterface
.linking
as linking
34 import MaKaC
.webinterface
.navigation
as navigation
35 import MaKaC
.schedule
as schedule
36 import MaKaC
.conference
as conference
37 import MaKaC
.webinterface
.materialFactories
as materialFactories
38 import MaKaC
.common
.filters
as filters
39 from MaKaC
.common
.utils
import isStringHTML
, formatDateTime
, formatDate
40 import MaKaC
.common
.utils
41 import MaKaC
.review
as review
42 from MaKaC
.webinterface
.pages
.base
import WPDecorated
43 from MaKaC
.webinterface
.common
.tools
import strip_ml_tags
, escape_html
44 from MaKaC
.webinterface
.materialFactories
import ConfMFRegistry
,PaperFactory
,SlidesFactory
,PosterFactory
45 from MaKaC
.common
import Config
46 from MaKaC
.webinterface
.common
.abstractStatusWrapper
import AbstractStatusList
47 from MaKaC
.webinterface
.common
.contribStatusWrapper
import ContribStatusList
48 from MaKaC
.common
.output
import outputGenerator
49 from MaKaC
.webinterface
.general
import strfFileSize
50 from MaKaC
.webinterface
.common
.timezones
import TimezoneRegistry
51 from MaKaC
.PDFinterface
.base
import PDFSizes
52 from pytz
import timezone
53 from MaKaC
.common
.timezoneUtils
import nowutc
, DisplayTZ
54 from MaKaC
.badgeDesignConf
import BadgeDesignConfiguration
55 from MaKaC
.posterDesignConf
import PosterDesignConfiguration
56 from MaKaC
.webinterface
.pages
import main
57 from MaKaC
.webinterface
.pages
import base
58 from MaKaC
.webinterface
.materialFactories
import MaterialFactoryRegistry
59 import MaKaC
.common
.info
as info
60 from MaKaC
.common
.cache
import EventCache
61 from MaKaC
.i18n
import _
62 from indico
.util
.i18n
import i18nformat
63 from indico
.util
.date_time
import format_time
, format_date
, format_datetime
64 import MaKaC
.webcast
as webcast
66 from MaKaC
.common
.fossilize
import fossilize
67 from MaKaC
.fossils
.conference
import IConferenceEventInfoFossil
68 from MaKaC
.common
.Conversion
import Conversion
69 from MaKaC
.common
.logger
import Logger
70 from MaKaC
.plugins
.base
import OldObservable
71 from MaKaC
.plugins
.base
import extension_point
72 from MaKaC
.common
import Configuration
73 from indico
.modules
import ModuleHolder
74 from MaKaC
.paperReviewing
import ConferencePaperReview
as CPR
75 from MaKaC
.conference
import Session
, Contribution
, LocalFile
76 from MaKaC
.common
.Configuration
import Config
77 from MaKaC
.common
.utils
import formatDateTime
78 from MaKaC
.user
import AvatarHolder
79 from MaKaC
.webinterface
.general
import WebFactory
82 def stringToDate( str ):
83 #Don't delete this dictionary inside comment. Its purpose is to add the dictionary in the language dictionary during the extraction!
84 #months = { _("January"):1, _("February"):2, _("March"):3, _("April"):4, _("May"):5, _("June"):6, _("July"):7, _("August"):8, _("September"):9, _("October"):10, _("November"):11, _("December"):12 }
85 months
= { "January":1, "February":2, "March":3, "April":4, "May":5, "June":6, "July":7, "August":8, "September":9, "October":10, "November":11, "December":12 }
86 [ day
, month
, year
] = str.split("-")
87 return datetime(int(year
),months
[month
],int(day
))
90 class WPConferenceBase( base
.WPDecorated
):
92 def __init__( self
, rh
, conference
):
93 WPDecorated
.__init
__( self
, rh
)
94 self
._navigationTarget
= self
._conf
= conference
95 tz
= self
._tz
= DisplayTZ(rh
._aw
,self
._conf
).getDisplayTZ()
96 sDate
= self
.sDate
= self
._conf
.getAdjustedScreenStartDate(tz
)
97 eDate
= self
.eDate
= self
._conf
.getAdjustedScreenEndDate(tz
)
98 dates
=" (%s)"%format
_date
(sDate
, format
='long')
99 if sDate
.strftime("%d%B%Y") != eDate
.strftime("%d%B%Y"):
100 if sDate
.strftime("%B%Y") == eDate
.strftime("%B%Y"):
101 dates
=" (%s-%s)"%(sDate
.strftime("%d"), format_date(eDate
, format
='long'))
103 dates
=" (%s - %s)"%(format_date(sDate
, format
='long'), format_date(eDate
, format
='long'))
104 self
._setTitle
( "%s %s"%(strip_ml_tags(self
._conf
.getTitle()), dates
))
106 def _getFooter( self
):
109 wc
= wcomponents
.WFooter()
111 p
= {"modificationDate": format_datetime(self
._conf
.getModificationDate(), format
='d MMMM yyyy H:mm'),
112 "subArea": self
._getSiteArea
()
116 def getLoginURL( self
):
117 wf
= self
._rh
.getWebFactory()
119 return WPDecorated
.getLoginURL(self
)
121 return urlHandlers
.UHConfSignIn
.getURL(self
._conf
,"%s"%self
._rh
.getCurrentURL())
123 def getLogoutURL( self
):
124 return urlHandlers
.UHSignOut
.getURL(str(urlHandlers
.UHConferenceDisplay
.getURL(self
._conf
)))
127 class WPConferenceDisplayBase( WPConferenceBase
, OldObservable
):
129 def getCSSFiles(self
):
130 # flatten returned list
132 return WPConferenceBase
.getCSSFiles(self
) + \
133 sum(self
._notify
('injectCSSFiles'), [])
135 class WPConferenceDefaultDisplayBase( WPConferenceBase
):
136 navigationEntry
= None
138 def getJSFiles(self
):
139 return WPConferenceBase
.getJSFiles(self
) + \
140 self
._includeJSPackage
('MaterialEditor') + sum(self
._notify
('injectJSFiles'), [])
142 def _getFooter( self
):
143 wc
= wcomponents
.WFooter()
144 p
= {"modificationDate": format_datetime(self
._conf
.getModificationDate(), format
='d MMMM yyyy H:mm'),
145 "subArea": self
._getSiteArea
()}
147 cid
= self
._conf
.getUrlTag().strip() or self
._conf
.getId()
148 p
["shortURL"] = Config
.getInstance().getShortEventURL() + cid
150 self
._notify
('eventDetailFooter', p
)
154 def _getHeader( self
):
157 wc
= wcomponents
.WConferenceHeader( self
._getAW
(), self
._conf
)
158 return wc
.getHTML( { "loginURL": self
.getLoginURL(),\
159 "logoutURL": self
.getLogoutURL(),\
160 "confId": self
._conf
.getId(), \
163 def _defineSectionMenu( self
):
165 awUser
= self
._getAW
().getUser()
166 self
._sectionMenu
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
).getMenu()
167 self
._overviewOpt
= self
._sectionMenu
.getLinkByName("overview")
168 self
._programOpt
= self
._sectionMenu
.getLinkByName("programme")
169 link
= self
._programOpt
170 self
._cfaOpt
= self
._sectionMenu
.getLinkByName("CFA")
171 self
._cfaNewSubmissionOpt
= self
._sectionMenu
.getLinkByName("SubmitAbstract")
172 self
._cfaViewSubmissionsOpt
= self
._sectionMenu
.getLinkByName("ViewAbstracts")
173 self
._abstractsBookOpt
= self
._sectionMenu
.getLinkByName("abstractsBook")
174 if not self
._conf
.getAbstractMgr().isActive() or not self
._conf
.hasEnabledSection("cfa"):
175 self
._cfaOpt
.setVisible(False)
176 self
._abstractsBookOpt
.setVisible(False)
178 self
._cfaOpt
.setVisible(True)
179 self
._abstractsBookOpt
.setVisible(True)
180 self
._trackMgtOpt
= self
._sectionMenu
.getLinkByName("manageTrack")
183 self
._regFormOpt
= self
._sectionMenu
.getLinkByName("registrationForm")
184 self
._viewRegFormOpt
= self
._sectionMenu
.getLinkByName("ViewMyRegistration")
185 self
._newRegFormOpt
= self
._sectionMenu
.getLinkByName("NewRegistration")
187 self
._viewRegFormOpt
.setVisible(awUser
.isRegisteredInConf(self
._conf
))
188 self
._newRegFormOpt
.setVisible(not awUser
.isRegisteredInConf(self
._conf
))
190 self
._viewRegFormOpt
.setVisible(False)
191 self
._newRegFormOpt
.setVisible(True)
192 self
._registrantsListOpt
= self
._sectionMenu
.getLinkByName("registrants")
193 if not self
._conf
.getRegistrationForm().isActivated() or not self
._conf
.hasEnabledSection("regForm"):
194 self
._regFormOpt
.setVisible(False)
195 self
._registrantsListOpt
.setVisible(False)
197 self
._regFormOpt
.setVisible(True)
198 self
._registrantsListOpt
.setVisible(True)
202 self
._notify
('confDisplaySMShow', {})
205 evaluation
= self
._conf
.getEvaluation()
206 self
._evaluationOpt
= self
._sectionMenu
.getLinkByName("evaluation")
207 self
._newEvaluationOpt
= self
._sectionMenu
.getLinkByName("newEvaluation")
208 self
._viewEvaluationOpt
= self
._sectionMenu
.getLinkByName("viewMyEvaluation")
209 self
._evaluationOpt
.setVisible(self
._conf
.hasEnabledSection("evaluation") and evaluation
.isVisible() and evaluation
.getNbOfQuestions()>0)
210 if awUser
!=None and awUser
.hasSubmittedEvaluation(evaluation
):
211 self
._newEvaluationOpt
.setVisible(not awUser
.hasSubmittedEvaluation(evaluation
))
212 self
._viewEvaluationOpt
.setVisible(awUser
.hasSubmittedEvaluation(evaluation
))
214 self
._newEvaluationOpt
.setVisible(True)
215 self
._viewEvaluationOpt
.setVisible(False)
219 self
._sectionMenu
.setCurrentItem(None)
221 self
._timetableOpt
= self
._sectionMenu
.getLinkByName("timetable")
222 self
._contribListOpt
= self
._sectionMenu
.getLinkByName("contributionList")
223 self
._authorIndexOpt
= self
._sectionMenu
.getLinkByName("authorIndex")
224 self
._speakerIndexOpt
= self
._sectionMenu
.getLinkByName("speakerIndex")
225 self
._myStuffOpt
=self
._sectionMenu
.getLinkByName("mystuff")
226 self
._myStuffOpt
.setVisible(awUser
is not None)
227 self
._mySessionsOpt
=self
._sectionMenu
.getLinkByName("mysessions")
228 ls
= set(self
._conf
.getCoordinatedSessions(awUser
)) |
set(self
._conf
.getManagedSession(awUser
))
229 self
._mySessionsOpt
.setVisible(len(ls
)>0)
230 self
._myTracksOpt
=self
._sectionMenu
.getLinkByName("mytracks")
231 lt
=self
._conf
.getCoordinatedTracks(awUser
)
232 self
._myTracksOpt
.setVisible(len(lt
)>0)
233 if not self
._conf
.getAbstractMgr().isActive():
234 self
._myTracksOpt
.setVisible(False)
235 self
._myContribsOpt
=self
._sectionMenu
.getLinkByName("mycontribs")
236 lc
=self
._conf
.getContribsForSubmitter(awUser
)
237 self
._myContribsOpt
.setVisible(len(lc
)>0)
238 self
._trackMgtOpt
.setVisible(len(lt
)>0)
239 if not self
._conf
.getAbstractMgr().isActive():
240 self
._trackMgtOpt
.setVisible(False)
242 #paper reviewing related
243 self
._paperReviewingOpt
= self
._sectionMenu
.getLinkByName("paperreviewing")
244 self
._paperReviewingMgtOpt
=self
._sectionMenu
.getLinkByName("managepaperreviewing")
245 self
._paperReviewingMgtOpt
.setVisible(False)
247 self
._assignContribOpt
=self
._sectionMenu
.getLinkByName("assigncontributions")
248 self
._assignContribOpt
.setVisible(False)
250 self
._judgeListOpt
=self
._sectionMenu
.getLinkByName("judgelist")
251 self
._judgeListOpt
.setVisible(False)
252 self
._judgereviewerListOpt
=self
._sectionMenu
.getLinkByName("judgelistreviewer")
254 self
._judgereviewerListOpt
.setVisible(False)
255 self
._judgeeditorListOpt
=self
._sectionMenu
.getLinkByName("judgelisteditor")
256 self
._judgeeditorListOpt
.setVisible(False)
258 self
._uploadPaperOpt
= self
._sectionMenu
.getLinkByName("uploadpaper")
259 self
._downloadTemplateOpt
= self
._sectionMenu
.getLinkByName("downloadtemplate")
261 if self
._conf
.getConfPaperReview().hasReviewing():
262 self
._paperReviewingOpt
.setVisible(True)
263 # These options are shown if there is any contribution of this user
264 self
._uploadPaperOpt
.setVisible(len(lc
)>0)
265 self
._downloadTemplateOpt
.setVisible(len(lc
)>0)
267 self
._paperReviewingOpt
.setVisible(False)
268 self
._uploadPaperOpt
.setVisible(False)
269 self
._downloadTemplateOpt
.setVisible(False)
274 conferenceRoles
= awUser
.getLinkedTo()["conference"]
276 if "paperReviewManager" in conferenceRoles
:
277 if self
._conf
in awUser
.getLinkedTo()["conference"]["paperReviewManager"]:
278 self
._paperReviewingMgtOpt
.setVisible(True)
279 self
._assignContribOpt
.setVisible(True)
280 self
._uploadPaperOpt
.setVisible(len(lc
)>0)
281 self
._downloadTemplateOpt
.setVisible(True)
283 if "referee" in conferenceRoles
and "editor" in conferenceRoles
and "reviewer" in conferenceRoles
:
284 showrefereearea
= self
._conf
in awUser
.getLinkedTo()["conference"]["referee"]
285 showreviewerarea
= self
._conf
in awUser
.getLinkedTo()["conference"]["reviewer"]
286 showeditorarea
= self
._conf
in awUser
.getLinkedTo()["conference"]["editor"]
288 if showrefereearea
and (self
._conf
.getConfPaperReview().getChoice() == CPR
.CONTENT_REVIEWING
or self
._conf
.getConfPaperReview().getChoice() == CPR
.CONTENT_AND_LAYOUT_REVIEWING
):
289 self
._assignContribOpt
.setVisible(True)
290 self
._judgeListOpt
.setVisible(True)
292 if showreviewerarea
and (self
._conf
.getConfPaperReview().getChoice() == CPR
.CONTENT_REVIEWING
or self
._conf
.getConfPaperReview().getChoice() == CPR
.CONTENT_AND_LAYOUT_REVIEWING
):
293 self
._judgereviewerListOpt
.setVisible(True)
295 if showeditorarea
and (self
._conf
.getConfPaperReview().getChoice() == CPR
.LAYOUT_REVIEWING
or self
._conf
.getConfPaperReview().getChoice() == CPR
.CONTENT_AND_LAYOUT_REVIEWING
):
296 self
._judgeeditorListOpt
.setVisible(True)
300 #collaboration related
301 self
._collaborationOpt
= self
._sectionMenu
.getLinkByName("collaboration")
302 self
._collaborationOpt
.setVisible(False)
303 csbm
= self
._conf
.getCSBookingManager()
304 if csbm
is not None and csbm
.hasBookings() and csbm
.isCSAllowed():
305 self
._collaborationOpt
.setVisible(True)
309 def _defineToolBar(self
):
312 def _display( self
, params
):
313 self
._defineSectionMenu
()
314 self
._toolBar
=wcomponents
.WebToolBar()
315 self
._defineToolBar
()
316 return WPConferenceBase
._display
(self
,params
)
318 def _getNavigationBarHTML(self
):
320 if self
.navigationEntry
:
321 item
= self
.navigationEntry()
323 while item
is not None:
325 itemList
.insert(0, wcomponents
.WTemplated
.htmlText(item
.getTitle()) )
327 itemList
.insert(0, """<a href=%s>%s</a>"""%( quoteattr(str(item
.getURL(self
._navigationTarget
))), wcomponents
.WTemplated
.htmlText(item
.getTitle()) ) )
328 item
= item
.getParent(self
._navigationTarget
)
329 itemList
.insert(0, i18nformat("""<a href=%s> _("Home")</a>""")%quoteattr(str(urlHandlers
.UHConferenceDisplay
.getURL(self
._conf
))) )
330 return " > ".join(itemList
)
332 def _getToolBarHTML(self
):
333 drawer
=wcomponents
.WConfTBDrawer(self
._toolBar
)
334 return drawer
.getHTML()
336 def _applyConfDisplayDecoration( self
, body
):
337 drawer
= wcomponents
.WConfTickerTapeDrawer(self
._conf
, self
._tz
)
338 frame
= WConfDisplayFrame( self
._getAW
(), self
._conf
)
339 urlClose
= urlHandlers
.UHConferenceDisplayMenuClose
.getURL(self
._conf
)
340 urlClose
.addParam("currentURL",self
._rh
.getCurrentURL())
341 urlOpen
= urlHandlers
.UHConferenceDisplayMenuOpen
.getURL(self
._conf
)
342 urlOpen
.addParam("currentURL",self
._rh
.getCurrentURL())
343 menuStatus
= self
._rh
._getSession
().getVar("menuStatus") or "open"
345 wm
= webcast
.HelperWebcastManager
.getWebcastManagerInstance()
347 onAirURL
= wm
.isOnAir(self
._conf
)
349 webcastURL
= onAirURL
351 wc
= wm
.getForthcomingWebcast(self
._conf
)
352 webcastURL
= wm
.getWebcastServiceURL(wc
)
353 forthcomingWebcast
= not onAirURL
and wm
.getForthcomingWebcast(self
._conf
)
356 "confModifURL": urlHandlers
.UHConferenceModification
.getURL(self
._conf
), \
357 "logoURL": urlHandlers
.UHConferenceLogo
.getURL( self
._conf
), \
358 "currentURL":self
._rh
.getCurrentURL(), \
359 "closeMenuURL": urlClose
, \
360 "menuStatus": menuStatus
, \
361 "nowHappening": drawer
.getNowHappeningHTML(), \
362 "simpleTextAnnouncement": drawer
.getSimpleText(), \
363 "onAirURL": onAirURL
,
364 "webcastURL": webcastURL
,
365 "forthcomingWebcast": forthcomingWebcast
}
366 if self
._conf
.getLogo():
367 frameParams
["logoURL"] = urlHandlers
.UHConferenceLogo
.getURL( self
._conf
)
372 if menuStatus
!= "open":
373 urlOpen
= urlHandlers
.UHConferenceDisplayMenuOpen
.getURL(self
._conf
)
374 urlOpen
.addParam("currentURL",self
._rh
.getCurrentURL())
375 colspan
= """ colspan="2" """
376 imgOpen
= """<table valign="top" align="left" border="0" cellspacing="0" cellpadding="0" style="padding-right:10px;">
378 <td align="left" valign="top">
379 <a href=%s><img alt="Show menu" src="%s" class="imglink" style="padding:0px; border:0px"></a>
382 </table>"""%(quoteattr(str(urlOpen
)),Config
.getInstance().getSystemIconURL("openMenuIcon"))
383 padding
=""" style="padding:0px" """
386 <div class="confBodyBox clearfix" %s %s>
390 <div class="breadcrumps">%s</div>
391 <div style="float:right;">%s</div>
394 <div class="mainContent">
399 </div>"""%(colspan
,padding
,imgOpen
,
400 self
._getNavigationBarHTML
(),
401 self
._getToolBarHTML
().strip(),
403 return frame
.getHTML( self
._sectionMenu
, body
, frameParams
)
405 def _getHeadContent( self
):
406 #This is used for fetching the default css file for the conference pages
407 #And also the modificated uploaded css
409 dmgr
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
)
410 path
= self
._getBaseURL
()
411 timestamp
= os
.stat(__file__
).st_mtime
413 <link rel="stylesheet" type="text/css" href="%s/css/Conf_Basic.css?%d" >
414 """ % (path
, timestamp
)
415 confCSS
= dmgr
.getStyleManager().getCSS()
418 printCSS
= printCSS
+ """<link rel="stylesheet" type="text/css" href="%s">"""%(confCSS
.getURL())
422 def _applyDecoration( self
, body
):
423 body
= self
._applyConfDisplayDecoration
( body
)
424 return WPConferenceBase
._applyDecoration
( self
, body
)
427 class WConfMetadata(wcomponents
.WTemplated
):
428 def __init__(self
, conf
):
432 v
= wcomponents
.WTemplated
.getVars( self
)
433 minfo
= info
.HelperMaKaCInfo
.getMaKaCInfoInstance()
435 v
['site_name'] = minfo
.getTitle()
436 v
['fb_config'] = minfo
.getSocialAppConfig().get('facebook', {})
438 if self
._conf
.getLogo():
439 v
['image'] = urlHandlers
.UHConferenceLogo
.getURL(self
._conf
)
441 v
['image'] = Config
.getInstance().getSystemIconURL("indico_co")
443 v
['description'] = strip_ml_tags(self
._conf
.getDescription()[:500])
447 class WConfDisplayFrame(wcomponents
.WTemplated
):
449 def __init__(self
, aw
, conf
):
453 def getHTML( self
, menu
, body
, params
):
456 return wcomponents
.WTemplated
.getHTML( self
, params
)
459 vars = wcomponents
.WTemplated
.getVars( self
)
461 if self
._conf
.getLogo():
462 vars["logo"] = "<img src=\"%s\" alt=\"%s\" border=\"0\" class=\"confLogo\" >"%(vars["logoURL"], escape_html(self
._conf
.getTitle(), escape_quotes
= True))
463 vars["confTitle"] = self
._conf
.getTitle()
464 vars["displayURL"] = urlHandlers
.UHConferenceDisplay
.getURL(self
._conf
)
465 vars["imgConferenceRoom"] = Config
.getInstance().getSystemIconURL( "conferenceRoom" )
466 tz
= DisplayTZ(self
._aw
,self
._conf
).getDisplayTZ()
467 adjusted_sDate
= self
._conf
.getAdjustedScreenStartDate(tz
)
468 adjusted_eDate
= self
._conf
.getAdjustedScreenEndDate(tz
)
470 vars["timezone"] = tz
471 vars["confDateInterval"] = i18nformat("""_("from") %s _("to") %s (%s)""")%(format_date(adjusted_sDate
, format
='long'), format_date(adjusted_eDate
, format
='long'), tz
)
472 if adjusted_sDate
.strftime("%d%B%Y") == \
473 adjusted_eDate
.strftime("%d%B%Y"):
474 vars["confDateInterval"] = format_date(adjusted_sDate
, format
='long')
475 elif adjusted_sDate
.strftime("%B%Y") == adjusted_eDate
.strftime("%B%Y"):
476 vars["confDateInterval"] = "%s-%s %s"%(adjusted_sDate
.day
, adjusted_eDate
.day
, format_date(adjusted_sDate
, format
='MMMM yyyy'))
477 vars["confLocation"] = ""
478 if self
._conf
.getLocationList():
479 vars["confLocation"] = self
._conf
.getLocationList()[0].getName()
480 vars["body"] = self
._body
481 vars["supportEmail"] = ""
482 vars["supportTelephone"] = ""
484 sinfo
= self
._conf
.getSupportInfo()
487 p
={"closeMenuURL": vars["closeMenuURL"], \
488 "menuStatus": vars["menuStatus"], \
490 "support_info": sinfo
,
493 vars["menu"] = WConfDisplayMenu(self
._menu
).getHTML(p
)
495 dm
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
, False)
496 format
= dm
.getFormat()
497 vars["bgColorCode"] = format
.getFormatOption("titleBgColor")["code"].replace("#","")
498 vars["textColorCode"] = format
.getFormatOption("titleTextColor")["code"].replace("#","")
500 vars['searchBox']= ""
501 vars["confId"] = self
._conf
.getId()
503 extension_point("fillConferenceHeader", vars)
507 class WConfDisplayMenu(wcomponents
.WTemplated
):
509 def __init__(self
, menu
):
510 wcomponents
.WTemplated
.__init
__(self
)
514 class WPConfSignIn( WPConferenceDefaultDisplayBase
):
516 def __init__(self
, rh
, conf
, login
="", msg
= ""):
519 WPConferenceBase
.__init
__( self
, rh
, conf
)
521 def _getBody( self
, params
):
522 wc
= wcomponents
.WSignIn()
524 "postURL": urlHandlers
.UHConfSignIn
.getURL( self
._conf
), \
525 "returnURL": params
["returnURL"], \
526 "createAccountURL": urlHandlers
.UHConfUserCreation
.getURL( self
._conf
), \
527 "forgotPassordURL": urlHandlers
.UHConfSendLogin
.getURL( self
._conf
), \
528 "login": self
._login
, \
530 return wc
.getHTML( p
)
532 class WPConfAccountAlreadyActivated( WPConferenceDefaultDisplayBase
):
534 def __init__(self
, rh
, conf
, av
):
535 WPConferenceDefaultDisplayBase
.__init
__( self
, rh
, conf
)
538 def _getBody( self
, params
):
539 wc
= wcomponents
.WAccountAlreadyActivated( self
._av
)
540 params
["mailLoginURL"] = urlHandlers
.UHConfSendLogin
.getURL( self
._conf
, self
._av
)
541 return wc
.getHTML( params
)
543 class WPConfAccountActivated( WPConferenceDefaultDisplayBase
):
545 def __init__(self
, rh
, conf
, av
, returnURL
=""):
546 WPConferenceDefaultDisplayBase
.__init
__( self
, rh
, conf
)
548 self
._returnURL
=returnURL
550 def _getBody( self
, params
):
551 wc
= wcomponents
.WAccountActivated( self
._av
)
552 params
["mailLoginURL"] = urlHandlers
.UHConfSendLogin
.getURL(self
._conf
, self
._av
)
553 params
["loginURL"] = urlHandlers
.UHConfSignIn
.getURL(self
._conf
)
554 if self
._returnURL
.strip()!="":
555 params
["loginURL"] = self
._returnURL
556 return wc
.getHTML( params
)
558 class WPConfAccountDisabled( WPConferenceDefaultDisplayBase
):
560 def __init__(self
, rh
, conf
, av
):
561 WPConferenceDefaultDisplayBase
.__init
__( self
, rh
, conf
)
564 def _getBody( self
, params
):
565 wc
= wcomponents
.WAccountDisabled( self
._av
)
566 #params["mailLoginURL"] = urlHandlers.UHSendLogin.getURL(self._av)
568 return wc
.getHTML( params
)
570 class WPConfUnactivatedAccount( WPConferenceDefaultDisplayBase
):
572 def __init__(self
, rh
, conf
, av
):
573 WPConferenceDefaultDisplayBase
.__init
__( self
, rh
, conf
)
576 def _getBody( self
, params
):
577 wc
= wcomponents
.WUnactivatedAccount( self
._av
)
578 params
["mailActivationURL"] = urlHandlers
.UHConfSendActivation
.getURL( self
._conf
, self
._av
)
580 return wc
.getHTML( params
)
583 class WPConfUserCreation( WPConferenceDefaultDisplayBase
):
585 def __init__(self
, rh
, conf
, params
):
586 self
._params
= params
587 WPConferenceDefaultDisplayBase
.__init
__(self
, rh
, conf
)
589 def _getBody(self
, params
):
591 p
= wcomponents
.WUserRegistration()
592 postURL
= urlHandlers
.UHConfUserCreation
.getURL( self
._conf
)
593 postURL
.addParam("returnURL", self
._params
.get("returnURL",""))
594 pars
["postURL"] = postURL
595 if pars
["msg"] != "":
596 pars
["msg"] = "<table bgcolor=\"gray\"><tr><td bgcolor=\"white\">\n<font size=\"+1\" color=\"red\"><b>%s</b></font>\n</td></tr></table>"%pars
["msg"]
597 return p
.getHTML( pars
)
600 class WPConfUserCreated( WPConferenceDefaultDisplayBase
):
602 def __init__(self
, rh
, conf
, av
):
603 WPConferenceDefaultDisplayBase
.__init
__( self
, rh
, conf
)
606 def _getBody(self
, params
):
607 p
= wcomponents
.WUserCreated(self
._av
)
608 pars
= {"signInURL" : urlHandlers
.UHConfSignIn
.getURL( self
._conf
)}
609 return p
.getHTML( pars
)
612 class WPConfUserExistWithIdentity( WPConferenceDefaultDisplayBase
):
614 def __init__(self
, rh
, conf
, av
):
615 WPConferenceDefaultDisplayBase
.__init
__(self
, rh
, conf
)
618 def _getBody(self
, params
):
619 p
= wcomponents
.WUserSendIdentity(self
._av
)
620 pars
= {"postURL" : urlHandlers
.UHConfSendLogin
.getURL(self
._conf
, self
._av
)}
621 return p
.getHTML( pars
)
624 class WConfDetailsBase( wcomponents
.WTemplated
):
626 def __init__(self
, aw
, conf
):
630 def _getMaterialHTML( self
):
632 for mat
in self
._conf
.getAllMaterialList():
633 if mat
.getTitle() != _("Internal Page Files"):
634 temp
= wcomponents
.WMaterialDisplayItem()
635 url
= urlHandlers
.UHMaterialDisplay
.getURL( mat
)
636 l
.append( temp
.getHTML( self
._aw
, mat
, url
) )
639 def _getActionsHTML( self
, showActions
= False):
642 html
=[ i18nformat("""
643 <table style="padding-top:40px; padding-left:20px">
646 <b> _("Conference sections"):</b>
649 menu
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
).getMenu()
650 for link
in menu
.getLinkList():
651 if link
.isVisible() and link
.isEnabled():
652 if not isinstance(link
, displayMgr
.Spacer
):
653 html
.append(""" <li><a href="%s">%s</a></li>
654 """%( link
.getURL(), link
.getCaption() ) )
656 html
.append("%s"%link
)
666 vars = wcomponents
.WTemplated
.getVars( self
)
667 tz
= DisplayTZ(self
._aw
,self
._conf
).getDisplayTZ()
668 vars["timezone"] = tz
670 description
= self
._conf
.getDescription()
671 vars["description_html"] = isStringHTML(description
)
672 vars["description"] = description
674 sdate
, edate
= self
._conf
.getAdjustedScreenStartDate(tz
), self
._conf
.getAdjustedScreenEndDate(tz
)
675 fsdate
, fedate
= format_date(sdate
, format
='medium'), format_date(edate
, format
='medium')
676 fstime
, fetime
= sdate
.strftime("%H:%M"), edate
.strftime("%H:%M")
678 vars["dateInterval"] = (fsdate
, fstime
, fedate
, fetime
)
680 vars["location"] = None
681 vars["address"] = None
684 location
= self
._conf
.getLocation()
686 vars["location"] = location
.getName()
687 vars["address"] = location
.getAddress()
689 room
= self
._conf
.getRoom()
690 if room
and room
.getName():
691 roomLink
= linking
.RoomLinker().getHTMLLink(room
, location
)
692 vars["room"] = roomLink
694 vars["chairs"] = self
._conf
.getChairList()
695 vars["material"] = self
._getMaterialHTML
()
696 vars["conf"] = self
._conf
698 info
= self
._conf
.getContactInfo()
699 vars["moreInfo_html"] = isStringHTML(info
)
700 vars["moreInfo"] = info
701 vars["actions"] = self
._getActionsHTML
(vars.get("menuStatus", "open") != "open")
702 vars["isSubmitter"] = self
._conf
.getAccessController().canUserSubmit(self
._aw
.getUser()) or self
._conf
.canModify(self
._aw
)
706 class WConfDetailsFull(WConfDetailsBase
):
710 #---------------------------------------------------------------------------
715 def __init__(self
, aw
, conf
):
719 def getHTML( self
, params
):
720 return WConfDetailsFull( self
._aw
, self
._conf
).getHTML( params
)
723 class WPConferenceDisplay( WPConferenceDefaultDisplayBase
):
725 def _getBody( self
, params
):
727 wc
= WConfDetails( self
._getAW
(), self
._conf
)
729 "modifyURL": urlHandlers
.UHConferenceModification
.getURL( self
._conf
), \
730 "sessionModifyURLGen": urlHandlers
.UHSessionModification
.getURL
, \
731 "contribModifyURLGen": urlHandlers
.UHContributionModification
.getURL
, \
732 "subContribModifyURLGen": urlHandlers
.UHSubContribModification
.getURL
, \
733 "materialURLGen": urlHandlers
.UHMaterialDisplay
.getURL
, \
734 "menuStatus": self
._rh
._getSession
().getVar("menuStatus") or "open"}
735 return wc
.getHTML( pars
)
737 def _getHeadContent( self
):
738 printCSS
= WPConferenceDefaultDisplayBase
._getHeadContent
(self
)
739 confMetadata
= WConfMetadata(self
._conf
).getHTML()
740 return printCSS
+ confMetadata
742 def _getFooter(self
):
743 wc
= wcomponents
.WEventFooter(self
._conf
)
746 def _defineSectionMenu( self
):
747 WPConferenceDefaultDisplayBase
._defineSectionMenu
(self
)
748 self
._sectionMenu
.setCurrentItem(self
._overviewOpt
)
750 class WSentMail (wcomponents
.WTemplated
):
751 def __init__(self
,conf
):
755 vars = wcomponents
.WTemplated
.getVars( self
)
756 vars["BackURL"]=urlHandlers
.UHConferenceDisplay
.getURL(self
._conf
)
760 class WPSentEmail( WPConferenceDefaultDisplayBase
):
761 def _getBody(self
,params
):
762 wc
= WSentMail(self
._conf
)
765 class WEmail(wcomponents
.WTemplated
):
767 def __init__(self
,conf
,user
,toUsers
):
773 vars = wcomponents
.WTemplated
.getVars( self
)
774 if vars.get("from", None) is None :
775 vars["FromName"] = self
._from
776 vars["fromUser"] = self
._from
777 vars["toUsers"] = self
._to
778 if vars.get("postURL",None) is None :
779 vars["postURL"]=urlHandlers
.UHConferenceSendEmail
.getURL(self
._to
)
780 if vars.get("subject", None) is None :
782 if vars.get("body", None) is None :
786 class WPEMail ( WPConferenceDefaultDisplayBase
):
788 def _getBody(self
,params
):
789 toemail
= params
["emailto"]
790 wc
= WEmail(self
._conf
, self
._getAW
().getUser(), toemail
)
791 params
["fromDisabled"] = True
792 params
["toDisabled"] = True
793 params
["ccDisabled"] = True
794 return wc
.getHTML(params
)
796 class WPXSLConferenceDisplay( WPConferenceBase
):
798 """ Use this class just to transform to XML"""
800 def __init__( self
, rh
, conference
, view
, type, params
):
801 WPConferenceBase
.__init
__( self
, rh
, conference
)
802 self
._params
= params
804 self
._conf
= conference
806 self
._firstDay
= params
.get("firstDay")
807 self
._lastDay
= params
.get("lastDay")
808 self
._daysPerRow
= params
.get("daysPerRow")
809 self
._webcastadd
= False
810 wm
= webcast
.HelperWebcastManager
.getWebcastManagerInstance()
811 if wm
.isManager(self
._getAW
().getUser()):
812 self
._webcastadd
= True
814 def _getFooter( self
):
819 def _getHTMLHeader( self
):
822 def _applyDecoration( self
, body
):
827 def _getHTMLFooter( self
):
830 def _getBodyVariables(self
):
832 "modifyURL": urlHandlers
.UHConferenceModification
.getURL( self
._conf
), \
833 "iCalURL": urlHandlers
.UHConferenceToiCal
.getURL(self
._conf
), \
834 "cloneURL": urlHandlers
.UHConfClone
.getURL( self
._conf
), \
835 "sessionModifyURLGen": urlHandlers
.UHSessionModification
.getURL
, \
836 "contribModifyURLGen": urlHandlers
.UHContributionModification
.getURL
, \
837 "subContribModifyURLGen": urlHandlers
.UHSubContribModification
.getURL
, \
838 "materialURLGen": urlHandlers
.UHMaterialDisplay
.getURL
, \
839 "resourceURLGen": urlHandlers
.UHFileAccess
.getURL
}
841 pars
.update({ 'firstDay' : self
._firstDay
, 'lastDay' : self
._lastDay
, 'daysPerRow' : self
._daysPerRow
})
844 urladdwebcast
= urlHandlers
.UHWebcastAddWebcast
.getURL()
845 urladdwebcast
.addParam("eventid",self
._conf
.getId())
846 pars
['webcastAdminURL'] = urladdwebcast
849 def _getBody( self
, params
):
850 vars = self
._getBodyVariables
()
852 outGen
= outputGenerator(self
._getAW
())
853 styleMgr
= info
.HelperMaKaCInfo
.getMaKaCInfoInstance().getStyleManager()
854 if styleMgr
.existsXSLFile(self
._view
):
855 minfo
= info
.HelperMaKaCInfo
.getMaKaCInfoInstance()
856 tz
= DisplayTZ(self
._getAW
(),self
._conf
).getDisplayTZ()
857 useCache
= minfo
.isCacheActive() and self
._params
.get("detailLevel", "") in [ "", "contribution" ] and self
._view
== self
._conf
.getDefaultStyle() and self
._params
.get("showSession","all") == "all" and self
._params
.get("showDate","all") == "all" and tz
== self
._conf
.getTimezone()
858 useNormalCache
= useCache
and self
._conf
.getAccessController().isFullyPublic() and not self
._conf
.canModify(self
._getAW
()) and self
._getAW
().getUser() == None
859 useManagerCache
= useCache
and self
._conf
.canModify( self
._getAW
())
862 cache
= EventCache({"id": self
._conf
.getId(), "type": "manager"})
863 body
= cache
.getCachePage()
865 cache
= EventCache({"id": self
._conf
.getId(), "type": "normal"})
866 body
= cache
.getCachePage()
868 if self
._params
.get("detailLevel", "") == "contribution" or self
._params
.get("detailLevel", "") == "":
869 includeContribution
= 1
871 includeContribution
= 0
872 body
= outGen
.getFormattedOutput(self
._rh
, self
._conf
, styleMgr
.getXSLPath(self
._view
), vars, 1, includeContribution
, 1, 1, self
._params
.get("showSession",""), self
._params
.get("showDate",""))
873 if useManagerCache
or useNormalCache
:
874 cache
.saveCachePage( body
)
877 return _("Cannot find the %s stylesheet") % view
879 def _defineSectionMenu( self
):
880 WPConferenceDefaultDisplayBase
._defineSectionMenu
(self
)
881 self
._sectionMenu
.setCurrentItem(self
._overviewOpt
)
883 class WPTPLConferenceDisplay(WPXSLConferenceDisplay
):
884 """Overrides XSL related functions in WPXSLConferenceDisplay
885 class and re-implements them using normal Indico templates.
887 _ImagesBaseURL
= Config
.getInstance().getImagesBaseURL()
889 "pdf" :{"mapsTo" : "pdf", "imgURL" : os
.path
.join(_ImagesBaseURL
, "pdf_small.png"), "imgAlt" : "pdf file"},
890 "doc" :{"mapsTo" : "doc", "imgURL" : os
.path
.join(_ImagesBaseURL
, "word.png"), "imgAlt" : "word file"},
891 "docx" :{"mapsTo" : "doc", "imgURL" : os
.path
.join(_ImagesBaseURL
, "word.png"), "imgAlt" : "word file"},
892 "ppt" :{"mapsTo" : "ppt", "imgURL" : os
.path
.join(_ImagesBaseURL
, "powerpoint.png"), "imgAlt" : "powerpoint file"},
893 "pptx" :{"mapsTo" : "ppt", "imgURL" : os
.path
.join(_ImagesBaseURL
, "powerpoint.png"), "imgAlt" : "powerpoint file"},
894 "sxi" :{"mapsTo" : "odp", "imgURL" : os
.path
.join(_ImagesBaseURL
, "impress.png"), "imgAlt" : "presentation file"},
895 "odp" :{"mapsTo" : "odp", "imgURL" : os
.path
.join(_ImagesBaseURL
, "impress.png"), "imgAlt" : "presentation file"},
896 "sxw" :{"mapsTo" : "odt", "imgURL" : os
.path
.join(_ImagesBaseURL
, "writer.png"), "imgAlt" : "writer file"},
897 "odt" :{"mapsTo" : "odt", "imgURL" : os
.path
.join(_ImagesBaseURL
, "writer.png"), "imgAlt" : "writer file"},
898 "sxc" :{"mapsTo" : "ods", "imgURL" : os
.path
.join(_ImagesBaseURL
, "calc.png"), "imgAlt" : "spreadsheet file"},
899 "ods" :{"mapsTo" : "ods", "imgURL" : os
.path
.join(_ImagesBaseURL
, "calc.png"), "imgAlt" : "spreadsheet file"},
900 "other" :{"mapsTo" : "other", "imgURL" : os
.path
.join(_ImagesBaseURL
, "file_small.png"), "imgAlt" : "unknown type file"},
901 "link" :{"mapsTo" : "link", "imgURL" : os
.path
.join(_ImagesBaseURL
, "link.png"), "imgAlt" : "link"}
904 def __init__( self
, rh
, conference
, view
, type, params
):
905 WPXSLConferenceDisplay
.__init
__( self
, rh
, conference
, view
, type, params
)
907 def _getVariables(self
, conf
):
909 styleMgr
= info
.HelperMaKaCInfo
.getMaKaCInfoInstance().getStyleManager()
910 vars['INCLUDE'] = '../include'
912 vars['accessWrapper'] = accessWrapper
= self
._rh
._aw
914 if conf
.getOwnerList():
915 vars['category'] = conf
.getOwnerList()[0].getName()
917 vars['category'] = ''
919 timezoneUtil
= DisplayTZ(accessWrapper
, conf
)
920 tz
= timezoneUtil
.getDisplayTZ()
921 vars['startDate'] = conf
.getAdjustedStartDate(tz
)
922 vars['endDate'] = conf
.getAdjustedEndDate(tz
)
923 vars['timezone'] = tz
925 if conf
.getParticipation().displayParticipantList() :
926 vars['participants'] = conf
.getParticipation().getPresentParticipantListText()
928 wm
= webcast
.HelperWebcastManager
.getWebcastManagerInstance()
929 vars['webcastOnAirURL'] = wm
.isOnAir(conf
)
930 forthcomingWebcast
= wm
.getForthcomingWebcast(conf
)
931 vars['forthcomingWebcast'] = forthcomingWebcast
932 if forthcomingWebcast
:
933 vars['forthcomingWebcastURL'] = wm
.getWebcastServiceURL(forthcomingWebcast
)
936 lectureTitles
= ['part%s' % nr
for nr
in xrange(1, 11)]
937 materials
, lectures
, minutesText
= [], [], []
938 for material
in conf
.getAllMaterialList():
939 if not material
.canView(accessWrapper
):
941 if material
.getTitle() in lectureTitles
:
942 lectures
.append(material
)
943 elif material
.getTitle() != "Internal Page Files":
944 materials
.append(material
)
946 vars['materials'] = materials
947 vars['minutesText'] = minutesText
948 byTitleNumber
= lambda x
, y
: int(x
.getTitle()[4:]) - int(y
.getTitle()[4:])
949 vars['lectures'] = sorted(lectures
, cmp=byTitleNumber
)
951 if (conf
.getType() in ("meeting", "simple_event")
952 and conf
.getParticipation().isAllowedForApplying()
953 and conf
.getStartDate() > nowutc()
954 and not conf
.getParticipation().isFull()):
955 vars['registrationOpen'] = True
956 evaluation
= conf
.getEvaluation()
957 if evaluation
.isVisible() and evaluation
.inEvaluationPeriod() and evaluation
.getNbOfQuestions() > 0:
958 vars['evaluationLink'] = urlHandlers
.UHConfEvaluationDisplay
.getURL(conf
)
959 vars['supportEmailCaption'] = conf
.getSupportInfo().getCaption()
961 vars['types'] = WPTPLConferenceDisplay
._Types
964 confSchedule
= conf
.getSchedule()
965 showSession
= self
._params
.get("showSession","")
966 detailLevel
= self
._params
.get("detailLevel", "contribution")
967 showDate
= self
._params
.get("showDate", "all")
969 if showDate
== "all":
970 entrylist
= confSchedule
.getEntries()
972 entrylist
= confSchedule
.getEntriesOnDay(timezone(tz
).localize(stringToDate(showDate
)))
973 # Check entries filters and access rights
974 for entry
in entrylist
:
975 sessionCand
= entry
.getOwner().getOwner()
977 if isinstance(sessionCand
, Session
) and (showSession
!= "all" and sessionCand
.getId() != showSession
):
979 # Hide/Show contributions
980 if isinstance(entry
.getOwner(), Contribution
) and detailLevel
!= "contribution":
982 if entry
.getOwner().canView(accessWrapper
):
983 if type(entry
) is schedule
.BreakTimeSchEntry
:
986 newItem
= entry
.getOwner()
987 vars['entries'].append(newItem
)
989 vars["pluginDetails"] = "".join(self
._notify
('eventDetailBanner', self
._conf
))
991 vars["daysPerRow"] = self
._daysPerRow
992 vars["firstDay"] = self
._firstDay
993 vars["lastDay"] = self
._lastDay
994 vars["currentUser"] = self
._rh
._aw
.getUser()
995 vars["reportNumberSystems"] = Config
.getInstance().getReportNumberSystems()
999 def _getMaterialFiles(self
, material
):
1001 for res
in material
.getResourceList():
1002 if isinstance(res
, LocalFile
):
1003 fileType
= res
.getFileType().lower()
1005 fileType
= WPTPLConferenceDisplay
._Types
[fileType
]["mapsTo"]
1008 filename
= res
.getName() or res
.getFileName()
1009 fileURL
= str(urlHandlers
.UHFileAccess
.getURL(res
))
1011 filename
, fileType
, fileURL
= str(res
.getName() or res
.getURL()), "link", str(res
.getURL())
1012 files
.append({'id': res
.getId(),
1014 'description': res
.getDescription(),
1017 'pdfConversionStatus': res
.getPDFConversionStatus()})
1020 def _getItemType(self
, item
):
1021 itemClass
= item
.__class
__.__name
__
1022 if itemClass
== 'BreakTimeSchEntry':
1024 elif itemClass
== 'SessionSlot':
1026 elif itemClass
== 'AcceptedContribution':
1027 return 'Contribution'
1029 # return Conference, Contribution or SubContribution
1032 def _generateMaterialList(self
, obj
):
1034 Generates a list containing all the materials, with the
1035 corresponding Ids for those that already exist
1037 # yes, this may look a bit redundant, but materialRegistry isn't
1038 # bound to a particular target
1039 materialRegistry
= obj
.getMaterialRegistry()
1040 return materialRegistry
.getMaterialList(obj
.getConference())
1042 def _extractInfoForButton(self
, item
):
1044 for key
in ['sessId', 'slotId', 'contId', 'subContId']:
1046 info
['confId'] = self
._conf
.getId()
1048 itemType
= self
._getItemType
(item
)
1049 info
['uploadURL'] = 'Indico.Urls.UploadAction.%s' % itemType
.lower()
1051 if itemType
!= 'Session':
1052 info
['materialList'] = self
._generateMaterialList
(item
)
1054 info
['materialList'] = self
._generateMaterialList
(item
.getSession())
1056 if itemType
== 'Conference':
1057 info
['parentProtection'] = item
.getAccessController().isProtected()
1058 if item
.canModify(self
._rh
._aw
):
1059 info
["modifyLink"] = urlHandlers
.UHConferenceModification
.getURL(item
)
1060 info
["minutesLink"] = True
1061 info
["materialLink"] = True
1062 info
["cloneLink"] = urlHandlers
.UHConfClone
.getURL(item
)
1063 if item
.getAccessController().canUserSubmit(self
._rh
._aw
.getUser()):
1064 info
["minutesLink"] = True
1065 info
["materialLink"] = True
1067 elif itemType
== 'Session':
1068 session
= item
.getSession()
1069 info
['parentProtection'] = session
.getAccessController().isProtected()
1070 if session
.canModify(self
._rh
._aw
) or session
.canCoordinate(self
._rh
._aw
):
1071 info
["modifyLink"] = urlHandlers
.UHSessionModification
.getURL(item
)
1072 info
['slotId'] = session
.getSortedSlotList().index(item
)
1073 info
['sessId'] = session
.getId()
1074 if session
.canModify(self
._rh
._aw
) or session
.canCoordinate(self
._rh
._aw
):
1075 info
["minutesLink"] = True
1076 info
["materialLink"] = True
1077 url
= urlHandlers
.UHSessionModifSchedule
.getURL(session
)
1078 ttLink
= "%s#%s.s%sl%s" % (url
, session
.getStartDate().strftime('%Y%m%d'), session
.getId(), info
['slotId'])
1079 info
["sessionTimetableLink"] = ttLink
1081 elif itemType
== 'Contribution':
1082 info
['parentProtection'] = item
.getAccessController().isProtected()
1083 if item
.canModify(self
._rh
._aw
):
1084 info
["modifyLink"] = urlHandlers
.UHContributionModification
.getURL(item
)
1085 if item
.canModify(self
._rh
._aw
) or item
.canUserSubmit(self
._rh
._aw
.getUser()):
1086 info
["minutesLink"] = True
1087 info
["materialLink"] = True
1088 info
["contId"] = item
.getId()
1089 owner
= item
.getOwner()
1090 if self
._getItemType
(owner
) == 'Session':
1091 info
['sessId'] = owner
.getId()
1093 elif itemType
== 'SubContribution':
1094 info
['parentProtection'] = item
.getContribution().getAccessController().isProtected()
1095 if item
.canModify(self
._rh
._aw
):
1096 info
["modifyLink"] = urlHandlers
.UHSubContributionModification
.getURL(item
)
1097 if item
.canModify(self
._rh
._aw
) or item
.canUserSubmit(self
._rh
._aw
.getUser()):
1098 info
["minutesLink"] = True
1099 info
["materialLink"] = True
1100 info
["subContId"] = item
.getId()
1101 info
["contId"] = item
.getContribution().getId()
1102 owner
= item
.getOwner()
1103 if self
._getItemType
(owner
) == 'Session':
1104 info
['sessId'] = owner
.getId()
1108 def _getHTMLHeader( self
):
1109 return WPConferenceBase
._getHTMLHeader
(self
)
1111 def _getHeadContent( self
):
1112 styleMgr
= info
.HelperMaKaCInfo
.getMaKaCInfoInstance().getStyleManager()
1113 htdocs
= Config
.getInstance().getHtdocsDir()
1114 baseurl
= self
._getBaseURL
()
1115 # First include the default Indico stylesheet
1116 timestamp
= os
.stat(__file__
).st_mtime
1117 styleText
= """<link rel="stylesheet" href="%s/css/%s?%d">\n""" % \
1118 (baseurl
, Config
.getInstance().getCssStylesheetName(), timestamp
)
1119 # Then the common event display stylesheet
1120 if os
.path
.exists("%s/css/events/common.css" % htdocs
):
1121 styleText
+= """ <link rel="stylesheet" href="%s/css/events/common.css?%d">\n""" % (baseurl
, timestamp
)
1122 # And finally the specific display stylesheet
1123 if styleMgr
.existsCSSFile(self
._view
):
1124 cssPath
= os
.path
.join(baseurl
, 'css', 'events', styleMgr
.getCSSFilename(self
._view
))
1125 styleText
+= """ <link rel="stylesheet" href="%s?%d">\n""" % (cssPath
, timestamp
)
1127 confMetadata
= WConfMetadata(self
._conf
).getHTML()
1129 return styleText
+ confMetadata
1131 def _getFooter( self
):
1134 wc
= wcomponents
.WEventFooter(self
._conf
)
1135 p
= {"modificationDate":format_datetime(self
._conf
.getModificationDate(), format
='d MMMM yyyy H:mm'),"subArea": self
._getSiteArea
(),"dark":True}
1136 if Config
.getInstance().getShortEventURL():
1137 id=self
._conf
.getUrlTag().strip()
1139 id = self
._conf
.getId()
1140 p
["shortURL"] = Config
.getInstance().getShortEventURL() + id
1141 return wc
.getHTML(p
)
1143 def _getHeader( self
):
1146 if self
._type
== "simple_event":
1147 wc
= wcomponents
.WMenuSimpleEventHeader( self
._getAW
(), self
._conf
)
1148 elif self
._type
== "meeting":
1149 wc
= wcomponents
.WMenuMeetingHeader( self
._getAW
(), self
._conf
)
1151 wc
= wcomponents
.WMenuConferenceHeader( self
._getAW
(), self
._conf
)
1152 return wc
.getHTML( { "loginURL": self
.getLoginURL(),\
1153 "logoutURL": self
.getLogoutURL(),\
1154 "confId": self
._conf
.getId(),\
1155 "currentView": self
._view
,\
1156 "type": self
._type
,\
1157 "selectedDate": self
._params
.get("showDate",""),\
1158 "selectedSession": self
._params
.get("showSession",""),\
1159 "detailLevel": self
._params
.get("detailLevel",""),\
1160 "filterActive": self
._params
.get("filterActive",""),\
1163 def getCSSFiles(self
):
1164 # flatten returned list
1166 return WPConferenceBase
.getCSSFiles(self
) + \
1167 sum(self
._notify
('injectCSSFiles'), [])
1169 def getJSFiles(self
):
1170 modules
= WPConferenceBase
.getJSFiles(self
)
1172 # if the user has management powers, include
1174 #if self._conf.canModify(self._rh.getAW()):
1176 # TODO: find way to check if the user is able to manage
1177 # anything inside the conference (sessions, ...)
1178 modules
+= self
._includeJSPackage
('Management')
1179 modules
+= self
._includeJSPackage
('MaterialEditor')
1180 modules
+= self
._includeJSPackage
('Display')
1181 modules
+= self
._includeJSPackage
('Collaboration')
1182 modules
+= sum(self
._notify
('injectJSFiles'), [])
1185 def _applyDecoration( self
, body
):
1188 if self
._params
.get("frame","")=="no" or self
._params
.get("fr","")=="no":
1189 return WPrintPageFrame().getHTML({"content":body
})
1190 return WPConferenceBase
._applyDecoration
(self
, body
)
1192 def _getHTMLFooter( self
):
1193 if self
._params
.get("frame","")=="no" or self
._params
.get("fr","")=="no":
1195 return WPConferenceBase
._getHTMLFooter
(self
)
1197 def _getBody(self
, params
):
1198 """Return main information about the event."""
1199 if self
._view
!= 'xml':
1200 vars = self
._getVariables
(self
._conf
)
1201 vars['getTime'] = lambda date
: format_time(date
.time(), format
="HH:mm")
1202 vars['isTime0H0M'] = lambda date
: (date
.hour
, date
.minute
) == (0,0)
1203 vars['getDate'] = lambda date
: format_date(date
, format
='yyyy-MM-dd')
1204 vars['prettyDate'] = lambda date
: format_date(date
, format
='full')
1205 vars['prettyDuration'] = MaKaC
.common
.utils
.prettyDuration
1206 vars['parseDate'] = MaKaC
.common
.utils
.parseDate
1207 vars['isStringHTML'] = MaKaC
.common
.utils
.isStringHTML
1208 vars['getMaterialFiles'] = lambda material
: self
._getMaterialFiles
(material
)
1209 vars['extractInfoForButton'] = lambda item
: self
._extractInfoForButton
(item
)
1210 vars['getItemType'] = lambda item
: self
._getItemType
(item
)
1211 vars['getLocationInfo'] = MaKaC
.common
.utils
.getLocationInfo
1212 vars['dumps'] = json
.dumps
1214 outGen
= outputGenerator(self
._rh
._aw
)
1215 varsForGenerator
= self
._getBodyVariables
()
1217 vars['xml'] = outGen
._getBasicXML
(self
._conf
, varsForGenerator
, 1, 1, 1, 1)
1219 styleMgr
= info
.HelperMaKaCInfo
.getMaKaCInfoInstance().getStyleManager()
1220 if styleMgr
.existsTPLFile(self
._view
):
1221 fileName
= os
.path
.splitext(styleMgr
.getTemplateFilename(self
._view
))[0]
1222 body
= wcomponents
.WTemplated(os
.path
.join("events", fileName
)).getHTML(vars)
1224 return _("Template could not be found.")
1228 class WPrintPageFrame (wcomponents
.WTemplated
):
1232 class WText(wcomponents
.WTemplated
):
1235 wcomponents
.WTemplated("events/Text")
1238 class WConfProgram(wcomponents
.WTemplated
):
1240 def __init__(self
, aw
, conf
):
1244 def buildTrackData(self
, track
):
1246 Returns a dict representing the data of the track and its Sub-tracks
1249 description
= track
.getDescription()
1252 'title': track
.getTitle(),
1253 'description': description
1256 if track
.getConference().getAbstractMgr().isActive() and \
1257 track
.getConference().hasEnabledSection("cfa") and \
1258 track
.canCoordinate(self
._aw
):
1260 if track
.getConference().canModify(self
._aw
):
1261 formattedTrack
['url'] = urlHandlers
.UHTrackModification
.getURL(track
)
1263 formattedTrack
['url'] = urlHandlers
.UHTrackModifAbstracts
.getURL(track
)
1265 return formattedTrack
1268 pvars
= wcomponents
.WTemplated
.getVars(self
)
1269 pvars
['description'] = self
._conf
.getProgramDescription()
1270 pvars
['program'] = [self
.buildTrackData(t
) for t
in self
._conf
.getTrackList()]
1271 pvars
['pdf_url'] = urlHandlers
.UHConferenceProgramPDF
.getURL(self
._conf
)
1276 class WPConferenceProgram(WPConferenceDefaultDisplayBase
):
1278 def _getBody(self
, params
):
1279 wc
= WConfProgram(self
._getAW
(), self
._conf
)
1282 def _defineSectionMenu(self
):
1283 WPConferenceDefaultDisplayBase
._defineSectionMenu
(self
)
1284 self
._sectionMenu
.setCurrentItem(self
._programOpt
)
1287 class WInternalPageDisplay(wcomponents
.WTemplated
):
1289 def __init__(self
, conf
, page
):
1293 def getVars( self
):
1294 vars = wcomponents
.WTemplated
.getVars( self
)
1295 vars["content"] = self
._page
.getContent()
1298 class WPInternalPageDisplay( WPConferenceDefaultDisplayBase
):
1300 def __init__( self
, rh
, conference
, page
):
1301 WPConferenceDefaultDisplayBase
.__init
__( self
, rh
, conference
)
1304 def _getBody( self
, params
):
1305 wc
= WInternalPageDisplay( self
._conf
, self
._page
)
1308 def _defineSectionMenu( self
):
1309 WPConferenceDefaultDisplayBase
._defineSectionMenu
(self
)
1311 for link
in self
._sectionMenu
.getAllLinks():
1312 if link
.getType() == 'page' and link
.getPage().getId() == self
._page
.getId():
1313 self
._sectionMenu
.setCurrentItem(link
)
1317 class WConferenceTimeTable(wcomponents
.WTemplated
):
1319 def __init__( self
, conference
, aw
):
1320 self
._conf
= conference
1323 def getVars( self
):
1324 vars = wcomponents
.WTemplated
.getVars( self
)
1325 tz
= DisplayTZ(self
._aw
,self
._conf
).getDisplayTZ()
1326 sf
= schedule
.ScheduleToJson
.process(self
._conf
.getSchedule(),
1328 useAttrCache
= True,
1329 hideWeekends
= True)
1330 # TODO: Move to beginning of file when proved useful
1333 jsonf
= ujson
.encode
1336 vars["ttdata"] = jsonf(sf
)
1337 eventInfo
= fossilize(self
._conf
, IConferenceEventInfoFossil
, tz
=tz
)
1338 eventInfo
['isCFAEnabled'] = self
._conf
.getAbstractMgr().isActive()
1339 vars['eventInfo'] = eventInfo
1340 vars['timetableLayout'] = vars.get('ttLyt','')
1343 #class WMeetingHighDetailTimeTable(WConferenceTimeTable):
1345 # def getVars( self ):
1346 # vars = wcomponents.WTemplated.getVars( self )
1347 # self._contribURLGen = vars["contribURLGen"]
1348 # self._sessionURLGen = vars["sessionURLGen"]
1349 # vars["title"] = self._conf.getTitle()
1350 # vars["timetable"] = self._getHTMLTimeTable(1)
1354 class WPConferenceTimeTable( WPConferenceDefaultDisplayBase
):
1355 navigationEntry
= navigation
.NEConferenceTimeTable
1357 def getJSFiles(self
):
1358 return WPConferenceDefaultDisplayBase
.getJSFiles(self
) + \
1359 self
._includeJSPackage
('Timetable')
1361 def _getBody( self
, params
):
1362 wc
= WConferenceTimeTable( self
._conf
, self
._getAW
() )
1363 return wc
.getHTML(params
)
1365 def _defineSectionMenu( self
):
1366 WPConferenceDefaultDisplayBase
._defineSectionMenu
( self
)
1367 self
._sectionMenu
.setCurrentItem(self
._timetableOpt
)
1369 def _getHeadContent( self
):
1370 headContent
=WPConferenceDefaultDisplayBase
._getHeadContent
(self
)
1371 baseurl
= self
._getBaseURL
()
1372 timestamp
= os
.stat(__file__
).st_mtime
1375 <link rel="stylesheet" type="text/css" href="%s/css/timetable.css?%d">
1376 """ % ( headContent
, baseurl
, timestamp
)
1378 #class WMeetingTimeTable(WConferenceTimeTable):
1380 # def getVars( self ):
1381 # vars = wcomponents.WTemplated.getVars( self )
1382 # self._contribURLGen = vars["contribURLGen"]
1383 # self._sessionURLGen = vars["sessionURLGen"]
1384 # vars["title"] = self._conf.getTitle()
1385 # vars["timetable"] = self._getHTMLTimeTable(0)
1388 class WPMeetingTimeTable( WPTPLConferenceDisplay
):
1390 def getJSFiles(self
):
1391 return WPXSLConferenceDisplay
.getJSFiles(self
) + \
1392 self
._includeJSPackage
('Timetable')
1394 def _getBody( self
, params
):
1395 wc
= WConferenceTimeTable( self
._conf
, self
._getAW
() )
1396 return wc
.getHTML(params
)
1398 class WPConferenceModifBase( main
.WPMainBase
, OldObservable
):
1400 _userData
= ['favorite-user-ids']
1402 def __init__( self
, rh
, conference
):
1403 main
.WPMainBase
.__init
__( self
, rh
)
1404 self
._navigationTarget
= self
._conf
= conference
1406 def getJSFiles(self
):
1407 return main
.WPMainBase
.getJSFiles(self
) + \
1408 self
._includeJSPackage
('Management') + \
1409 self
._includeJSPackage
('MaterialEditor')
1411 def _getSiteArea(self
):
1412 return "ModificationArea"
1414 def _getHeader( self
):
1417 wc
= wcomponents
.WHeader( self
._getAW
() )
1418 return wc
.getHTML( { "subArea": self
._getSiteArea
(), \
1419 "loginURL": self
._escapeChars
(str(self
.getLoginURL())),\
1420 "logoutURL": self
._escapeChars
(str(self
.getLogoutURL())) } )
1422 def _getNavigationDrawer(self
):
1423 pars
= {"target": self
._conf
, "isModif": True }
1424 return wcomponents
.WNavigationDrawer( pars
, bgColor
="white" )
1426 def _createSideMenu(self
):
1427 self
._sideMenu
= wcomponents
.ManagementSideMenu()
1429 # The main section containing most menu items
1430 self
._generalSection
= wcomponents
.SideMenuSection()
1432 self
._generalSettingsMenuItem
= wcomponents
.SideMenuItem(_("General settings"),
1433 urlHandlers
.UHConferenceModification
.getURL( self
._conf
))
1434 self
._generalSection
.addItem( self
._generalSettingsMenuItem
)
1436 self
._timetableMenuItem
= wcomponents
.SideMenuItem(_("Timetable"),
1437 urlHandlers
.UHConfModifSchedule
.getURL( self
._conf
))
1438 self
._generalSection
.addItem( self
._timetableMenuItem
)
1440 self
._materialMenuItem
= wcomponents
.SideMenuItem(_("Material"),
1441 urlHandlers
.UHConfModifShowMaterials
.getURL( self
._conf
))
1442 self
._generalSection
.addItem( self
._materialMenuItem
)
1444 self
._roomBookingMenuItem
= wcomponents
.SideMenuItem(_("Room booking"),
1445 urlHandlers
.UHConfModifRoomBookingList
.getURL( self
._conf
))
1446 self
._generalSection
.addItem( self
._roomBookingMenuItem
)
1448 self
._programMenuItem
= wcomponents
.SideMenuItem(_("Programme"),
1449 urlHandlers
.UHConfModifProgram
.getURL( self
._conf
))
1450 self
._generalSection
.addItem( self
._programMenuItem
)
1452 self
._regFormMenuItem
= wcomponents
.SideMenuItem(_("Registration"),
1453 urlHandlers
.UHConfModifRegForm
.getURL( self
._conf
))
1454 self
._generalSection
.addItem( self
._regFormMenuItem
)
1456 self
._abstractMenuItem
= wcomponents
.SideMenuItem(_("Abstracts"),
1457 urlHandlers
.UHConfModifCFA
.getURL( self
._conf
))
1458 self
._generalSection
.addItem( self
._abstractMenuItem
)
1460 self
._contribListMenuItem
= wcomponents
.SideMenuItem(_("Contributions"),
1461 urlHandlers
.UHConfModifContribList
.getURL( self
._conf
))
1462 self
._generalSection
.addItem( self
._contribListMenuItem
)
1464 self
._reviewingMenuItem
= wcomponents
.SideMenuItem(_("Paper Reviewing"),
1465 urlHandlers
.UHConfModifReviewingAccess
.getURL( target
= self
._conf
) )
1466 self
._generalSection
.addItem( self
._reviewingMenuItem
)
1468 if self
._conf
.getCSBookingManager() is not None and self
._conf
.getCSBookingManager().isCSAllowed(self
._rh
.getAW().getUser()):
1469 self
._videoServicesMenuItem
= wcomponents
.SideMenuItem(_("Video Services"),
1470 urlHandlers
.UHConfModifCollaboration
.getURL(self
._conf
, secure
= self
._rh
.use_https()))
1471 self
._generalSection
.addItem( self
._videoServicesMenuItem
)
1473 self
._videoServicesMenuItem
= wcomponents
.SideMenuItem(_("Video Services"), None)
1474 self
._generalSection
.addItem( self
._videoServicesMenuItem
)
1475 self
._videoServicesMenuItem
.setVisible(False)
1477 self
._participantsMenuItem
= wcomponents
.SideMenuItem(_("Participants"),
1478 urlHandlers
.UHConfModifParticipants
.getURL( self
._conf
) )
1479 self
._generalSection
.addItem( self
._participantsMenuItem
)
1481 self
._evaluationMenuItem
= wcomponents
.SideMenuItem(_("Evaluation"),
1482 urlHandlers
.UHConfModifEvaluation
.getURL( self
._conf
) )
1483 self
._generalSection
.addItem( self
._evaluationMenuItem
)
1485 self
._pluginsDictMenuItem
= {}
1486 self
._notify
('fillManagementSideMenu', self
._pluginsDictMenuItem
)
1487 for element
in self
._pluginsDictMenuItem
.values():
1489 self
._generalSection
.addItem( element
)
1490 except Exception, e
:
1491 Logger
.get('Conference').error("Exception while trying to access the plugin elements of the side menu: %s" %str
(e
))
1493 self
._sideMenu
.addSection(self
._generalSection
)
1495 # The section containing all advanced options
1496 self
._advancedOptionsSection
= wcomponents
.SideMenuSection(_("Advanced options"))
1498 self
._listingsMenuItem
= wcomponents
.SideMenuItem(_("Lists"),
1499 urlHandlers
.UHConfAllSpeakers
.getURL( self
._conf
) )
1500 self
._advancedOptionsSection
.addItem( self
._listingsMenuItem
)
1502 self
._ACMenuItem
= wcomponents
.SideMenuItem(_("Protection"),
1503 urlHandlers
.UHConfModifAC
.getURL( self
._conf
) )
1504 self
._advancedOptionsSection
.addItem( self
._ACMenuItem
)
1506 self
._toolsMenuItem
= wcomponents
.SideMenuItem(_("Tools"),
1507 urlHandlers
.UHConfModifTools
.getURL( self
._conf
) )
1508 self
._advancedOptionsSection
.addItem( self
._toolsMenuItem
)
1510 self
._layoutMenuItem
= wcomponents
.SideMenuItem(_("Layout"),
1511 urlHandlers
.UHConfModifDisplay
.getURL(self
._conf
))
1512 self
._advancedOptionsSection
.addItem( self
._layoutMenuItem
)
1514 self
._logMenuItem
= wcomponents
.SideMenuItem(_("Logs"),
1515 urlHandlers
.UHConfModifLog
.getURL( self
._conf
) )
1516 self
._advancedOptionsSection
.addItem( self
._logMenuItem
)
1518 self
._sideMenu
.addSection(self
._advancedOptionsSection
)
1520 #we decide which side menu item appear and which don't
1521 from MaKaC
.webinterface
.rh
.reviewingModif
import RCPaperReviewManager
, RCReviewingStaff
1522 from MaKaC
.webinterface
.rh
.collaboration
import RCVideoServicesManager
, RCCollaborationAdmin
, RCCollaborationPluginAdmin
1524 canModify
= self
._conf
.canModify(self
._rh
.getAW())
1525 isReviewingStaff
= RCReviewingStaff
.hasRights(self
._rh
)
1526 isPRM
= RCPaperReviewManager
.hasRights(self
._rh
)
1527 #isAM = RCAbstractManager.hasRights(self._rh)
1528 isRegistrar
= self
._conf
.canManageRegistration(self
._rh
.getAW().getUser())
1531 self
._generalSettingsMenuItem
.setVisible(False)
1532 self
._timetableMenuItem
.setVisible(False)
1533 self
._materialMenuItem
.setVisible(False)
1534 self
._programMenuItem
.setVisible(False)
1535 self
._participantsMenuItem
.setVisible(False)
1536 self
._listingsMenuItem
.setVisible(False)
1537 self
._layoutMenuItem
.setVisible(False)
1538 self
._ACMenuItem
.setVisible(False)
1539 self
._toolsMenuItem
.setVisible(False)
1540 self
._logMenuItem
.setVisible(False)
1541 self
._evaluationMenuItem
.setVisible(False)
1543 if not (info
.HelperMaKaCInfo
.getMaKaCInfoInstance().getRoomBookingModuleActive() and canModify
):
1544 self
._roomBookingMenuItem
.setVisible(False)
1546 #if not (self._conf.hasEnabledSection("cfa") and (canModify or isAM)):
1547 if not (self
._conf
.hasEnabledSection("cfa") and (canModify
)):
1548 self
._abstractMenuItem
.setVisible(False)
1550 if not (canModify
or isPRM
):
1551 self
._contribListMenuItem
.setVisible(False)
1553 if not (self
._conf
.hasEnabledSection("regForm") and (canModify
or isRegistrar
)):
1554 self
._regFormMenuItem
.setVisible(False)
1556 if not (self
._conf
.getType() == "conference" and (canModify
or isReviewingStaff
)):
1557 self
._reviewingMenuItem
.setVisible(False)
1558 else: #reviewing tab is enabled
1559 if isReviewingStaff
and not canModify
:
1560 self
._reviewingMenuItem
.setVisible(True)
1561 # For now we don't want the paper reviewing to be displayed
1562 #self._reviewingMenuItem.setVisible(False)
1565 if not (canModify
or
1566 RCVideoServicesManager
.hasRights(self
._rh
, 'any') or
1567 RCCollaborationAdmin
.hasRights(self
._rh
) or RCCollaborationPluginAdmin
.hasRights(self
._rh
, plugins
= 'any')):
1568 self
._videoServicesMenuItem
.setVisible(False)
1570 #we hide the Advanced Options section if it has no items
1571 if not self
._advancedOptionsSection
.hasVisibleItems():
1572 self
._advancedOptionsSection
.setVisible(False)
1574 # we disable the Participants section for events of type conference
1575 if self
._conf
.getType() == 'conference':
1576 self
._participantsMenuItem
.setVisible(False)
1578 # make sure that the section evaluation is always activated
1579 # for all conferences
1580 self
._conf
.enableSection("evaluation")
1581 wf
= self
._rh
.getWebFactory()
1583 wf
.customiseSideMenu( self
)
1585 def _setActiveSideMenuItem( self
):
1588 def _applyFrame( self
, body
):
1589 frame
= wcomponents
.WConferenceModifFrame( self
._conf
, self
._getAW
())
1591 sideMenu
= self
._sideMenu
.getHTML()
1593 p
= { "categDisplayURLGen": urlHandlers
.UHCategoryDisplay
.getURL
, \
1594 "confDisplayURLGen": urlHandlers
.UHConferenceDisplay
.getURL
, \
1595 "event": "Conference",
1596 "sideMenu": sideMenu
}
1597 wf
= self
._rh
.getWebFactory()
1599 p
["event"]=wf
.getName()
1600 return frame
.getHTML( body
, **p
)
1602 def _getBody( self
, params
):
1603 self
._createSideMenu
()
1604 self
._setActiveSideMenuItem
()
1606 return self
._applyFrame
( self
._getPageContent
( params
) )
1608 def _getTabContent( self
, params
):
1611 def _getPageContent( self
, params
):
1614 class WPConferenceModifAbstractBase( WPConferenceModifBase
):
1616 def __init__(self
, rh
, conf
):
1617 WPConferenceModifBase
.__init
__(self
, rh
, conf
)
1619 def _createTabCtrl(self
):
1620 self
._tabCtrl
= wcomponents
.TabControl()
1622 self
._tabCFA
= self
._tabCtrl
.newTab( "cfasetup", _("Setup"), urlHandlers
.UHConfModifCFA
.getURL( self
._conf
) )
1623 self
._tabCFAPreview
= self
._tabCtrl
.newTab("cfapreview", _("Preview"), urlHandlers
.UHConfModifCFAPreview
.getURL(self
._conf
))
1624 self
._tabAbstractList
= self
._tabCtrl
.newTab( "abstractList", _("List of Abstracts"), urlHandlers
.UHConfAbstractList
.getURL( self
._conf
) )
1625 self
._tabBOA
= self
._tabCtrl
.newTab("boa", _("Book of Abstracts Setup"), urlHandlers
.UHConfModAbstractBook
.getURL(self
._conf
))
1626 self
._tabCFAR
= self
._tabCtrl
.newTab("reviewing", _("Reviewing"), urlHandlers
.UHAbstractReviewingSetup
.getURL(self
._conf
))
1628 # Create subtabs for the reviewing
1629 self
._subTabARSetup
= self
._tabCFAR
.newSubTab( "revsetup", _("Settings"),\
1630 urlHandlers
.UHAbstractReviewingSetup
.getURL(self
._conf
))
1631 self
._subTabARTeam
= self
._tabCFAR
.newSubTab( "revteam", _("Team"),\
1632 urlHandlers
.UHAbstractReviewingTeam
.getURL(self
._conf
))
1633 self
._subTabARNotifTpl
= self
._tabCFAR
.newSubTab( "notiftpl", _("Notification templates"),\
1634 urlHandlers
.UHAbstractReviewingNotifTpl
.getURL(self
._conf
))
1636 if not self
._conf
.hasEnabledSection("cfa"):
1637 self
._tabBOA
.disable()
1638 self
._tabCFA
.disable()
1639 self
._tabAbstractList
.disable()
1640 self
._tabCFAPreview
.disable()
1641 self
._tabCFAR
.disable()
1643 self
._setActiveTab
()
1645 def _getPageContent(self
, params
):
1646 self
._createTabCtrl
()
1648 return wcomponents
.WTabControl( self
._tabCtrl
, self
._getAW
() ).getHTML( self
._getTabContent
( params
) )
1650 def _setActiveSideMenuItem(self
):
1651 self
._abstractMenuItem
.setActive()
1653 def _getTabContent(self
, params
):
1656 def _setActiveTab(self
):
1659 class WConfModifMainData(wcomponents
.WTemplated
):
1661 def __init__(self
,conference
,mfRegistry
,ct
,rh
):
1662 self
._conf
=conference
1663 self
.__mfr
=mfRegistry
1667 def _getChairPersonsList(self
):
1668 result
= fossilize(self
._conf
.getChairList())
1669 for chair
in result
:
1670 av
= AvatarHolder().match({"email": chair
['email']},
1671 forceWithoutExtAuth
=True, exact
=True)
1672 chair
['showManagerCB'] = True
1673 chair
['showSubmitterCB'] = True
1675 if self
._conf
.getPendingQueuesMgr().getPendingConfSubmittersByEmail(chair
['email']):
1676 chair
['showSubmitterCB'] = False
1677 elif (av
[0] in self
._conf
.getAccessController().getSubmitterList()):
1678 chair
['showSubmitterCB'] = False
1679 if (av
and self
._conf
.getAccessController().canModify(av
[0])) or chair
['email'] in self
._conf
.getAccessController().getModificationEmail():
1680 chair
['showManagerCB'] = False
1684 vars = wcomponents
.WTemplated
.getVars(self
)
1686 vars["defaultStyle"] = displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
).getDefaultStyle()
1687 vars["visibility"] = self
._conf
.getVisibility()
1688 vars["dataModificationURL"]=quoteattr(str(urlHandlers
.UHConfDataModif
.getURL(self
._conf
)))
1689 vars["addTypeURL"]=urlHandlers
.UHConfAddContribType
.getURL(self
._conf
)
1690 vars["removeTypeURL"]=urlHandlers
.UHConfRemoveContribType
.getURL(self
._conf
)
1691 vars["title"]=self
._conf
.getTitle()
1692 if isStringHTML(self
._conf
.getDescription()):
1693 vars["description"] = self
._conf
.getDescription()
1694 elif self
._conf
.getDescription():
1695 vars["description"] = self
._conf
.getDescription()
1697 vars["description"] = ""
1699 ###################################
1700 # Fermi timezone awareness #
1701 ###################################
1702 tz
= self
._conf
.getTimezone()
1703 vars["timezone"] = tz
1704 vars["startDate"]=formatDateTime(self
._conf
.getAdjustedStartDate())
1705 vars["endDate"]=formatDateTime(self
._conf
.getAdjustedEndDate())
1706 ###################################
1707 # Fermi timezone awareness(end) #
1708 ###################################
1709 vars["chairText"] = self
.htmlText(self
._conf
.getChairmanText())
1710 place
=self
._conf
.getLocation()
1712 vars["locationName"]=vars["locationAddress"]=""
1714 vars["locationName"]=self
.htmlText(place
.getName())
1715 vars["locationAddress"]=self
.htmlText(place
.getAddress())
1716 room
=self
._conf
.getRoom()
1717 vars["locationRoom"]=""
1719 vars["locationRoom"]=self
.htmlText(room
.getName())
1720 if isStringHTML(self
._conf
.getContactInfo()):
1721 vars["contactInfo"]=self
._conf
.getContactInfo()
1723 vars["contactInfo"] = """<table class="tablepre"><tr><td><pre>%s</pre></td></tr></table>""" % self
._conf
.getContactInfo()
1724 vars["supportEmailCaption"] = self
._conf
.getSupportInfo().getCaption()
1725 vars["supportEmail"] = i18nformat("""--_("not set")--""")
1726 if self
._conf
.getSupportInfo().hasEmail():
1727 vars["supportEmail"] = self
.htmlText(self
._conf
.getSupportInfo().getEmail())
1729 for type in self
._conf
.getContribTypeList():
1730 typeList
.append("""<input type="checkbox" name="types" value="%s"><a href="%s">%s</a><br>
1731 <table><tr><td width="30"></td><td><font><pre>%s</pre></font></td></tr></table>"""%( \
1733 str(urlHandlers
.UHConfEditContribType
.getURL(type)), \
1735 type.getDescription()))
1736 vars["typeList"] = "".join(typeList
)
1737 #------------------------------------------------------
1738 vars["reportNumbersTable"]=wcomponents
.WReportNumbersTable(self
._conf
).getHTML()
1739 vars["eventType"] = self
._conf
.getType()
1740 vars["keywords"] = self
._conf
.getKeywords()
1741 vars["shortURLBase"] = Config
.getInstance().getShortEventURL()
1742 vars["shortURLTag"] = self
._conf
.getUrlTag()
1743 vars["screenDatesURL"] = urlHandlers
.UHConfScreenDatesEdit
.getURL(self
._conf
)
1744 ssdate
= format_datetime(self
._conf
.getAdjustedScreenStartDate(), format
='EEEE d MMMM yyyy H:mm')
1745 if self
._conf
.getScreenStartDate() == self
._conf
.getStartDate():
1746 ssdate
+= i18nformat(""" <i> _("(normal)")</i>""")
1748 ssdate
+= i18nformat(""" <font color='red'>_("(modified)")</font>""")
1749 sedate
= format_datetime(self
._conf
.getAdjustedScreenEndDate(), format
='EEEE d MMMM yyyy H:mm')
1750 if self
._conf
.getScreenEndDate() == self
._conf
.getEndDate():
1751 sedate
+= i18nformat(""" <i> _("(normal)")</i>""")
1753 sedate
+= i18nformat(""" <font color='red'> _("(modified)")</font>""")
1754 vars['rbActive'] = info
.HelperMaKaCInfo
.getMaKaCInfoInstance().getRoomBookingModuleActive()
1755 vars["screenDates"] = "%s -> %s" % (ssdate
, sedate
)
1756 vars["timezoneList"] = TimezoneRegistry
.getList()
1757 vars["chairpersons"] = self
._getChairPersonsList
()
1759 loc
= self
._conf
.getLocation()
1760 room
= self
._conf
.getRoom()
1761 vars["currentLocation"] = { 'location': loc
.getName() if loc
else "",
1762 'room': room
.name
if room
else "",
1763 'address': loc
.getAddress() if loc
else "" }
1766 class WPConferenceModificationClosed( WPConferenceModifBase
):
1768 def __init__(self
, rh
, target
):
1769 WPConferenceModifBase
.__init
__(self
, rh
, target
)
1771 def _getPageContent( self
, params
):
1772 message
= _("The event is currently locked and you cannot modify it in this status. ")
1773 if self
._conf
.canModify(self
._rh
.getAW()):
1774 message
+= _("If you unlock the event, you will be able to modify its details again.")
1775 return wcomponents
.WClosed().getHTML({"message": message
,
1776 "postURL": urlHandlers
.UHConferenceOpen
.getURL(self
._conf
),
1777 "showUnlockButton": self
._conf
.canModify(self
._rh
.getAW()),
1778 "unlockButtonCaption": _("Unlock event")})
1781 class WPConferenceModification( WPConferenceModifBase
):
1783 def __init__(self
, rh
, target
, ct
=None):
1784 WPConferenceModifBase
.__init
__(self
, rh
, target
)
1787 def _setActiveSideMenuItem( self
):
1788 self
._generalSettingsMenuItem
.setActive()
1790 def _getPageContent( self
, params
):
1791 wc
= WConfModifMainData( self
._conf
, ConfMFRegistry(), self
._ct
, self
._rh
)
1792 pars
= { "type": params
.get("type","") , "conferenceId": self
._conf
.getId()}
1793 return wc
.getHTML( pars
)
1795 class WConfModScreenDatesEdit(wcomponents
.WTemplated
):
1797 def __init__(self
,conf
):
1801 vars=wcomponents
.WTemplated
.getVars(self
)
1802 vars["postURL"]=quoteattr(str(urlHandlers
.UHConfScreenDatesEdit
.getURL(self
._conf
)))
1803 ###################################
1804 # Fermi timezone awareness #
1805 ###################################
1806 csd
= self
._conf
.getAdjustedStartDate()
1807 ced
= self
._conf
.getAdjustedEndDate()
1808 ###################################
1809 # Fermi timezone awareness(end) #
1810 ###################################
1811 vars["conf_start_date"]=self
.htmlText(format_datetime(csd
, format
='EEEE d MMMM yyyy H:mm'))
1812 vars["conf_end_date"]=self
.htmlText(format_datetime(ced
, format
='EEEE d MMMM yyyy H:mm'))
1813 vars["start_date_own_sel"]=""
1814 vars["start_date_conf_sel"]=" checked"
1815 vars["sDay"],vars["sMonth"],vars["sYear"]=csd
.day
,csd
.month
,csd
.year
1816 vars["sHour"],vars["sMin"]=csd
.hour
,csd
.minute
1817 if self
._conf
.getScreenStartDate() != self
._conf
.getStartDate():
1818 vars["start_date_own_sel"]=" checked"
1819 vars["start_date_conf_sel"]=""
1820 sd
=self
._conf
.getAdjustedScreenStartDate()
1821 vars["sDay"]=quoteattr(str(sd
.day
))
1822 vars["sMonth"]=quoteattr(str(sd
.month
))
1823 vars["sYear"]=quoteattr(str(sd
.year
))
1824 vars["sHour"]=quoteattr(str(sd
.hour
))
1825 vars["sMin"]=quoteattr(str(sd
.minute
))
1826 vars["end_date_own_sel"]=""
1827 vars["end_date_conf_sel"]=" checked"
1828 vars["eDay"],vars["eMonth"],vars["eYear"]=ced
.day
,ced
.month
,ced
.year
1829 vars["eHour"],vars["eMin"]=ced
.hour
,ced
.minute
1830 if self
._conf
.getScreenEndDate() != self
._conf
.getEndDate():
1831 vars["end_date_own_sel"]=" checked"
1832 vars["end_date_conf_sel"]=""
1833 ed
=self
._conf
.getAdjustedScreenEndDate()
1834 vars["eDay"]=quoteattr(str(ed
.day
))
1835 vars["eMonth"]=quoteattr(str(ed
.month
))
1836 vars["eYear"]=quoteattr(str(ed
.year
))
1837 vars["eHour"]=quoteattr(str(ed
.hour
))
1838 vars["eMin"]=quoteattr(str(ed
.minute
))
1841 class WPScreenDatesEdit(WPConferenceModification
):
1843 def _getPageContent( self
, params
):
1844 wc
= WConfModScreenDatesEdit(self
._conf
)
1847 class WConferenceDataModificationAdditionalInfo(wcomponents
.WTemplated
):
1849 def __init__( self
, conference
):
1850 self
._conf
= conference
1853 vars = wcomponents
.WTemplated
.getVars( self
)
1854 vars["contactInfo"] = self
._conf
.getContactInfo()
1858 class WConferenceDataModification(wcomponents
.WTemplated
):
1860 def __init__( self
, conference
, rh
):
1861 self
._conf
= conference
1864 def _getVisibilityHTML(self
):
1865 visibility
= self
._conf
.getVisibility()
1866 topcat
= self
._conf
.getOwnerList()[0]
1870 selected
= "selected"
1871 vis
= [ i18nformat("""<option value="0" %s> _("Nowhere")</option>""") % selected
]
1875 if level
== visibility
:
1876 selected
= "selected"
1877 if topcat
.getId() != "0":
1878 from MaKaC
.common
.TemplateExec
import truncateTitle
1879 vis
.append("""<option value="%s" %s>%s</option>""" % (level
, selected
, truncateTitle(topcat
.getName(), 120)))
1880 topcat
= topcat
.getOwner()
1882 if visibility
> level
:
1883 selected
= "selected"
1884 vis
.append( i18nformat("""<option value="999" %s> _("Everywhere")</option>""") % selected
)
1889 vars = wcomponents
.WTemplated
.getVars( self
)
1890 minfo
= info
.HelperMaKaCInfo
.getMaKaCInfoInstance()
1893 styleMgr
= info
.HelperMaKaCInfo
.getMaKaCInfoInstance().getStyleManager()
1894 type = self
._conf
.getType()
1895 vars["timezoneOptions"] = TimezoneRegistry
.getShortSelectItemsHTML(self
._conf
.getTimezone())
1896 styles
=styleMgr
.getExistingStylesForEventType(type)
1898 defStyle
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
).getDefaultStyle()
1899 if defStyle
not in styles
:
1901 for styleId
in styles
:
1902 if styleId
== defStyle
or (defStyle
== "" and styleId
== "static"):
1903 selected
= "selected"
1906 styleoptions
+= "<option value=\"%s\" %s>%s</option>" % (styleId
,selected
,styleMgr
.getStyleName(styleId
))
1907 vars["conference"] = self
._conf
1908 vars["useRoomBookingModule"] = minfo
.getRoomBookingModuleActive()
1909 vars["styleOptions"] = styleoptions
1910 import MaKaC
.webinterface
.webFactoryRegistry
as webFactoryRegistry
1911 wr
= webFactoryRegistry
.WebFactoryRegistry()
1912 types
= [ "conference" ]
1913 for fact
in wr
.getFactoryList():
1914 types
.append(fact
.getId())
1918 if typetext
== "simple_event":
1919 typetext
= "lecture"
1920 if self
._conf
.getType() == id:
1921 vars["types"] += "<option value=\"%s\" selected>%s" % (id,typetext
)
1923 vars["types"] += "<option value=\"%s\">%s" % (id,typetext
)
1924 vars["title"] = quoteattr( self
._conf
.getTitle() )
1925 vars["description"] = self
._conf
.getDescription()
1926 vars["keywords"] = self
._conf
.getKeywords()
1927 tz
= self
._conf
.getTimezone()
1928 vars["sDay"] = str( self
._conf
.getAdjustedStartDate(tz
).day
)
1929 vars["sMonth"] = str( self
._conf
.getAdjustedStartDate(tz
).month
)
1930 vars["sYear"] = str( self
._conf
.getAdjustedStartDate(tz
).year
)
1931 vars["sHour"] = str( self
._conf
.getAdjustedStartDate(tz
).hour
)
1932 vars["sMinute"] = str( self
._conf
.getAdjustedStartDate(tz
).minute
)
1933 vars["eDay"] = str( self
._conf
.getAdjustedEndDate(tz
).day
)
1934 vars["eMonth"] = str( self
._conf
.getAdjustedEndDate(tz
).month
)
1935 vars["eYear"] = str( self
._conf
.getAdjustedEndDate(tz
).year
)
1936 vars["eHour"] = str( self
._conf
.getAdjustedEndDate(tz
).hour
)
1937 vars["eMinute"] = str( self
._conf
.getAdjustedEndDate(tz
).minute
)
1938 vars["chairText"] = quoteattr( self
._conf
.getChairmanText() )
1939 vars["orgText"] = quoteattr( self
._conf
.getOrgText() )
1940 vars["visibility"] = self
._getVisibilityHTML
()
1941 vars["shortURLTag"] = quoteattr( self
._conf
.getUrlTag() )
1942 locName
, locAddress
, locRoom
= "", "", ""
1943 location
= self
._conf
.getLocation()
1945 locName
= location
.getName()
1946 locAddress
= location
.getAddress()
1947 room
= self
._conf
.getRoom()
1949 locRoom
= room
.getName()
1950 vars["locator"] = self
._conf
.getLocator().getWebForm()
1952 vars["locationAddress"] = locAddress
1954 vars["supportCaption"] = quoteattr(self
._conf
.getSupportInfo().getCaption())
1955 vars["supportEmail"] = quoteattr( self
._conf
.getSupportInfo().getEmail() )
1956 vars["locator"] = self
._conf
.getLocator().getWebForm()
1957 vars["event_type"] = ""
1958 vars["navigator"] = navigator
1959 eventType
= self
._conf
.getType()
1960 if eventType
== "conference":
1961 vars["additionalInfo"] = WConferenceDataModificationAdditionalInfo(self
._conf
).getHTML(vars)
1963 vars["additionalInfo"] = ""
1967 class WPConfDataModif( WPConferenceModification
):
1969 def _getPageContent( self
, params
):
1970 p
= WConferenceDataModification( self
._conf
, self
._rh
)
1972 "postURL": urlHandlers
.UHConfPerformDataModif
.getURL(),
1973 "calendarIconURL": Config
.getInstance().getSystemIconURL("calendar"),
1974 "calendarSelectURL": urlHandlers
.UHSimpleCalendar
.getURL(),
1975 "type": params
.get("type") }
1976 return p
.getHTML( pars
)
1979 class WPConfAddMaterial( WPConferenceModification
):
1981 def __init__( self
, rh
, conf
, mf
):
1982 WPConferenceModification
.__init
__( self
, rh
, conf
)
1985 def _getTabContent( self
, params
):
1987 comp
= self
._mf
.getCreationWC( self
._conf
)
1989 comp
= wcomponents
.WMaterialCreation( self
._conf
)
1990 pars
= { "postURL": urlHandlers
.UHConferencePerformAddMaterial
.getURL() }
1991 return comp
.getHTML( pars
)
1994 class WConfModifScheduleGraphic(wcomponents
.WTemplated
):
1996 def __init__(self
, conference
, customLinks
, **params
):
1997 wcomponents
.WTemplated
.__init
__(self
, **params
)
1998 self
._conf
= conference
1999 self
._customLinks
= customLinks
2001 def getVars( self
):
2002 vars=wcomponents
.WTemplated
.getVars(self
)
2003 ################################
2004 # Fermi timezone awareness #
2005 ################################
2006 tz
= self
._conf
.getTimezone()
2007 vars["timezone"]= tz
2008 vars["start_date"]=self
._conf
.getAdjustedStartDate().strftime("%a %d/%m")
2009 vars["end_date"]=self
._conf
.getAdjustedEndDate().strftime("%a %d/%m")
2010 #################################
2011 # Fermi timezone awareness(end) #
2012 #################################
2013 vars["editURL"]=quoteattr(str(urlHandlers
.UHConfModScheduleDataEdit
.getURL(self
._conf
)))
2015 vars['ttdata'] = schedule
.ScheduleToJson
.process(self
._conf
.getSchedule(), tz
, None,
2016 days
= None, mgmtMode
= True)
2018 vars['customLinks'] = self
._customLinks
2020 eventInfo
= fossilize(self
._conf
, IConferenceEventInfoFossil
, tz
= tz
)
2021 eventInfo
['isCFAEnabled'] = self
._conf
.getAbstractMgr().isActive()
2022 vars['eventInfo'] = eventInfo
2026 class WPConfModifScheduleGraphic( WPConferenceModifBase
):
2028 _userData
= ['favorite-user-list', 'favorite-user-ids']
2030 def __init__(self
, rh
, conf
):
2031 WPConferenceModifBase
.__init
__(self
, rh
, conf
)
2032 self
._contrib
= None
2034 def _setActiveSideMenuItem( self
):
2035 self
._timetableMenuItem
.setActive()
2037 def getJSFiles(self
):
2038 pluginJSFiles
= {"paths" : []}
2039 self
._notify
("includeTimetableJSFiles", pluginJSFiles
)
2040 return WPConferenceModifBase
.getJSFiles(self
) + \
2041 self
._includeJSPackage
('Timetable') + \
2042 pluginJSFiles
['paths']
2044 def _getSchedule(self
):
2045 self
._customLinks
= {}
2046 self
._notify
("customTimetableLinks", self
._customLinks
)
2047 return WConfModifScheduleGraphic( self
._conf
, self
._customLinks
)
2049 def _getTTPage( self
, params
):
2050 wc
= self
._getSchedule
()
2051 return wc
.getHTML(params
)
2053 def _getHeadContent( self
):
2055 baseurl
= self
._getBaseURL
()
2056 pluginCSSFiles
= {"paths" : []}
2057 self
._notify
("includeTimetableCSSFiles", pluginCSSFiles
)
2058 return ".".join(["""<link rel="stylesheet" href="%s/%s">"""%(baseurl
,path
) for path
in pluginCSSFiles
['paths']])
2060 def _getPageContent(self
, params
):
2061 return self
._getTTPage
(params
)
2063 #------------------------------------------------------------------------------
2064 class WPConfModifSchedule( WPConferenceModifBase
):
2066 def _setActiveTab( self
):
2067 self
._tabSchedule
.setActive()
2069 #def _getTabContent( self, params ):
2070 # wc = WConfModifSchedule( self._conf )
2071 # return wc.getHTML(params)
2073 #------------------------------------------------------------------------------
2074 class WConfModScheduleDataEdit(wcomponents
.WTemplated
):
2076 def __init__(self
,conf
):
2080 vars=wcomponents
.WTemplated
.getVars(self
)
2081 vars["postURL"]=quoteattr(str(urlHandlers
.UHConfModScheduleDataEdit
.getURL(self
._conf
)))
2082 #######################################
2083 # Fermi timezone awareness #
2084 #######################################
2085 csd
= self
._conf
.getAdjustedStartDate()
2086 ced
= self
._conf
.getAdjustedEndDate()
2087 #######################################
2088 # Fermi timezone awareness(end) #
2089 #######################################
2090 vars["sDay"],vars["sMonth"],vars["sYear"]=str(csd
.day
),str(csd
.month
),str(csd
.year
)
2091 vars["sHour"],vars["sMin"]=str(csd
.hour
),str(csd
.minute
)
2092 vars["eDay"],vars["eMonth"],vars["eYear"]=str(ced
.day
),str(ced
.month
),str(ced
.year
)
2093 vars["eHour"],vars["eMin"]=str(ced
.hour
),str(ced
.minute
)
2096 class WPModScheduleDataEdit(WPConfModifSchedule
):
2098 def _getPageContent( self
, params
):
2099 wc
= WConfModScheduleDataEdit(self
._conf
)
2103 class WConfModifACSessionCoordinatorRights(wcomponents
.WTemplated
):
2105 def __init__(self
,conf
):
2108 def getVars( self
):
2109 vars = wcomponents
.WTemplated
.getVars(self
)
2110 url
= urlHandlers
.UHConfModifCoordinatorRights
.getURL(self
._conf
)
2112 scr
= conference
.SessionCoordinatorRights()
2113 for rightKey
in scr
.getRightKeys():
2114 url
= urlHandlers
.UHConfModifCoordinatorRights
.getURL(self
._conf
)
2115 url
.addParam("rightId", rightKey
)
2116 if self
._conf
.hasSessionCoordinatorRight(rightKey
):
2117 imgurl
=Config
.getInstance().getSystemIconURL("tick")
2119 imgurl
=Config
.getInstance().getSystemIconURL("cross")
2121 <a href=%s><img class="imglink" src=%s></a> %s
2122 """%(quoteattr(str(url
)), quoteattr(str(imgurl
)), scr
.getRight(rightKey
)))
2123 vars["optionalRights"]="<br>".join(html
)
2129 def __init__(self
, conference
, eventType
, user
):
2130 self
.__conf
= conference
2131 self
._eventType
= eventType
2134 def getHTML( self
, params
):
2135 ac
= wcomponents
.WConfAccessControlFrame().getHTML( self
.__conf
,\
2136 params
["setVisibilityURL"])
2138 if not self
.__conf
.isProtected():
2139 dc
= "<br>%s"%wcomponents
.WDomainControlFrame( self
.__conf
).getHTML()
2141 mc
= wcomponents
.WConfModificationControlFrame().getHTML( self
.__conf
) + "<br>"
2143 if self
._eventType
== "conference":
2144 rc
= wcomponents
.WConfRegistrarsControlFrame().getHTML(self
.__conf
) + "<br>"
2149 if self
._eventType
in ["conference", "meeting"]:
2150 tf
= "<br>%s" % wcomponents
.WConfProtectionToolsFrame(self
.__conf
).getHTML()
2152 if self
._eventType
== "conference":
2153 cr
= "<br>%s" % WConfModifACSessionCoordinatorRights(self
.__conf
).getHTML()
2155 return """<br><table width="100%%" class="ACtab"><tr><td>%s%s%s%s%s%s<br></td></tr></table>""" % (mc
, rc
, ac
, dc
, tf
, cr
)
2158 class WPConfModifAC(WPConferenceModifBase
):
2160 def __init__(self
, rh
, conf
):
2161 WPConferenceModifBase
.__init
__(self
, rh
, conf
)
2162 self
._eventType
= "conference"
2163 if self
._rh
.getWebFactory() is not None:
2164 self
._eventType
= self
._rh
.getWebFactory().getId()
2165 self
._user
= self
._rh
._getUser
()
2167 def _setActiveSideMenuItem(self
):
2168 self
._ACMenuItem
.setActive()
2170 def _getPageContent(self
, params
):
2171 wc
= WConfModifAC(self
._conf
, self
._eventType
, self
._user
)
2172 import MaKaC
.webinterface
.rh
.conferenceModif
as conferenceModif
2174 "setVisibilityURL": urlHandlers
.UHConfSetVisibility
.getURL()
2176 return wc
.getHTML(p
)
2179 class WConfModifTools(wcomponents
.WTemplated
):
2181 def __init__(self
, conference
, user
=None):
2182 self
.__conf
= conference
2186 vars = wcomponents
.WTemplated
.getVars(self
)
2187 vars["offlsiteMsg"] = ""
2188 vars["dvdURL"] = quoteattr(str(urlHandlers
.UHConfDVDCreation
.getURL(self
.__conf
)))
2190 if self
._user
is None:
2191 vars["offlsiteMsg"] = _("(Please, login if you want to apply for your Offline Website)")
2192 vars["dvdURL"] = quoteattr("")
2194 vars["deleteIconURL"] = Config
.getInstance().getSystemIconURL("delete")
2195 vars["cloneIconURL"] = Config
.getInstance().getSystemIconURL("clone")
2196 vars["matPkgIconURL"] = quoteattr(str(Config
.getInstance().getSystemIconURL("materialPkg")))
2197 vars["matPkgURL"] = quoteattr(str(urlHandlers
.UHConfModFullMaterialPackage
.getURL(self
.__conf
)))
2198 vars["dvdIconURL"] = quoteattr(str(Config
.getInstance().getSystemIconURL("dvd")))
2199 vars["closeIconURL"] = quoteattr(str(Config
.getInstance().getSystemIconURL("closeIcon")))
2200 vars["closeURL"] = quoteattr(str(urlHandlers
.UHConferenceClose
.getURL(self
.__conf
)))
2201 vars["alarmURL"] = quoteattr(str(urlHandlers
.UHConfDisplayAlarm
.getURL(self
.__conf
)))
2202 vars["alarmIconURL"] = quoteattr(str(Config
.getInstance().getSystemIconURL("alarmIcon")))
2203 vars["badgePrintingURL"] = quoteattr(str(urlHandlers
.UHConfModifBadgePrinting
.getURL(self
.__conf
)))
2204 vars["badgeIconURL"] = quoteattr(str(Config
.getInstance().getSystemIconURL("badge")))
2208 class WPConfModifToolsBase(WPConferenceModifBase
):
2210 def _setActiveSideMenuItem(self
):
2211 self
._toolsMenuItem
.setActive()
2213 def _createTabCtrl(self
):
2214 self
._tabCtrl
= wcomponents
.TabControl()
2216 self
._tabAlarms
= self
._tabCtrl
.newTab("alarms", _("Alarms"), \
2217 urlHandlers
.UHConfDisplayAlarm
.getURL(self
._conf
))
2218 self
._tabCloneEvent
= self
._tabCtrl
.newTab("clone", _("Clone Event"), \
2219 urlHandlers
.UHConfClone
.getURL(self
._conf
))
2220 self
._tabPosters
= self
._tabCtrl
.newTab("posters", _("Posters"), \
2221 urlHandlers
.UHConfModifPosterPrinting
.getURL(self
._conf
))
2222 self
._tabBadges
= self
._tabCtrl
.newTab("badges", _("Badges/Tablesigns"), \
2223 urlHandlers
.UHConfModifBadgePrinting
.getURL(self
._conf
))
2224 self
._tabClose
= self
._tabCtrl
.newTab("close", _("Lock"), \
2225 urlHandlers
.UHConferenceClose
.getURL(self
._conf
))
2226 self
._tabDelete
= self
._tabCtrl
.newTab("delete", _("Delete"), \
2227 urlHandlers
.UHConfDeletion
.getURL(self
._conf
))
2228 self
._tabMatPackage
= self
._tabCtrl
.newTab("matPackage", _("Material Package"), \
2229 urlHandlers
.UHConfModFullMaterialPackage
.getURL(self
._conf
))
2230 self
._tabOfflineSite
= self
._tabCtrl
.newTab("offlineSite", _("Offline Site"), \
2231 urlHandlers
.UHConfDVDCreation
.getURL(self
._conf
))
2233 self
._tabOfflineSite
.setHidden(True)
2235 self
._setActiveTab
()
2237 wf
= self
._rh
.getWebFactory()
2239 wf
.customiseToolsTabCtrl(self
._tabCtrl
)
2241 def _getPageContent(self
, params
):
2242 self
._createTabCtrl
()
2244 html
= wcomponents
.WTabControl(self
._tabCtrl
, self
._getAW
()).getHTML(self
._getTabContent
(params
))
2247 def _setActiveTab(self
):
2250 def _getTabContent(self
, params
):
2254 class WPConfClosing(WPConfModifToolsBase
):
2256 def __init__(self
, rh
, conf
):
2257 WPConferenceModifBase
.__init
__(self
, rh
, conf
)
2258 self
._eventType
= "conference"
2259 if self
._rh
.getWebFactory() is not None:
2260 self
._eventType
= self
._rh
.getWebFactory().getId()
2262 def _setActiveTab(self
):
2263 self
._tabClose
.setActive()
2265 def _getTabContent(self
, params
):
2266 msg
= {'challenge': _("Are you sure that you want to lock the event?"),
2267 'target': self
._conf
.getTitle(),
2268 'subtext': _("Note that if you lock the event, you will not be able to change its details any more. "
2269 "Only the creator of the event or an administrator of the system / category can unlock an event."),
2272 wc
= wcomponents
.WConfirmation()
2273 return wc
.getHTML(msg
,
2274 urlHandlers
.UHConferenceClose
.getURL(self
._conf
),
2277 confirmButtonCaption
=_("Yes, lock this event"),
2278 cancelButtonCaption
=_("No"))
2281 class WPConfDeletion(WPConfModifToolsBase
):
2283 def _setActiveTab(self
):
2284 self
._tabDelete
.setActive()
2286 def _getTabContent(self
, params
):
2287 msg
= {'challenge': _("Are you sure that you want to delete the conference?"),
2288 'target': self
._conf
.getTitle(),
2289 'subtext': _("Note that if you delete the conference, all the items below it will also be deleted")
2292 wc
= wcomponents
.WConfirmation()
2293 return wc
.getHTML(msg
,
2294 urlHandlers
.UHConfDeletion
.getURL(self
._conf
),
2297 confirmButtonCaption
=_("Yes, I am sure"),
2298 cancelButtonCaption
=_("No"))
2301 class WPConfCloneConfirm(WPConfModifToolsBase
):
2303 def __init__(self
, rh
, conf
, nbClones
):
2304 WPConfModifToolsBase
.__init
__(self
, rh
, conf
)
2305 self
._nbClones
= nbClones
2307 def _setActiveTab(self
):
2308 self
._tabCloneEvent
.setActive()
2310 def _getTabContent(self
, params
):
2312 msg
= _("This action will create {0} new events. Are you sure you want to proceed").format(self
._nbClones
)
2314 wc
= wcomponents
.WConfirmation()
2315 url
= urlHandlers
.UHConfPerformCloning
.getURL(self
._conf
)
2316 params
= self
._rh
._getRequestParams
()
2317 for key
in params
.keys():
2318 url
.addParam(key
, params
[key
])
2319 return wc
.getHTML( msg
, \
2321 confirmButtonCaption
=_("Yes"), cancelButtonCaption
=_("No"))
2323 #---------------------------------------------------------------------------
2326 class WPConferenceModifParticipantBase(WPConferenceModifBase
):
2328 def __init__(self
, rh
, conf
):
2329 WPConferenceModifBase
.__init
__(self
, rh
, conf
)
2331 def _createTabCtrl(self
):
2332 self
._tabCtrl
= wcomponents
.TabControl()
2334 self
._tabParticipantsSetup
= self
._tabCtrl
.newTab("participantsetup", _("Setup"), urlHandlers
.UHConfModifParticipantsSetup
.getURL(self
._conf
))
2335 self
._tabParticipantsList
= self
._tabCtrl
.newTab("participantsList", _("Participants"), urlHandlers
.UHConfModifParticipants
.getURL(self
._conf
))
2336 self
._tabStatistics
= self
._tabCtrl
.newTab("statistics", _("Statistics"), urlHandlers
.UHConfModifParticipantsStatistics
.getURL(self
._conf
))
2337 if self
._conf
.getParticipation().getPendingParticipantList() and nowutc() < self
._conf
.getStartDate():
2338 self
._tabParticipantsPendingList
= self
._tabCtrl
.newTab("pendingList", _("Pending"), urlHandlers
.UHConfModifParticipantsPending
.getURL(self
._conf
), className
="pendingTab")
2339 if self
._conf
.getParticipation().getDeclinedParticipantList():
2340 self
._tabParticipantsDeclinedList
= self
._tabCtrl
.newTab("declinedList", _("Declined"), urlHandlers
.UHConfModifParticipantsDeclined
.getURL(self
._conf
))
2342 self
._setActiveTab
()
2344 def _getPageContent(self
, params
):
2345 self
._createTabCtrl
()
2347 return wcomponents
.WTabControl(self
._tabCtrl
, self
._getAW
()).getHTML(self
._getTabContent
(params
))
2349 def getJSFiles(self
):
2350 return WPConferenceModifBase
.getJSFiles(self
) + \
2351 self
._includeJSPackage
('Display')
2353 def _setActiveSideMenuItem(self
):
2354 self
._participantsMenuItem
.setActive()
2356 def _getTabContent(self
, params
):
2359 def _setActiveTab(self
):
2363 class WConferenceParticipant(wcomponents
.WTemplated
):
2365 def __init__(self
, conference
, participant
):
2366 self
._conf
= conference
2367 self
._participant
= participant
2370 vars = wcomponents
.WTemplated
.getVars(self
)
2371 vars["conference"] = self
._conf
2372 vars["participant"] = self
._participant
2376 class WConferenceParticipantPending(wcomponents
.WTemplated
):
2378 def __init__(self
, conference
, id, pending
):
2379 self
._conf
= conference
2381 self
._pending
= pending
2384 vars = wcomponents
.WTemplated
.getVars(self
)
2385 vars["conference"] = self
._conf
2386 vars["id"] = self
._id
2387 vars["pending"] = self
._pending
2391 class WConferenceParticipantsSetup(wcomponents
.WTemplated
):
2393 def __init__(self
, conference
):
2394 self
._conf
= conference
2397 vars = wcomponents
.WTemplated
.getVars(self
)
2398 vars["confId"] = self
._conf
.getId()
2399 vars["isObligatory"] = self
._conf
.getParticipation().isObligatory()
2400 vars["allowDisplay"] = self
._conf
.getParticipation().displayParticipantList()
2401 vars["addedInfo"] = self
._conf
.getParticipation().isAddedInfo()
2402 vars["allowForApply"] = self
._conf
.getParticipation().isAllowedForApplying()
2403 vars["autoAccept"] = self
._conf
.getParticipation().isAutoAccept()
2404 vars["numMaxParticipants"] = self
._conf
.getParticipation().getNumMaxParticipants()
2405 vars["notifyMgrNewParticipant"] = self
._conf
.getParticipation().isNotifyMgrNewParticipant()
2409 class WPConfModifParticipantsSetup(WPConferenceModifParticipantBase
):
2411 def _setActiveTab(self
):
2412 self
._tabParticipantsSetup
.setActive()
2414 def _getTabContent(self
, params
):
2415 p
= WConferenceParticipantsSetup(self
._conf
)
2416 return p
.getHTML(params
)
2419 class WConferenceParticipants(wcomponents
.WTemplated
):
2421 def __init__(self
, conference
):
2422 self
._conf
= conference
2425 vars = wcomponents
.WTemplated
.getVars(self
)
2427 vars["selectAll"] = Config
.getInstance().getSystemIconURL("checkAll")
2428 vars["deselectAll"] = Config
.getInstance().getSystemIconURL("uncheckAll")
2430 vars["participantsAction"] = str(urlHandlers
.UHConfModifParticipantsAction
.getURL(self
._conf
))
2431 vars["hasStarted"] = nowutc() < self
._conf
.getStartDate()
2432 vars["currentUser"] = self
._rh
._aw
.getUser()
2433 vars["numberParticipants"] = len(self
._conf
.getParticipation().getParticipantList())
2434 vars["conf"] = self
._conf
2435 vars["excelIconURL"] = quoteattr(str(Config
.getInstance().getSystemIconURL("excel")))
2440 class WPConfModifParticipants(WPConferenceModifParticipantBase
):
2442 def _setActiveTab(self
):
2443 self
._tabParticipantsList
.setActive()
2445 def _getTabContent(self
, params
):
2446 p
= WConferenceParticipants(self
._conf
)
2447 return p
.getHTML(params
)
2450 class WConferenceParticipantsPending(wcomponents
.WTemplated
):
2452 def __init__(self
, conference
):
2453 self
._conf
= conference
2456 vars = wcomponents
.WTemplated
.getVars(self
)
2458 vars["selectAll"] = Config
.getInstance().getSystemIconURL("checkAll")
2459 vars["deselectAll"] = Config
.getInstance().getSystemIconURL("uncheckAll")
2460 vars["pending"] = self
._getPendingParticipantsList
()
2461 vars["numberPending"] = self
._conf
.getParticipation().getPendingNumber()
2462 vars["conf"] = self
._conf
2463 vars["conferenceStarted"] = nowutc() > self
._conf
.getStartDate()
2464 vars["currentUser"] = self
._rh
._aw
.getUser()
2468 def _getPendingParticipantsList(self
):
2471 for k
in self
._conf
.getParticipation().getPendingParticipantList().keys():
2472 p
= self
._conf
.getParticipation().getPendingParticipantByKey(k
)
2477 class WPConfModifParticipantsPending(WPConferenceModifParticipantBase
):
2479 def _setActiveTab(self
):
2480 self
._tabParticipantsPendingList
.setActive()
2482 def _getTabContent(self
, params
):
2483 p
= WConferenceParticipantsPending(self
._conf
)
2487 class WConferenceParticipantsDeclined(wcomponents
.WTemplated
):
2489 def __init__(self
, conference
):
2490 self
._conf
= conference
2494 vars = wcomponents
.WTemplated
.getVars(self
)
2495 vars["declined"] = self
._getDeclinedParticipantsList
()
2496 vars["numberDeclined"] = self
._conf
.getParticipation().getDeclinedNumber()
2499 def _getDeclinedParticipantsList(self
):
2502 for k
in self
._conf
.getParticipation().getDeclinedParticipantList().keys():
2503 p
= self
._conf
.getParticipation().getDeclinedParticipantByKey(k
)
2508 class WPConfModifParticipantsDeclined(WPConferenceModifParticipantBase
):
2510 def _setActiveTab(self
):
2511 self
._tabParticipantsDeclinedList
.setActive()
2513 def _getTabContent(self
, params
):
2514 p
= WConferenceParticipantsDeclined(self
._conf
)
2518 class WConferenceParticipantsStatistics(wcomponents
.WTemplated
):
2520 def __init__(self
, conference
):
2521 self
._conf
= conference
2525 vars = wcomponents
.WTemplated
.getVars(self
)
2526 vars["invited"] = self
._conf
.getParticipation().getInvitedNumber()
2527 vars["rejected"] = self
._conf
.getParticipation().getRejectedNumber()
2528 vars["added"] = self
._conf
.getParticipation().getAddedNumber()
2529 vars["refused"] = self
._conf
.getParticipation().getRefusedNumber()
2530 vars["pending"] = self
._conf
.getParticipation().getPendingNumber()
2531 vars["declined"] = self
._conf
.getParticipation().getDeclinedNumber()
2532 vars["conferenceStarted"] = nowutc() > self
._conf
.getStartDate()
2533 vars["present"] = self
._conf
.getParticipation().getPresentNumber()
2534 vars["absent"] = self
._conf
.getParticipation().getAbsentNumber()
2535 vars["excused"] = self
._conf
.getParticipation().getExcusedNumber()
2539 class WPConfModifParticipantsStatistics(WPConferenceModifParticipantBase
):
2541 def _setActiveTab(self
):
2542 self
._tabStatistics
.setActive()
2544 def _getTabContent(self
, params
):
2545 p
= WConferenceParticipantsStatistics(self
._conf
)
2546 return p
.getHTML(params
)
2549 class WPConfModifParticipantsInvitationBase(WPConferenceDisplayBase
):
2551 def _getHeader(self
):
2554 wc
= wcomponents
.WMenuSimpleEventHeader(self
._getAW
(), self
._conf
)
2555 return wc
.getHTML({"loginURL": self
.getLoginURL(),\
2556 "logoutURL": self
.getLogoutURL(),\
2557 "confId": self
._conf
.getId(),\
2558 "currentView": "static",\
2559 "type": WebFactory
.getId(),\
2562 def _getBody(self
, params
):
2563 return '<div style="margin:10px">{0}</div>'.format(self
._getContent
(params
))
2566 class WPConfModifParticipantsInvite(WPConfModifParticipantsInvitationBase
):
2568 def _getContent(self
, params
):
2569 msg
= _("Please indicate whether you want to accept or reject the invitation to '{0}'").format(self
._conf
.getTitle())
2570 wc
= wcomponents
.WConfirmation()
2571 url
= urlHandlers
.UHConfParticipantsInvitation
.getURL(self
._conf
)
2572 url
.addParam("participantId",params
["participantId"])
2573 return wc
.getHTML(msg
,
2576 confirmButtonCaption
=_("Accept"),
2577 cancelButtonCaption
=_("Reject"),
2580 #---------------------------------------------------------------------------
2582 class WPConfModifParticipantsRefuse(WPConfModifParticipantsInvitationBase
):
2584 def _getContent( self
, params
):
2585 msg
= i18nformat("""
2586 <font size="+2"> _("Are you sure you want to refuse to attend the '%s'")?</font>
2587 """)%(self
._conf
.getTitle())
2588 wc
= wcomponents
.WConfirmation()
2589 url
= urlHandlers
.UHConfParticipantsRefusal
.getURL( self
._conf
)
2590 url
.addParam("participantId",params
["participantId"])
2591 return wc
.getHTML( msg
, url
, {}, \
2592 confirmButtonCaption
= _("Refuse"), cancelButtonCaption
= _("Cancel") )
2594 #---------------------------------------------------------------------------
2596 class WConferenceLog(wcomponents
.WTemplated
):
2598 def __init__(self
, conference
):
2599 wcomponents
.WTemplated
.__init
__(self
)
2600 self
.__conf
= conference
2601 self
._tz
= info
.HelperMaKaCInfo
.getMaKaCInfoInstance().getTimezone()
2606 log_vars
= wcomponents
.WTemplated
.getVars(self
)
2607 log_vars
["log_dict"] = self
._getLogDict
()
2608 log_vars
["timezone"] = timezone(self
._tz
)
2611 def _getLogDict(self
):
2612 """Return a dictionary of log entries per day."""
2613 log
= self
.__conf
.getLogHandler().getLogList()
2614 log_dict
= collections
.defaultdict(list)
2616 date
= line
.getLogDate().date()
2617 log_dict
[date
].append(line
)
2621 class WPConfModifLog(WPConferenceModifBase
):
2623 def _setActiveSideMenuItem(self
):
2624 self
._logMenuItem
.setActive()
2626 def _getPageContent(self
, params
):
2627 p
= WConferenceLog(self
._conf
)
2628 return p
.getHTML(params
)
2630 #---------------------------------------------------------------------------
2632 class WConfModifListings( wcomponents
.WTemplated
):
2634 def __init__( self
, conference
):
2635 self
.__conf
= conference
2637 def getVars( self
):
2638 vars = wcomponents
.WTemplated
.getVars( self
)
2639 vars["pendingQueuesIconURL"]=quoteattr(str(Config
.getInstance().getSystemIconURL("listing")))
2640 vars["pendingQueuesURL"]=quoteattr(str(urlHandlers
.UHConfModifPendingQueues
.getURL( self
.__conf
)))
2641 vars["allSessionsConvenersIconURL"]=quoteattr(str(Config
.getInstance().getSystemIconURL("listing")))
2642 vars["allSessionsConvenersURL"]=quoteattr(str(urlHandlers
.UHConfAllSessionsConveners
.getURL( self
.__conf
)))
2643 vars["allSpeakersIconURL"]=quoteattr(str(Config
.getInstance().getSystemIconURL("listing")))
2644 vars["allSpeakersURL"]=quoteattr(str(urlHandlers
.UHConfAllSpeakers
.getURL( self
.__conf
)))
2645 vars["allPrimaryAuthorsIconURL"]=quoteattr(str(Config
.getInstance().getSystemIconURL("listing")))
2646 vars["allPrimaryAuthorsURL"]=quoteattr(str(urlHandlers
.UHConfAllPrimaryAuthors
.getURL( self
.__conf
)))
2647 vars["allCoAuthorsIconURL"]=quoteattr(str(Config
.getInstance().getSystemIconURL("listing")))
2648 vars["allCoAuthorsURL"]=quoteattr(str(urlHandlers
.UHConfAllCoAuthors
.getURL( self
.__conf
)))
2652 class WPConfModifListings(WPConferenceModifBase
):
2654 def __init__(self
, rh
, conference
):
2655 WPConferenceModifBase
.__init
__(self
, rh
, conference
)
2656 self
._createTabCtrl
()
2658 def _setActiveSideMenuItem(self
):
2659 self
._listingsMenuItem
.setActive()
2661 def _createTabCtrl(self
):
2662 self
._tabCtrl
= wcomponents
.TabControl()
2663 self
._subTabSpeakers
= self
._tabCtrl
.newTab('speakers',
2664 _('All Contribution Speakers'),
2665 urlHandlers
.UHConfAllSpeakers
.getURL(self
._conf
))
2666 self
._subTabConveners
= self
._tabCtrl
.newTab('conveners',
2667 _('All Session Conveners'),
2668 urlHandlers
.UHConfAllSessionsConveners
.getURL(self
._conf
))
2669 self
._subTabUsers
= self
._tabCtrl
.newTab('users',
2670 _('People Pending'),
2671 urlHandlers
.UHConfModifPendingQueues
.getURL(self
._conf
))
2673 def _getPageContent(self
, params
):
2674 self
._setActiveTab
()
2675 return wcomponents
.WTabControl(self
._tabCtrl
, self
._getAW
()).getHTML(self
._getTabContent
(params
))
2677 def _setActiveTab(self
):
2678 self
._subTabUsers
.setActive()
2680 #---------------------------------------------------------------------------
2681 #---------------------------------------------------------------------------
2683 class WConferenceClone(wcomponents
.WTemplated
):
2685 def __init__(self
, conference
):
2686 self
.__conf
= conference
2688 def _getSelectDay(self
):
2690 for i
in range(31) :
2692 if datetime
.today().day
== (i
+1) :
2693 selected
= "selected=\"selected\""
2694 sd
+= "<OPTION VALUE=\"%d\" %s>%d\n"%(i
+1, selected
, i
+1)
2697 def _getSelectMonth(self
):
2699 month
= [ "January", "February", "March", "April", "May", "June",
2700 "July", "August", "September", "October", "November", "December"]
2701 for i
in range(12) :
2703 if datetime
.today().month
== (i
+1) :
2704 selected
= "selected=\"selected\""
2705 sm
+= "\t<OPTION VALUE=\"%d\" %s>%s\n"%(i
+1, selected
, _(month
[i
]))
2708 def _getSelectYear(self
):
2713 if datetime
.today().year
== i
:
2714 selected
= "selected=\"selected\""
2715 sy
+= "\t<OPTION VALUE=\"%d\" %s>%d\n"%(i
, selected
, i
)
2721 vars = wcomponents
.WTemplated
.getVars(self
)
2722 vars["confTitle"] = self
.__conf
.getTitle()
2723 vars["confId"] = self
.__conf
.getId()
2724 vars["selectDay"] = self
._getSelectDay
()
2725 vars["selectMonth"] = self
._getSelectMonth
()
2726 vars["selectYear"] = self
._getSelectYear
()
2727 vars["calendarIconURL"] = Config
.getInstance().getSystemIconURL( "calendar" )
2728 vars["calendarSelectURL"] = urlHandlers
.UHSimpleCalendar
.getURL()
2732 class WPConfClone( WPConfModifToolsBase
, OldObservable
):
2734 def _setActiveTab( self
):
2735 self
._tabCloneEvent
.setActive()
2737 def _getTabContent( self
, params
):
2738 p
= WConferenceClone( self
._conf
)
2739 pars
= {"cancelURL": urlHandlers
.UHConfModifTools
.getURL( self
._conf
), \
2740 "cloneOnce": urlHandlers
.UHConfPerformCloneOnce
.getURL( self
._conf
), \
2741 "cloneInterval": urlHandlers
.UHConfPerformCloneInterval
.getURL( self
._conf
), \
2742 "cloneday": urlHandlers
.UHConfPerformCloneDays
.getURL( self
._conf
), \
2743 "cloning" : urlHandlers
.UHConfPerformCloning
.getURL( self
._conf
),
2744 "cloneOptions": i18nformat("""<li><input type="checkbox" name="cloneTracks" id="cloneTracks" value="1" />_("Tracks")</li>
2745 <li><input type="checkbox" name="cloneTimetable" id="cloneTimetable" value="1" />_("Full timetable")</li>
2746 <li><ul style="list-style-type: none;"><li><input type="checkbox" name="cloneSessions" id="cloneSessions" value="1" />_("Sessions")</li></ul></li>
2747 <li><input type="checkbox" name="cloneRegistration" id="cloneRegistration" value="1" >_("Registration")</li>
2748 <li><input type="checkbox" name="cloneEvaluation" id="cloneEvaluation" value="1" />_("Evaluation")</li>""") }
2749 #let the plugins add their own elements
2750 self
._notify
('addCheckBox2CloneConf', pars
)
2751 return p
.getHTML(pars
)
2753 #---------------------------------------------------------------------------------------
2756 class WConferenceAllSessionsConveners(wcomponents
.WTemplated
):
2758 def __init__(self
, conference
):
2759 self
.__conf
= conference
2762 vars = wcomponents
.WTemplated
.getVars(self
)
2763 vars["confTitle"] = self
.__conf
.getTitle()
2764 vars["confId"] = self
.__conf
.getId()
2765 vars["convenerSelectionAction"] = quoteattr(str(urlHandlers
.UHConfAllSessionsConvenersAction
.getURL(self
.__conf
)))
2766 vars["contribSetIndex"] = 'index'
2767 vars["convenerNumber"] = str(len(self
.__conf
.getAllSessionsConvenerList()))
2768 vars["conveners"] = self
._getAllConveners
()
2769 vars["backURL"] = quoteattr(str(urlHandlers
.UHConfModifListings
.getURL(self
.__conf
)))
2772 def _getTimetableURL(self
, convener
):
2773 url
= urlHandlers
.UHSessionModifSchedule
.getURL(self
.__conf
)
2774 url
.addParam("sessionId", convener
.getSession().getId())
2775 if hasattr(convener
, "getSlot"):
2776 timetable
= "#" + str(convener
.getSlot().getStartDate().strftime("%Y%m%d")) + ".s%sl%s" % (convener
.getSession().getId(), convener
.getSlot().getId())
2778 timetable
= "#" + str(convener
.getSession().getStartDate().strftime("%Y%m%d"))
2780 return "%s%s" % (url
, timetable
)
2782 def _getAllConveners(self
):
2783 convenersFormatted
= []
2784 convenersDict
= self
.__conf
.getAllSessionsConvenerList()
2786 for key
, conveners
in convenersDict
.iteritems():
2789 for convener
in convenersDict
[key
]:
2793 'email': convener
.getEmail(),
2794 'name': convener
.getFullName() or '',
2800 'urlTimetable': self
._getTimetableURL
(convener
),
2801 'urlSessionModif': None
2804 if isinstance(convener
, conference
.SlotChair
):
2805 title
= convener
.getSlot().getTitle() or "Block %s" % convener
.getSlot().getId()
2806 sessionData
['title'] = convener
.getSession().getTitle() + ': ' + title
2808 url
= urlHandlers
.UHSessionModification
.getURL(self
.__conf
)
2809 url
.addParam('sessionId', convener
.getSession().getId())
2811 sessionData
['urlSessionModif'] = str(url
)
2812 sessionData
['title'] = convener
.getSession().getTitle() or ''
2814 data
['sessions'].append(sessionData
)
2816 convenersFormatted
.append(data
)
2818 return convenersFormatted
2821 class WPConfAllSessionsConveners(WPConfModifListings
):
2823 def _setActiveTab(self
):
2824 self
._subTabConveners
.setActive()
2826 def _getTabContent(self
, params
):
2827 p
= WConferenceAllSessionsConveners(self
._conf
)
2830 #---------------------------------------------------------------------------------------
2833 class WConfModifAllContribParticipants(wcomponents
.WTemplated
):
2835 def __init__(self
, conference
, partIndex
):
2836 self
._title
= _("All participants list")
2837 self
._conf
= conference
2839 self
._dispopts
= ["Email", "Contributions"]
2840 self
._partIndex
= partIndex
2843 vars = wcomponents
.WTemplated
.getVars(self
)
2844 self
._url
= vars["participantMainPageURL"]
2845 vars["speakers"] = self
._getAllParticipants
()
2846 vars["backURL"] = quoteattr(str(urlHandlers
.UHConfModifListings
.getURL(self
._conf
)))
2847 vars["participantNumber"] = str(len(self
._partIndex
.getParticipationKeys()))
2851 def _getAllParticipants(self
):
2854 for key
in self
._partIndex
.getParticipationKeys():
2855 participationList
= self
._partIndex
.getById(key
)
2857 if participationList
:
2858 participant
= participationList
[0]
2861 'name': participant
.getFullName(),
2862 'email': participant
.getEmail(),
2866 for participation
in participationList
:
2867 contribution
= participation
.getContribution()
2870 pData
['contributions'].append({
2871 'title': contribution
.getTitle(),
2872 'url': str(urlHandlers
.UHContributionModification
.getURL(contribution
))
2875 speakers
.append(pData
)
2883 class WPConfAllSpeakers(WPConfModifListings
):
2885 def _setActiveTab(self
):
2886 self
._subTabSpeakers
.setActive()
2888 def _getTabContent(self
, params
):
2889 p
= WConfModifAllContribParticipants( self
._conf
, self
._conf
.getSpeakerIndex() )
2890 return p
.getHTML({"title": _("All speakers list"), \
2891 "participantMainPageURL":urlHandlers
.UHConfAllSpeakers
.getURL(self
._conf
), \
2892 "participantSelectionAction":quoteattr(str(urlHandlers
.UHConfAllSpeakersAction
.getURL(self
._conf
)))})
2894 # I can't find where any of these are used or mathcing tpls,
2895 # I presume they are legacy and (potentially) can be deleted? Matt
2897 # class WPConfAllPrimaryAuthors( WPConfModifListings ):
2899 # def _getPageContent( self, params ):
2900 # p = WConfModifAllContribParticipants( self._conf, self._conf.getPrimaryAuthorIndex() )
2901 # return p.getHTML({"title": _("All primary authors list"), \
2902 # "participantMainPageURL":urlHandlers.UHConfAllPrimaryAuthors.getURL(self._conf), \
2903 # "participantSelectionAction":quoteattr(str(urlHandlers.UHConfAllPrimaryAuthorsAction.getURL(self._conf)))})
2906 # class WPConfAllCoAuthors( WPConfModifListings ):
2908 # def _getPageContent( self, params ):
2909 # p = WConfModifAllContribParticipants( self._conf, self._conf.getCoAuthorIndex() )
2910 # return p.getHTML({"title": _("All co-authors list"), \
2911 # "participantMainPageURL":urlHandlers.UHConfAllCoAuthors.getURL(self._conf), \
2912 # "participantSelectionAction":quoteattr(str(urlHandlers.UHConfAllCoAuthorsAction.getURL(self._conf)))})
2915 class WPEMailContribParticipants ( WPConfModifListings
):
2916 def __init__(self
, rh
, conf
, participantList
):
2917 WPConfModifListings
.__init
__(self
, rh
, conf
)
2918 self
._participantList
= participantList
2920 def _getPageContent(self
,params
):
2921 wc
= WEmailToContribParticipants(self
._conf
, self
._getAW
().getUser(), self
._participantList
)
2924 class WEmailToContribParticipants(wcomponents
.WTemplated
):
2925 def __init__(self
,conf
,user
,contribParticipantList
):
2928 self
._fromemail
= user
.getEmail()
2930 self
._fromemail
= ""
2931 self
._contribParticipantList
= contribParticipantList
2934 vars = wcomponents
.WTemplated
.getVars( self
)
2937 for email
in self
._contribParticipantList
:
2939 toEmails
.append(email
)
2940 vars["From"] = self
._fromemail
2941 vars["toEmails"]= ", ".join(toEmails
)
2942 vars["emails"]= ",".join(toEmails
)
2943 vars["postURL"]=urlHandlers
.UHContribParticipantsSendEmail
.getURL(self
._conf
)
2947 #---------------------------------------------------------------------------------------
2949 class WPEMailConveners ( WPConfModifListings
):
2950 def __init__(self
, rh
, conf
, convenerList
):
2951 WPConfModifListings
.__init
__(self
, rh
, conf
)
2952 self
._convenerList
= convenerList
2954 def _getPageContent(self
,params
):
2955 wc
= WEmailToConveners(self
._conf
, self
._getAW
().getUser(), self
._convenerList
)
2958 class WEmailToConveners(wcomponents
.WTemplated
):
2959 def __init__(self
,conf
,user
,convenerList
):
2962 self
._fromemail
= user
.getEmail()
2964 self
._fromemail
= ""
2965 self
._convenerList
= convenerList
2968 vars = wcomponents
.WTemplated
.getVars( self
)
2971 for email
in self
._convenerList
:
2973 toEmails
.append(email
)
2974 vars["From"] = self
._fromemail
2975 vars["toEmails"]= ", ".join(toEmails
)
2976 vars["emails"]= ",".join(toEmails
)
2977 vars["postURL"]=urlHandlers
.UHConvenersSendEmail
.getURL(self
._conf
)
2982 class WPConfAllParticipants( WPConfModifListings
):
2984 def _getTabContent( self
, params
):
2985 p
= wcomponents
.WConferenceAllParticipants( self
._conf
)
2988 #---------------------------------------------------------------------------------------
2991 class WConvenerSentMail (wcomponents
.WTemplated
):
2992 def __init__(self
,conf
):
2996 vars = wcomponents
.WTemplated
.getVars( self
)
2997 vars["BackURL"]=quoteattr(str(urlHandlers
.UHConfAllSessionsConveners
.getURL(self
._conf
)))
3000 class WPConvenerSentEmail( WPConfModifListings
):
3001 def _getTabContent(self
,params
):
3002 wc
= WConvenerSentMail(self
._conf
)
3006 class WContribParticipationSentMail(wcomponents
.WTemplated
):
3007 def __init__(self
,conf
):
3011 vars = wcomponents
.WTemplated
.getVars( self
)
3012 vars["BackURL"]=quoteattr(str(urlHandlers
.UHConfAllSpeakers
.getURL(self
._conf
)))
3016 class WPContribParticipationSentEmail( WPConfModifListings
):
3017 def _getTabContent(self
,params
):
3018 wc
= WContribParticipationSentMail(self
._conf
)
3022 #---------------------------------------------------------------------------------------
3024 class WConfDisplayAlarm( wcomponents
.WTemplated
):
3026 def __init__(self
, conference
, aw
):
3027 self
.__conf
= self
.__target
= conference
3030 def getVars( self
):
3031 vars = wcomponents
.WTemplated
.getVars( self
)
3032 vars["locator"] = self
.__target
.getLocator().getWebForm()
3033 vars["dtFormat"]= "%Y-%m-%d %H:%M"
3034 vars["confTZ"]= timezone(self
.__target
.getTimezone())
3035 vars["alarmList"] = self
.__target
.getAlarmList()
3036 vars["timezone"] = self
.__target
.getTimezone()
3037 vars["addAlarmURL"] = urlHandlers
.UHConfAddAlarm
.getURL( self
.__conf
)
3038 vars["deleteAlarmURL"] = urlHandlers
.UHConfDeleteAlarm
.getURL()
3039 vars["modifyAlarmURL"] = urlHandlers
.UHConfModifyAlarm
.getURL()
3042 class WPConfDisplayAlarm( WPConfModifToolsBase
):
3044 def _getTabContent( self
, params
):
3045 wc
= WConfDisplayAlarm( self
._conf
, self
._rh
._getUser
() )
3048 #---------------------------------------------------------------------------------------
3050 class WSetAlarm(wcomponents
.WTemplated
):
3052 def __init__(self
, conference
, aw
):
3053 self
.__conf
= conference
3056 def _getFromList(self
):
3058 for ch
in self
.__conf
.getChairList():
3059 if not fromList
.has_key(ch
.getEmail().strip()):
3060 fromList
[ch
.getEmail().strip()] = ch
.getFullName()
3061 if self
.__conf
.getSupportInfo().getEmail().strip()!="" and not fromList
.has_key(self
.__conf
.getSupportInfo().getEmail().strip()):
3062 fromList
[self
.__conf
.getSupportInfo().getEmail().strip()] = self
.__conf
.getSupportInfo().getEmail().strip()
3063 if self
._aw
.getUser() is not None and not fromList
.has_key(self
._aw
.getUser().getEmail().strip()):
3064 fromList
[self
._aw
.getUser().getEmail().strip()] = self
._aw
.getUser().getFullName()
3065 if self
.__conf
.getCreator() is not None and not fromList
.has_key(self
.__conf
.getCreator().getEmail().strip()):
3066 fromList
[self
.__conf
.getCreator().getEmail().strip()] = self
.__conf
.getCreator().getFullName()
3070 vars = wcomponents
.WTemplated
.getVars(self
)
3071 if vars.has_key("alarmId"):
3072 vars["formTitle"] = _("Create a new alarm email")
3074 vars["formTitle"] = _("Modify alarm data")
3075 vars["timezone"] = self
.__conf
.getTimezone()
3076 vars["conference"] = self
.__conf
3077 vars["today"] = datetime
.today()
3078 vars["fromList"] = self
._getFromList
()
3079 vars["date_format"] = '%d/%m/%Y %H:%M'
3082 vars["alarm_date"] = datetime(vars['year'], vars['month'], vars['day'],
3083 int(vars['hour']), int(vars['minute']))
3085 vars["alarm_date"] = self
.__conf
.getAdjustedStartDate()
3088 class WPConfAddAlarm( WPConfModifToolsBase
):
3090 def _setActiveTab( self
):
3091 self
._tabAlarms
.setActive()
3093 def _getTabContent( self
, params
):
3094 wc
= WSetAlarm( self
._conf
, self
._getAW
() )
3096 pars
["alarmId"] = self
._rh
._reqParams
.get("alarmId","")
3097 pars
["user"] = self
._rh
._getUser
()
3098 pars
["fromAddr"] = self
._rh
._reqParams
.get("fromAddr","")
3099 pars
["Emails"] = self
._rh
._reqParams
.get("Emails","")
3100 pars
["note"] = self
._rh
._reqParams
.get("note","")
3101 pars
["includeConf"] = (self
._rh
._reqParams
.get("includeConf","")=="1")
3102 pars
["toAllParticipants"] = (self
._rh
._reqParams
.get("toAllParticipants",False) == "on")
3103 pars
["dateType"] = int(self
._rh
._reqParams
.get("dateType",-1))
3104 tz
=self
._conf
.getTimezone()
3105 now
= nowutc().astimezone(timezone(tz
))
3106 pars
["year"]=self
._rh
._reqParams
.get("year",now
.year
)
3107 pars
["month"] = self
._rh
._reqParams
.get("month",now
.month
)
3108 pars
["day"] = self
._rh
._reqParams
.get("day",now
.day
)
3109 pars
["hour"] = self
._rh
._reqParams
.get("hour","08")
3110 pars
["minute"] = self
._rh
._reqParams
.get("minute","00")
3111 pars
["timeBefore"] = int(self
._rh
._reqParams
.get("_timeBefore",0))
3112 pars
["timeTypeBefore"] = self
._rh
._reqParams
.get("dayBefore","")
3113 return wc
.getHTML( pars
)
3115 #--------------------------------------------------------------------
3117 class WPConfModifyAlarm( WPConfModifToolsBase
):
3119 def __init__(self
, caller
, conf
, alarm
):
3120 WPConfModifToolsBase
.__init
__(self
, caller
, conf
)
3123 def _getTabContent( self
, params
):
3124 wc
= WSetAlarm(self
._conf
, self
._getAW
())
3126 pars
["alarmId"] = self
._alarm
.getConfRelativeId()
3127 pars
["timeBeforeType"] = ""
3129 year
= month
= day
= hour
= minute
= -1
3130 if self
._alarm
.getTimeBefore():
3131 pars
["dateType"] = 2
3132 #the date is calculated from the conference startdate
3133 if self
._alarm
.getTimeBefore() < timedelta(days
=1):
3134 pars
["timeBeforeType"] = "hours"
3135 timeBefore
= int(self
._alarm
.getTimeBefore().seconds
/3600)
3137 #time before upper to 1 day
3138 pars
["timeBeforeType"] = "days"
3139 timeBefore
= int(self
._alarm
.getTimeBefore().days
)
3142 pars
["dateType"] = 1
3143 startOn
= self
._alarm
.getStartOn().astimezone(timezone(self
._conf
.getTimezone()))
3145 month
= startOn
.month
3148 minute
= startOn
.minute
3151 pars
["month"] = month
3154 pars
["minute"] = minute
3155 pars
["timeBefore"] = timeBefore
3156 pars
["subject"] = self
._alarm
.getSubject()
3157 pars
["Emails"] = ", ".join(self
._alarm
.getToAddrList())
3158 pars
["fromAddr"] = self
._alarm
.getFromAddr()
3159 pars
["text"] = self
._alarm
.getText()
3160 pars
["note"] = self
._alarm
.getNote()
3161 pars
["toAllParticipants"] = self
._alarm
.getToAllParticipants()
3162 pars
["includeConf"] = self
._alarm
.getConfSummary()
3163 return wc
.getHTML( pars
)
3165 #----------------------------------------------------------------------------------
3167 class WConfModifCFAAddField( wcomponents
.WTemplated
):
3169 def __init__( self
, conference
, fieldId
):
3170 self
._conf
= conference
3171 self
._fieldId
= fieldId
3174 vars = wcomponents
.WTemplated
.getVars(self
)
3175 vars["postURL"] = quoteattr(str(urlHandlers
.UHConfModifCFAPerformAddOptFld
.getURL(self
._conf
)))
3177 selectedNo
= "checked"
3178 fieldType
= "textarea"
3179 if self
._fieldId
!= "":
3180 abf
= self
._conf
.getAbstractMgr().getAbstractFieldsMgr().getFieldById(self
._fieldId
)
3181 vars["id"] = quoteattr(abf
.getId())
3182 vars["name"] = quoteattr(abf
.getName())
3183 vars["caption"] = quoteattr(abf
.getCaption())
3184 vars["maxlength"] = quoteattr(str(abf
.getMaxLength()))
3185 vars["action"] = "Edit"
3186 if abf
.isMandatory():
3187 selectedYes
= "checked"
3189 fieldType
= abf
.getType()
3190 vars["limitationOption"] = abf
.getLimitation()
3192 vars["id"] = vars["name"] = vars["caption"] = quoteattr("")
3193 vars["maxlength"] = 0
3194 vars["action"] = "Add"
3195 vars["limitationOption"] = "words" # by default we show selected the "words" option
3196 #vars["fieldName"] = """<input type="text" name="fieldId" value=%s size="60">""" % quoteattr(self._fieldId)
3197 #if self._fieldId == "content":
3198 # vars["fieldName"] = """%s<input type="hidden" name="fieldId" value=%s size="60">""" % (self._fieldId, quoteattr(self._fieldId))
3199 vars["selectedYes"] = selectedYes
3200 vars["selectedNo"] = selectedNo
3201 vars["fieldTypeOptions"] = ""
3202 for type in review
.AbstractField
._fieldTypes
:
3204 if type == fieldType
:
3205 selected
= " selected"
3206 vars["fieldTypeOptions"] += """<option value="%s"%s>%s\n""" % (type, selected
, type)
3210 class WConfModifCFA( wcomponents
.WTemplated
):
3212 def __init__( self
, conference
):
3213 self
._conf
= conference
3215 def _getAbstractFieldsHTML(self
, vars):
3216 abMgr
= self
._conf
.getAbstractMgr()
3217 enabledText
= _("Click to disable")
3218 disabledText
= _("Click to enable")
3220 urlAdd
= str(urlHandlers
.UHConfModifCFAAddOptFld
.getURL(self
._conf
))
3221 urlRemove
= str(urlHandlers
.UHConfModifCFARemoveOptFld
.getURL(self
._conf
))
3222 laf
.append("""<form action="%s" method="POST">""" % urlAdd
)
3223 for af
in abMgr
.getAbstractFieldsMgr().getFields():
3224 urlUp
= urlHandlers
.UHConfModifCFAAbsFieldUp
.getURL(self
._conf
)
3225 urlUp
.addParam("fieldId",af
.getId())
3226 urlDown
= urlHandlers
.UHConfModifCFAAbsFieldDown
.getURL(self
._conf
)
3227 urlDown
.addParam("fieldId",af
.getId())
3228 if af
.isMandatory():
3229 mandatoryText
= _("mandatory")
3231 mandatoryText
= _("optional")
3233 if int(af
.getMaxLength()) != 0:
3234 maxCharText
= _("max: %s %s.") % (af
.getMaxLength(), af
.getLimitation())
3236 maxCharText
= _("no limited")
3237 addInfo
= "(%s - %s)" % (mandatoryText
,maxCharText
)
3238 url
=urlHandlers
.UHConfModifCFAOptFld
.getURL(self
._conf
)
3239 url
.addParam("fieldId", af
.getId())
3240 url
=quoteattr("%s#optional"%str
(url
))
3241 urledit
=urlHandlers
.UHConfModifCFAEditOptFld
.getURL(self
._conf
)
3242 urledit
.addParam("fieldId", af
.getId())
3243 urledit
=quoteattr("%s#optional"%str
(urledit
))
3244 if self
._conf
.getAbstractMgr().hasEnabledAbstractField(af
.getId()):
3245 icon
=vars["enablePic"]
3246 textIcon
=enabledText
3248 icon
=vars["disablePic"]
3249 textIcon
=disabledText
3250 if af
.getId() == "content":
3253 removeButton
= "<input type=\"checkbox\" name=\"fieldId\" value=\"%s\">" % af
.getId()
3257 <a href=%s><img src=%s alt="%s" class="imglink"></a> <a href=%s><img src=%s border="0" alt=""></a><a href=%s><img src=%s border="0" alt=""></a>
3259 <td width="1%%">%s</td>
3261 <a href=%s>%s</a> %s
3268 quoteattr(str(urlUp
)),\
3269 quoteattr(str(Config
.getInstance().getSystemIconURL("upArrow"))),\
3270 quoteattr(str(urlDown
)),\
3271 quoteattr(str(Config
.getInstance().getSystemIconURL("downArrow"))),\
3276 laf
.append( i18nformat("""
3278 <td align="right" colspan="3">
3279 <input type="submit" value="_("remove")" onClick="this.form.action='%s';" class="btn">
3280 <input type="submit" value="_("add")" class="btn">
3283 </form>""") % urlRemove
)
3284 laf
.append("</form>")
3287 def getVars( self
):
3288 vars = wcomponents
.WTemplated
.getVars(self
)
3289 abMgr
= self
._conf
.getAbstractMgr()
3291 vars["iconDisabled"] = str(Config
.getInstance().getSystemIconURL( "disabledSection" ))
3292 vars["iconEnabled"] = str(Config
.getInstance().getSystemIconURL( "enabledSection" ))
3294 vars["multipleTracks"] = abMgr
.getMultipleTracks()
3295 vars["areTracksMandatory"] = abMgr
.areTracksMandatory()
3296 vars["canAttachFiles"] = abMgr
.canAttachFiles()
3297 vars["showSelectAsSpeaker"] = abMgr
.showSelectAsSpeaker()
3298 vars["isSelectSpeakerMandatory"] = abMgr
.isSelectSpeakerMandatory()
3299 vars["showAttachedFilesContribList"] = abMgr
.showAttachedFilesContribList()
3301 vars["multipleUrl"] = urlHandlers
.UHConfCFASwitchMultipleTracks
.getURL(self
._conf
)
3302 vars["mandatoryUrl"] = urlHandlers
.UHConfCFAMakeTracksMandatory
.getURL(self
._conf
)
3303 vars["attachUrl"] = urlHandlers
.UHConfCFAAllowAttachFiles
.getURL(self
._conf
)
3304 vars["showSpeakerUrl"] = urlHandlers
.UHConfCFAShowSelectAsSpeaker
.getURL(self
._conf
)
3305 vars["speakerMandatoryUrl"] = urlHandlers
.UHConfCFASelectSpeakerMandatory
.getURL(self
._conf
)
3306 vars["showAttachedFilesUrl"] = urlHandlers
.UHConfCFAAttachedFilesContribList
.getURL(self
._conf
)
3308 vars["setStatusURL"]=urlHandlers
.UHConfCFAChangeStatus
.getURL(self
._conf
)
3309 vars["dataModificationURL"]=urlHandlers
.UHCFADataModification
.getURL(self
._conf
)
3310 vars["addTypeURL"]=urlHandlers
.UHCFAManagementAddType
.getURL(self
._conf
)
3311 vars["removeTypeURL"]=urlHandlers
.UHCFAManagementRemoveType
.getURL(self
._conf
)
3312 if abMgr
.getCFAStatus():
3313 vars["changeTo"] = "False"
3314 vars["status"] = _("ENABLED")
3315 vars["changeStatus"] = _("DISABLE")
3316 vars["startDate"] = format_date(abMgr
.getStartSubmissionDate(), format
='full')
3317 vars["endDate"] = format_date(abMgr
.getEndSubmissionDate(), format
='full')
3318 vars["announcement"] = abMgr
.getAnnouncement()
3319 vars["disabled"] = ""
3320 modifDL
= abMgr
.getModificationDeadline()
3321 vars["modifDL"] = i18nformat("""--_("not specified")--""")
3323 vars["modifDL"] = format_date(modifDL
, format
='full')
3324 vars["notification"] = i18nformat("""
3325 <table align="left">
3327 <td align="right"><b> _("To List"):</b></td>
3328 <td align="left">%s</td>
3331 <td align="right"><b> _("Cc List"):</b></td>
3332 <td align="left">%s</td>
3335 """)%(", ".join(abMgr
.getSubmissionNotification().getToList()) or i18nformat("""--_("no TO list")--"""), ", ".join(abMgr
.getSubmissionNotification().getCCList()) or i18nformat("""--_("no CC list")--"""))
3337 vars["changeTo"] = "True"
3338 vars["status"] = _("DISABLED")
3339 vars["changeStatus"] = _("ENABLE")
3340 vars["startDate"] = ""
3341 vars["endDate"] = ""
3342 vars["announcement"] = ""
3345 vars["disabled"] = "disabled"
3346 vars["modifDL"] = ""
3347 vars["submitters"] = ""
3348 vars["notification"]=""
3349 vars["enablePic"]=quoteattr(str(Config
.getInstance().getSystemIconURL( "enabledSection" )))
3350 vars["disablePic"]=quoteattr(str(Config
.getInstance().getSystemIconURL( "disabledSection" )))
3351 vars["abstractFields"]=self
._getAbstractFieldsHTML
(vars)
3352 vars["addNotifTplURL"]=urlHandlers
.UHAbstractModNotifTplNew
.getURL(self
._conf
)
3353 vars["remNotifTplURL"]=urlHandlers
.UHAbstractModNotifTplRem
.getURL(self
._conf
)
3354 vars["confId"] = self
._conf
.getId()
3355 vars["lateAuthUsers"] = fossilize(self
._conf
.getAbstractMgr().getAuthorizedSubmitterList())
3359 class WPConfModifCFAPreview( WPConferenceModifAbstractBase
):
3361 def _setActiveTab( self
):
3362 self
._tabCFAPreview
.setActive()
3364 def _getTabContent( self
, params
):
3365 import MaKaC
.webinterface
.pages
.abstracts
as abstracts
3366 wc
= abstracts
.WAbstractDataModification( self
._conf
)
3367 # Simulate fake abstract
3368 from MaKaC
.webinterface
.common
.abstractDataWrapper
import AbstractData
3369 ad
= AbstractData(self
._conf
.getAbstractMgr(), {}, 9999)
3370 params
= ad
.toDict()
3371 params
["postURL"] = ""
3372 params
["origin"] = "management"
3373 return wc
.getHTML(params
)
3375 class WPConfModifCFA( WPConferenceModifAbstractBase
):
3377 def _setActiveTab( self
):
3378 self
._tabCFA
.setActive()
3380 def _getTabContent( self
, params
):
3381 wc
= WConfModifCFA( self
._conf
)
3384 class WPConfModifCFAAddField( WPConferenceModifAbstractBase
):
3386 def __init__(self
,rh
,conf
,fieldId
):
3387 WPConferenceModifAbstractBase
.__init
__(self
, rh
, conf
)
3389 self
._fieldId
= fieldId
3391 def _setActiveTab( self
):
3392 self
._tabCFA
.setActive()
3394 def _getTabContent( self
, params
):
3395 wc
= WConfModifCFAAddField( self
._conf
, self
._fieldId
)
3398 class WCFADataModification(wcomponents
.WTemplated
):
3400 def __init__( self
, conf
):
3403 def getVars( self
):
3404 vars = wcomponents
.WTemplated
.getVars(self
)
3405 abMgr
= self
._conf
.getAbstractMgr()
3406 vars["sDay"] = abMgr
.getStartSubmissionDate().day
3407 vars["sMonth"] = abMgr
.getStartSubmissionDate().month
3408 vars["sYear"] = abMgr
.getStartSubmissionDate().year
3410 vars["eDay"] = abMgr
.getEndSubmissionDate().day
3411 vars["eMonth"] = abMgr
.getEndSubmissionDate().month
3412 vars["eYear"] = abMgr
.getEndSubmissionDate().year
3417 if abMgr
.getModificationDeadline():
3418 vars["mDay"] = str(abMgr
.getModificationDeadline().day
)
3419 vars["mMonth"] = str(abMgr
.getModificationDeadline().month
)
3420 vars["mYear"] = str(abMgr
.getModificationDeadline().year
)
3422 vars["announcement"] = abMgr
.getAnnouncement()
3423 vars["toList"] = ", ".join(abMgr
.getSubmissionNotification().getToList())
3424 vars["ccList"] = ", ".join(abMgr
.getSubmissionNotification().getCCList())
3425 vars["postURL" ] = urlHandlers
.UHCFAPerformDataModification
.getURL( self
._conf
)
3428 class WPCFADataModification( WPConferenceModifAbstractBase
):
3430 def _setActiveTab( self
):
3431 self
._tabCFA
.setActive()
3433 def _getTabContent( self
, params
):
3434 p
= WCFADataModification( self
._conf
)
3438 class WConfModifProgram(wcomponents
.WTemplated
):
3440 def __init__( self
, conference
):
3441 self
._conf
= conference
3443 def getVars( self
):
3444 vars = wcomponents
.WTemplated
.getVars(self
)
3445 vars["deleteItemsURL"]=urlHandlers
.UHConfDelTracks
.getURL(self
._conf
)
3446 vars["addTrackURL"]=urlHandlers
.UHConfAddTrack
.getURL( self
._conf
)
3447 vars["conf"] = self
._conf
3451 class WPConfModifProgram( WPConferenceModifBase
):
3453 def _setActiveSideMenuItem( self
):
3454 self
._programMenuItem
.setActive()
3456 def _getPageContent( self
, params
):
3457 wc
= WConfModifProgram( self
._conf
)
3461 class WTrackCreation( wcomponents
.WTemplated
):
3463 def __init__( self
, targetConf
):
3464 self
.__conf
= targetConf
3466 def getVars( self
):
3467 vars = wcomponents
.WTemplated
.getVars(self
)
3468 vars["title"], vars["description"] = "", ""
3469 vars["locator"] = self
.__conf
.getLocator().getWebForm()
3474 class WPConfAddTrack( WPConfModifProgram
):
3476 def _setActiveSideMenuItem(self
):
3477 self
._programMenuItem
.setActive()
3479 def _getPageContent( self
, params
):
3480 p
= WTrackCreation( self
._conf
)
3481 pars
= {"postURL": urlHandlers
.UHConfPerformAddTrack
.getURL() }
3482 return p
.getHTML( pars
)
3484 class WFilterCriteriaAbstracts(wcomponents
.WFilterCriteria
):
3486 Draws the options for a filter criteria object
3487 This means rendering the actual table that contains
3488 all the HTML for the several criteria
3491 def __init__(self
, options
, filterCrit
, extraInfo
=""):
3492 wcomponents
.WFilterCriteria
.__init
__(self
, options
, filterCrit
, extraInfo
)
3494 def _drawFieldOptions(self
, id, data
):
3495 page
= WFilterCriterionOptionsAbstracts(id, data
)
3497 # TODO: remove when we have a better template system
3498 return page
.getHTML()
3500 class WFilterCriterionOptionsAbstracts(wcomponents
.WTemplated
):
3502 def __init__(self
, id, data
):
3508 vars = wcomponents
.WTemplated
.getVars( self
)
3510 vars["id"] = self
._id
3511 vars["title"] = self
._data
["title"]
3512 vars["options"] = self
._data
["options"]
3513 vars["selectFunc"] = self
._data
.get("selectFunc", True)
3517 class WAbstracts( wcomponents
.WTemplated
):
3520 COLUMNS
= ["ID", "Title", "PrimaryAuthor", "Tracks", "Type", "Status", "Rating", "AccTrack", "AccType", "SubmissionDate", "ModificationDate"]
3522 def __init__( self
, conference
, filterCrit
, sortingCrit
, order
, display
, filterUsed
):
3523 self
._conf
= conference
3524 self
._filterCrit
= filterCrit
3525 self
._sortingCrit
= sortingCrit
3527 self
._display
= display
3528 self
._filterUsed
= filterUsed
3530 def _getURL( self
, sortingField
, column
):
3531 url
= urlHandlers
.UHConfAbstractManagment
.getURL(self
._conf
)
3532 url
.addParam("sortBy", column
)
3533 if sortingField
and sortingField
.getId() == column
:
3534 if self
._order
== "down":
3535 url
.addParam("order","up")
3536 elif self
._order
== "up":
3537 url
.addParam("order","down")
3541 def _getTrackFilterItemList( self
):
3543 field
=self
._filterCrit
.getField("track")
3544 if field
is not None and field
.getShowNoValue():
3545 checked
= " checked"
3546 l
= [ i18nformat("""<input type="checkbox" name="trackShowNoValue"%s> --_("not specified")--""")%checked
]
3547 for t
in self
._conf
.getTrackList():
3549 if field
is not None and t
.getId() in field
.getValues():
3550 checked
= " checked"
3551 l
.append( """<input type="checkbox" name="track" value=%s%s> (%s) %s\n"""%(quoteattr(t
.getId()),checked
,self
.htmlText(t
.getCode()),self
.htmlText(t
.getTitle())))
3554 def _getContribTypeFilterItemList( self
):
3556 field
=self
._filterCrit
.getField("type")
3557 if field
is not None and field
.getShowNoValue():
3558 checked
= " checked"
3559 l
= [ i18nformat("""<input type="checkbox" name="typeShowNoValue"%s> --_("not specified")--""")%checked
]
3560 for contribType
in self
._conf
.getContribTypeList():
3562 if field
is not None and contribType
in field
.getValues():
3563 checked
= " checked"
3564 l
.append( """<input type="checkbox" name="type" value=%s%s> %s"""%(quoteattr(contribType
.getId()), checked
, self
.htmlText(contribType
.getName())) )
3567 def _getAccTrackFilterItemList( self
):
3569 field
=self
._filterCrit
.getField("acc_track")
3570 if field
is not None and field
.getShowNoValue():
3571 checked
= " checked"
3572 l
= [ i18nformat("""<input type="checkbox" name="accTrackShowNoValue"%s> --_("not specified")--""")%checked
]
3573 for t
in self
._conf
.getTrackList():
3575 if field
is not None and t
.getId() in field
.getValues():
3577 l
.append("""<input type="checkbox" name="acc_track" value=%s%s> (%s) %s"""%(quoteattr(t
.getId()),checked
,self
.htmlText(t
.getCode()),self
.htmlText(t
.getTitle())))
3580 def _getAccContribTypeFilterItemList( self
):
3582 field
=self
._filterCrit
.getField("acc_type")
3583 if field
is not None and field
.getShowNoValue():
3584 checked
= " checked"
3585 l
= [ i18nformat("""<input type="checkbox" name="accTypeShowNoValue"%s> --_("not specified")--""")%checked
]
3586 for contribType
in self
._conf
.getContribTypeList():
3588 if field
is not None and contribType
in field
.getValues():
3589 checked
= " checked"
3590 l
.append( """<input type="checkbox" name="acc_type" value=%s%s> %s"""%(quoteattr(contribType
.getId()),checked
,self
.htmlText(contribType
.getName())))
3593 def _getStatusFilterItemList( self
):
3595 for status
in AbstractStatusList
.getInstance().getStatusList():
3597 statusId
= AbstractStatusList
.getInstance().getId( status
)
3598 statusCaption
= AbstractStatusList
.getInstance().getCaption( status
)
3599 statusCode
=AbstractStatusList
.getInstance().getCode(status
)
3600 statusIconURL
= AbstractStatusList
.getInstance().getIconURL( status
)
3601 field
=self
._filterCrit
.getField("status")
3602 if field
is not None and statusId
in field
.getValues():
3604 imgHTML
= """<img src=%s border="0" alt="">"""%(quoteattr(str(statusIconURL
)))
3605 l
.append( """<input type="checkbox" name="status" value=%s%s>%s (%s) %s"""%(quoteattr(statusId
),checked
,imgHTML
,self
.htmlText(statusCode
),self
.htmlText(statusCaption
)))
3608 def _getOthersFilterItemList( self
):
3609 checkedShowMultiple
, checkedShowComments
= "", ""
3610 track_field
=self
._filterCrit
.getField("track")
3611 if track_field
is not None and track_field
.onlyMultiple():
3612 checkedShowMultiple
= " checked"
3613 if self
._filterCrit
.getField("comment") is not None:
3614 checkedShowComments
= " checked"
3615 l
= [ i18nformat("""<input type="checkbox" name="trackShowMultiple"%s> _("only multiple tracks")""")%checkedShowMultiple
,
3616 i18nformat("""<input type="checkbox" name="comment"%s> _("only with comments")""")%checkedShowComments
]
3619 def _getFilterMenu(self
):
3622 ('Tracks', {"title": _("tracks"),
3623 "options": self
._getTrackFilterItemList
()}),
3624 ('Types', {"title": _("types"),
3625 "options": self
._getContribTypeFilterItemList
()}),
3626 ('Status', {"title": _("status"),
3627 "options": self
._getStatusFilterItemList
()}),
3628 ('AccTracks', {"title": _("(proposed to be) accepted for tracks"),
3629 "options": self
._getAccTrackFilterItemList
()}),
3630 ('AccTypes', {"title": _("(proposed to be) accepted for types"),
3631 "options": self
._getAccContribTypeFilterItemList
()}),
3632 ('Others', {"title": _("others"),
3633 "selectFunc": False,
3634 "options": self
._getOthersFilterItemList
()})
3638 if self
._conf
.getRegistrationForm().getStatusesList():
3639 extraInfo
= i18nformat("""<table align="center" cellspacing="10" width="100%%">
3641 <td colspan="5" class="titleCellFormat"> _("Author search") <input type="text" name="authSearch" value=%s></td>
3644 """)%(quoteattr(str(self
._authSearch
)))
3646 p
= WFilterCriteriaAbstracts(options
, None, extraInfo
)
3651 def _getColumnTitlesDict(self
):
3653 Dictionary with the translation from "ids" to "name to display" for each of the options you can choose for the display.
3654 This method complements the method "_setDispOpts" in which we get a dictonary with "ids".
3656 if not hasattr(self
, "_columns"):
3657 self
._columns
= {"ID": "ID","Title": "Title", "PrimaryAuthor": "Primary Author", "Tracks": "Tracks", "Type": "Type", "Status":"Status", \
3658 "Rating":" Rating", "AccTrack": "Acc. Track", "AccType": "Acc. Type", "SubmissionDate": "Submission Date", "ModificationDate": "Modification Date"}
3659 return self
._columns
3661 def _getDisplay(self
):
3663 These are the 'display' options selected by the user. In case no options were selected we add some of them by default.
3665 display
= self
._display
[:]
3668 display
= self
.COLUMNS
3671 def _getAccType(self
, abstract
):
3672 status
= abstract
.getCurrentStatus()
3673 if isinstance(status
,(review
.AbstractStatusAccepted
, review
.AbstractStatusProposedToAccept
)) and status
.getType() is not None:
3674 return self
.htmlText(status
.getType().getName())
3677 def _getAccTrack(self
, abstract
):
3678 status
= abstract
.getCurrentStatus()
3679 if isinstance(status
,(review
.AbstractStatusAccepted
, review
.AbstractStatusProposedToAccept
)) and status
.getTrack() is not None:
3680 return self
.htmlText(status
.getTrack().getCode())
3683 def getVars( self
):
3684 vars = wcomponents
.WTemplated
.getVars(self
)
3685 vars["abstractSelectionAction"]=quoteattr(str(urlHandlers
.UHAbstractConfSelectionAction
.getURL(self
._conf
)))
3686 vars["confId"] = self
._conf
.getId()
3687 self
._authSearch
=vars.get("authSearch","")
3689 vars["filterMenu"] = self
._getFilterMenu
()
3692 if self
._sortingCrit
is not None:
3693 sortingField
=self
._sortingCrit
.getField()
3695 vars["sortingField"] = sortingField
.getId()
3696 vars["order"] = self
._order
3697 vars["downArrow"] = Config
.getInstance().getSystemIconURL("downArrow")
3698 vars["upArrow"] = Config
.getInstance().getSystemIconURL("upArrow")
3699 vars["getSortingURL"] = lambda column
: self
._getURL
(sortingField
, column
)
3700 vars["getAccType"] = lambda abstract
: self
._getAccType
(abstract
)
3701 vars["getAccTrack"] = lambda abstract
: self
._getAccTrack
(abstract
)
3703 f
= filters
.SimpleFilter( self
._filterCrit
, self
._sortingCrit
)
3704 abstractList
=f
.apply(self
._conf
.getAbstractMgr().getAbstractsMatchingAuth(self
._authSearch
))
3705 if self
._order
=="up":
3706 abstractList
.reverse()
3707 vars["abstracts"] = abstractList
3709 vars["totalNumberAbstracts"] = str(len(self
._conf
.getAbstractMgr().getAbstractList()))
3710 vars["filteredNumberAbstracts"] = str(len(abstractList
))
3711 vars["filterUsed"] = self
._filterUsed
3712 vars["accessAbstract"] = quoteattr(str(urlHandlers
.UHAbstractDirectAccess
.getURL(self
._conf
)))
3714 url
= urlHandlers
.UHConfAbstractManagment
.getURL(self
._conf
)
3715 url
.setSegment( "results" )
3716 vars["filterPostURL"] = quoteattr(str(url
))
3717 vars["excelIconURL"]=quoteattr(str(Config
.getInstance().getSystemIconURL("excel")))
3718 vars["pdfIconURL"]=quoteattr(str(Config
.getInstance().getSystemIconURL("pdf")))
3719 vars["xmlIconURL"]=quoteattr(str(Config
.getInstance().getSystemIconURL("xml")))
3720 vars["displayColumns"] = self
._getDisplay
()
3721 vars["columnsDict"] = self
._getColumnTitlesDict
()
3722 vars["columns"] = self
.COLUMNS
3726 class WPConfAbstractList( WPConferenceModifAbstractBase
):
3728 def __init__(self
, rh
, conf
, msg
, filterUsed
= False ):
3730 self
._filterUsed
= filterUsed
3731 WPConferenceModifAbstractBase
.__init
__(self
, rh
, conf
)
3733 def _getTabContent( self
, params
):
3734 order
= params
.get("order","down")
3735 wc
= WAbstracts( self
._conf
, params
.get("filterCrit", None ),
3736 params
.get("sortingCrit", None),
3738 params
.get("display",None),
3740 p
= {"authSearch":params
.get("authSearch","")}
3741 return wc
.getHTML( p
)
3743 def _setActiveTab(self
):
3744 self
._tabAbstractList
.setActive()
3747 class WPModNewAbstract(WPConfAbstractList
):
3749 def __init__(self
, rh
, conf
, abstractData
):
3750 WPConfAbstractList
.__init
__(self
, rh
, conf
, "")
3752 def _getTabContent(self
, params
):
3753 from MaKaC
.webinterface
.pages
.abstracts
import WAbstractDataModification
3754 params
["postURL"] = urlHandlers
.UHConfModNewAbstract
.getURL(self
._conf
)
3755 params
["origin"] = "management"
3756 wc
= WAbstractDataModification(self
._conf
)
3757 return wc
.getHTML(params
)
3760 class WConfModAbstractsMerge(wcomponents
.WTemplated
):
3762 def __init__(self
,conf
):
3766 vars=wcomponents
.WTemplated
.getVars(self
)
3767 vars["postURL"]=quoteattr(str(urlHandlers
.UHConfModAbstractsMerge
.getURL(self
._conf
)))
3768 vars["selAbstracts"]=",".join(vars.get("absIdList",[]))
3769 vars["targetAbs"]=quoteattr(str(vars.get("targetAbsId","")))
3770 vars["inclAuthChecked"]=""
3771 if vars.get("inclAuth",False):
3772 vars["inclAuthChecked"]=" checked"
3773 vars["comments"]=self
.htmlText(vars.get("comments",""))
3774 vars["notifyChecked"]=""
3775 if vars.get("notify",False):
3776 vars["notifyChecked"]=" checked"
3780 class WPModMergeAbstracts(WPConfAbstractList
):
3782 def __init__(self
, rh
, conf
):
3783 WPConfAbstractList
.__init
__(self
, rh
, conf
, "")
3785 def _getTabContent(self
, params
):
3786 wc
= WConfModAbstractsMerge(self
._conf
)
3787 p
= {"absIdList": params
.get("absIdList", []),
3788 "targetAbsId": params
.get("targetAbsId", ""),
3789 "inclAuth": params
.get("inclAuth", False),
3790 "comments": params
.get("comments", ""),
3791 "notify": params
.get("notify", True),
3793 return wc
.getHTML(p
)
3797 class WPConfModifDisplayBase( WPConferenceModifBase
):
3799 def _createTabCtrl( self
):
3801 self
._tabCtrl
= wcomponents
.TabControl()
3803 self
._tabDisplayCustomization
= self
._tabCtrl
.newTab( "dispCustomization", _("Layout customization"), \
3804 urlHandlers
.UHConfModifDisplayCustomization
.getURL( self
._conf
) )
3805 self
._tabDisplayConfHeader
= self
._tabCtrl
.newTab( "displConfHeader", _("Conference header"), \
3806 urlHandlers
.UHConfModifDisplayConfHeader
.getURL( self
._conf
) )
3807 self
._tabDisplayMenu
= self
._tabCtrl
.newTab( "dispMenu", _("Menu"), \
3808 urlHandlers
.UHConfModifDisplayMenu
.getURL( self
._conf
) )
3809 self
._tabDisplayResources
= self
._tabCtrl
.newTab( "dispResources", _("Images"), \
3810 urlHandlers
.UHConfModifDisplayResources
.getURL( self
._conf
) )
3812 self
._setActiveTab
()
3814 def _getPageContent( self
, params
):
3815 self
._createTabCtrl
()
3817 html
= wcomponents
.WTabControl( self
._tabCtrl
, self
._getAW
() ).getHTML( self
._getTabContent
( params
) )
3820 def _getTabContent( self
):
3823 def _setActiveSideMenuItem( self
):
3824 self
._layoutMenuItem
.setActive()
3826 class WPConfModifDisplayCustomization( WPConfModifDisplayBase
):
3828 def __init__(self
, rh
, conf
):
3829 WPConfModifDisplayBase
.__init
__(self
, rh
, conf
)
3831 def _getTabContent( self
, params
):
3832 wc
= WConfModifDisplayCustom( self
._conf
)
3835 def _setActiveTab( self
):
3836 self
._tabDisplayCustomization
.setActive()
3838 class WConfModifDisplayCustom(wcomponents
.WTemplated
):
3840 def __init__(self
, conf
):
3842 dm
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
)
3843 self
._format
= dm
.getFormat()
3846 vars = wcomponents
.WTemplated
.getVars(self
)
3847 vars["conf"]=self
._conf
3848 vars["saveLogo"]=urlHandlers
.UHSaveLogo
.getURL(self
._conf
)
3850 if self
._conf
.getLogo():
3851 vars["logoURL"] = urlHandlers
.UHConferenceLogo
.getURL( self
._conf
)
3853 vars["formatTitleTextColor"] = WFormatColorOptionModif("titleTextColor", self
._format
, self
._conf
, 3).getHTML()
3854 vars["formatTitleBgColor"] = WFormatColorOptionModif("titleBgColor", self
._format
, self
._conf
, 4).getHTML()
3856 #indico-style "checkboxes"
3857 enabledText
= _("Click to disable")
3858 disabledText
= _("Click to enable")
3860 # Set up the logo of the conference
3861 vars["logoIconURL"] = Config
.getInstance().getSystemIconURL("logo")
3863 vars["logo"] = """<img heigth=\"95\" width=\"150\" src="%s" alt="%s" border="0">"""%(vars["logoURL"], self
._conf
.getTitle())
3864 vars["removeLogo"] = i18nformat("""<form action=%s method="POST"><input type="submit" class="btn" value="_("remove")"></form>""")%quoteattr(str(urlHandlers
.UHRemoveLogo
.getURL(self
._conf
)))
3866 vars["logo"] = "<em>No logo has been saved for this conference</em>"
3867 vars["removeLogo"] = ""
3871 vars["saveCSS"]=urlHandlers
.UHSaveCSS
.getURL(self
._conf
)
3872 sm
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
).getStyleManager()
3873 if sm
.getLocalCSS():
3874 vars["cssDownload"] = sm
.getCSS().getURL()
3877 vars["cssDownload"] = ""
3878 vars["removeCSS"] = str(urlHandlers
.UHRemoveCSS
.getURL(self
._conf
))
3879 vars["previewURL"]= urlHandlers
.UHConfModifPreviewCSS
.getURL(self
._conf
)
3883 vars["currentCSSFileName"] = sm
.getCSS().getFileName()
3885 vars["currentCSSFileName"] = ""
3888 class WPConfModifDisplayMenu( WPConfModifDisplayBase
):
3890 def __init__(self
, rh
, conf
, linkId
):
3891 WPConfModifDisplayBase
.__init
__(self
, rh
, conf
)
3892 self
._linkId
= linkId
3894 def _getTabContent( self
, params
):
3895 wc
= WConfModifDisplayMenu( self
._conf
, self
._linkId
)
3898 def _setActiveTab( self
):
3899 self
._tabDisplayMenu
.setActive()
3901 class WConfModifDisplayMenu(wcomponents
.WTemplated
):
3903 def __init__(self
, conf
, linkId
):
3905 dm
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
)
3906 self
._menu
= dm
.getMenu()
3907 self
._link
= self
._menu
.getLinkById(linkId
)
3910 vars = wcomponents
.WTemplated
.getVars(self
)
3911 vars["addLinkURL"]=quoteattr(str(urlHandlers
.UHConfModifDisplayAddLink
.getURL(self
._conf
)))
3912 vars["addPageURL"]=quoteattr(str(urlHandlers
.UHConfModifDisplayAddPage
.getURL(self
._conf
)))
3913 vars["addSpacerURL"]=quoteattr(str(urlHandlers
.UHConfModifDisplayAddSpacer
.getURL(self
._conf
)))
3914 vars["menuDisplay"] = ConfEditMenu(self
._menu
, urlHandlers
.UHConfModifDisplayMenu
.getURL
).getHTML()
3915 vars["confId"] = self
._conf
.getId()
3917 if isinstance(self
._link
, displayMgr
.SystemLink
):
3919 "dataModificationURL": quoteattr(str(urlHandlers
.UHConfModifDisplayModifySystemData
.getURL(self
._link
))), \
3920 "moveUpURL": quoteattr(str(urlHandlers
.UHConfModifDisplayUpLink
.getURL(self
._link
))), \
3921 "imageUpURL": quoteattr(str(Config
.getInstance().getSystemIconURL("upArrow"))), \
3922 "moveDownURL": quoteattr(str(urlHandlers
.UHConfModifDisplayDownLink
.getURL(self
._link
))), \
3923 "imageDownURL": quoteattr(str(Config
.getInstance().getSystemIconURL("downArrow")))
3925 vars["linkEdition"] = WSystemLinkModif(self
._link
).getHTML(p
)
3926 elif isinstance(self
._link
, displayMgr
.Spacer
):
3928 "removeLinkURL": quoteattr(str(urlHandlers
.UHConfModifDisplayRemoveLink
.getURL(self
._link
))), \
3929 "toggleLinkStatusURL": quoteattr(str(urlHandlers
.UHConfModifDisplayToggleLinkStatus
.getURL(self
._link
))), \
3930 "moveUpURL": quoteattr(str(urlHandlers
.UHConfModifDisplayUpLink
.getURL(self
._link
))), \
3931 "imageUpURL": quoteattr(str(Config
.getInstance().getSystemIconURL("upArrow"))), \
3932 "moveDownURL": quoteattr(str(urlHandlers
.UHConfModifDisplayDownLink
.getURL(self
._link
))), \
3933 "imageDownURL": quoteattr(str(Config
.getInstance().getSystemIconURL("downArrow")))
3935 vars["linkEdition"] = WSpacerModif(self
._link
).getHTML(p
)
3936 elif isinstance(self
._link
, displayMgr
.ExternLink
):
3938 "dataModificationURL": quoteattr(str(urlHandlers
.UHConfModifDisplayModifyData
.getURL(self
._link
))), \
3939 "removeLinkURL": quoteattr(str(urlHandlers
.UHConfModifDisplayRemoveLink
.getURL(self
._link
))), \
3940 "addSubLinkURL": quoteattr(str(urlHandlers
.UHConfModifDisplayAddLink
.getURL(self
._link
))), \
3941 "toggleLinkStatusURL": quoteattr(str(urlHandlers
.UHConfModifDisplayToggleLinkStatus
.getURL(self
._link
))), \
3942 "moveUpURL": quoteattr(str(urlHandlers
.UHConfModifDisplayUpLink
.getURL(self
._link
))), \
3943 "imageUpURL": quoteattr(str(Config
.getInstance().getSystemIconURL("upArrow"))), \
3944 "moveDownURL": quoteattr(str(urlHandlers
.UHConfModifDisplayDownLink
.getURL(self
._link
))), \
3945 "imageDownURL": quoteattr(str(Config
.getInstance().getSystemIconURL("downArrow"))) }
3946 vars["linkEdition"] = WLinkModif(self
._link
).getHTML(p
)
3949 "dataModificationURL": quoteattr(str(urlHandlers
.UHConfModifDisplayModifyData
.getURL(self
._link
))), \
3950 "removeLinkURL": quoteattr(str(urlHandlers
.UHConfModifDisplayRemoveLink
.getURL(self
._link
))), \
3951 "toggleLinkStatusURL": quoteattr(str(urlHandlers
.UHConfModifDisplayToggleLinkStatus
.getURL(self
._link
))), \
3952 "toggleHomePageURL": quoteattr(str(urlHandlers
.UHConfModifDisplayToggleHomePage
.getURL(self
._link
))), \
3953 "moveUpURL": quoteattr(str(urlHandlers
.UHConfModifDisplayUpLink
.getURL(self
._link
))), \
3954 "imageUpURL": quoteattr(str(Config
.getInstance().getSystemIconURL("upArrow"))), \
3955 "moveDownURL": quoteattr(str(urlHandlers
.UHConfModifDisplayDownLink
.getURL(self
._link
))), \
3956 "imageDownURL": quoteattr(str(Config
.getInstance().getSystemIconURL("downArrow"))) }
3957 vars["linkEdition"] = WPageLinkModif(self
._link
).getHTML(p
)
3959 vars["linkEdition"] = i18nformat("""<center><b> _("Click on an item of the menu to edit it")</b></center>""")
3963 class WPConfModifDisplayResources( WPConfModifDisplayBase
):
3965 def __init__(self
, rh
, conf
):
3966 WPConfModifDisplayBase
.__init
__(self
, rh
, conf
)
3968 def _getTabContent( self
, params
):
3969 wc
= WConfModifDisplayResources( self
._conf
)
3972 def _setActiveTab( self
):
3973 self
._tabDisplayResources
.setActive()
3975 class WConfModifDisplayResources(wcomponents
.WTemplated
):
3977 def __init__(self
, conf
):
3981 vars = wcomponents
.WTemplated
.getVars(self
)
3982 vars["savePic"]=urlHandlers
.UHSavePic
.getURL(self
._conf
)
3983 #creating picture items for each saved picture
3984 vars["picsList"] = []
3985 im
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
).getImagesManager()
3986 for pic
in im
.getPicList().values():
3987 vars["picsList"].append({"id":pic
.getId(),
3988 "picURL": str(urlHandlers
.UHConferencePic
.getURL(pic
))})
3991 class WPConfModifDisplayConfHeader( WPConfModifDisplayBase
):
3993 def __init__(self
, rh
, conf
, optionalParams
={}):
3994 WPConfModifDisplayBase
.__init
__(self
, rh
, conf
)
3995 self
._optionalParams
=optionalParams
3997 def _getTabContent( self
, params
):
3998 wc
= WConfModifDisplayConfHeader( self
._conf
)
3999 return wc
.getHTML(self
._optionalParams
)
4001 def _setActiveTab( self
):
4002 self
._tabDisplayConfHeader
.setActive()
4004 class WConfModifDisplayConfHeader(wcomponents
.WTemplated
):
4006 def __init__(self
, conf
):
4008 dm
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
)
4009 self
._tickerTape
=dm
.getTickerTape()
4010 self
._searchEnabled
= dm
.getSearchEnabled()
4013 vars = wcomponents
.WTemplated
.getVars(self
)
4015 #indico-style "checkboxes"
4016 vars["enablePic"]=quoteattr(str(Config
.getInstance().getSystemIconURL( "enabledSection" )))
4017 vars["disablePic"]=quoteattr(str(Config
.getInstance().getSystemIconURL( "disabledSection" )))
4018 enabledText
= _("Click to disable")
4019 disabledText
= _("Click to enable")
4021 # ------ Ticker Tape: ------
4023 vars["tickertapeURL"]=quoteattr(str(urlHandlers
.UHTickerTapeAction
.getURL(self
._conf
)))
4024 status
= _("DISABLED")
4025 btnLabel
= _("Enable")
4026 statusColor
= "#612828"
4027 if self
._tickerTape
.isSimpleTextEnabled():
4028 statusColor
= "#286135"
4029 status
= _("ENABLED")
4030 btnLabel
= _("Disable")
4031 vars["status"]= """<span style="color: %s;">%s</span>""" %(statusColor
,status
)
4032 vars["statusBtn"]=btnLabel
4034 urlNP
=urlHandlers
.UHTickerTapeAction
.getURL(self
._conf
)
4035 urlNP
.addParam("nowHappening", "action")
4036 if self
._tickerTape
.isNowHappeningEnabled():
4037 vars["nowHappeningIcon"]=vars["enablePic"]
4038 vars["nowHappeningTextIcon"]=enabledText
4040 vars["nowHappeningIcon"]=vars["disablePic"]
4041 vars["nowHappeningTextIcon"]=disabledText
4042 vars["nowHappeningURL"]=quoteattr("%s#tickerTape"%str
(urlNP
))
4044 urlST
=urlHandlers
.UHTickerTapeAction
.getURL(self
._conf
)
4045 urlST
.addParam("simpleText", "action")
4046 vars["simpleTextURL"]=quoteattr("%s#tickerTape"%urlST
)
4048 vars["text"]=quoteattr(self
._tickerTape
.getText())
4049 if not vars.has_key("modifiedText"):
4050 vars["modifiedText"]=""
4052 vars["modifiedText"]= i18nformat("""<font color="green"> _("(text saved)")</font>""")
4054 #enable or disable the contribution search feature
4055 urlSB
=urlHandlers
.UHConfModifToggleSearch
.getURL(self
._conf
)
4056 if self
._searchEnabled
:
4057 vars["searchBoxIcon"]=vars["enablePic"]
4058 vars["searchBoxTextIcon"]=enabledText
4060 vars["searchBoxIcon"]=vars["disablePic"]
4061 vars["searchBoxTextIcon"]=disabledText
4062 vars["searchBoxURL"]=quoteattr(str(urlSB
))
4064 #enable or disable navigation icons
4065 vars["confType"] = self
._conf
.getType()
4066 urlSB
=urlHandlers
.UHConfModifToggleNavigationBar
.getURL(self
._conf
)
4067 if displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
).getDisplayNavigationBar():
4068 vars["navigationBoxIcon"]=vars["enablePic"]
4069 vars["navigationBoxTextIcon"]=enabledText
4071 vars["navigationBoxIcon"]=vars["disablePic"]
4072 vars["navigationBoxTextIcon"]=disabledText
4073 vars["navigationBoxURL"]=quoteattr(str(urlSB
))
4077 class WFormatColorOptionModif(wcomponents
.WTemplated
):
4079 def __init__(self
, formatOption
, format
, conf
, formId
=4):
4080 self
._formatOption
= formatOption
4081 self
._format
= format
4084 # The form number on the page... used for the color picker
4085 self
._formId
= formId
4088 vars = wcomponents
.WTemplated
.getVars(self
)
4089 value
= self
._format
.getFormatOption(self
._formatOption
)
4091 urlChangeColor
= value
["url"].getURL(self
._conf
)
4092 urlChangeColor
.addParam("formatOption",self
._formatOption
)
4094 vars["changeColorURL"] = str(urlChangeColor
)
4095 vars["colorCode"] = value
["code"]
4096 vars["formatOption"] = self
._formatOption
4102 def __init__(self
, menu
, modifURLGen
=None):
4104 self
._linkModifHandler
= modifURLGen
4108 for link
in self
._menu
.getLinkList():
4109 html
.append(self
._getLinkHTML
(link
))
4110 html
.append("</table>")
4111 return "".join(html
)
4113 def _getLinkHTML(self
, link
, indent
=""):
4114 if self
._menu
.linkHasToBeDisplayed(link
):
4115 disabled
= i18nformat("""<font size="-1" color="red"> _("(disabled)")</font>""")
4116 if link
.isEnabled():
4118 if link
.getType() == "spacer":
4119 html
= """<tr><td></td><td nowrap><a href="%s">[%s]</a>%s</td></tr>\n"""%(self
._linkModifHandler
(link
), link
.getName(), disabled
)
4121 system
= "<font size=-1>E </font>"
4123 if isinstance(link
, displayMgr
.SystemLink
):
4124 system
= "<font size=-1 color=\"green\">S </font>"
4125 if isinstance(link
, displayMgr
.PageLink
):
4126 if link
.getPage().isHome():
4127 home
= " <font size=-1 color=\"green\">(home)</font>"
4128 system
= "<font size=-1 color=\"black\">P </font>"
4129 html
= ["""<tr><td>%s</td><td nowrap>%s<a href="%s">%s</a>%s%s</td></tr>\n"""%(system
, indent
, self
._linkModifHandler
(link
), escape(link
.getCaption()), disabled
, home
)]
4130 for l
in link
.getLinkList():
4131 html
.append( self
._getLinkHTML
(l
, "%s%s"%(indent
,self
._menu
.getIndent())))
4132 return "".join(html
)
4136 class WLinkModif(wcomponents
.WTemplated
):
4137 def __init__(self
, link
):
4141 vars = wcomponents
.WTemplated
.getVars(self
)
4143 vars["linkName"] = self
._link
.getCaption()
4144 vars["linkURL"] = self
._link
.getURL()
4145 vars["displayTarget"] = _("Display in the SAME window")
4146 if self
._link
.getDisplayTarget() == "_blank":
4147 vars["displayTarget"] = _("Display in a NEW window")
4148 if self
._link
.isEnabled():
4149 vars["linkStatus"] = _("Activated")
4150 vars["changeStatusTo"] = _("Disable")
4152 vars["linkStatus"] = _("Disabled")
4153 vars["changeStatusTo"] = _("Activate")
4157 class WPageLinkModif(wcomponents
.WTemplated
):
4159 def __init__(self
, link
):
4163 vars = wcomponents
.WTemplated
.getVars(self
)
4165 vars["linkName"] = self
._link
.getCaption()
4166 vars["linkContent"] = self
.htmlText("%s..."%self
._link
.getPage().getContent()[0:50])
4167 vars["displayTarget"] = _("Display in the SAME window")
4168 if self
._link
.getDisplayTarget() == "_blank":
4169 vars["displayTarget"] = _("Display in a NEW window")
4170 if self
._link
.isEnabled():
4171 vars["linkStatus"] = _("Activated")
4172 vars["changeStatusTo"] = _("Disable")
4174 vars["linkStatus"] = _("Disabled")
4175 vars["changeStatusTo"] = _("Activate")
4176 if self
._link
.getPage().isHome():
4177 vars["homeText"] = _("Default conference home page")
4178 vars["changeHomeTo"] = _("Normal page")
4180 vars["homeText"] = _("Normal page")
4181 vars["changeHomeTo"] = _("Default conference home page")
4184 class WSystemLinkModif(wcomponents
.WTemplated
):
4186 def __init__(self
, link
):
4190 vars = wcomponents
.WTemplated
.getVars(self
)
4191 vars["linkName"] = self
._link
.getCaption()
4192 vars["linkURL"] = self
._link
.getURL()
4193 vars["linkStatus"] = _("Disabled")
4194 vars["changeStatusTo"] = _("Activate")
4195 if self
._link
.isEnabled():
4196 vars["linkStatus"] = _("Activated")
4197 vars["changeStatusTo"] = _("Disable")
4198 url
=urlHandlers
.UHConfModifDisplayToggleLinkStatus
.getURL(self
._link
)
4199 vars["toggleLinkStatusURL"]=quoteattr(str(url
))
4203 class WSpacerModif(wcomponents
.WTemplated
):
4204 def __init__(self
, link
):
4208 vars = wcomponents
.WTemplated
.getVars(self
)
4209 vars["linkName"] = self
._link
.getName()
4210 if self
._link
.isEnabled():
4211 vars["linkStatus"] = _("Activated")
4212 vars["changeStatusTo"] = _("Disable")
4214 vars["linkStatus"] = _("Disabled")
4215 vars["changeStatusTo"] = _("Activate")
4218 class WPConfModifDisplayAddPage( WPConfModifDisplayBase
):
4220 def __init__(self
, rh
, conf
, linkId
):
4221 WPConfModifDisplayBase
.__init
__(self
, rh
, conf
)
4222 self
._linkId
= linkId
4223 self
._menu
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
).getMenu()
4225 self
._link
= self
._menu
.getLinkById(linkId
)
4227 self
._link
= self
._menu
4229 def _setActiveTab( self
):
4230 self
._tabDisplayMenu
.setActive()
4232 def _getTabContent( self
, params
):
4233 return WConfModifDisplayAddPage( self
._conf
, self
._linkId
).getHTML()
4236 class WConfModifDisplayAddPage(wcomponents
.WTemplated
):
4238 def __init__(self
, conf
, linkId
):
4240 self
._menu
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
).getMenu()
4242 self
._link
= self
._menu
.getLinkById(linkId
)
4244 self
._link
= self
._menu
4247 vars = wcomponents
.WTemplated
.getVars(self
)
4248 vars["saveLinkURL"] = quoteattr(str(urlHandlers
.UHConfModifDisplayAddPage
.getURL(self
._link
)))
4252 class WPConfModifDisplayAddLink( WPConfModifDisplayBase
):
4253 def __init__(self
, rh
, conf
, linkId
):
4254 WPConfModifDisplayBase
.__init
__(self
, rh
, conf
)
4255 self
._linkId
= linkId
4256 self
._menu
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
).getMenu()
4258 self
._link
= self
._menu
.getLinkById(linkId
)
4260 self
._link
= self
._menu
4262 def _setActiveTab( self
):
4263 self
._tabDisplayMenu
.setActive()
4265 def _getTabContent( self
, params
):
4266 wc
= WConfModifDisplayAddLink( self
._conf
, self
._linkId
)
4267 p
= {"addLinkURL": quoteattr(str(urlHandlers
.UHConfModifDisplayAddLink
.getURL(self
._conf
))), \
4268 "addPageURL": quoteattr(str(urlHandlers
.UHConfModifDisplayAddPage
.getURL(self
._conf
))), \
4269 "addSpacerURL": quoteattr(str(urlHandlers
.UHConfModifDisplayAddSpacer
.getURL(self
._conf
))) }
4270 return wc
.getHTML( p
)
4273 class WConfModifDisplayAddLink(wcomponents
.WTemplated
):
4275 def __init__(self
, conf
, linkId
):
4277 self
._menu
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
).getMenu()
4279 self
._link
= self
._menu
.getLinkById(linkId
)
4281 self
._link
= self
._menu
4284 vars = wcomponents
.WTemplated
.getVars(self
)
4285 vars["menuDisplay"] = ConfEditMenu(self
._menu
, urlHandlers
.UHConfModifDisplay
.getURL
).getHTML()
4286 vars["saveLinkURL"] = quoteattr(str(urlHandlers
.UHConfModifDisplayAddLink
.getURL(self
._link
)))
4290 class WPConfModifDisplayModifyData( WPConfModifDisplayBase
):
4291 def __init__(self
, rh
, conf
, link
):
4292 WPConfModifDisplayBase
.__init
__(self
, rh
, conf
)
4294 self
._menu
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
).getMenu()
4296 def _setActiveTab( self
):
4297 self
._tabDisplayMenu
.setActive()
4299 def _getTabContent( self
, params
):
4300 wc
= WConfModifDisplayModifyData( self
._conf
, self
._link
)
4302 "modifyDataURL": quoteattr(str(urlHandlers
.UHConfModifDisplayModifyData
.getURL(self
._link
))), \
4303 "addLinkURL": quoteattr(str(urlHandlers
.UHConfModifDisplayAddLink
.getURL(self
._conf
))), \
4304 "addPageURL": quoteattr(str(urlHandlers
.UHConfModifDisplayAddPage
.getURL(self
._conf
))), \
4305 "addSpacerURL": quoteattr(str(urlHandlers
.UHConfModifDisplayAddSpacer
.getURL(self
._conf
))) }
4306 return wc
.getHTML( p
)
4308 class WConfModifDisplayModifyData(wcomponents
.WTemplated
):
4310 def __init__(self
, conf
, link
):
4312 self
._menu
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
).getMenu()
4317 vars = wcomponents
.WTemplated
.getVars(self
)
4318 vars["menuDisplay"] = ConfEditMenu(self
._menu
, urlHandlers
.UHConfModifDisplay
.getURL
).getHTML()
4319 vars["saveLinkURL"] = quoteattr(str(urlHandlers
.UHConfModifDisplayAddLink
.getURL(self
._link
)))
4320 vars["name"] = self
._link
.getCaption()
4321 vars["value_name"] = quoteattr(self
._link
.getCaption())
4322 vars["url"] = self
._link
.getURL()
4323 if self
._link
.getDisplayTarget() == "_blank":
4324 vars["newChecked"] = _("""CHECKED""")
4325 vars["sameChecked"] = ""
4327 vars["newChecked"] = ""
4328 vars["sameChecked"] = _("""CHECKED""")
4334 class WPConfModifDisplayModifyPage( WPConfModifDisplayBase
):
4335 def __init__(self
, rh
, conf
, link
):
4336 WPConfModifDisplayBase
.__init
__(self
, rh
, conf
)
4338 self
._menu
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
).getMenu()
4340 def _setActiveTab( self
):
4341 self
._tabDisplayMenu
.setActive()
4343 def _getTabContent( self
, params
):
4344 wc
= WConfModifDisplayModifyPage( self
._conf
, self
._link
)
4346 "modifyDataURL": quoteattr(str(urlHandlers
.UHConfModifDisplayModifyData
.getURL(self
._link
))) }
4347 return wc
.getHTML( p
)
4349 class WConfModifDisplayModifyPage(wcomponents
.WTemplated
):
4351 def __init__(self
, conf
, link
):
4353 self
._menu
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
).getMenu()
4358 vars = wcomponents
.WTemplated
.getVars(self
)
4359 vars["saveLinkURL"] = quoteattr(str(urlHandlers
.UHConfModifDisplayAddLink
.getURL(self
._link
)))
4360 vars["name"] = self
._link
.getCaption()
4361 vars["value_name"] = quoteattr(self
._link
.getCaption())
4362 vars["content"] = self
._link
.getPage().getContent().replace('"','\\"').replace("'","\\'").replace('\r\n','\\n').replace('\n','\\n')
4363 if self
._link
.getDisplayTarget() == "_blank":
4364 vars["newChecked"] = _("""CHECKED""")
4365 vars["sameChecked"] = ""
4367 vars["newChecked"] = ""
4368 vars["sameChecked"] = _("""CHECKED""")
4371 class WPConfModifDisplayModifySystemData( WPConfModifDisplayBase
):
4372 def __init__(self
, rh
, conf
, link
):
4373 WPConfModifDisplayBase
.__init
__(self
, rh
, conf
)
4375 self
._menu
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
).getMenu()
4377 def _setActiveTab( self
):
4378 self
._tabDisplayMenu
.setActive()
4380 def _getTabContent( self
, params
):
4381 wc
= WConfModifDisplayModifySystemData( self
._conf
, self
._link
)
4383 "modifyDataURL": quoteattr(str(urlHandlers
.UHConfModifDisplayModifySystemData
.getURL(self
._link
))), \
4384 "addLinkURL": quoteattr(str(urlHandlers
.UHConfModifDisplayAddLink
.getURL(self
._conf
))), \
4385 "addPageURL": quoteattr(str(urlHandlers
.UHConfModifDisplayAddPage
.getURL(self
._conf
))), \
4386 "addSpacerURL": quoteattr(str(urlHandlers
.UHConfModifDisplayAddSpacer
.getURL(self
._conf
))) }
4387 return wc
.getHTML( p
)
4389 class WConfModifDisplayModifySystemData(wcomponents
.WTemplated
):
4391 def __init__(self
, conf
, link
):
4393 self
._menu
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
).getMenu()
4398 vars = wcomponents
.WTemplated
.getVars(self
)
4399 vars["menuDisplay"] = ConfEditMenu(self
._menu
, urlHandlers
.UHConfModifDisplay
.getURL
).getHTML()
4400 vars["saveLinkURL"] = quoteattr(str(urlHandlers
.UHConfModifDisplayModifySystemData
.getURL(self
._link
)))
4401 vars["name"] = self
._link
.getCaption()
4402 vars["value_name"] = quoteattr(self
._link
.getCaption())
4406 class WPConfModifDisplayRemoveLink( WPConfModifDisplayBase
):
4407 def __init__(self
, rh
, conf
, link
):
4408 WPConfModifDisplayBase
.__init
__(self
, rh
, conf
)
4411 def _setActiveTab( self
):
4412 self
._tabDisplayMenu
.setActive()
4414 def _getTabContent( self
, params
):
4417 'challenge': _("Are you sure that you want to delete this link?"),
4418 'target': self
._link
.getName()
4421 postURL
= quoteattr(str(urlHandlers
.UHConfModifDisplayRemoveLink
.getURL(self
._link
)))
4422 return wcomponents
.WConfirmation().getHTML( msg
, postURL
, {})
4425 class WPConfParticipantList( WPConfAbstractList
):
4427 def __init__(self
, rh
, conf
, emailList
, displayedGroups
, abstracts
):
4428 WPConfAbstractList
.__init
__(self
, rh
, conf
, None)
4429 self
._emailList
= emailList
4430 self
._displayedGroups
= displayedGroups
4431 self
._abstracts
= abstracts
4433 def _getTabContent( self
, params
):
4434 wc
= WAbstractsParticipantList(self
._conf
, self
._emailList
, self
._displayedGroups
, self
._abstracts
)
4437 class WPConfModifParticipantList( WPConferenceBase
):
4439 def __init__(self
, rh
, conf
, emailList
, displayedGroups
, contribs
):
4440 WPConferenceBase
.__init
__(self
, rh
, conf
)
4441 self
._emailList
= emailList
4442 self
._displayedGroups
= displayedGroups
4443 self
._contribs
= contribs
4445 def _getBody( self
, params
):
4446 WPConferenceBase
._getBody
(self
, params
)
4447 wc
= WContribParticipantList(self
._conf
, self
._emailList
, self
._displayedGroups
, self
._contribs
)
4448 params
= {"urlDisplayGroup":urlHandlers
.UHContribsConfManagerDisplayParticipantList
.getURL(self
._conf
)}
4449 return wc
.getHTML(params
)
4452 class WConfModifContribList(wcomponents
.WTemplated
):
4454 def __init__(self
,conf
,filterCrit
, sortingCrit
, order
, websession
, filterUsed
=False, filterUrl
=None):
4456 self
._filterCrit
=filterCrit
4457 self
._sortingCrit
=sortingCrit
4459 self
._totaldur
=timedelta(0)
4460 self
.websession
= websession
4461 self
._filterUsed
= filterUsed
4462 self
._filterUrl
= filterUrl
4465 def _getURL( self
):
4466 #builds the URL to the contribution list page
4467 # preserving the current filter and sorting status
4468 url
= urlHandlers
.UHConfModifContribList
.getURL(self
._conf
)
4470 #save params in websession
4471 dict = self
.websession
.getVar("ContributionFilterConf%s"%self
._conf
.getId())
4474 if self
._filterCrit
.getField("type"):
4476 for t
in self
._filterCrit
.getField("type").getValues():
4480 if self
._filterCrit
.getField("type").getShowNoValue():
4481 dict["typeShowNoValue"] = "1"
4483 if self
._filterCrit
.getField("track"):
4484 dict["tracks"] = self
._filterCrit
.getField("track").getValues()
4485 if self
._filterCrit
.getField("track").getShowNoValue():
4486 dict["trackShowNoValue"] = "1"
4488 if self
._filterCrit
.getField("session"):
4489 dict["sessions"] = self
._filterCrit
.getField("session").getValues()
4490 if self
._filterCrit
.getField("session").getShowNoValue():
4491 dict["sessionShowNoValue"] = "1"
4493 if self
._filterCrit
.getField("status"):
4494 dict["status"] = self
._filterCrit
.getField("status").getValues()
4496 if self
._filterCrit
.getField("material"):
4497 dict["material"] = self
._filterCrit
.getField("material").getValues()
4499 if self
._sortingCrit
.getField():
4500 dict["sortBy"] = self
._sortingCrit
.getField().getId()
4501 dict["order"] = "down"
4503 self
.websession
.setVar("ContributionFilterConf%s"%self
._conf
.getId(), dict)
4508 def _getMaterialsHTML(self
, contrib
):
4510 if contrib
.getPaper() is not None:
4511 url
= urlHandlers
.UHContribModifMaterialBrowse
.getURL(contrib
.getPaper())
4512 #url.addParams({'contribId' : contrib.getId(), 'confId' : contrib.getConference().getId(), 'materialId' : 'paper'})
4513 materials
.append("""<a href=%s>%s</a>"""%(quoteattr(str(url
)),self
.htmlText(PaperFactory().getTitle().lower())))
4514 if contrib
.getSlides() is not None:
4515 url
= urlHandlers
.UHContribModifMaterialBrowse
.getURL(contrib
.getSlides())
4516 #url.addParams({'contribId' : contrib.getId(), 'confId' : contrib.getConference().getId(), 'materialId' : 'slides'})
4517 materials
.append("""<a href=%s>%s</a>"""%(quoteattr(str(url
)),self
.htmlText(SlidesFactory().getTitle().lower())))
4518 if contrib
.getPoster() is not None:
4519 url
= urlHandlers
.UHContribModifMaterialBrowse
.getURL(contrib
.getPoster())
4520 #url.addParams({'contribId' : contrib.getId(), 'confId' : contrib.getConference().getId(), 'materialId' : 'poster'})
4521 materials
.append("""<a href=%s>%s</a>"""%(quoteattr(str(url
)),self
.htmlText(PosterFactory().getTitle().lower())))
4522 if contrib
.getVideo() is not None:
4523 materials
.append("""<a href=%s>%s</a>"""%(
4524 quoteattr(str(urlHandlers
.UHContribModifMaterials
.getURL(contrib
))),
4525 self
.htmlText(materialFactories
.VideoFactory
.getTitle())))
4526 if contrib
.getMinutes() is not None:
4527 materials
.append("""<a href=%s>%s</a>"""%(
4528 quoteattr(str(urlHandlers
.UHContribModifMaterials
.getURL(contrib
))),
4529 self
.htmlText(materialFactories
.MinutesFactory
.getTitle())))
4530 for material
in contrib
.getMaterialList():
4531 url
=urlHandlers
.UHContribModifMaterials
.getURL(contrib
)
4532 materials
.append("""<a href=%s>%s</a>"""%(
4533 quoteattr(str(url
)),self
.htmlText(material
.getTitle())))
4534 return "<br>".join(materials
)
4536 def _getContribHTML( self
, contrib
):
4538 sdate
=contrib
.getAdjustedStartDate().strftime("%d-%b-%Y %H:%M" )
4539 except AttributeError:
4541 title
= """<a href=%s>%s</a>"""%( quoteattr( str( urlHandlers
.UHContributionModification
.getURL( contrib
) ) ), self
.htmlText( contrib
.getTitle() ))
4543 if contrib
.getDuration() is not None and contrib
.getDuration().seconds
!= 0:
4544 strdur
= (datetime(1900,1,1)+ contrib
.getDuration()).strftime("%Hh%M'")
4545 dur
= contrib
.getDuration()
4546 self
._totaldur
= self
._totaldur
+ dur
4548 l
= [self
.htmlText( spk
.getFullName() ) for spk
in contrib
.getSpeakerList()]
4549 speaker
= "<br>".join( l
)
4551 if contrib
.getSession() is not None:
4552 if contrib
.getSession().getCode() != "no code":
4553 session
=self
.htmlText(contrib
.getSession().getCode())
4555 session
=self
.htmlText(contrib
.getSession().getId())
4557 if contrib
.getTrack() is not None:
4558 if contrib
.getTrack().getCode() is not None:
4559 track
= self
.htmlText( contrib
.getTrack().getCode() )
4561 track
= self
.htmlText( contrib
.getTrack().getId() )
4563 if contrib
.getType() is not None:
4564 cType
=self
.htmlText(contrib
.getType().getName())
4565 status
=contrib
.getCurrentStatus()
4566 statusCaption
=ContribStatusList().getCode(status
.__class
__)
4568 <tr id="contributions%s" style="background-color: transparent;" onmouseout="javascript:onMouseOut('contributions%s')" onmouseover="javascript:onMouseOver('contributions%s')">
4569 <td valign="top" align="right" nowrap><input onchange="javascript:isSelected('contributions%s')" type="checkbox" name="contributions" value=%s></td>
4570 <td valign="top" nowrap class="CRLabstractDataCell">%s</td>
4571 <td valign="top" nowrap class="CRLabstractDataCell">%s</td>
4572 <td valign="top" nowrap class="CRLabstractDataCell">%s</td>
4573 <td valign="top" class="CRLabstractDataCell">%s</td>
4574 <td valign="top" class="CRLabstractDataCell">%s</td>
4575 <td valign="top" class="CRLabstractDataCell">%s</td>
4576 <td valign="top" class="CRLabstractDataCell">%s</td>
4577 <td valign="top" class="CRLabstractDataCell">%s</td>
4578 <td valign="top" class="CRLabstractDataCell">%s</td>
4579 <td valign="top" class="CRLabstractDataCell" nowrap>%s</td>
4581 """%(contrib
.getId(), contrib
.getId(), contrib
.getId(),
4582 contrib
.getId(), contrib
.getId(),
4583 self
.htmlText(contrib
.getId()),
4584 sdate
or " ",strdur
or " ",cType
or " ",
4586 speaker
or " ",session
or " ",
4587 track
or " ",statusCaption
or " ",
4588 self
._getMaterialsHTML
(contrib
) or " ")
4591 def _getTypeItemsHTML(self
):
4593 if self
._filterCrit
.getField("type").getShowNoValue():
4595 res
=[ i18nformat("""<input type="checkbox" name="typeShowNoValue" value="--none--"%s> --_("not specified")--""")%checked
]
4596 for t
in self
._conf
.getContribTypeList():
4598 if t
.getId() in self
._filterCrit
.getField("type").getValues():
4600 res
.append("""<input type="checkbox" name="types" value=%s%s> %s"""%(quoteattr(str(t
.getId())),checked
,self
.htmlText(t
.getName())))
4603 def _getSessionItemsHTML(self
):
4605 if self
._filterCrit
.getField("session").getShowNoValue():
4607 res
=[ i18nformat("""<input type="checkbox" name="sessionShowNoValue" value="--none--"%s> --_("not specified")--""")%checked
]
4608 for s
in self
._conf
.getSessionListSorted():
4610 l
= self
._filterCrit
.getField("session").getValues()
4611 if not isinstance(l
, list):
4615 res
.append("""<input type="checkbox" name="sessions" value=%s%s> (%s) %s"""%(quoteattr(str(s
.getId())),checked
,self
.htmlText(s
.getCode()),self
.htmlText(s
.getTitle())))
4618 def _getTrackItemsHTML(self
):
4620 if self
._filterCrit
.getField("track").getShowNoValue():
4622 res
=[ i18nformat("""<input type="checkbox" name="trackShowNoValue" value="--none--"%s> --_("not specified")--""")%checked
]
4623 for t
in self
._conf
.getTrackList():
4625 if t
.getId() in self
._filterCrit
.getField("track").getValues():
4627 res
.append("""<input type="checkbox" name="tracks" value=%s%s> (%s) %s"""%(quoteattr(str(t
.getId())),checked
,self
.htmlText(t
.getCode()),self
.htmlText(t
.getTitle())))
4630 def _getStatusItemsHTML(self
):
4632 for st
in ContribStatusList().getList():
4633 id=ContribStatusList().getId(st
)
4635 if id in self
._filterCrit
.getField("status").getValues():
4637 code
=ContribStatusList().getCode(st
)
4638 caption
=ContribStatusList().getCaption(st
)
4639 res
.append("""<input type="checkbox" name="status" value=%s%s> (%s) %s"""%(quoteattr(str(id)),checked
,self
.htmlText(code
),self
.htmlText(caption
)))
4642 def _getMaterialItemsHTML(self
):
4644 for (id,caption
) in [(PaperFactory().getId(),PaperFactory().getTitle()),\
4645 (SlidesFactory().getId(),SlidesFactory().getTitle()),\
4646 ("--other--", _("other")),("--none--", i18nformat("""--_("no material")--"""))]:
4648 if id in self
._filterCrit
.getField("material").getValues():
4650 res
.append("""<input type="checkbox" name="material" value=%s%s> %s"""%(quoteattr(str(id)),checked
,self
.htmlText(caption
)))
4653 def _getFilterMenu(self
):
4656 ('Types', {"title": _("Types"),
4657 "options": self
._getTypeItemsHTML
()}),
4658 ('Sessions', {"title": _("Sessions"),
4659 "options": self
._getSessionItemsHTML
()}),
4660 ('Tracks', {"title": _("Tracks"),
4661 "options": self
._getTrackItemsHTML
()}),
4662 ('Status', {"title": _("Status"),
4663 "options": self
._getStatusItemsHTML
()}),
4664 ('Materials', {"title": _("Materials"),
4665 "options": self
._getMaterialItemsHTML
()})
4668 extraInfo
= i18nformat("""<table align="center" cellspacing="10" width="100%%">
4670 <td colspan="5" class="titleCellFormat"> _("Author search") <input type="text" name="authSearch" value=%s></td>
4673 """)%(quoteattr(str(self
._authSearch
)))
4675 p
= WFilterCriteriaContribs(options
, None, extraInfo
)
4679 def getVars( self
):
4680 vars = wcomponents
.WTemplated
.getVars( self
)
4681 vars["filterUrl"] = str(self
._filterUrl
).replace('%', '%%')
4682 vars["quickSearchURL"]=quoteattr(str(urlHandlers
.UHConfModContribQuickAccess
.getURL(self
._conf
)))
4683 vars["filterPostURL"]=quoteattr(str(urlHandlers
.UHConfModifContribList
.getURL(self
._conf
)))
4684 self
._authSearch
=vars.get("authSearch","").strip()
4685 cl
=self
._conf
.getContribsMatchingAuth(self
._authSearch
)
4687 sortingField
= self
._sortingCrit
.getField()
4688 self
._currentSorting
=""
4690 if sortingField
is not None:
4691 self
._currentSorting
=sortingField
.getId()
4692 vars["currentSorting"]=""
4695 url
.addParam("sortBy","number")
4696 vars["numberImg"]=""
4697 if self
._currentSorting
== "number":
4698 vars["currentSorting"] = i18nformat("""<input type="hidden" name="sortBy" value="_("number")">""")
4699 if self
._order
== "down":
4700 vars["numberImg"] = """<img src=%s alt="down">"""%(quoteattr(Config
.getInstance().getSystemIconURL("downArrow")))
4701 url
.addParam("order","up")
4702 elif self
._order
== "up":
4703 vars["numberImg"] = """<img src=%s alt="up">"""%(quoteattr(Config
.getInstance().getSystemIconURL("upArrow")))
4704 url
.addParam("order","down")
4705 vars["numberSortingURL"]=quoteattr(str(url
))
4707 url
= self
._getURL
()
4708 url
.addParam("sortBy", "date")
4709 vars["dateImg"] = ""
4710 if self
._currentSorting
== "date":
4711 vars["currentSorting"]= i18nformat("""<input type="hidden" name="sortBy" value="_("date")">""")
4712 if self
._order
== "down":
4713 vars["dateImg"]="""<img src=%s alt="down">"""%(quoteattr(Config
.getInstance().getSystemIconURL("downArrow")))
4714 url
.addParam("order","up")
4715 elif self
._order
== "up":
4716 vars["dateImg"]="""<img src=%s alt="up">"""%(quoteattr(Config
.getInstance().getSystemIconURL("upArrow")))
4717 url
.addParam("order","down")
4718 vars["dateSortingURL"]=quoteattr(str(url
))
4721 url
= self
._getURL
()
4722 url
.addParam("sortBy", "name")
4723 vars["titleImg"] = ""
4724 if self
._currentSorting
== "name":
4725 vars["currentSorting"]= i18nformat("""<input type="hidden" name="sortBy" value="_("name")">""")
4726 if self
._order
== "down":
4727 vars["titleImg"]="""<img src=%s alt="down">"""%(quoteattr(Config
.getInstance().getSystemIconURL("downArrow")))
4728 url
.addParam("order","up")
4729 elif self
._order
== "up":
4730 vars["titleImg"]="""<img src=%s alt="up">"""%(quoteattr(Config
.getInstance().getSystemIconURL("upArrow")))
4731 url
.addParam("order","down")
4732 vars["titleSortingURL"]=quoteattr(str(url
))
4735 url
= self
._getURL
()
4736 url
.addParam("sortBy", "type")
4737 vars["typeImg"] = ""
4738 if self
._currentSorting
== "type":
4739 vars["currentSorting"]= i18nformat("""<input type="hidden" name="sortBy" value="_("type")">""")
4740 if self
._order
== "down":
4741 vars["typeImg"]="""<img src=%s alt="down">"""%(quoteattr(Config
.getInstance().getSystemIconURL("downArrow")))
4742 url
.addParam("order","up")
4743 elif self
._order
== "up":
4744 vars["typeImg"]="""<img src=%s alt="up">"""%(quoteattr(Config
.getInstance().getSystemIconURL("upArrow")))
4745 url
.addParam("order","down")
4746 vars["typeSortingURL"] = quoteattr( str( url
) )
4747 url
= self
._getURL
()
4748 url
.addParam("sortBy", "session")
4749 vars["sessionImg"] = ""
4750 if self
._currentSorting
== "session":
4751 vars["currentSorting"] = i18nformat("""<input type="hidden" name="sortBy" value='_("session")'>""")
4752 if self
._order
== "down":
4753 vars["sessionImg"] = """<img src=%s alt="down">"""%(quoteattr(Config
.getInstance().getSystemIconURL("downArrow")))
4754 url
.addParam("order","up")
4755 elif self
._order
== "up":
4756 vars["sessionImg"] = """<img src=%s alt="up">"""%(quoteattr(Config
.getInstance().getSystemIconURL("upArrow")))
4757 url
.addParam("order","down")
4758 vars["sessionSortingURL"] = quoteattr( str( url
) )
4759 url
= self
._getURL
()
4760 url
.addParam("sortBy", "speaker")
4761 vars["speakerImg"]=""
4762 if self
._currentSorting
=="speaker":
4763 vars["currentSorting"] = i18nformat("""<input type="hidden" name="sortBy" value="_("speaker")">""")
4764 if self
._order
== "down":
4765 vars["speakerImg"] = """<img src=%s alt="down">"""%(quoteattr(Config
.getInstance().getSystemIconURL("downArrow")))
4766 url
.addParam("order","up")
4767 elif self
._order
== "up":
4768 vars["speakerImg"] = """<img src=%s alt="up">"""%(quoteattr(Config
.getInstance().getSystemIconURL("upArrow")))
4769 url
.addParam("order","down")
4770 vars["speakerSortingURL"]=quoteattr( str( url
) )
4772 url
= self
._getURL
()
4773 url
.addParam("sortBy","track")
4774 vars["trackImg"] = ""
4775 if self
._currentSorting
== "track":
4776 vars["currentSorting"] = i18nformat("""<input type="hidden" name="sortBy" value="_("track")">""")
4777 if self
._order
== "down":
4778 vars["trackImg"] = """<img src=%s alt="down">"""%(quoteattr(Config
.getInstance().getSystemIconURL("downArrow")))
4779 url
.addParam("order","up")
4780 elif self
._order
== "up":
4781 vars["trackImg"] = """<img src=%s alt="up">"""%(quoteattr(Config
.getInstance().getSystemIconURL("upArrow")))
4782 url
.addParam("order","down")
4783 vars["trackSortingURL"] = quoteattr( str( url
) )
4785 f
=filters
.SimpleFilter(self
._filterCrit
,self
._sortingCrit
)
4786 filteredContribs
= f
.apply(cl
)
4787 l
= [self
._getContribHTML
(contrib
) for contrib
in filteredContribs
]
4788 contribsToPrint
= ["""<input type="hidden" name="contributions" value="%s">"""%contrib
.getId() for contrib
in filteredContribs
]
4789 numContribs
= len(filteredContribs
)
4791 if self
._order
=="up":
4793 vars["contribsToPrint"] = "\n".join(contribsToPrint
)
4794 vars["contributions"] = "".join(l
)
4795 orginURL
= urlHandlers
.UHConfModifContribList
.getURL(self
._conf
)
4796 vars["numContribs"]=str(numContribs
)
4798 vars["totalNumContribs"] = str(len(self
._conf
.getContributionList()))
4799 vars["filterUsed"] = self
._filterUsed
4801 vars["contributionsPDFURL"]=quoteattr(str(urlHandlers
.UHContribsConfManagerDisplayMenuPDF
.getURL(self
._conf
)))
4802 vars["contribSelectionAction"]=quoteattr(str(urlHandlers
.UHContribConfSelectionAction
.getURL(self
._conf
)))
4804 totaldur
= self
._totaldur
4805 days
= totaldur
.days
4806 hours
= (totaldur
.seconds
)/3600
4807 dayhours
= (days
* 24)+hours
4808 mins
= ((totaldur
.seconds
)/60)-(hours
*60)
4809 vars["totaldur" ]="""%sh%sm"""%(dayhours
,mins
)
4810 vars['rbActive'] = info
.HelperMaKaCInfo
.getMaKaCInfoInstance().getRoomBookingModuleActive()
4811 vars["bookings"] = Conversion
.reservationsList(self
._conf
.getRoomBookingList())
4812 vars["filterMenu"] = self
._getFilterMenu
()
4813 vars["sortingOptions"]="""<input type="hidden" name="sortBy" value="%s">
4814 <input type="hidden" name="order" value="%s">"""%(self
._sortingCrit
.getField().getId(), self
._order
)
4815 vars["pdfIconURL"]=quoteattr(str(Config
.getInstance().getSystemIconURL("pdf")))
4816 vars["excelIconURL"] = quoteattr(str(Config
.getInstance().getSystemIconURL("excel")))
4817 vars["xmlIconURL"]=quoteattr(str(Config
.getInstance().getSystemIconURL("xml")))
4820 class WFilterCriteriaContribs(wcomponents
.WFilterCriteria
):
4822 Draws the options for a filter criteria object
4823 This means rendering the actual table that contains
4824 all the HTML for the several criteria
4827 def __init__(self
, options
, filterCrit
, extraInfo
=""):
4828 wcomponents
.WFilterCriteria
.__init
__(self
, options
, filterCrit
, extraInfo
)
4830 def _drawFieldOptions(self
, id, data
):
4832 page
= WFilterCriterionOptionsContribs(id, data
)
4834 # TODO: remove when we have a better template system
4835 return page
.getHTML().replace('%','%%')
4837 class WFilterCriterionOptionsContribs(wcomponents
.WTemplated
):
4839 def __init__(self
, id, data
):
4845 vars = wcomponents
.WTemplated
.getVars( self
)
4847 vars["id"] = self
._id
4848 vars["title"] = self
._data
["title"]
4849 vars["options"] = self
._data
["options"]
4850 vars["selectFunc"] = self
._data
.get("selectFunc", True)
4854 class WPModifContribList( WPConferenceModifBase
):
4856 _userData
= ['favorite-user-list', 'favorite-user-ids']
4858 def __init__(self
, rh
, conference
, filterUsed
=False):
4859 WPConferenceModifBase
.__init
__(self
, rh
, conference
)
4860 self
._filterUsed
= filterUsed
4862 def _setActiveSideMenuItem(self
):
4863 self
._contribListMenuItem
.setActive(True)
4865 def _getPageContent( self
, params
):
4866 filterCrit
=params
.get("filterCrit",None)
4867 sortingCrit
=params
.get("sortingCrit",None)
4868 order
= params
.get("order","down")
4869 websession
= self
._rh
._getSession
()
4872 fields
= getattr(filterCrit
, '_fields')
4873 for field
in fields
.values():
4875 showNoValue
= field
.getShowNoValue()
4876 values
= field
.getValues()
4878 filterParams
['%sShowNoValue' % id] = '--none--'
4879 filterParams
[id] = values
4881 requestParams
= self
._rh
.getRequestParams()
4883 operationType
= requestParams
.get('operationType')
4884 if operationType
!= 'resetFilters':
4885 operationType
= 'filter'
4886 urlParams
= dict(isBookmark
='y', operationType
=operationType
)
4888 urlParams
.update(self
._rh
.getRequestParams())
4889 urlParams
.update(filterParams
)
4890 filterUrl
= self
._rh
._uh
.getURL(None, **urlParams
)
4892 wc
= WConfModifContribList(self
._conf
,filterCrit
, sortingCrit
, order
, websession
, self
._filterUsed
, filterUrl
)
4893 p
={"authSearch":params
.get("authSearch","")}
4895 return wc
.getHTML(p
)
4897 class WPConfModifContribToPDFMenu( WPModifContribList
):
4899 def __init__(self
, rh
, conf
, contribIds
):
4900 WPModifContribList
.__init
__(self
, rh
, conf
)
4901 self
._contribIds
= contribIds
4903 def _getPageContent(self
, params
):
4905 wc
= WConfModifContribToPDFMenu(self
._conf
, self
._contribIds
)
4906 return wc
.getHTML(params
)
4908 class WConfModifContribToPDFMenu(wcomponents
.WTemplated
):
4909 def __init__(self
, conf
, contribIds
):
4911 self
.contribIds
= contribIds
4913 def getVars( self
):
4914 vars = wcomponents
.WTemplated
.getVars( self
)
4915 vars["createPDFURL"] = urlHandlers
.UHContribsConfManagerDisplayMenuPDF
.getURL(self
._conf
)
4917 for id in self
.contribIds
:
4918 l
.append("""<input type="hidden" name="contributions" value="%s">"""%id)
4919 vars["contribIdsList"] = "\n".join(l
)
4923 class WConfModMoveContribsToSession(wcomponents
.WTemplated
):
4925 def __init__(self
,conf
,contribIdList
=[]):
4927 self
._contribIdList
=contribIdList
4930 vars=wcomponents
.WTemplated
.getVars(self
)
4931 vars["postURL"]=quoteattr(str(urlHandlers
.UHConfModMoveContribsToSession
.getURL(self
._conf
)))
4932 vars["contribs"]=",".join(self
._contribIdList
)
4933 s
=["""<option value="--none--">--none--</option>"""]
4934 for session
in self
._conf
.getSessionListSorted():
4935 if not session
.isClosed():
4936 s
.append("""<option value=%s>%s</option>"""%(
4937 quoteattr(str(session
.getId())),
4938 self
.htmlText(session
.getTitle())))
4939 vars["sessions"]="".join(s
)
4943 class WPModMoveContribsToSession(WPModifContribList
):
4945 def _getPageContent(self
,params
):
4946 wc
=WConfModMoveContribsToSession(self
._conf
,params
.get("contribIds",[]))
4950 class WPModMoveContribsToSessionConfirmation(WPModifContribList
):
4952 def _getPageContent(self
,params
):
4953 wc
=wcomponents
.WConfModMoveContribsToSessionConfirmation(self
._conf
,params
.get("contribIds",[]),params
.get("targetSession",None))
4954 p
={"postURL":urlHandlers
.UHConfModMoveContribsToSession
.getURL(self
._conf
),}
4955 return wc
.getHTML(p
)
4958 class WPConfEditContribType(WPConferenceModifBase
):
4960 def __init__(self
, rh
, ct
):
4961 self
._conf
= ct
.getConference()
4962 self
._contribType
= ct
4963 WPConferenceModifBase
.__init
__(self
, rh
, self
._conf
)
4965 def _setActiveSideMenuItem(self
):
4966 self
._generalSettingsMenuItem
.setActive(True)
4968 def _getPageContent( self
, params
):
4969 wc
= WConfEditContribType(self
._contribType
)
4970 params
["saveURL"] = quoteattr(str(urlHandlers
.UHConfEditContribType
.getURL(self
._contribType
)))
4971 return wc
.getHTML(params
)
4974 class WConfEditContribType(wcomponents
.WTemplated
):
4976 def __init__(self
, contribType
):
4977 self
._contribType
= contribType
4980 vars = wcomponents
.WTemplated
.getVars(self
)
4981 vars["ctName"] = self
._contribType
.getName()
4982 vars["ctDescription"] = self
._contribType
.getDescription()
4986 class WPConfAddContribType(WPConferenceModifBase
):
4988 def _setActiveSideMenuItem(self
):
4989 self
._generalSettingsMenuItem
.setActive(True)
4991 def _getPageContent( self
, params
):
4992 wc
= WConfAddContribType()
4993 params
["saveURL"] = quoteattr(str(urlHandlers
.UHConfAddContribType
.getURL(self
._conf
)))
4994 return wc
.getHTML(params
)
4997 class WConfAddContribType(wcomponents
.WTemplated
):
5000 vars = wcomponents
.WTemplated
.getVars(self
)
5003 class WAbstractsParticipantList(wcomponents
.WTemplated
):
5005 def __init__(self
, conf
, emailList
, displayedGroups
, abstracts
):
5006 self
._emailList
= emailList
5007 self
._displayedGroups
= displayedGroups
5009 self
._abstracts
= abstracts
5012 vars = wcomponents
.WTemplated
.getVars(self
)
5014 vars["submitterEmails"] = ",".join(self
._emailList
["submitters"]["emails"])
5015 vars["primaryAuthorEmails"] = ",".join(self
._emailList
["primaryAuthors"]["emails"])
5016 vars["coAuthorEmails"] = ",".join(self
._emailList
["coAuthors"]["emails"])
5018 urlDisplayGroup
= urlHandlers
.UHAbstractsConfManagerDisplayParticipantList
.getURL(self
._conf
)
5019 abstractsToPrint
= []
5020 for abst
in self
._abstracts
:
5021 abstractsToPrint
.append("""<input type="hidden" name="abstracts" value="%s">"""%abst
)
5022 abstractsList
= "".join(abstractsToPrint
)
5023 displayedGroups
= []
5024 for dg
in self
._displayedGroups
:
5025 displayedGroups
.append("""<input type="hidden" name="displayedGroups" value="%s">"""%dg)
5026 groupsList
= "".join(displayedGroups
)
5029 text
= _("show list")
5030 vars["submitters"] = "<tr colspan=\"2\"><td> </td></tr>"
5031 if "submitters" in self
._displayedGroups
:
5034 text
= _("close list")
5035 for subm
in self
._emailList
["submitters"]["tree"].values():
5040 participant
= "%s %s %s <%s>"%(subm
.getTitle(), subm
.getFirstName(), subm
.getFamilyName().upper(), subm
.getEmail())
5042 <td colspan=\"2\" nowrap bgcolor=\"%s\" class=\"blacktext\">\
5043 %s</td></tr>"%(color
, self
.htmlText(participant
)))
5044 vars["submitters"] = "".join(l
)
5045 urlDisplayGroup
.addParam("clickedGroup", "submitters")
5046 vars["showSubmitters"] = """<form action="%s" method="post">\
5049 <input type="submit" class="btn" value="%s">
5050 </form>"""%(str(urlDisplayGroup
), abstractsList
,groupsList
, text
)
5053 text
= _("show list")
5054 vars["primaryAuthors"] = "<tr colspan=\"2\"><td> </td></tr>"
5055 if "primaryAuthors" in self
._displayedGroups
:
5058 text
= _("close list")
5059 for pAuth
in self
._emailList
["primaryAuthors"]["tree"].values():
5064 participant
= "%s <%s>"%(pAuth
.getFullName(), pAuth
.getEmail())
5065 l
.append("<tr><td colspan=\"2\" nowrap bgcolor=\"%s\" \
5066 class=\"blacktext\"> %s</td></tr>"%(color
, self
.htmlText(participant
)))
5067 vars["primaryAuthors"] = "".join(l
)
5068 urlDisplayGroup
.addParam("clickedGroup", "primaryAuthors")
5069 vars["showPrimaryAuthors"] = """<form action="%s" method="post">\
5072 <input type="submit" class="btn" value="%s">
5073 </form>"""%(str(urlDisplayGroup
), abstractsList
,groupsList
, text
)
5076 text
= _("show list")
5077 vars["coAuthors"] = "<tr colspan=\"2\"><td> </td></tr>"
5078 if "coAuthors" in self
._displayedGroups
:
5081 text
= _("close list")
5082 for cAuth
in self
._emailList
["coAuthors"]["tree"].values():
5087 cAuthEmail
= cAuth
.getEmail()
5088 if cAuthEmail
.strip() == "":
5089 participant
= "%s"%cAuth
.getFullName()
5091 participant
= "%s <%s>"%(cAuth
.getFullName(), cAuthEmail
)
5092 l
.append("<tr><td colspan=\"2\" nowrap bgcolor=\"%s\" class=\"blacktext\">\
5093 %s</td></tr>"%(color
, self
.htmlText(participant
)))
5094 vars["coAuthors"] = "".join(l
)
5095 urlDisplayGroup
.addParam("clickedGroup", "coAuthors")
5096 vars["showCoAuthors"] = """<form action="%s" method="post">\
5099 <input type="submit" class="btn" value="%s">
5100 </form>"""%(str(urlDisplayGroup
), abstractsList
,groupsList
, text
)
5103 class WContribParticipantList(wcomponents
.WTemplated
):
5105 def __init__(self
, conf
, emailList
, displayedGroups
, contribs
):
5106 self
._emailList
= emailList
5107 self
._displayedGroups
= displayedGroups
5109 self
._contribs
= contribs
5112 vars = wcomponents
.WTemplated
.getVars(self
)
5114 vars["speakerEmails"] = ", ".join(self
._emailList
["speakers"]["emails"])
5115 vars["primaryAuthorEmails"] = ", ".join(self
._emailList
["primaryAuthors"]["emails"])
5116 vars["coAuthorEmails"] = ", ".join(self
._emailList
["coAuthors"]["emails"])
5118 urlDisplayGroup
= vars["urlDisplayGroup"]
5119 contribsToPrint
= []
5120 for contrib
in self
._contribs
:
5121 contribsToPrint
.append("""<input type="hidden" name="contributions" value="%s">"""%contrib
)
5122 contribsList
= "".join(contribsToPrint
)
5123 displayedGroups
= []
5124 for dg
in self
._displayedGroups
:
5125 displayedGroups
.append("""<input type="hidden" name="displayedGroups" value="%s">"""%dg)
5126 groupsList
= "".join(displayedGroups
)
5129 text
= _("show list")
5130 vars["speakers"] = "<tr colspan=\"2\"><td> </td></tr>"
5131 if "speakers" in self
._displayedGroups
:
5134 text
= _("close list")
5135 for speaker
in self
._emailList
["speakers"]["tree"].values():
5140 participant
= "%s <%s>"%(speaker
.getFullName(), speaker
.getEmail())
5142 <td colspan=\"2\" nowrap bgcolor=\"%s\" class=\"blacktext\">\
5143 %s</td></tr>"%(color
, self
.htmlText(participant
)))
5144 vars["speakers"] = "".join(l
)
5145 urlDisplayGroup
.addParam("clickedGroup", "speakers")
5146 vars["showSpeakers"] = """<form action="%s" method="post">\
5149 <input type="submit" class="btn" value="%s">
5150 </form>"""%(str(urlDisplayGroup
), contribsList
,groupsList
, text
)
5153 text
= _("show list")
5154 vars["primaryAuthors"] = "<tr colspan=\"2\"><td> </td></tr>"
5155 if "primaryAuthors" in self
._displayedGroups
:
5158 text
= _("close list")
5159 for pAuth
in self
._emailList
["primaryAuthors"]["tree"].values():
5164 participant
= "%s %s %s <%s>"%(pAuth
.getTitle(), pAuth
.getFirstName(), pAuth
.getFamilyName().upper(), pAuth
.getEmail())
5165 l
.append("<tr><td colspan=\"2\" nowrap bgcolor=\"%s\" \
5166 class=\"blacktext\"> %s</td></tr>"%(color
, self
.htmlText(participant
)))
5167 vars["primaryAuthors"] = "".join(l
)
5168 urlDisplayGroup
.addParam("clickedGroup", "primaryAuthors")
5169 vars["showPrimaryAuthors"] = """<form action="%s" method="post">\
5172 <input type="submit" class="btn" value="%s">
5173 </form>"""%(str(urlDisplayGroup
), contribsList
,groupsList
, text
)
5176 text
= _("show list")
5177 vars["coAuthors"] = "<tr colspan=\"2\"><td> </td></tr>"
5178 if "coAuthors" in self
._displayedGroups
:
5181 text
= _("close list")
5182 for cAuth
in self
._emailList
["coAuthors"]["tree"].values():
5187 cAuthEmail
= cAuth
.getEmail()
5188 if cAuthEmail
.strip() == "":
5189 participant
= "%s %s %s"%(cAuth
.getTitle(), cAuth
.getFirstName(), cAuth
.getFamilyName().upper())
5191 participant
= "%s %s %s <%s>"%(cAuth
.getTitle(), cAuth
.getFirstName(), cAuth
.getFamilyName().upper(), cAuthEmail
)
5192 l
.append("<tr><td colspan=\"2\" nowrap bgcolor=\"%s\" class=\"blacktext\">\
5193 %s</td></tr>"%(color
, self
.htmlText(participant
)))
5194 vars["coAuthors"] = "".join(l
)
5195 urlDisplayGroup
.addParam("clickedGroup", "coAuthors")
5196 vars["showCoAuthors"] = """<form action="%s" method="post">\
5199 <input type="submit" class="btn" value="%s">
5200 </form>"""%(str(urlDisplayGroup
), contribsList
,groupsList
, text
)
5204 class WPAbstractSendNotificationMail(WPConferenceBase
):
5206 def __init__(self
, rh
, conf
, count
):
5207 WPConferenceBase
.__init
__(self
, rh
, conf
)
5210 def _getBody( self
, params
):
5211 return i18nformat("""
5212 <table align="center"><tr><td align="center">
5213 <b> _("The submitters of the selected abstracts will nearly recieve the notification mail").<br>
5215 _("You can now close this window.")</b>
5221 class WPContributionList( WPConferenceDefaultDisplayBase
):
5222 navigationEntry
= navigation
.NEContributionList
5224 def _getBody( self
, params
):
5225 wc
= WConfContributionList( self
._getAW
(), self
._conf
, params
["filterCrit"], params
.get("filterText",""))
5228 def _defineSectionMenu( self
):
5229 WPConferenceDefaultDisplayBase
._defineSectionMenu
( self
)
5230 self
._sectionMenu
.setCurrentItem(self
._contribListOpt
)
5234 class WConfContributionList ( wcomponents
.WTemplated
):
5236 def __init__(self
, aw
, conf
, filterCrit
, filterText
):
5239 self
._filterCrit
= filterCrit
5240 self
._filterText
= filterText
5242 def getVars( self
):
5243 vars = wcomponents
.WTemplated
.getVars( self
)
5245 vars["contributions"] = self
._conf
.getContributionListSorted(includeWithdrawn
=False, key
="title")
5246 vars["showAttachedFiles"] = self
._conf
.getAbstractMgr().showAttachedFilesContribList()
5247 vars["conf"] = self
._conf
5248 vars["accessWrapper"] = self
._aw
5249 vars["filterCriteria"] = self
._filterCrit
5250 vars["filterText"] = self
._filterText
5251 vars["formatDate"] = lambda date
: format_date(date
, "d MMM yyyy")
5252 vars["formatTime"] = lambda time
: format_time(time
, format
="short", timezone
=timezone(DisplayTZ(self
._aw
, self
._conf
).getDisplayTZ()))
5256 class WConfAuthorIndex( wcomponents
.WTemplated
):
5258 def __init__(self
, conf
):
5263 vars = wcomponents
.WTemplated
.getVars(self
)
5265 for key
, authors
in self
._conf
.getAuthorIndex().iteritems():
5267 # get the first identity that matches the author
5268 if len(authors
) == 0:
5273 authorURL
= urlHandlers
.UHContribAuthorDisplay
.getURL(auth
.getContribution(),
5274 authorId
=auth
.getId())
5276 res
.append({'fullName': auth
.getFullNameNoTitle(),
5277 'affiliation': auth
.getAffiliation(),
5278 'authorURL': authorURL
,
5279 'contributions': contribs
5282 for auth
in authors
:
5283 contrib
= auth
.getContribution()
5284 if contrib
is not None:
5286 'title': contrib
.getTitle(),
5287 'url': str(urlHandlers
.UHContributionDisplay
.getURL(auth
.getContribution())),
5288 'materials': fossilize(contrib
.getAllMaterialList())
5291 vars["items"] = dict(enumerate(res
))
5295 class WPAuthorIndex( WPConferenceDefaultDisplayBase
):
5296 navigationEntry
= navigation
.NEAuthorIndex
5298 def getJSFiles(self
):
5299 return WPConferenceDefaultDisplayBase
.getJSFiles(self
) + \
5300 self
._asset
_env
['indico_authors'].urls()
5302 def _getBody(self
,params
):
5303 wc
= WConfAuthorIndex(self
._conf
)
5306 def _defineSectionMenu( self
):
5307 WPConferenceDefaultDisplayBase
._defineSectionMenu
( self
)
5308 self
._sectionMenu
.setCurrentItem(self
._authorIndexOpt
)
5311 class WConfSpeakerIndex( wcomponents
.WTemplated
):
5313 def __init__(self
, conf
):
5317 vars = wcomponents
.WTemplated
.getVars(self
)
5318 res
= collections
.defaultdict(list)
5319 for index
, key
in enumerate(self
._conf
.getSpeakerIndex().getParticipationKeys()):
5320 pl
= self
._conf
.getSpeakerIndex().getById(key
)
5325 res
[index
].append({'fullName': speaker
.getFullNameNoTitle(), 'affiliation': speaker
.getAffiliation()})
5327 if isinstance(speaker
, conference
.SubContribParticipation
):
5328 participation
= speaker
.getSubContrib()
5329 if participation
is None:
5331 url
= urlHandlers
.UHSubContributionDisplay
.getURL(participation
)
5333 participation
= speaker
.getContribution()
5334 if participation
is None:
5336 url
= urlHandlers
.UHContributionDisplay
.getURL(participation
)
5337 res
[index
].append({'title': participation
.getTitle(), 'url': str(url
), 'materials': fossilize(participation
.getAllMaterialList())})
5341 class WPSpeakerIndex( WPConferenceDefaultDisplayBase
):
5342 navigationEntry
= navigation
.NESpeakerIndex
5344 def _getBody(self
, params
):
5345 wc
=WConfSpeakerIndex(self
._conf
)
5348 def getJSFiles(self
):
5349 return WPConferenceDefaultDisplayBase
.getJSFiles(self
) + \
5350 self
._asset
_env
['indico_authors'].urls()
5352 def _defineSectionMenu( self
):
5353 WPConferenceDefaultDisplayBase
._defineSectionMenu
( self
)
5354 self
._sectionMenu
.setCurrentItem(self
._speakerIndexOpt
)
5356 class WConfMyContributions(wcomponents
.WTemplated
):
5358 def __init__(self
, aw
, conf
):
5362 def getHTML(self
, params
):
5363 return wcomponents
.WTemplated
.getHTML(self
, params
)
5366 vars = wcomponents
.WTemplated
.getVars( self
)
5367 vars["User"] = self
._aw
.getUser()
5368 vars["Conference"] = self
._conf
5369 vars["ConfReviewingChoice"] = self
._conf
.getConfPaperReview().getChoice()
5372 class WConfMyStuffMySessions(wcomponents
.WTemplated
):
5374 def __init__(self
,aw
,conf
):
5378 def _getSessionsHTML(self
):
5379 if self
._aw
.getUser() is None:
5381 #ls=self._conf.getCoordinatedSessions(self._aw.getUser())+self._conf.getManagedSession(self._aw.getUser())
5382 ls
= set(self
._conf
.getCoordinatedSessions(self
._aw
.getUser()))
5383 ls
= list(ls |
set(self
._conf
.getManagedSession(self
._aw
.getUser())))
5387 iconURL
=Config
.getInstance().getSystemIconURL("conf_edit")
5389 modURL
=urlHandlers
.UHSessionModification
.getURL(s
)
5390 dispURL
=urlHandlers
.UHSessionDisplay
.getURL(s
)
5393 <td class="infoTD" width="100%%">%s</td>
5394 <td nowrap class="infoTD"><a href=%s>Edit</a><span class="horizontalSeparator">|</span><a href=%s>View</a></td>
5395 </tr>"""%(self
.htmlText(s
.getTitle()),
5396 quoteattr(str(modURL
)),
5397 quoteattr(str(dispURL
))))
5399 <table class="groupTable width="70%%" align="center" cellspacing="0" style="padding-top:15px;">
5401 <td class="groupTitle" colspan="4">Sessions</td>
5411 vars=wcomponents
.WTemplated
.getVars(self
)
5412 vars["items"]=self
._getSessionsHTML
()
5415 class WPConfMyStuffMySessions(WPConferenceDefaultDisplayBase
):
5416 navigationEntry
= navigation
.NEMyStuff
5418 def _getBody(self
,params
):
5419 wc
=WConfMyStuffMySessions(self
._getAW
(),self
._conf
)
5422 def _defineSectionMenu( self
):
5423 WPConferenceDefaultDisplayBase
._defineSectionMenu
( self
)
5424 self
._sectionMenu
.setCurrentItem(self
._myStuffOpt
)
5427 class WConfMyStuffMyContributions(wcomponents
.WTemplated
):
5429 def __init__(self
,aw
,conf
):
5433 def _getContribsHTML(self
):
5434 return WConfMyContributions(self
._aw
, self
._conf
).getHTML({})
5437 vars=wcomponents
.WTemplated
.getVars(self
)
5438 vars["items"]=self
._getContribsHTML
()
5441 class WPConfMyStuffMyContributions(WPConferenceDefaultDisplayBase
):
5442 navigationEntry
= navigation
.NEMyStuff
5444 def _getBody(self
,params
):
5445 wc
=WConfMyStuffMyContributions(self
._getAW
(),self
._conf
)
5448 def _defineSectionMenu( self
):
5449 WPConferenceDefaultDisplayBase
._defineSectionMenu
( self
)
5450 self
._sectionMenu
.setCurrentItem(self
._myContribsOpt
)
5453 class WConfMyStuffMyTracks(wcomponents
.WTemplated
):
5455 def __init__(self
,aw
,conf
):
5459 def _getTracksHTML(self
):
5460 if self
._aw
.getUser() is None or not self
._conf
.getAbstractMgr().isActive() or not self
._conf
.hasEnabledSection("cfa"):
5462 lt
=self
._conf
.getCoordinatedTracks(self
._aw
.getUser())
5466 iconURL
=Config
.getInstance().getSystemIconURL("conf_edit")
5468 modURL
=urlHandlers
.UHTrackModifAbstracts
.getURL(t
)
5471 <td class="infoTD" width="100%%">%s</td>
5472 <td nowrap class="infoTD"><a href=%s>Edit</a></td>
5473 </tr>"""%(self
.htmlText(t
.getTitle()),
5474 quoteattr(str(modURL
))))
5476 <table class="groupTable width="70%%" align="center" cellspacing="0" style="padding-top: 25px;">
5478 <td class="groupTitle" colspan="4">Tracks</td>
5487 vars=wcomponents
.WTemplated
.getVars(self
)
5488 vars["items"]=self
._getTracksHTML
()
5490 from MaKaC
.webinterface
.pages
import reviewing
5491 vars["hasPaperReviewing"] = self
._conf
.hasEnabledSection('paperReviewing')
5492 vars["ContributionReviewingTemplatesList"] = reviewing
.WContributionReviewingTemplatesList(self
._conf
).getHTML({"CanDelete" : False})
5495 class WPConfMyStuffMyTracks(WPConferenceDefaultDisplayBase
):
5496 navigationEntry
= navigation
.NEMyStuff
5498 def _getBody(self
,params
):
5499 wc
=WConfMyStuffMyTracks(self
._getAW
(),self
._conf
)
5502 def _defineSectionMenu( self
):
5503 WPConferenceDefaultDisplayBase
._defineSectionMenu
( self
)
5504 self
._sectionMenu
.setCurrentItem(self
._myTracksOpt
)
5506 class WConfMyStuff(wcomponents
.WTemplated
):
5508 def __init__(self
,aw
,conf
):
5512 class WPMyStuff(WPConferenceDefaultDisplayBase
):
5513 navigationEntry
= navigation
.NEMyStuff
5515 def _getBody(self
,params
):
5516 wc
=WConfMyStuff(self
._getAW
(),self
._conf
)
5519 def _defineSectionMenu( self
):
5520 WPConferenceDefaultDisplayBase
._defineSectionMenu
( self
)
5521 self
._sectionMenu
.setCurrentItem(self
._myStuffOpt
)
5524 class WConfModAbstractBook(wcomponents
.WTemplated
):
5526 def __init__(self
,conf
):
5530 vars = wcomponents
.WTemplated
.getVars(self
)
5531 boaConfig
= self
._conf
.getBOAConfig()
5532 vars["sortByList"] = boaConfig
.getSortByTypes()
5533 vars["modURL"] = quoteattr(str(urlHandlers
.UHConfModAbstractBookEdit
.getURL(self
._conf
)))
5534 vars["previewURL"] = quoteattr(str(urlHandlers
.UHConfAbstractBook
.getURL(self
._conf
)))
5535 vars["sortBy"] = boaConfig
.getSortBy()
5536 vars["boaConfig"] = boaConfig
5537 vars["urlToogleShowIds"] = str(urlHandlers
.UHConfModAbstractBookToogleShowIds
.getURL(self
._conf
))
5538 vars["conf"] = self
._conf
5539 vars["bookOfAbstractsActive"] = self
._conf
.getAbstractMgr().getCFAStatus()
5540 vars["bookOfAbstractsMenuActive"] = displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
).getMenu().getLinkByName('abstractsBook').isEnabled()
5541 vars["correspondingAuthorList"] = boaConfig
.getCorrespondingAuthorTypes()
5542 vars["correspondingAuthor"]= boaConfig
.getCorrespondingAuthor()
5545 class WPModAbstractBook(WPConferenceModifAbstractBase
):
5547 def _setActiveTab( self
):
5548 self
._tabBOA
.setActive()
5550 def _getTabContent( self
, params
):
5551 wc
=WConfModAbstractBook(self
._conf
)
5555 class WPFullMaterialPackage(WPConfModifToolsBase
):
5557 def _setActiveTab(self
):
5558 self
._tabMatPackage
.setActive()
5560 def _getTabContent(self
, params
):
5561 wc
= WFullMaterialPackage(self
._conf
)
5565 class WFullMaterialPackage(wcomponents
.WTemplated
):
5567 def __init__(self
,conf
):
5571 vars=wcomponents
.WTemplated
.getVars(self
)
5572 if not vars.has_key("getPkgURL"):
5573 vars["getPkgURL"] = quoteattr(str(urlHandlers
.UHConfModFullMaterialPackagePerform
.getURL(self
._conf
)))
5575 #######################################
5576 # Fermi timezone awareness #
5577 #######################################
5578 sDate
= self
._conf
.getSchedule().getAdjustedStartDate()
5579 eDate
= self
._conf
.getSchedule().getAdjustedEndDate()
5580 #######################################
5581 # Fermi timezone awareness(end) #
5582 #######################################
5583 vars["selectAll"] = Config
.getInstance().getSystemIconURL("checkAll")
5584 vars["deselectAll"] = Config
.getInstance().getSystemIconURL("uncheckAll")
5586 while sDate
<= eDate
:
5589 <td nowrap="nowrap" valign="top"><input name="days" type="checkbox" checked="checked" value="%s">%s</td>
5591 """%(format_date(sDate
, format
='dMMMMyyyy'), format_date(sDate
, format
='long') ) )
5592 sDate
+= timedelta(days
=1)
5593 vars["dayList"] = "".join(htmlDay
)
5594 vars["sessionList"] = ""
5595 if len(self
._conf
.getSessionList()) == 0:
5596 vars["sessionList"] = "No session in this event"
5597 for session
in self
._conf
.getSessionList():
5598 vars["sessionList"] += i18nformat("""
5599 <input name="sessionList" type="checkbox" value="%s" checked="checked">%s _("(last modified: %s)")<br>""") % (session
.getId(),session
.getTitle(), format_datetime(session
.getModificationDate(), format
='d MMMM yyyy H:mm'))
5601 vars["materialTypes"] = MaterialFactoryRegistry
.getAllowed(self
._conf
)
5604 # ------------------ Static web pages ------------------
5606 class WPConferenceStaticDefaultDisplayBase( WPConferenceDefaultDisplayBase
):
5608 def _getHTMLHeader( self
):
5610 if len(self
._staticPars
) > 0 and self
._staticPars
.values()[0].startswith(".."):
5613 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
5617 <meta http-equiv="X-UA-Compatible" content="IE=edge" />
5618 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5619 <link rel="shortcut icon" href=%s>
5620 <link rel="stylesheet" type="text/css" href="%s/%s">
5624 """%(self
._getTitle
(), quoteattr(self
._staticPars
["addressBarIcon"]),
5625 cssDir
, Config
.getInstance().getCssStylesheetName(),
5626 self
._getWarningMessage
())
5628 def _getHeader( self
):
5631 wc
= wcomponents
.WStaticWebHeader()
5633 params
["imgLogo"] = self
._staticPars
["miniLogo"]
5634 return wc
.getHTML( params
)
5636 def _applyConfDisplayDecoration( self
, body
):
5637 frame
= WConfStaticDisplayFrame( self
._getAW
(), self
._conf
, self
._staticPars
)
5640 <div class="confBodyBox clearfix">
5641 <div style="width: 100%;">
5646 return frame
.getHTML( self
._sectionMenu
, body
, frameParams
)
5648 class WConfStaticDetails( wcomponents
.WTemplated
):
5650 def __init__(self
, aw
, conf
, staticPars
):
5653 self
._staticPars
= staticPars
5655 def _getChairsHTML( self
):
5658 for chair
in self
._conf
.getChairList():
5659 mailToURL
= """mailto:%s"""%urllib
.quote(chair
.getEmail())
5660 l
.append( """<a href=%s>%s</a>"""%(quoteattr(mailToURL
),self
.htmlText(chair
.getFullName())))
5663 res
= i18nformat("""
5665 <td align="right" valign="top" class="displayField"><b> _("Chairs"):</b></td>
5671 def _getMaterialHTML( self
):
5673 for mat
in self
._conf
.getAllMaterialList():
5674 temp
= wcomponents
.WMaterialDisplayItem()
5675 url
= urlHandlers
.UHStaticMaterialDisplay
.getRelativeURL(mat
)
5676 l
.append( temp
.getHTML( self
._aw
, mat
, url
, self
._staticPars
["material"] ) )
5679 res
= i18nformat("""
5681 <td align="right" valign="top" class="displayField"><b> _("Material"):</b></td>
5682 <td align="left" width="100%%">%s</td>
5683 </tr>""")%"<br>".join( l
)
5686 def _getMoreInfoHTML( self
):
5688 if self
._conf
.getContactInfo() != "":
5689 res
= i18nformat("""
5691 <td align="right" valign="top" class="displayField"><b> _("Additional info"):</b>
5694 </tr>""")%self
._conf
.getContactInfo()
5697 def _getActionsHTML( self
, showActions
= False):
5700 html
=[ i18nformat("""
5701 <table style="padding-top:40px; padding-left:20px">
5704 <b> _("Conference sections"):</b>
5707 menu
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
).getMenu()
5708 for link
in menu
.getLinkList():
5709 if link
.isVisible() and link
.isEnabled():
5710 html
.append(""" <li><a href="%s">%s</a></li>
5711 """%( link
.getURL(), link
.getCaption() ) )
5718 return "".join(html
)
5720 def getVars( self
):
5721 vars = wcomponents
.WTemplated
.getVars( self
)
5722 vars["description"] = self
._conf
.getDescription()
5723 sdate
, edate
= self
._conf
.getAdjustedStartDate(), self
._conf
.getAdjustedEndDate()
5724 fsdate
, fedate
= format_date(sDate
, format
='long'), format_date(eDate
, format
='long')
5725 fstime
, fetime
= sdate
.strftime("%H:%M"), edate
.strftime("%H:%M")
5726 vars["dateInterval"] = i18nformat("""_("from") %s %s _("to") %s %s""")%(fsdate
, fstime
, \
5728 if sdate
.strftime("%d%B%Y") == edate
.strftime("%d%B%Y"):
5729 timeInterval
= fstime
5730 if sdate
.strftime("%H%M") != edate
.strftime("%H%M"):
5731 timeInterval
= "%s-%s"%(fstime
, fetime
)
5732 vars["dateInterval"] = "%s (%s)"%( fsdate
, timeInterval
)
5733 vars["location"] = ""
5734 location
= self
._conf
.getLocation()
5736 vars["location"] = "<i>%s</i><br><pre>%s</pre>"%( location
.getName(), location
.getAddress() )
5737 room
= self
._conf
.getRoom()
5739 roomLink
= linking
.RoomLinker().getHTMLLink( room
, location
)
5740 vars["location"] += i18nformat("""<small> _("Room"):</small> %s""")%roomLink
5741 vars["chairs"] = self
._getChairsHTML
()
5742 vars["material"] = self
._getMaterialHTML
()
5743 vars["moreInfo"] = self
._getMoreInfoHTML
()
5744 vars["actions"] = self
._getActionsHTML
(vars.get("menuStatus", "open") != "open")
5748 class ConfStaticDisplayMenu
:
5750 def __init__(self
, menu
, linkList
):
5752 self
._linkList
= linkList
5754 def getHTML(self
, params
):
5756 html
= ["""<!--Left menu-->
5757 <div class="conf_leftMenu">
5759 <li class="menuConfTopCell">
5763 for link
in self
._linkList
:
5764 if link
.isVisible():
5765 html
.append(self
._getLinkHTML
(link
, params
))
5766 html
.append("""<li class="menuConfBottomCell"> </li>""")
5767 html
.append(""" </ul>
5768 <div align="left" class="confSupportEmailBox">%s</div>
5769 </div>"""%params
["supportEmail"])
5770 return "".join(html
)
5772 def _getLinkHTML(self
, link
, params
, indent
=""):
5773 if not link
.isVisible():
5775 if link
.getType() == "spacer":
5776 html
= """<tr><td><br></td></tr>\n"""
5779 if len(params
) > 0 and params
.values()[0].startswith(".."):
5784 for sublink
in link
.getEnabledLinkList():
5785 if sublink
.isVisible():
5786 sublinkList
.append(sublink
)
5788 if isinstance(link
,displayMgr
.ExternLink
):
5789 target
=""" target="_blank" """
5790 #Commented because menuicon variable is not used anymore
5792 # menuicon=params["arrowBottomMenuConf"]
5794 # menuicon=params["arrowRightMenuConf"]
5796 #TODO: eventually change this so that it's the same as the non-static menu
5797 if self
._menu
.isCurrentItem(link
):
5798 url
="%s%s"%(parentDir
, link
.getStaticURL())
5799 html
= ["""<li id="menuLink_%s" class="menuConfSelected" nowrap><a href="%s"%s>%s</a></li>\n"""%(sublink
.getName(), url
, target
, \
5800 _(link
.getCaption()))]
5802 url
="%s%s"%(parentDir
, link
.getStaticURL())
5803 html
= ["""<li id="menuLink_%s" class="menuConfTitle" nowrap><a class="confSection" href="%s"%s>%s</a></li>\n"""%(sublink
.getName(), url
, target
, link
.getCaption())]
5805 for sublink
in sublinkList
:
5807 if isinstance(link
, displayMgr
.ExternLink
):
5808 target
= " target=\"_blank\""
5809 if self
._menu
.isCurrentItem(sublink
):
5810 url
="%s%s"%(parentDir
, sublink
.getStaticURL())
5811 html
.append("""<li id="menuLink_%s" class="menuConfSelected" nowrap><a href="%s"%s>\
5813 %(sublink
.getName(), url
, target
, _(sublink
.getCaption())))
5815 url
="%s%s"%(parentDir
, sublink
.getStaticURL())
5816 html
.append( """<li id="menuLink_%s" class="menuConfMiddleCell" nowrap><a class="confSubSection" href="%s"%s>\
5817 <img border="0" src="%s" alt=""> %s</a></li>"""%(sublink
.getName(), url
, target
,\
5818 params
["bulletMenuConf"], _(sublink
.getCaption()) ))
5819 return "".join(html
)
5821 class WConfStaticDisplayFrame(wcomponents
.WTemplated
):
5823 def __init__(self
, aw
, conf
, staticPars
):
5826 self
._staticPars
= staticPars
5828 def getHTML( self
, menu
, body
, params
):
5831 return wcomponents
.WTemplated
.getHTML( self
, params
)
5833 def _getMenuList(self
, menuIds
):
5836 link
= self
._menu
.getLinkByName(id)
5837 if link
is not None:
5842 vars = wcomponents
.WTemplated
.getVars( self
)
5844 if self
._conf
.getLogo():
5845 vars["logo"] = "<img src=\"%s\" alt=\"%s\" border=\"0\" class=\"\" >"%(self
._staticPars
["logo"], self
._conf
.getTitle())
5846 vars["confTitle"] = self
._conf
.getTitle()
5847 tz
= DisplayTZ(self
._aw
,self
._conf
).getDisplayTZ()
5848 adjusted_sDate
= self
._conf
.getAdjustedStartDate(tz
)
5849 adjusted_eDate
= self
._conf
.getAdjustedEndDate(tz
)
5850 vars["confDateInterval"] = i18nformat("""_("from") %s _("to") %s""")%(format_date(adjusted_sDate
, format
='long'), format_date(adjusted_eDate
, format
='long'))
5851 if adjusted_sDate
.strftime("%d%B%Y") == \
5852 adjusted_eDate
.strftime("%d%B%Y"):
5853 vars["confDateInterval"] = format_date(adjusted_sDate
, format
='long')
5854 elif adjusted_sDate
.strftime("%B%Y") == adjusted_eDate
.strftime("%B%Y"):
5855 vars["confDateInterval"] = "%s-%s %s"%(adjusted_sDate
.day
, adjusted_eDate
.day
, format_date(adjusted_sDate
, format
='MMMM yyyy'))
5856 vars["confLocation"] = ""
5857 if self
._conf
.getLocationList():
5858 vars["confLocation"] = self
._conf
.getLocationList()[0].getName()
5859 vars["body"] = self
._body
5860 vars["supportEmail"] = ""
5861 if self
._conf
.getSupportInfo().hasEmail():
5862 mailto
= quoteattr("""mailto:%s?subject=%s"""%(self
._conf
.getSupportInfo().getEmail(), urllib
.quote( self
._conf
.getTitle() ) ))
5863 vars["supportEmail"] = i18nformat("""<a href=%s class="confSupportEmail"><img src="%s" border="0" alt="email"> _("support")</a>""")%(mailto
, self
._staticPars
["smallEmail"] )
5865 p
["supportEmail"] = vars["supportEmail"]
5866 menuList
= self
._getMenuList
(["overview", "programme", "timetable", "contributionList", "authorIndex", "abstractsBook"])
5867 vars["menu"] = ConfStaticDisplayMenu( self
._menu
, menuList
).getHTML(p
)
5868 format
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
).getFormat()
5869 vars["bgColorCode"] = format
.getFormatOption("titleBgColor")["code"]
5870 vars["textColorCode"] = format
.getFormatOption("titleTextColor")["code"]
5873 class WPConferenceStaticDisplay( WPConferenceStaticDefaultDisplayBase
):
5875 def __init__(self
, rh
, target
, staticPars
):
5876 WPConferenceStaticDefaultDisplayBase
.__init
__(self
, rh
, target
)
5877 self
._staticPars
= staticPars
5879 def _getBody( self
, params
):
5880 wc
= WConfStaticDetails( self
._getAW
(), self
._conf
, self
._staticPars
)
5881 return wc
.getHTML({})
5883 def _defineSectionMenu( self
):
5884 WPConferenceStaticDefaultDisplayBase
._defineSectionMenu
(self
)
5885 self
._sectionMenu
.setCurrentItem(self
._overviewOpt
)
5887 class WConfStaticProgramTrack(wcomponents
.WTemplated
):
5889 def __init__( self
, aw
, track
, staticPars
):
5892 self
._staticPars
=staticPars
5894 def getVars( self
):
5895 vars = wcomponents
.WTemplated
.getVars( self
)
5896 vars["bulletURL"] = self
._staticPars
["track_bullet"]
5897 vars["title"] = """%s """%(self
._track
.getTitle() )#"""<a href=%s>%s</a> """%(quoteattr(str(urlHandlers.UHStaticTrackContribList.getRelativeURL(self._track))), self._track.getTitle() )
5898 vars["description"] = self
._track
.getDescription()
5900 for subtrack
in self
._track
.getSubTrackList():
5901 subtracks
.append( "%s"%subtrack
.getTitle() )
5902 vars["subtracks"] = ""
5904 vars["subtracks"] = i18nformat("""<i> _("Sub-tracks") </i>: %s""")%", ".join( subtracks
)
5907 class WConfStaticProgram(wcomponents
.WTemplated
):
5909 def __init__(self
, aw
, conf
, staticPars
):
5912 self
._staticPars
= staticPars
5914 def getVars( self
):
5915 vars = wcomponents
.WTemplated
.getVars( self
)
5917 for track
in self
._conf
.getTrackList():
5918 program
.append( WConfStaticProgramTrack( self
._aw
, track
, self
._staticPars
).getHTML() )
5919 vars["program"] = "".join( program
)
5922 class WPConferenceStaticProgram( WPConferenceStaticDefaultDisplayBase
):
5924 def __init__(self
, rh
, target
, staticPars
):
5925 WPConferenceStaticDefaultDisplayBase
.__init
__(self
, rh
, target
)
5926 self
._staticPars
= staticPars
5928 def _getBody( self
, params
):
5929 wc
= WConfStaticProgram( self
._getAW
(), self
._conf
, self
._staticPars
)
5932 def _defineSectionMenu( self
):
5933 WPConferenceStaticDefaultDisplayBase
._defineSectionMenu
( self
)
5934 self
._sectionMenu
.setCurrentItem(self
._programOpt
)
5936 class WConfStaticAuthorIndex(wcomponents
.WTemplated
):
5938 def __init__(self
,aw
,conf
, staticPars
):
5941 self
._staticPars
=staticPars
5942 self
._lastLetter
= "-1"
5944 def _getMaterialHTML(self
, contrib
):
5946 paper
=contrib
.getPaper()
5947 track
=contrib
.getTrack()
5948 trackFolder
="./other_contributions"
5949 if track
is not None:
5950 trackFolder
=track
.getTitle().replace(" ","_")
5951 for mat
in contrib
.getAllMaterialList():
5952 url
="%s/%s"%(trackFolder
, str(urlHandlers
.UHStaticMaterialDisplay
.getRelativeURL(mat
)))
5953 lm
.append("""<a href=%s><span style="font-style: italic;"><small> %s</small></span></a>"""%(
5955 self
.htmlText(mat
.getTitle().lower())))
5956 return ", ".join(lm
)
5958 def _getLetterIndex(self
):
5959 url
=urlHandlers
.UHStaticConfAuthorIndex
.getRelativeURL()
5961 for letter
in ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']:
5962 res
.append("""<a href="%s#letter_%s">%s</a>"""%(str(url
),letter
, letter
))
5963 return " | ".join(res
)
5965 def _getItemHTML(self
,pl
):
5969 authCaption
="%s"%auth
.getFamilyName().upper()
5972 if len(auth
.getFamilyName()) > 0:
5973 letter
= auth
.getFamilyName()[0].lower()
5974 if self
._lastLetter
!= letter
:
5975 self
._lastLetter
= letter
5976 htmlLetter
= """<a href="" name="letter_%s"></a>"""%letter
5977 if auth
.getFirstName()!="":
5978 authCaption
="%s, %s"%(authCaption
,auth
.getFirstName())
5979 if authCaption
.strip()=="":
5983 contrib
=auth
.getContribution()
5984 url
=urlHandlers
.UHStaticContributionDisplay
.getRelativeURL(contrib
)
5985 material
= self
._getMaterialHTML
(contrib
)
5986 if material
.strip()!="":
5987 material
= " ( %s )"%material
5988 contribList
.append("""<p style="text-indent: -3em;margin-left:3em"><a href=%s>%s-%s</a>%s</p>"""%(quoteattr(str(url
)), self
.htmlText(contrib
.getId()),self
.htmlText(contrib
.getTitle()), material
))
5991 <td valign="top">%s%s</td>
5992 <td width="100%%">%s</td>
5995 <td colspan="2" style="border-bottom: 1px solid; border-color: #EAEAEA"> </td>
5996 </tr>"""%(htmlLetter
, self
.htmlText(authCaption
),"".join(contribList
))
6000 vars=wcomponents
.WTemplated
.getVars(self
)
6002 for partList
in self
._conf
.getAuthorIndex().getParticipations():
6003 res
.append(self
._getItemHTML
(partList
))
6004 vars["letterIndex"] = self
._getLetterIndex
()
6005 vars["items"]="".join(res
)
6008 class WPStaticAuthorIndex(WPConferenceStaticDefaultDisplayBase
):
6010 def __init__(self
, rh
, target
, staticPars
):
6011 WPConferenceStaticDefaultDisplayBase
.__init
__(self
, rh
, target
)
6012 self
._staticPars
= staticPars
6014 def _getBody(self
,params
):
6015 wc
=WConfStaticAuthorIndex(self
._getAW
(),self
._conf
,self
._staticPars
)
6018 def _defineSectionMenu( self
):
6019 WPConferenceStaticDefaultDisplayBase
._defineSectionMenu
( self
)
6020 self
._sectionMenu
.setCurrentItem(self
._authorIndexOpt
)
6022 class WConfStaticContributionList ( wcomponents
.WTemplated
):
6024 def __init__( self
, conf
, trackDict
):
6026 self
._trackDict
= trackDict
6028 def _getMaterialHTML(self
, contrib
):
6030 paper
=contrib
.getPaper()
6031 track
=contrib
.getTrack()
6032 trackFolder
="./other_contributions"
6033 if track
is not None:
6034 trackFolder
=track
.getTitle().replace(" ","_")
6035 for mat
in contrib
.getAllMaterialList():
6036 url
="%s/%s"%(trackFolder
, str(urlHandlers
.UHStaticMaterialDisplay
.getRelativeURL(mat
)))
6037 lm
.append("""<a href=%s><span style="font-style: italic;"><small> %s</small></span></a>"""%(
6039 self
.htmlText(mat
.getTitle().lower())))
6040 return ", ".join(lm
)
6042 def _getTrackHTML(self
, track
):
6044 <tr><td colspan="5"> </td></tr>
6046 <td class="groupTitle" colspan="5" style="background:#E5E5E5; color:gray">%s</td>
6048 <tr><td colspan="5"> </td></tr>
6049 """%(track
.getTitle())
6051 def _getContribHTML( self
, contrib
):
6053 if contrib
.isScheduled():
6054 sdate
=contrib
.getAdjustedStartDate().strftime("%d-%b-%Y %H:%M" )
6055 title
= """<a href=%s>%s</a>"""%( quoteattr( str( urlHandlers
.UHStaticContributionDisplay
.getRelativeURL( contrib
) ) ), self
.htmlText( contrib
.getTitle() ))
6057 if contrib
.getType() is not None:
6058 contribType
= contrib
.getType().getName()
6060 for spk
in contrib
.getSpeakerList():
6061 l
.append( self
.htmlText( spk
.getFullName() ) )
6062 speaker
= "<br>".join( l
)
6064 if contrib
.getSession() is not None:
6065 if contrib
.getSession().getCode() != "no code":
6066 session
=self
.htmlText(contrib
.getSession().getCode())
6068 session
=self
.htmlText(contrib
.getSession().getTitle())
6070 if contrib
.getTrack() is not None:
6071 track
= self
.htmlText( contrib
.getTrack().getCode() )
6074 <td class="abstractLeftDataCell">%s</td>
6075 <td class="abstractDataCell">%s</td>
6076 <td class="abstractDataCell">%s</td>
6077 <td class="abstractDataCell">%s</td>
6078 <td class="abstractDataCell">%s</td>
6080 """%(title
or " ", speaker
or " ",
6081 self
._getMaterialHTML
(contrib
) or " ",
6082 contribType
or " ",
6083 self
.htmlText( contrib
.getId() )
6087 def _cmpContribTitle(c1
, c2
):
6088 o1
=c1
.getTitle().lower().strip()
6089 o2
=c2
.getTitle().lower().strip()
6090 return cmp( o1
, o2
)
6091 _cmpContribTitle
=staticmethod(_cmpContribTitle
)
6093 def getVars( self
):
6094 vars = wcomponents
.WTemplated
.getVars( self
)
6097 #for track in self._conf.getTrackList():
6098 # l.append(self._getTrackHTML(track))
6099 # for contrib in self._trackDict[track.getId()]:
6100 # l.append( self._getContribHTML( contrib ) )
6101 contList
=self
._conf
.getContributionList()
6102 contList
.sort(WConfStaticContributionList
._cmpContribTitle
)
6103 for contrib
in contList
:
6104 l
.append( self
._getContribHTML
( contrib
) )
6105 vars["contributions"] = "".join(l
)
6109 class WPStaticContributionList( WPConferenceStaticDefaultDisplayBase
):
6111 def __init__(self
, rh
, target
, staticPars
, trackDict
):
6112 WPConferenceStaticDefaultDisplayBase
.__init
__(self
, rh
, target
)
6113 self
._staticPars
= staticPars
6114 self
._trackDict
= trackDict
6116 def _getBody( self
, params
):
6117 wc
= WConfStaticContributionList( self
._conf
, self
._trackDict
)
6120 def _defineSectionMenu( self
):
6121 WPConferenceStaticDefaultDisplayBase
._defineSectionMenu
( self
)
6122 self
._sectionMenu
.setCurrentItem(self
._contribListOpt
)
6124 class WPContributionStaticDisplay( WPConferenceStaticDefaultDisplayBase
):
6126 def __init__(self
, rh
, target
, staticPars
):
6127 WPConferenceStaticDefaultDisplayBase
.__init
__(self
, rh
, target
.getConference())
6128 self
._staticPars
= staticPars
6129 self
._contrib
= target
6131 def _getBody( self
, params
):
6132 wc
=WContributionStaticDisplay( self
._getAW
(), self
._contrib
, self
._staticPars
)
6135 def _defineSectionMenu( self
):
6136 WPConferenceStaticDefaultDisplayBase
._defineSectionMenu
( self
)
6137 self
._sectionMenu
.setCurrentItem(self
._contribListOpt
)
6139 class WContributionStaticDisplay(wcomponents
.WTemplated
):
6141 def __init__(self
, aw
, contrib
, staticPars
):
6143 self
._contrib
= contrib
6144 self
._staticPars
=staticPars
6146 def _getHTMLRow( self
, title
, body
):
6147 if body
.strip() == "":
6151 <td align="right" valign="top" class="displayField" nowrap><b>%s:</b></td>
6152 <td width="100%%">%s</td>
6153 </tr>"""%(title
, body
)
6156 def _getMaterialHTML(self
):
6158 paper
=self
._contrib
.getPaper()
6159 if paper
is not None:
6160 lm
.append("""<a href=%s><img src=%s border="0" alt="paper"> %s</a>"""%(
6161 quoteattr(str(urlHandlers
.UHStaticMaterialDisplay
.getRelativeURL(paper
))),
6162 quoteattr(str(self
._staticPars
["paper"])),
6163 self
.htmlText(materialFactories
.PaperFactory().getTitle())))
6164 slides
=self
._contrib
.getSlides()
6165 if slides
is not None:
6166 lm
.append("""<a href=%s><img src=%s border="0" alt="slides"> %s</a>"""%(
6167 quoteattr(str(urlHandlers
.UHStaticMaterialDisplay
.getRelativeURL(slides
))),
6168 quoteattr(str(self
._staticPars
["slides"])),
6169 self
.htmlText(materialFactories
.SlidesFactory().getTitle())))
6170 poster
=self
._contrib
.getPoster()
6171 if poster
is not None:
6172 lm
.append("""<a href=%s><img src=%s border="0" alt="poster"> %s</a>"""%(
6173 quoteattr(str(urlHandlers
.UHStaticMaterialDisplay
.getRelativeURL(poster
))),
6174 quoteattr(str(self
._staticPars
["poster"])),
6175 self
.htmlText(materialFactories
.PosterFactory().getTitle())))
6176 video
=self
._contrib
.getVideo()
6177 if video
is not None:
6178 lm
.append("""<a href=%s><img src=%s border="0" alt="video"> %s</a>"""%(
6179 quoteattr(str(urlHandlers
.UHStaticMaterialDisplay
.getRelativeURL(video
))),
6180 quoteattr(str(self
._staticPars
["video"])),
6181 self
.htmlText(materialFactories
.VideoFactory().getTitle())))
6182 iconURL
=quoteattr(str(self
._staticPars
["material"]))
6183 minutes
=self
._contrib
.getMinutes()
6184 if minutes
is not None:
6185 lm
.append("""<a href=%s><img src=%s border="0" alt="minutes"> %s</a>"""%(
6186 quoteattr(str(urlHandlers
.UHStaticMaterialDisplay
.getRelativeURL(minutes
))),
6188 self
.htmlText(materialFactories
.MinutesFactory().getTitle())))
6189 iconURL
=quoteattr(str(self
._staticPars
["material"]))
6190 for material
in self
._contrib
.getMaterialList():
6191 url
=urlHandlers
.UHStaticMaterialDisplay
.getRelativeURL(material
)
6192 lm
.append("""<a href=%s><img src=%s border="0" alt=""> %s</a>"""%(
6193 quoteattr(str(url
)),iconURL
,self
.htmlText(material
.getTitle())))
6194 return self
._getHTMLRow
("Material","<br>".join(lm
))
6196 def getVars( self
):
6197 vars = wcomponents
.WTemplated
.getVars( self
)
6199 vars["title"] = self
.htmlText(self
._contrib
.getTitle())
6200 vars["description"] = self
._contrib
.getDescription()
6201 vars["id"]=self
.htmlText(self
._contrib
.getId())
6202 vars["startDate"] = i18nformat("""--_("not yet scheduled")--""")
6203 vars["startTime"] = ""
6204 if self
._contrib
.isScheduled():
6205 vars["startDate"]=self
.htmlText(self
._contrib
.getAdjustedStartDate().strftime("%d-%b-%Y"))
6206 vars["startTime"]=self
.htmlText(self
._contrib
.getAdjustedStartDate().strftime("%H:%M"))
6208 loc
=self
._contrib
.getLocation()
6210 vars["location"]="<i>%s</i>"%(self
.htmlText(loc
.getName()))
6211 if loc
.getAddress() is not None and loc
.getAddress()!="":
6212 vars["location"]="%s <pre>%s</pre>"%(vars["location"],loc
.getAddress())
6213 room
=self
._contrib
.getRoom()
6214 if room
is not None:
6215 roomLink
=linking
.RoomLinker().getHTMLLink(room
,loc
)
6216 vars["location"]= i18nformat("""%s <small> _("Room"):</small> %s""")%(\
6217 vars["location"],roomLink
)
6218 vars["location"]=self
._getHTMLRow
( _("Place"),vars["location"])
6220 for speaker
in self
._contrib
.getSpeakerList():
6221 l
.append(self
.htmlText(speaker
.getFullName()))
6222 vars["speakers"]=self
._getHTMLRow
( _("Presenters"),"<br>".join(l
))
6225 for pa
in self
._contrib
.getPrimaryAuthorList():
6226 authCaption
="%s"%pa
.getFullName()
6227 if pa
.getAffiliation()!="":
6228 authCaption
="%s (%s)"%(authCaption
,pa
.getAffiliation())
6229 pal
.append(self
.htmlText(authCaption
))
6230 vars["primaryAuthors"]=self
._getHTMLRow
( _("Primary Authors"),"<br>".join(pal
))
6232 for ca
in self
._contrib
.getCoAuthorList():
6233 authCaption
="%s"%ca
.getFullName()
6234 if ca
.getAffiliation()!="":
6235 authCaption
="%s (%s)"%(authCaption
,ca
.getAffiliation())
6236 cal
.append(self
.htmlText(authCaption
))
6237 vars["coAuthors"]=self
._getHTMLRow
( _("Co-Authors"),"<br>".join(cal
))
6238 vars["contribType"]=""
6239 if self
._contrib
.getType() != None:
6240 vars["contribType"]=self
._getHTMLRow
( _("Contribution type"),self
.htmlText(self
._contrib
.getType().getName()))
6241 vars["material"]=self
._getMaterialHTML
()
6243 if self
._contrib
.getDuration() is not None:
6244 vars["duration"]=(datetime(1900,1,1)+self
._contrib
.getDuration()).strftime("%M'")
6245 if (datetime(1900,1,1)+self
._contrib
.getDuration()).hour
>0:
6246 vars["duration"]=(datetime(1900,1,1)+self
._contrib
.getDuration()).strftime("%Hh%M'")
6248 if self
._contrib
.getTrack():
6249 trackCaption
=self
._contrib
.getTrack().getTitle()
6250 vars["inTrack"]="""%s"""%(self
.htmlText(trackCaption
))
6251 vars["inTrack"]=self
._getHTMLRow
( _("Included in track"),vars["inTrack"])
6254 class WMaterialStaticDisplay(wcomponents
.WTemplated
):
6256 def __init__(self
, aw
, material
, staticPars
):
6257 self
._material
=material
6259 self
._staticPars
= staticPars
6261 def getVars( self
):
6262 vars=wcomponents
.WTemplated
.getVars( self
)
6263 if isinstance(self
._material
, conference
.Paper
):
6264 vars["icon"]=quoteattr(str(self
._staticPars
["paper"]))
6265 elif isinstance(self
._material
, conference
.Slides
):
6266 vars["icon"]=quoteattr(str(self
._staticPars
["slides"]))
6268 vars["icon"]=quoteattr(str(self
._staticPars
["material"]))
6269 vars["title"]=self
._material
.getTitle()
6270 vars["description"]=self
._material
.getDescription()
6272 for res
in self
._material
.getResourceList():
6273 # TODO: remove the check "isinstance", it is only for CHEP04
6274 if isinstance(res
,conference
.Link
):# and not isinstance(self._material, conference.Video):
6275 rl
.append("""<tr><td align="left">[LINK]</td><td width="100%%" align="left"><b>%s</b> <small>(<a href="%s">%s</a>)</small)</td></tr>"""%(res
.getName(), res
.getURL(), res
.getURL()))
6279 <td align="left"> </td>
6280 <td width="100%%" align="left"><b>%s</b> <small>(<a href="%s/%s">%s</a> %s)</small></td>
6281 </tr>"""%(res
.getName(),
6282 vars["rootDir"], vars["fileAccessURLGen"](res
),
6283 res
.getFileName(),strfFileSize(res
.getSize())))
6284 vars["resources"] = """
6285 <table border="0" width="100%%" align="left">
6287 </table>"""%"".join(rl
)
6291 class WPMaterialStaticDisplay( WPConferenceStaticDefaultDisplayBase
):
6293 def __init__(self
, rh
, material
, staticPars
):
6294 WPConferenceStaticDefaultDisplayBase
.__init
__(self
, rh
, material
.getConference())
6295 self
._material
=material
6296 self
._staticPars
= staticPars
6298 def _getBody( self
, params
):
6299 wc
= WMaterialStaticDisplay( self
._getAW
(), self
._material
, self
._staticPars
)
6300 pars
= {"rootDir":".", "fileAccessURLGen": urlHandlers
.UHStaticResourceDisplay
.getRelativeURL
}
6301 return wc
.getHTML( pars
)
6303 class WTrackStaticContribList ( wcomponents
.WTemplated
):
6305 def __init__( self
, track
, trackDict
):
6307 self
._conf
= track
.getConference()
6308 self
._trackDict
= trackDict
6310 def _getTrackHTML(self
, track
):
6312 <tr><td colspan="5"> </td></tr>
6314 <td class="groupTitle" colspan="5" style="background:#E5E5E5; color:gray">%s</td>
6316 <tr><td colspan="5"> </td></tr>
6317 """%(track
.getTitle())
6319 def _getMaterialHTML(self
, contrib
):
6321 paper
=contrib
.getPaper()
6322 track
=contrib
.getTrack()
6323 trackFolder
="./other_contributions"
6324 if track
is not None:
6325 trackFolder
=track
.getTitle().replace(" ","_")
6326 for mat
in self
._conf
.getAllMaterialList():
6327 url
="%s/%s"%(trackFolder
, str(urlHandlers
.UHStaticMaterialDisplay
.getRelativeURL(mat
)))
6328 lm
.append("""<a href=%s><span style="font-style: italic;"><small> %s</small></span></a>"""%(
6330 self
.htmlText(mat
.getTitle().lower())))
6331 return ", ".join(lm
)
6333 def _getContribHTML( self
, contrib
):
6335 if contrib
.isScheduled():
6336 sdate
=contrib
.getAdjustedStartDate().strftime("%d-%b-%Y %H:%M" )
6337 title
= """<a href=%s>%s</a>"""%( quoteattr( str( urlHandlers
.UHStaticContributionDisplay
.getRelativeURL( contrib
) ) ), self
.htmlText( contrib
.getTitle() ))
6339 if contrib
.getType() is not None:
6340 contribType
= contrib
.getType().getName()
6342 for spk
in contrib
.getSpeakerList():
6343 l
.append( self
.htmlText( spk
.getFullName() ) )
6344 speaker
= "<br>".join( l
)
6346 if contrib
.getSession() is not None:
6347 if contrib
.getSession().getCode() != "no code":
6348 session
=self
.htmlText(contrib
.getSession().getCode())
6350 session
=self
.htmlText(contrib
.getSession().getTitle())
6352 if contrib
.getTrack() is not None:
6353 track
= self
.htmlText( contrib
.getTrack().getCode() )
6356 <td class="abstractLeftDataCell">%s</td>
6357 <td class="abstractDataCell">%s</td>
6358 <td class="abstractDataCell">%s</td>
6359 <td class="abstractDataCell">%s</td>
6360 <td class="abstractDataCell">%s</td>
6362 """%(title
or " ", speaker
or " ",
6363 self
._getMaterialHTML
(contrib
) or " ",
6364 contribType
or " ",
6365 self
.htmlText( contrib
.getId() )
6369 def getVars( self
):
6370 vars = wcomponents
.WTemplated
.getVars( self
)
6373 l
.append(self
._getTrackHTML
(self
._track
))
6374 for contrib
in self
._trackDict
[self
._track
.getId()]:
6375 l
.append( self
._getContribHTML
( contrib
) )
6376 vars["contributions"] = "".join(l
)
6380 class WPTrackStaticContribList( WPConferenceStaticDefaultDisplayBase
):
6382 def __init__(self
, rh
, target
, staticPars
, trackDict
):
6383 WPConferenceStaticDefaultDisplayBase
.__init
__(self
, rh
, target
.getConference())
6384 self
._staticPars
= staticPars
6385 self
._track
= target
6386 self
._trackDict
= trackDict
6388 def _getBody( self
, params
):
6389 wc
= WTrackStaticContribList( self
._track
, self
._trackDict
)
6392 def _defineSectionMenu( self
):
6393 WPConferenceStaticDefaultDisplayBase
._defineSectionMenu
( self
)
6394 self
._sectionMenu
.setCurrentItem(self
._programOpt
)
6396 class WPStaticMeetingBase(WPConferenceStaticDefaultDisplayBase
):
6398 def getRootDir(self
, target
):
6400 if not isinstance(target
, conference
.Conference
):
6401 rootDir
="%s/.."%rootDir
6402 owner
=target
.getOwner()
6403 while not isinstance(owner
, conference
.Conference
):
6404 rootDir
="%s/.."%rootDir
6405 owner
=owner
.getOwner()
6408 def _getHTMLHeader( self
):
6409 path
= Config
.getInstance().getStylesheetsDir()
6410 # if a css file is associated with the XSL stylesheet, then we include it in the header
6411 styleText
= """<link rel="stylesheet" href="%s/css/%s">
6412 <link rel="stylesheet" href="%s/css/events/common.css">""" % \
6413 (self
.getRootDir(self
._target
), Config
.getInstance().getCssStylesheetName(), self
.getRootDir(self
._target
))
6415 if os
.path
.exists("%s.css" % (os
.path
.join(path
,self
._view
))):
6417 <style type="text/css">
6419 </style>""" % open("%s/%s.css" % (path
,self
._view
),"r").read()
6420 except AttributeError, e
:
6423 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
6427 <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6428 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6429 <link rel="shortcut icon" href=%s>
6432 <body>"""%(self
._getTitle
(),
6433 quoteattr(self
._staticPars
["addressBarIcon"]),
6436 def _getHeader( self
):
6439 wc
= wcomponents
.WStaticWebHeader()
6441 params
["imgLogo"] = self
._staticPars
["miniLogo"]
6442 return wc
.getHTML( params
)
6444 def _applyConfDisplayDecoration( self
, body
):
6448 class WPXSLMeetingStaticDisplay( WPStaticMeetingBase
):
6450 def __init__(self
, rh
, target
, staticPars
):
6451 WPStaticMeetingBase
.__init
__(self
, rh
, target
.getConference())
6452 self
._view
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(target
.getConference()).getDefaultStyle()
6453 if self
._view
=="static":
6454 self
._view
="standard"
6455 self
._type
= "meeting"
6457 self
._params
["showDate"] = "all"
6458 self
._params
["showSession"] = "all"
6459 self
._params
["detailLevel"] = "contribution"
6460 self
._conf
= self
._target
=target
6461 self
._staticPars
= staticPars
6463 def _getBody( self
, params
):
6466 "materialURL": "", \
6468 "sessionModifyURLGen": "", \
6469 "contribModifyURLGen": "", \
6470 "contribMaterialURLGen": "", \
6471 "subContribMaterialURLGen": "", \
6472 "sessionMaterialURLGen": "", \
6473 "subContribModifyURLGen": "", \
6474 "materialURLGen": urlHandlers
.UHMStaticMaterialDisplay
.getRelativeURL
, \
6475 "resourceURLGen": urlHandlers
.UHMStaticResourceDisplay
.getRelativeURL
}
6477 from MaKaC
.accessControl
import AccessWrapper
6478 outGen
= outputGenerator(AccessWrapper())
6479 path
= Config
.getInstance().getStylesheetsDir()
6480 stylepath
= "%s.xsl" % (os
.path
.join(path
, view
))
6481 if os
.path
.exists(stylepath
):
6482 if self
._params
.get("detailLevel", "") == "contribution" or self
._params
.get("detailLevel", "") == "":
6483 includeContribution
= 1
6485 includeContribution
= 0
6486 return outGen
.getFormattedOutput(self
._rh
, self
._conf
, stylepath
, pars
, 1, includeContribution
, 1, 1, self
._params
.get("showSession",""), self
._params
.get("showDate",""))
6488 return "Cannot find the %s stylesheet" % view
6490 class WPMMaterialStaticDisplay( WPStaticMeetingBase
):
6492 def __init__(self
, rh
, material
, staticPars
):
6493 WPStaticMeetingBase
.__init
__(self
, rh
, material
.getConference())
6494 self
._material
=self
._target
=material
6495 self
._staticPars
= staticPars
6497 def _applyConfDisplayDecoration( self
, body
):
6498 from MaKaC
.webinterface
.meeting
import WMConfDisplayFrame
6499 frame
= WMConfDisplayFrame( self
._getAW
(), self
._conf
)
6501 "logoURL": urlHandlers
.UHConferenceLogo
.getURL( self
._conf
) }
6502 if self
._conf
.getLogo():
6503 frameParams
["logoURL"] = urlHandlers
.UHConferenceLogo
.getURL( self
._conf
)
6505 confTitle
= self
._conf
.getTitle()
6509 padding
=""" style="padding:0px" """
6510 urlIndex
=str(urlHandlers
.UHStaticConferenceDisplay
.getRelativeURL())
6511 urlIndex
="%s/%s"%(self
.getRootDir(self
._material
), urlIndex
)
6512 body
= i18nformat("""
6513 <div class="confBodyBox clearfix" %s %s>
6515 <table border="0" cellpadding="0" cellspacing="0"
6516 align="center" valign="top" width="95%%">
6518 <td class="formTitle" width="100%%"> _("Added Material") - %s</td>
6521 <td align="left" valign="middle" width="100%%">
6522 <b><br><a href=%s> _("Home")</a></b>
6528 </div>""")%(colspan
,padding
,imgOpen
, confTitle
,
6529 quoteattr(urlIndex
),
6531 return frame
.getHTML( body
, frameParams
)
6533 def _getBody( self
, params
):
6534 wc
= WMaterialStaticDisplay( self
._getAW
(), self
._material
, self
._staticPars
)
6535 pars
= { "rootDir":self
.getRootDir(self
._material
), "fileAccessURLGen": urlHandlers
.UHMStaticResourceDisplay
.getRelativeURL
}
6536 return wc
.getHTML( pars
)
6539 class WConferenceStaticTimeTable(wcomponents
.WTemplated
):
6541 def __init__( self
, timeTable
, conference
, aw
):
6543 self
._timeTable
= timeTable
6544 self
._conf
= conference
6545 self
._sessionColorMap
= {}
6547 def _getRandomColor( self
, color
=1 ):
6549 r
=g
=b
= random
.randint(130,255)
6551 r
= random
.randint(130,255)
6552 g
= random
.randint(130,255)
6553 b
= random
.randint(130,255)
6554 return "#%X%X%X"%(r
,g
,b
)
6556 def _generateColor( self
, color
=1, colorMap
={} ):
6558 This function generates a color which does not already exist in the passed colormap
6560 color: indicates whether the returned color should be gray-level or colored
6561 colormap: returned color must not be in this dict.
6563 color
= self
._getRandomColor
(color
)
6564 while(color
in colorMap
.values()):
6565 color
= self
._getRandomColor
(color
)
6568 def _getSessionColor( self
, session
):
6569 if session
.getId() not in self
._sessionColorMap
.keys():
6570 color
= session
.getColor()
6571 # if color=="#F0C060" and color in self._sessionColorMap.values():
6572 # color = self._generateColor(1,self._sessionColorMap)
6573 self
._sessionColorMap
[session
.getId()] = color
6574 return self
._sessionColorMap
[session
.getId()]
6576 def _getColor( self
, entry
):
6578 if isinstance(entry
, schedule
.LinkedTimeSchEntry
) and \
6579 isinstance(entry
.getOwner(), conference
.SessionSlot
):
6580 bgcolor
= self
._getSessionColor
( entry
.getOwner().getSession() )
6581 elif isinstance(entry
, schedule
.LinkedTimeSchEntry
) and \
6582 isinstance(entry
.getOwner(), conference
.Contribution
):
6583 contrib
= entry
.getOwner()
6584 if contrib
.getSession():
6585 bgcolor
= self
._getSessionColor
( contrib
.getSession() )
6588 elif isinstance(entry
, schedule
.BreakTimeSchEntry
):
6589 owner
= entry
.getSchedule().getOwner()
6590 if isinstance(owner
,conference
.Session
):
6591 bgcolor
= self
._getSessionColor
( owner
)
6594 if entry
.getColor()!="":
6595 bgcolor
=entry
.getColor()
6598 def _getTextColor( self
, entry
):
6599 textcolor
= "#777777"
6600 if isinstance(entry
, schedule
.LinkedTimeSchEntry
) and \
6601 isinstance(entry
.getOwner(), conference
.SessionSlot
):
6602 textcolor
= entry
.getOwner().getSession().getTextColor()
6603 elif isinstance(entry
, schedule
.LinkedTimeSchEntry
) and \
6604 isinstance(entry
.getOwner(), conference
.Contribution
):
6605 contrib
= entry
.getOwner()
6606 if contrib
.getSession():
6607 textcolor
= contrib
.getSession().getTextColor()
6608 elif isinstance(entry
, schedule
.BreakTimeSchEntry
):
6609 owner
= entry
.getSchedule().getOwner()
6610 if isinstance(owner
,conference
.Session
):
6611 textcolor
= owner
.getTextColor()
6613 if entry
.getTextColor()!="":
6614 textcolor
=entry
.getTextColor()
6617 def _getContributionHTML( self
, contribution
, URL
):
6619 if contribution
.getRoom() != None:
6620 room
= "%s: "%contribution
.getRoom().getName()
6622 for spk
in contribution
.getSpeakerList():
6623 spkcapt
=spk
.getFullName()
6624 if spk
.getAffiliation().strip() != "":
6625 spkcapt
="%s (%s)"%(spkcapt
, spk
.getAffiliation())
6626 speakerList
.append(spkcapt
)
6628 if speakerList
!= []:
6629 speakers
= "<br><small>by %s</small>"%"; ".join(speakerList
)
6631 if contribution
.getSession() is not None:
6632 if contribution
.getSession().isTextColorToLinks():
6633 linkColor
="color:%s"%contribution
.getSession().getTextColor()
6634 return """<table width="100%%">
6636 <td width="100%%" align="center" style="%s">
6637 [%s] <a href="%s" style="%s">%s</a>%s<br><small>(%s%s - %s)</small>
6640 </table>"""%(linkColor
, self
.htmlText(contribution
.getId()),URL
, linkColor
,
6641 self
.htmlText(contribution
.getTitle()),
6643 contribution
.getAdjustedStartDate().strftime("%H:%M"),
6644 contribution
.getAdjustedEndDate().strftime("%H:%M") )
6646 def _getSessionHTML( self
, session
, URL
, refDay
):
6648 if session
.getRoom() != None:
6649 room
= "%s: "%session
.getRoom().getName()
6650 #################################
6651 # Fermi timezone awareness #
6652 #################################
6653 sDate
= session
.getAdjustedStartDate()
6654 eDate
= session
.getAdjustedEndDate()
6655 timeInterval
= "<br>(%s%s - %s)"%(room
, \
6656 sDate
.strftime("%H:%M"), \
6657 eDate
.strftime("%H:%M") )
6658 if session
.getAdjustedStartDate().strftime("%d%B%Y") != \
6659 refDay
.getDate().strftime("%d%B%Y") :
6660 if session
.getAdjustedEndDate().strftime("%d%B%Y") != \
6661 refDay
.getDate().strftime("%d%B%Y") :
6664 timeInterval
= i18nformat("""<br>(%s_("until") %s)""")%(room
, eDate
.strftime("%H:%M"))
6666 if session
.getAdjustedEndDate().strftime("%d%B%Y") != \
6667 refDay
.getDate().strftime("%d%B%Y") :
6668 timeInterval
= i18nformat("""<br>(%s_("from") %s)""")%(room
, sDate
.strftime("%H:%M"))
6670 #################################
6671 # Fermi timezone awareness(end) #
6672 #################################
6675 for conv
in session
.getConvenerList():
6676 l
.append("""%s"""%(self
.htmlText(conv
.getDirectFullName())))
6678 conveners
= i18nformat("""<br><small> _("Conveners"): %s</small>""")%"; ".join(l
)
6679 title
= self
.htmlText(session
.getSession().getTitle())
6680 if session
.getTitle().strip() != "":
6681 title
= "%s: %s"%(title
, session
.getTitle())
6683 if session
.getSession().isTextColorToLinks():
6684 linkColor
="color:%s"%session
.getSession().getTextColor()
6685 return """<a href="%s" style="%s">%s</a>%s<small>%s</small>"""%(URL
, linkColor
,\
6686 title
, conveners
, timeInterval
)
6688 def _getBreakHTML( self
, breakEntry
):
6690 if breakEntry
.getRoom() != None:
6691 room
= "%s: "%breakEntry
.getRoom().getName()
6693 ################################
6694 # Fermi timezone awareness #
6695 ################################
6696 sDate
= breakEntry
.getAdjustedStartDate()
6697 eDate
= breakEntry
.getAdjustedEndDate()
6698 return """<b>%s</b><br><small>(%s%s - %s)</small>"""%( breakEntry
.getTitle(),\
6700 sDate
.strftime("%H:%M"),\
6701 eDate
.strftime("%H:%M") )
6702 ################################
6703 # Fermi timezone awareness(end) #
6704 ################################
6706 def _getEntryHTML(self
,entry
,refDay
):
6707 if isinstance(entry
,schedule
.LinkedTimeSchEntry
):
6708 if isinstance(entry
.getOwner(),conference
.SessionSlot
):
6709 return self
._getSessionHTML
(entry
.getOwner(),self
._sessionURLGen
(entry
.getOwner().getSession()),refDay
)
6710 if isinstance(entry
.getOwner(), conference
.Contribution
):
6711 return self
._getContributionHTML
(entry
.getOwner(), \
6712 self
._contribURLGen
(entry
.getOwner()))
6713 elif isinstance(entry
,schedule
.BreakTimeSchEntry
):
6714 return self
._getBreakHTML
(entry
)
6716 def _getColorLegendItemHTML( self
, color
, descrip
):
6717 str = """ <span height="10px" width="20px" style="background:%s; border:1px solid black;font-size: 10px;"> </span>
6718 <span align="left" style="font-size: 10px;">%s</span>
6719 """%(color
, descrip
)
6722 def _getColorLegendHTML( self
):
6723 html
= """<table bgcolor="white" cellpadding="0" cellspacing="1" width="100%%" style="padding:3px; border-top:1px solid #E6E6E6;border-bottom:1px solid #E6E6E6;">
6725 <td bgcolor="white" width="100%%" align="center">
6733 l
.append( self
._getColorLegendItemHTML
( "#90C0F0", _("Conference break")) )
6734 l
.append( self
._getColorLegendItemHTML
( "#F6F6F6", _("Conference contribution")) )
6735 for sessionId
in self
._sessionColorMap
.keys():
6736 session
= self
._conf
.getSessionById( sessionId
)
6737 str = self
._getColorLegendItemHTML
(\
6738 self
._sessionColorMap
[ sessionId
],\
6739 i18nformat(""" _("Session"): <i>%s </i>""")%session
.getTitle())
6741 return html
%" - ".join( l
)
6743 def _getHTMLTimeTable( self
, highDetailLevel
=0 ):
6744 self
._sessionColorMap
= {}
6746 num_slots_in_hour
=int(timedelta(hours
=1).seconds
/self
._timeTable
.getSlotLength().seconds
)
6747 for day
in self
._timeTable
.getDayList():
6748 self
._sessionColorMap
.clear()
6752 maxOverlap
=day
.getNumMaxOverlaping()
6755 width
=100/maxOverlap
6758 for hour
in range(day
.getStartHour(),day
.getEndHour()+1):
6761 for slot
in day
.getSlotsOnHour(hour
):
6762 remColSpan
=maxOverlap
6764 entryList
=slot
.getEntryList()
6765 entryList
.sort(timetable
.sortEntries
)
6766 for entry
in entryList
:
6769 if len(slot
.getEntryList()):
6773 if entry
in lastEntries
:
6775 bgcolor
=self
._getColor
(entry
)
6776 textcolor
=self
._getTextColor
(entry
)
6778 if not day
.hasEntryOverlaps(entry
):
6779 colspan
=""" colspan="%s" """%maxOverlap
6780 temp
.append("""<td valign="top" rowspan="%i" align="center" bgcolor="%s" width="%i%%"%s><font color="%s">%s</font></td>"""%(day
.getNumSlots(entry
),bgcolor
, width
, colspan
, textcolor
, self
._getEntryHTML
(entry
,day
)))
6781 lastEntries
.append(entry
)
6783 temp
.append("""<td width="100%%" colspan="%i"></td>"""%(remColSpan))
6784 if slot
.getAdjustedStartDate().minute
==0:
6785 hourSlots
.append("""
6787 <td valign="top" rowspan="%s" bgcolor="white" width="10" style="padding-right: 5px;"><font color="gray" size="-1">%02i:00</font></td>
6790 """%(num_slots_in_hour
,\
6795 temp
= ["<td></td>"]
6796 hourSlots
.append("""<tr>%s</tr>"""%"".join(temp
))
6800 <td valign="top" bgcolor="white" width="10" style="padding-right: 5px;"><font color="gray" size="-1">%02i:00</font></td>
6804 slotList
.append("".join(hourSlots
))
6807 legend
=self
._getColorLegendHTML
()
6810 <table align="center" width="100%%">
6813 <table align="center" border="0" width="100%%"
6814 celspacing="0" cellpadding="0" bgcolor="#E6E6E6">
6816 <td colspan="%i" align="center" bgcolor="white"><b>%s</b></td>
6819 <td colspan="%i">%s</td>
6827 format_date(day
.getDate(), format
='full'), \
6828 maxOverlap
+2, legend
, \
6831 str = "<br>".join( daySch
)
6834 def getVars( self
):
6835 vars = wcomponents
.WTemplated
.getVars( self
)
6836 self
._contribURLGen
= vars["contribURLGen"]
6837 self
._sessionURLGen
= vars["sessionURLGen"]
6838 vars["timetable"] = self
._getHTMLTimeTable
(vars.get("detailLevel", "") == "contribution")
6843 class WPConferenceStaticTimeTable( WPConferenceStaticDefaultDisplayBase
):
6845 def __init__(self
, rh
, target
, staticPars
):
6846 WPConferenceStaticDefaultDisplayBase
.__init
__(self
, rh
, target
)
6847 self
._staticPars
= staticPars
6849 def _getEntryList(self
):
6850 lsessions
= self
._conf
.getSchedule().getEntries()
6852 for entry
in lsessions
:
6853 if isinstance(entry
,schedule
.LinkedTimeSchEntry
):
6854 owner
= entry
.getOwner()
6855 if isinstance(owner
, conference
.SessionSlot
):
6856 if owner
.canAccess(self
._getAW
()):
6858 elif owner
.canView(self
._getAW
()):
6859 if isinstance(owner
,conference
.SessionSlot
):
6861 for slotEntry
in slot
.getSchedule().getEntries():
6862 if isinstance(slotEntry
.getOwner(),conference
.Contribution
):
6863 if slotEntry
.getOwner().canAccess(self
._getAW
()):
6864 res
.append(slotEntry
)
6866 if owner
.canAccess(self
._getAW
()):
6872 def _getParallelTimeTable( self
, params
):
6873 tz
= DisplayTZ(self
._getAW
(),self
._conf
).getDisplayTZ()
6874 tt
= timetable
.TimeTable( self
._conf
.getSchedule(), tz
)
6875 #####################################
6876 # Fermi timezone awareness #
6877 #####################################
6878 sDate
= self
._conf
.getSchedule().getStartDate(tz
)
6879 eDate
= self
._conf
.getSchedule().getEndDate(tz
)
6880 #####################################
6881 # Fermi timezone awareness(end) #
6882 #####################################
6883 tt
.setStartDate( sDate
)
6884 tt
.setEndDate( eDate
)
6885 tt
.mapEntryList(self
._getEntryList
())
6888 def _getBody( self
, params
):
6889 tt
= self
._getParallelTimeTable
( params
)
6890 wc
= WConferenceStaticTimeTable( tt
, self
._conf
, self
._getAW
() )
6891 pars
= {"contribURLGen": urlHandlers
.UHStaticContributionDisplay
.getRelativeURL
, \
6892 "sessionURLGen": urlHandlers
.UHStaticSessionDisplay
.getRelativeURL
}
6893 return wc
.getHTML( pars
)
6895 def _defineSectionMenu( self
):
6896 WPConferenceStaticDefaultDisplayBase
._defineSectionMenu
( self
)
6897 self
._sectionMenu
.setCurrentItem(self
._timetableOpt
)
6899 class WSessionStaticDisplay(wcomponents
.WTemplated
):
6901 def __init__(self
,aw
,session
):
6903 self
._session
=session
6905 def _getHTMLRow(self
,title
,body
):
6908 <td nowrap class="displayField" valign="top"><b>%s:</b></td>
6910 </tr>"""%(title
,body
)
6911 if body
.strip() == "":
6915 def _getColor(self
,entry
):
6917 if isinstance(entry
,schedule
.LinkedTimeSchEntry
):
6918 if isinstance(entry
.getOwner(),conference
.Contribution
):
6919 bgcolor
= entry
.getOwner().getSession().getColor()
6920 elif isinstance(entry
,schedule
.BreakTimeSchEntry
):
6921 bgcolor
= entry
.getColor()
6924 def _getContributionHTML(self
,contrib
):
6925 URL
=urlHandlers
.UHStaticContributionDisplay
.getRelativeURL(contrib
, "..")
6927 if contrib
.getRoom() != None:
6928 room
= "%s: "%contrib
.getRoom().getName()
6930 for spk
in contrib
.getSpeakerList():
6931 speakerList
.append(spk
.getDirectFullName())
6933 if speakerList
!= []:
6934 speakers
= i18nformat("""<br><small> _("by") %s</small>""")%"; ".join(speakerList
)
6936 if contrib
.getSession().isTextColorToLinks():
6937 linkColor
="color:%s"%contrib
.getSession().getTextColor()
6938 return """<table width="100%%">
6940 <td width="100%%" align="center" style="color:%s">
6941 [%s] <a href="%s" style="%s">%s</a>%s<br><small>(%s%s - %s)</small>
6945 contrib
.getSession().getTextColor(),contrib
.getId(),URL
,\
6946 linkColor
, contrib
.getTitle(),speakers
,room
,
6947 contrib
.getAdjustedStartDate().strftime("%H:%M"),
6948 contrib
.getAdjustedEndDate().strftime("%H:%M") )
6950 def _getBreakHTML(self
,breakEntry
):
6952 <font color="%s">%s<br><small>(%s - %s)</small></font>
6954 breakEntry
.getTextColor(),\
6955 self
.htmlText(breakEntry
.getTitle()),\
6956 self
.htmlText(breakEntry
.getAdjustedStartDate().strftime("%H:%M")),\
6957 self
.htmlText(breakEntry
.getAdjustedEndDate().strftime("%H:%M")))
6959 def _getSchEntries(self
):
6961 for slot
in self
._session
.getSlotList():
6962 for entry
in slot
.getSchedule().getEntries():
6966 def _getEntryHTML(self
,entry
):
6967 if isinstance(entry
,schedule
.LinkedTimeSchEntry
):
6968 if isinstance(entry
.getOwner(),conference
.Contribution
):
6969 return self
._getContributionHTML
(entry
.getOwner())
6970 elif isinstance(entry
,schedule
.BreakTimeSchEntry
):
6971 return self
._getBreakHTML
(entry
)
6973 def _getTimeTableHTML(self
):
6974 tz
= DisplayTZ(self
._aw
,self
._session
.getConference()).getDisplayTZ()
6975 timeTable
=timetable
.TimeTable(self
._session
.getSchedule(), tz
)
6976 sDate
,eDate
=self
._session
.getAdjustedStartDate(tz
),self
._session
.getAdjustedEndDate(tz
)
6977 timeTable
.setStartDate(sDate
)
6978 timeTable
.setEndDate(eDate
)
6979 timeTable
.mapEntryList(self
._getSchEntries
())
6981 num_slots_in_hour
=int(timedelta(hours
=1).seconds
/timeTable
.getSlotLength().seconds
)
6982 hourSlots
,hourNeedsDisplay
=[],False
6983 for day
in timeTable
.getDayList():
6986 maxOverlap
=day
.getNumMaxOverlaping()
6989 width
=100/maxOverlap
6992 for slot
in day
.getSlotList():
6993 if slot
.getAdjustedStartDate().minute
==0:
6994 if hourNeedsDisplay
:
6995 slotList
.append("".join(hourSlots
))
6996 hourSlots
,hourNeedsDisplay
=[],False
6997 remColSpan
=maxOverlap
6999 for entry
in slot
.getEntryList():
7000 hourNeedsDisplay
=True
7001 if len(slot
.getEntryList()):
7005 if entry
in lastEntries
:
7007 bgcolor
=self
._getColor
(entry
)
7009 if not day
.hasEntryOverlaps(entry
):
7010 colspan
=""" colspan="%s" """%maxOverlap
7011 temp
.append("""<td valign="top" rowspan="%i" align="center" bgcolor="%s" width="%i%%"%s>%s</td>"""%(day
.getNumSlots(entry
),bgcolor
,width
,colspan
,self
._getEntryHTML
(entry
)))
7012 lastEntries
.append(entry
)
7014 temp
.append("""<td width="100%%" colspan="%i"></td>"""%(remColSpan))
7015 if slot
.getAdjustedStartDate().minute
==0:
7018 <td valign="top" rowspan="%s" bgcolor="white" width="40"><font color="gray" size="-1">%s</font></td>
7021 """%(num_slots_in_hour
,\
7022 slot
.getAdjustedStartDate().strftime("%H:%M"),\
7026 temp
= ["<td></td>"]
7027 str = """<tr>%s</tr>"""%"".join(temp
)
7028 hourSlots
.append(str)
7031 <table align="center" width="100%%">
7034 <table align="center" border="0" width="100%%"
7035 celspacing="0" cellpadding="0" bgcolor="#E6E6E6">
7037 <td colspan="%i" align="center" bgcolor="white"><b>%s</b></td>
7044 """%(day
.getDate().strftime("%Y-%m-%d"),maxOverlap
+2,
7045 format_date(day
.getDate(), format
='full'),
7048 str = "<br>".join( daySch
)
7052 vars=wcomponents
.WTemplated
.getVars( self
)
7054 vars["title"]=self
.htmlText(self
._session
.getTitle())
7056 if self
._session
.getDescription():
7057 desc
= self
._session
.getDescription().strip()
7062 vars["description"]="""
7064 <td colspan="2">%s</td>
7068 vars["description"] = ""
7070 #################################
7071 # Fermi timezone awareness #
7072 #################################
7073 sDate
=self
._session
.getAdjustedStartDate()
7074 eDate
=self
._session
.getAdjustedEndDate()
7075 if sDate
.strftime("%d%b%Y")==eDate
.strftime("%d%b%Y"):
7076 vars["dateInterval"]=format_datetime(sDate
, format
='EEEE d MMMM yyyy H:mm')
7078 vars["dateInterval"]=i18nformat("""_("from") %s _("to") %s""")%(
7079 format_datetime(sDate
, format
='EEEE d MMMM yyyy H:mm'),
7080 format_datetime(eDate
, format
='EEEE d MMMM yyyy H:mm'))
7081 #################################
7082 # Fermi timezone awareness(end) #
7083 #################################
7086 loc
=self
._session
.getLocation()
7087 if loc
is not None and loc
.getName().strip()!="":
7088 vars["location"]="""<i>%s</i>"""%self
.htmlText(loc
.getName())
7089 if loc
.getAddress().strip()!="":
7090 vars["location"]="""%s<pre>%s</pre>"""%(vars["location"],
7092 room
= self
._session
.getRoom()
7093 if room
is not None:
7094 roomLink
=linking
.RoomLinker().getHTMLLink(room
,loc
)
7095 vars["location"]= i18nformat("""%s<br><small> _("Room"):</small> %s""")%(vars["location"],
7097 vars["location"]=self
._getHTMLRow
("Place", vars["location"])
7100 for convener
in self
._session
.getConvenerList():
7101 sessionConvs
.append("""<a href="mailto:%s">%s</a>"""%(convener
.getEmail(),
7102 self
.htmlText(convener
.getFullName())))
7104 for entry
in self
._session
.getSchedule().getEntries():
7105 slot
=entry
.getOwner()
7107 for convener
in slot
.getOwnConvenerList():
7108 l
.append("""<a href="mailto:%s">%s</a>"""%(convener
.getEmail(),
7109 self
.htmlText(convener
.getFullName())))
7113 <td valign="top">%s (<small>%s-%s</small>):</td>
7116 """%(self
.htmlText(slot
.getTitle()),
7117 slot
.getAdjustedStartDate().strftime("%d-%b-%y %H:%M"),
7118 slot
.getAdjustedEndDate().strftime("%d-%b-%y %H:%M"),
7121 if len(sessionConvs
)>0 or slotConvsHTML
.strip()!="":
7125 <td valign="top" colspan="2">%s</td>
7128 </table>"""%("<br>".join(sessionConvs
),slotConvsHTML
)
7129 vars["conveners"]=self
._getHTMLRow
( _("Conveners"),convs
)
7131 for material
in self
._session
.getAllMaterialList():
7132 url
=urlHandlers
.UHStaticMaterialDisplay
.getRelativeURL(material
)
7133 lm
.append(wcomponents
.WMaterialDisplayItem().getHTML(self
._aw
,material
,url
))
7134 vars["material"] = self
._getHTMLRow
( _("Material"), "<br>".join( lm
) )
7135 vars["contribs"]= ""
7136 if self
._session
.getContributionList() != []:
7137 vars["contribs"]=self
._getTimeTableHTML
()
7141 class WPSessionStaticDisplay(WPConferenceStaticDefaultDisplayBase
):
7143 def __init__(self
, rh
, target
, staticPars
):
7144 WPConferenceStaticDefaultDisplayBase
.__init
__(self
, rh
, target
.getConference())
7145 self
._session
= target
7146 self
._staticPars
= staticPars
7148 def _defineSectionMenu(self
):
7149 WPConferenceStaticDefaultDisplayBase
._defineSectionMenu
(self
)
7150 self
._sectionMenu
.setCurrentItem(self
._timetableOpt
)
7152 def _getBody(self
,params
):
7153 wc
= WSessionStaticDisplay(self
._getAW
(), self
._session
)
7156 #------------------------ End Static ---------------------------------------------------------------
7159 class WDVDDone(wcomponents
.WTemplated
):
7162 vars = wcomponents
.WTemplated
.getVars(self
)
7163 vars["supportAddr"] = Config
.getInstance().getSupportEmail()
7167 class WPDVDDone(WPConfModifToolsBase
):
7169 def _setActiveTab(self
):
7170 self
._tabOfflineSite
.setActive()
7172 def _getTabContent(self
, params
):
7175 p
["url"] = quoteattr(str(params
.get("url")))
7179 class WPConfModifDVDCreationConfirm(WPConfModifToolsBase
):
7181 def _setActiveTab(self
):
7182 self
._tabOfflineSite
.setActive()
7184 def _getTabContent(self
, params
):
7185 wc
= wcomponents
.WConfirmation()
7186 msg
= """<br>Please confirm that you want to create an "Offline Website" for your event<br>
7187 <font color="red">(note if you confirm you cannot stop the creation of the website )</font><br>"""
7188 url
= urlHandlers
.UHConfDVDCreation
.getURL(self
._conf
)
7189 return wc
.getHTML(msg
, url
, {})
7192 class WTimeTableCustomizePDF(wcomponents
.WTemplated
):
7194 def __init__(self
, conf
):
7198 vars = wcomponents
.WTemplated
.getVars(self
)
7199 url
= urlHandlers
.UHConfTimeTablePDF
.getURL(self
._conf
)
7200 vars["getPDFURL"] = quoteattr(str(url
))
7201 vars["showDays"] = vars.get("showDays", "all")
7202 vars["showSessions"] = vars.get("showSessions", "all")
7204 wc
= WConfCommonPDFOptions(self
._conf
)
7205 vars["commonPDFOptions"] = wc
.getHTML()
7210 class WPTimeTableCustomizePDF(WPConferenceDefaultDisplayBase
):
7211 navigationEntry
= navigation
.NETimeTableCustomizePDF
7213 def _getBody(self
, params
):
7214 wc
= WTimeTableCustomizePDF(self
._conf
)
7215 return wc
.getHTML(params
)
7217 def _defineSectionMenu(self
):
7218 WPConferenceDefaultDisplayBase
._defineSectionMenu
(self
)
7219 self
._sectionMenu
.setCurrentItem(self
._timetableOpt
)
7222 class WConfModifPendingQueuesList(wcomponents
.WTemplated
):
7224 def __init__(self
, url
, title
, target
, list, pType
):
7227 self
._target
= target
7231 def _cmpByConfName(self
, cp1
, cp2
):
7232 if cp1
is None and cp2
is not None:
7234 elif cp1
is not None and cp2
is None:
7236 elif cp1
is None and cp2
is None:
7238 return cmp(cp1
.getTitle(), cp2
.getTitle())
7240 def _cmpByContribName(self
, cp1
, cp2
):
7241 if cp1
is None and cp2
is not None:
7243 elif cp1
is not None and cp2
is None:
7245 elif cp1
is None and cp2
is None:
7247 return cmp(cp1
.getContribution().getTitle(), cp2
.getContribution().getTitle())
7249 def _cmpBySessionName(self
, cp1
, cp2
):
7250 if cp1
is None and cp2
is not None:
7252 elif cp1
is not None and cp2
is None:
7254 elif cp1
is None and cp2
is None:
7256 return cmp(cp1
.getSession().getTitle(), cp2
.getSession().getTitle())
7259 vars = wcomponents
.WTemplated
.getVars(self
)
7261 vars["postURL"] = self
._postURL
7262 vars["title"] = self
._title
7263 vars["target"] = self
._target
7264 vars["list"] = self
._list
7265 vars["pType"] = self
._pType
7270 class WConfModifPendingQueues(wcomponents
.WTemplated
):
7272 def __init__(self
, conf
, aw
, activeTab
="submitters"):
7275 self
._activeTab
= activeTab
7276 self
._pendingConfSubmitters
= self
._conf
.getPendingQueuesMgr().getPendingConfSubmitters()
7277 self
._pendingSubmitters
= self
._conf
.getPendingQueuesMgr().getPendingSubmitters()
7278 self
._pendingManagers
= self
._conf
.getPendingQueuesMgr().getPendingManagers()
7279 self
._pendingCoordinators
= self
._conf
.getPendingQueuesMgr().getPendingCoordinators()
7281 def _createTabCtrl(self
):
7282 self
._tabCtrl
= wcomponents
.TabControl()
7283 url
= urlHandlers
.UHConfModifPendingQueues
.getURL(self
._conf
)
7284 url
.addParam("tab", "conf_submitters")
7285 self
._tabConfSubmitters
= self
._tabCtrl
.newTab("conf_submitters", \
7286 _("Pending Conference Submitters"),str(url
))
7287 url
.addParam("tab", "submitters")
7288 self
._tabSubmitters
= self
._tabCtrl
.newTab("submitters", \
7289 _("Pending Contribution Submitters"),str(url
))
7290 url
.addParam("tab", "managers")
7291 self
._tabManagers
= self
._tabCtrl
.newTab("managers", \
7292 _("Pending Managers"),str(url
))
7293 url
.addParam("tab", "coordinators")
7294 self
._tabCoordinators
= self
._tabCtrl
.newTab("coordinators", \
7295 _("Pending Coordinators"),str(url
))
7296 self
._tabSubmitters
.setEnabled(True)
7297 tab
= self
._tabCtrl
.getTabById(self
._activeTab
)
7299 tab
= self
._tabCtrl
.getTabById("conf_submitters")
7303 vars = wcomponents
.WTemplated
.getVars(self
)
7304 self
._createTabCtrl
()
7309 if self
._tabConfSubmitters
.isActive():
7310 # Pending conference submitters
7311 keys
= self
._conf
.getPendingQueuesMgr().getPendingConfSubmittersKeys(True)
7313 url
= urlHandlers
.UHConfModifPendingQueuesActionConfSubm
.getURL(self
._conf
)
7314 url
.addParam("tab","conf_submitters")
7315 title
= _("Pending chairpersons/speakers to become submitters")
7316 target
= _("Conference")
7317 pType
= "ConfSubmitters"
7320 list.append((key
, self
._pendingConfSubmitters
[key
][:]))
7322 if self
._tabSubmitters
.isActive():
7323 # Pending submitters
7324 keys
= self
._conf
.getPendingQueuesMgr().getPendingSubmittersKeys(True)
7326 url
= urlHandlers
.UHConfModifPendingQueuesActionSubm
.getURL(self
._conf
)
7327 url
.addParam("tab", "submitters")
7328 title
= _("Pending authors/speakers to become submitters")
7329 target
= _("Contribution")
7330 pType
= "Submitters"
7333 list.append((key
, self
._pendingSubmitters
[key
][:]))
7335 elif self
._tabManagers
.isActive():
7337 keys
= self
._conf
.getPendingQueuesMgr().getPendingManagersKeys(True)
7339 url
= urlHandlers
.UHConfModifPendingQueuesActionMgr
.getURL(self
._conf
)
7340 url
.addParam("tab", "managers")
7341 title
= _("Pending conveners to become managers")
7342 target
= _("Session")
7346 list.append((key
, self
._pendingManagers
[key
][:]))
7347 #list.sort(conference.SessionChair._cmpFamilyName)
7349 elif self
._tabCoordinators
.isActive():
7350 # Pending coordinators
7351 keys
= self
._conf
.getPendingQueuesMgr().getPendingCoordinatorsKeys(True)
7353 url
= urlHandlers
.UHConfModifPendingQueuesActionCoord
.getURL(self
._conf
)
7354 url
.addParam("tab", "coordinators")
7355 title
= _("Pending conveners to become coordinators")
7356 target
= _("Session")
7357 pType
= "Coordinators"
7360 list.append((key
, self
._pendingCoordinators
[key
][:]))
7361 list.sort(conference
.ConferenceParticipation
._cmpFamilyName
)
7363 html
= WConfModifPendingQueuesList(str(url
), title
, target
, list, pType
).getHTML()
7364 vars["pendingQueue"] = wcomponents
.WTabControl(self
._tabCtrl
, self
._aw
).getHTML(html
)
7365 vars["backURL"] = quoteattr(str(urlHandlers
.UHConfModifListings
.getURL(self
._conf
)))
7370 class WPConfModifPendingQueuesBase(WPConfModifListings
):
7372 def __init__(self
, rh
, conf
, activeTab
=""):
7373 WPConfModifListings
.__init
__(self
, rh
, conf
)
7374 self
._activeTab
= activeTab
7376 def _getTabContent(self
, params
):
7377 banner
= wcomponents
.WListingsBannerModif(self
._conf
, _("Pending queues")).getHTML()
7378 return banner
+ self
._getTabContent
(params
)
7380 def _setActiveSideMenuItem(self
):
7381 self
._listingsMenuItem
.setActive(True)
7384 class WPConfModifPendingQueues(WPConfModifPendingQueuesBase
):
7386 def _getTabContent(self
, params
):
7387 wc
= WConfModifPendingQueues(self
._conf
, self
._getAW
(), self
._activeTab
)
7390 class WPConfModifPendingQueuesRemoveConfSubmConfirm(WPConfModifPendingQueuesBase
):
7392 def __init__(self
, rh
, conf
, pendingConfSubms
):
7393 WPConfModifPendingQueuesBase
.__init
__(self
, rh
, conf
)
7394 self
._pendingConfSubms
= pendingConfSubms
7396 def _getTabContent(self
,params
):
7397 wc
= wcomponents
.WConfirmation()
7398 psubs
= ''.join(list("<li>{0}</li>".format(s
) for s
in self
._pendingConfSubms
))
7400 msg
= {'challenge': _("Are you sure you want to delete the following users pending to become submitters?"),
7401 'target': "<ul>{0}</ul>".format(psubs
),
7402 'subtext': _("Please note that they will still remain as user"),
7405 url
= urlHandlers
.UHConfModifPendingQueuesActionConfSubm
.getURL(self
._conf
)
7406 return wc
.getHTML(msg
,url
,{"pendingSubmitters":self
._pendingConfSubms
, "remove": _("remove")})
7408 class WPConfModifPendingQueuesRemoveSubmConfirm(WPConfModifPendingQueuesBase
):
7410 def __init__(self
, rh
, conf
, pendingSubms
):
7411 WPConfModifPendingQueuesBase
.__init
__(self
, rh
, conf
)
7412 self
._pendingSubms
= pendingSubms
7414 def _getTabContent(self
, params
):
7415 wc
= wcomponents
.WConfirmation()
7416 psubs
= ''.join(list("<li>{0}</li>".format(s
) for s
in self
._pendingSubms
))
7418 msg
= {'challenge': _("Are you sure you want to delete the following participants pending to become submitters?"),
7419 'target': "<ul>{0}</ul>".format(psubs
),
7420 'subtext': _("Please note that they will still remain as participants"),
7423 url
= urlHandlers
.UHConfModifPendingQueuesActionSubm
.getURL(self
._conf
)
7424 return wc
.getHTML(msg
, url
, {"pendingSubmitters": self
._pendingSubms
, "remove": _("remove")})
7426 class WPConfModifPendingQueuesReminderConfSubmConfirm(WPConfModifPendingQueuesBase
):
7428 def __init__(self
, rh
, conf
, pendingConfSubms
):
7429 WPConfModifPendingQueuesBase
.__init
__(self
, rh
, conf
)
7430 self
._pendingConfSubms
= pendingConfSubms
7432 def _getTabContent(self
,params
):
7433 wc
= wcomponents
.WConfirmation()
7434 psubs
= ''.join(list("<li>{0}</li>".format(s
) for s
in self
._pendingConfSubms
))
7436 msg
= {'challenge': _("Are you sure that you want to send these users an email with a reminder to create an account in Indico?"),
7437 'target': "<ul>{0}</ul>".format(psubs
)
7439 url
= urlHandlers
.UHConfModifPendingQueuesActionConfSubm
.getURL(self
._conf
)
7443 "pendingSubmitters": self
._pendingConfSubms
,
7444 "reminder": _("reminder")
7448 class WPConfModifPendingQueuesReminderSubmConfirm( WPConfModifPendingQueuesBase
):
7450 def __init__(self
,rh
, conf
, pendingSubms
):
7451 WPConfModifPendingQueuesBase
.__init
__(self
,rh
,conf
)
7452 self
._pendingSubms
= pendingSubms
7454 def _getTabContent(self
,params
):
7455 wc
= wcomponents
.WConfirmation()
7457 psubs
= ''.join(list("<li>{0}</li>".format(s
) for s
in self
._pendingSubms
))
7459 msg
= {'challenge': _("Are you sure that you want to send these users an email with a reminder to create an account in Indico?"),
7460 'target': "<ul>{0}</ul>".format(psubs
)
7463 url
= urlHandlers
.UHConfModifPendingQueuesActionSubm
.getURL(self
._conf
)
7467 "pendingSubmitters": self
._pendingSubms
,
7468 "reminder": _("reminder")
7472 class WPConfModifPendingQueuesRemoveMgrConfirm( WPConfModifPendingQueuesBase
):
7474 def __init__(self
,rh
, conf
, pendingMgrs
):
7475 WPConfModifPendingQueuesBase
.__init
__(self
,rh
,conf
)
7476 self
._pendingMgrs
= pendingMgrs
7478 def _getTabContent(self
,params
):
7479 wc
= wcomponents
.WConfirmation()
7481 pmgrs
= ''.join(list("<li>{0}</li>".format(s
) for s
in self
._pendingMgrs
))
7483 msg
= {'challenge': _("Are you sure you want to delete the following conveners pending to become managers?"),
7484 'target': "<ul>{0}</ul>".format(pmgrs
),
7485 'subtext': _("Please note that they will still remain as conveners")
7488 url
= urlHandlers
.UHConfModifPendingQueuesActionMgr
.getURL(self
._conf
)
7489 return wc
.getHTML(msg
,url
,{"pendingManagers":self
._pendingMgrs
, "remove": _("remove")})
7491 class WPConfModifPendingQueuesReminderMgrConfirm( WPConfModifPendingQueuesBase
):
7493 def __init__(self
,rh
, conf
, pendingMgrs
):
7494 WPConfModifPendingQueuesBase
.__init
__(self
,rh
,conf
)
7495 self
._pendingMgrs
= pendingMgrs
7497 def _getTabContent(self
,params
):
7498 wc
= wcomponents
.WConfirmation()
7500 pmgrs
= ''.join(list("<li>{0}</li>".format(s
) for s
in self
._pendingMgrs
))
7502 msg
= {'challenge': _("Are you sure that you want to send these users an email with a reminder to create an account in Indico?"),
7503 'target': "<ul>{0}</ul>".format(pmgrs
)
7506 url
= urlHandlers
.UHConfModifPendingQueuesActionMgr
.getURL(self
._conf
)
7507 return wc
.getHTML(msg
,url
,{"pendingManagers":self
._pendingMgrs
, "reminder": _("reminder")})
7509 class WPConfModifPendingQueuesRemoveCoordConfirm( WPConfModifPendingQueuesBase
):
7511 def __init__(self
,rh
, conf
, pendingCoords
):
7512 WPConfModifPendingQueuesBase
.__init
__(self
,rh
,conf
)
7513 self
._pendingCoords
= pendingCoords
7515 def _getTabContent(self
,params
):
7516 wc
= wcomponents
.WConfirmation()
7518 pcoords
= ''.join(list("<li>{0}</li>".format(s
) for s
in self
._pendingMgrs
))
7520 msg
= {'challenge': _("Are you sure you want to delete the following conveners pending to become coordinators?"),
7521 'target': "<ul>{0}</ul>".format(pcoords
),
7522 'subtext': _("Please note that they will still remain as conveners")
7525 url
= urlHandlers
.UHConfModifPendingQueuesActionCoord
.getURL(self
._conf
)
7526 return wc
.getHTML(msg
, url
,{
7527 "pendingCoordinators": self
._pendingCoords
,
7528 "remove": _("remove")
7531 class WPConfModifPendingQueuesReminderCoordConfirm( WPConfModifPendingQueuesBase
):
7533 def __init__(self
,rh
, conf
, pendingCoords
):
7534 WPConfModifPendingQueuesBase
.__init
__(self
,rh
,conf
)
7535 self
._pendingCoords
= pendingCoords
7537 def _getTabContent(self
,params
):
7538 wc
= wcomponents
.WConfirmation()
7540 pcoords
= ''.join(list("<li>{0}</li>".format(s
) for s
in self
._pendingMgrs
))
7542 msg
= {'challenge': _("Are you sure that you want to send these users an email with a reminder to create an account in Indico?"),
7543 'target': "<ul>{0}</ul>".format(pcoords
)
7546 url
= urlHandlers
.UHConfModifPendingQueuesActionCoord
.getURL(self
._conf
)
7549 "pendingCoordinators": self
._pendingCoords
,
7550 "reminder": _("reminder")
7553 class WAbstractBookCustomise(wcomponents
.WTemplated
):
7555 def __init__(self
, conf
):
7558 def getVars( self
):
7559 vars = wcomponents
.WTemplated
.getVars( self
)
7560 url
=urlHandlers
.UHConfAbstractBookPerform
.getURL(self
._conf
)
7561 vars["getPDFURL"]=quoteattr(str(url
))
7564 class WPAbstractBookCustomise( WPConferenceDefaultDisplayBase
):
7565 navigationEntry
= navigation
.NEAbstractBookCustomise
7567 def _getBody( self
, params
):
7568 wc
= WAbstractBookCustomise( self
._conf
)
7569 return wc
.getHTML(params
)
7571 def _defineSectionMenu( self
):
7572 WPConferenceDefaultDisplayBase
._defineSectionMenu
( self
)
7573 self
._sectionMenu
.setCurrentItem(self
._abstractsBookOpt
)
7575 ##################################################################################3
7577 class WPMeetingStaticDisplay( WPConferenceStaticDefaultDisplayBase
):
7579 def __init__(self
, rh
, target
, staticPars
):
7580 WPConferenceStaticDefaultDisplayBase
.__init
__(self
, rh
, target
)
7581 self
._staticPars
= staticPars
7583 def _getBody( self
, params
):
7584 wc
= WMeetingStaticDetails( self
._getAW
(), self
._conf
, self
._staticPars
)
7585 return wc
.getHTML({})
7587 def _defineSectionMenu( self
):
7588 WPConferenceStaticDefaultDisplayBase
._defineSectionMenu
(self
)
7589 self
._sectionMenu
.setCurrentItem(self
._overviewOpt
)
7592 class WPMeetiStaticProgram( WPConferenceStaticDefaultDisplayBase
):
7594 def __init__(self
, rh
, target
, staticPars
):
7595 WPConferenceStaticDefaultDisplayBase
.__init
__(self
, rh
, target
)
7596 self
._staticPars
= staticPars
7598 def _getBody( self
, params
):
7599 wc
= WConfStaticProgram( self
._getAW
(), self
._conf
, self
._staticPars
)
7602 def _defineSectionMenu( self
):
7603 WPConferenceStaticDefaultDisplayBase
._defineSectionMenu
( self
)
7604 self
._sectionMenu
.setCurrentItem(self
._programOpt
)
7607 class WMConfStaticDetails( wcomponents
.WTemplated
):
7609 def __init__(self
, aw
, conf
, staticPars
):
7612 self
._staticPars
= staticPars
7614 def _getChairsHTML( self
):
7617 for chair
in self
._conf
.getChairList():
7618 mailToURL
= """mailto:%s"""%urllib
.quote(chair
.getEmail())
7619 l
.append( """<a href=%s>%s</a>"""%(quoteattr(mailToURL
),self
.htmlText(chair
.getFullName())))
7622 res
= i18nformat("""
7624 <td align="right" valign="top" class="displayField"><b> _("Chairs"):</b></td>
7630 def _getMaterialHTML( self
):
7632 for mat
in self
._conf
.getAllMaterialList():
7633 temp
= wcomponents
.WMaterialDisplayItem()
7634 url
= urlHandlers
.UHStaticMaterialDisplay
.getRelativeURL(mat
)
7635 l
.append( temp
.getHTML( self
._aw
, mat
, url
, self
._staticPars
["material"] ) )
7638 res
= i18nformat("""
7640 <td align="right" valign="top" class="displayField"><b> _("Material"):</b></td>
7641 <td align="left" width="100%%">%s</td>
7642 </tr>""")%"<br>".join( l
)
7645 def _getMoreInfoHTML( self
):
7647 if self
._conf
.getContactInfo() != "":
7648 res
= i18nformat("""
7650 <td align="right" valign="top" class="displayField"><b> _("Additional info"):</b>
7653 </tr>""")%self
._conf
.getContactInfo()
7656 def _getActionsHTML( self
, showActions
= False):
7659 html
=[ i18nformat("""
7660 <table style="padding-top:40px; padding-left:20px">
7663 <b> _("Conference sections"):</b>
7666 menu
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
).getMenu()
7667 for link
in menu
.getLinkList():
7668 if link
.isVisible() and link
.isEnabled():
7669 html
.append(""" <li><a href="%s">%s</a></li>
7670 """%( link
.getURL(), link
.getCaption() ) )
7677 return "".join(html
)
7679 def getVars( self
):
7680 vars = wcomponents
.WTemplated
.getVars( self
)
7681 vars["description"] = self
._conf
.getDescription()
7682 sdate
, edate
= self
._conf
.getAdjustedStartDate(), self
._conf
.getAdjustedEndDate()
7683 fsdate
, fedate
= format_date(sdate
, format
='long'), format_date(edate
, format
='long')
7684 fstime
, fetime
= sdate
.strftime("%H:%M"), edate
.strftime("%H:%M")
7685 vars["dateInterval"] = i18nformat("""_("from") %s %s _("to") %s %s""")%(fsdate
, fstime
, \
7687 if sdate
.strftime("%d%B%Y") == edate
.strftime("%d%B%Y"):
7688 timeInterval
= fstime
7689 if sdate
.strftime("%H%M") != edate
.strftime("%H%M"):
7690 timeInterval
= "%s-%s"%(fstime
, fetime
)
7691 vars["dateInterval"] = "%s (%s)"%( fsdate
, timeInterval
)
7692 vars["location"] = ""
7693 location
= self
._conf
.getLocation()
7695 vars["location"] = "<i>%s</i><br><pre>%s</pre>"%( location
.getName(), location
.getAddress() )
7696 room
= self
._conf
.getRoom()
7698 roomLink
= linking
.RoomLinker().getHTMLLink( room
, location
)
7699 vars["location"] += i18nformat("""<small> _("Room"):</small> %s""")%roomLink
7700 vars["chairs"] = self
._getChairsHTML
()
7701 vars["material"] = self
._getMaterialHTML
()
7702 vars["moreInfo"] = self
._getMoreInfoHTML
()
7703 vars["actions"] = self
._getActionsHTML
(vars.get("menuStatus", "open") != "open")
7707 class WConfStaticProgram(wcomponents
.WTemplated
):
7709 def __init__(self
, aw
, conf
, staticPars
):
7712 self
._staticPars
= staticPars
7714 def getVars( self
):
7715 vars = wcomponents
.WTemplated
.getVars( self
)
7717 for track
in self
._conf
.getTrackList():
7718 program
.append( WConfStaticProgramTrack( self
._aw
, track
, self
._staticPars
).getHTML() )
7719 vars["program"] = "".join( program
)
7722 class WConfModifReschedule(wcomponents
.WTemplated
):
7724 def __init__(self
, targetDay
):
7725 self
._targetDay
= targetDay
7728 vars = wcomponents
.WTemplated
.getVars(self
)
7729 vars["targetDay"]=quoteattr(str(self
._targetDay
))
7732 class WPConfModifReschedule(WPConferenceModifBase
):
7734 def __init__(self
, rh
, conf
, targetDay
):
7735 WPConferenceModifBase
.__init
__(self
, rh
, conf
)
7736 self
._targetDay
=targetDay
7738 def _getPageContent( self
, params
):
7739 wc
=WConfModifReschedule(self
._targetDay
)
7740 p
={"postURL":quoteattr(str(urlHandlers
.UHConfModifReschedule
.getURL(self
._conf
)))}
7741 return wc
.getHTML(p
)
7743 class WPConfModifRelocate(WPConferenceModifBase
):
7745 def __init__(self
, rh
, conf
, entry
, targetDay
):
7746 WPConferenceModifBase
.__init
__(self
, rh
, conf
)
7747 self
._targetDay
=targetDay
7750 def _getPageContent( self
, params
):
7751 wc
=wcomponents
.WSchRelocate(self
._entry
)
7752 p
={"postURL":quoteattr(str(urlHandlers
.UHConfModifScheduleRelocate
.getURL(self
._entry
))), \
7753 "targetDay":quoteattr(str(self
._targetDay
))}
7754 return wc
.getHTML(p
)
7756 class WPConfModifExistingMaterials( WPConferenceModifBase
):
7758 _userData
= ['favorite-user-list', 'favorite-user-ids']
7760 def __init__(self
, rh
, conf
):
7761 WPConferenceModifBase
.__init
__(self
, rh
, conf
)
7763 def _getPageContent( self
, pars
):
7764 wc
=wcomponents
.WShowExistingMaterial(self
._conf
)
7765 return wc
.getHTML( pars
)
7767 def _setActiveTab( self
):
7768 self
._tabMaterials
.setActive()
7770 def _setActiveSideMenuItem( self
):
7771 self
._materialMenuItem
.setActive()
7773 class WPConfModifDisplayImageBrowser (wcomponents
.WTemplated
):
7775 def __init__(self
, conf
, req
):
7779 def _getFileHTML(self
, file):
7780 return """<td> <a href="#" onClick="OpenFile('%s');return false;"><img src="%s" height="80"></a></td>""" % (str(urlHandlers
.UHFileAccess
.getURL(file)),str(urlHandlers
.UHFileAccess
.getURL(file)))
7783 vars = wcomponents
.WTemplated
.getVars( self
)
7784 vars["baseURL"] = Config
.getInstance().getBaseURL()
7786 materialName
= _("Internal Page Files")
7787 mats
= self
._conf
.getMaterialList()
7791 if m
.getTitle() == materialName
:
7794 existingFiles
= mat
.getResourceList()
7795 if len(existingFiles
) == 0:
7796 vars["body"] = i18nformat("""<br><br> _("no image found")...""")
7798 vars["body"] += "<table><tr>"
7799 for file in existingFiles
:
7800 vars["body"] += self
._getFileHTML
(file)
7801 vars["body"] += "</tr></table>"
7805 class WPDisplayFullMaterialPackage(WPConferenceDefaultDisplayBase
):
7807 def _getBody(self
, params
):
7808 wc
= WFullMaterialPackage(self
._conf
)
7809 p
= {"getPkgURL": urlHandlers
.UHConferenceDisplayMaterialPackagePerform
.getURL(self
._conf
)}
7810 return wc
.getHTML(p
)
7813 # ============================================================================
7814 # === Room booking related ===================================================
7815 # ============================================================================
7817 #from MaKaC.webinterface.pages.roomBooking import WPRoomBookingBase0
7818 class WPConfModifRoomBookingBase( WPConferenceModifBase
):
7820 def getJSFiles(self
):
7821 return WPConferenceModifBase
.getJSFiles(self
) + \
7822 self
._includeJSPackage
('RoomBooking')
7824 def _getHeadContent( self
):
7827 If you update the following, you will need to do
7829 roomBooking.py / WPRoomBookingBase0 AND
7830 conferences.py / WPConfModifRoomBookingBase
7832 For complex reasons, these two inheritance chains
7833 should not have common root, so this duplication is
7834 necessary evil. (In general, one chain is for standalone
7835 room booking and second is for conference-context room
7838 baseurl
= self
._getBaseURL
()
7841 <script type="text/javascript" src="%s/js/indico/Legacy/validation.js?%d"></script>
7843 """ % (baseurl
, os
.stat(__file__
).st_mtime
)
7845 def _setActiveSideMenuItem(self
):
7846 self
._roomBookingMenuItem
.setActive()
7848 def _createTabCtrl(self
):
7849 self
._tabCtrl
= wcomponents
.TabControl()
7851 self
._tabExistBookings
= self
._tabCtrl
.newTab( "existing", "Existing Bookings", \
7852 urlHandlers
.UHConfModifRoomBookingList
.getURL( self
._conf
) )
7853 self
._tabNewBooking
= self
._tabCtrl
.newTab( "new", "New Booking", \
7854 urlHandlers
.UHConfModifRoomBookingChooseEvent
.getURL( self
._conf
) )
7856 self
._setActiveTab
()
7858 def _getPageContent(self
, params
):
7859 self
._createTabCtrl
()
7860 return wcomponents
.WTabControl( self
._tabCtrl
, self
._getAW
() ).getHTML( self
._getTabContent
( params
) )
7862 def _getTabContent(self
, params
):
7866 # 0. Choosing an "event" (conference / session / contribution)...
7868 class WPConfModifRoomBookingChooseEvent( WPConfModifRoomBookingBase
):
7870 def __init__( self
, rh
):
7872 WPConfModifRoomBookingBase
.__init
__( self
, rh
, rh
._conf
)
7874 def _getTabContent( self
, params
):
7875 wc
= wcomponents
.WRoomBookingChooseEvent( self
._rh
)
7876 return wc
.getHTML( params
)
7878 def _setActiveTab( self
):
7879 self
._tabNewBooking
.setActive()
7883 class WPConfModifRoomBookingSearch4Rooms( WPConfModifRoomBookingBase
):
7885 def __init__( self
, rh
):
7887 WPConfModifRoomBookingBase
.__init
__( self
, rh
, rh
._conf
)
7890 def _getTabContent( self
, params
):
7891 wc
= wcomponents
.WRoomBookingSearch4Rooms( self
._rh
)
7892 return wc
.getHTML( params
)
7894 def _setActiveTab( self
):
7895 self
._tabNewBooking
.setActive()
7899 class WPConfModifRoomBookingRoomList( WPConfModifRoomBookingBase
):
7901 def __init__( self
, rh
):
7903 WPConfModifRoomBookingBase
.__init
__( self
, rh
, self
._rh
._conf
)
7905 def _setActiveTab( self
):
7906 self
._tabNewBooking
.setActive()
7908 def _getTabContent( self
, params
):
7909 wc
= wcomponents
.WRoomBookingRoomList( self
._rh
)
7910 return wc
.getHTML( params
)
7914 class WPConfModifRoomBookingList( WPConfModifRoomBookingBase
):
7916 def __init__( self
, rh
):
7917 WPConfModifRoomBookingBase
.__init
__( self
, rh
, rh
._conf
)
7919 def _setActiveTab( self
):
7920 self
._tabExistBookings
.setActive()
7922 def _getTabContent( self
, pars
):
7923 wc
= wcomponents
.WRoomBookingList( self
._rh
)
7924 return wc
.getHTML( pars
)
7929 class WPConfModifRoomBookingRoomDetails( WPConfModifRoomBookingBase
):
7931 def __init__( self
, rh
):
7933 WPConfModifRoomBookingBase
.__init
__( self
, rh
, rh
._conf
)
7935 def _setActiveTab( self
):
7936 self
._tabNewBooking
.setActive()
7938 def _getTabContent( self
, params
):
7939 wc
= wcomponents
.WRoomBookingRoomDetails( self
._rh
)
7940 return wc
.getHTML( params
)
7942 class WPConfModifRoomBookingDetails( WPConfModifRoomBookingBase
):
7944 def __init__( self
, rh
):
7946 WPConfModifRoomBookingBase
.__init
__( self
, rh
, rh
._conf
)
7948 def _setActiveTab( self
):
7949 self
._tabExistBookings
.setActive()
7951 def _getTabContent( self
, params
):
7952 wc
= wcomponents
.WRoomBookingDetails( self
._rh
, self
._rh
._conf
)
7953 return wc
.getHTML( params
)
7957 class WPConfModifRoomBookingBookingForm( WPConfModifRoomBookingBase
):
7959 def __init__( self
, rh
):
7961 WPConfModifRoomBookingBase
.__init
__( self
, rh
, rh
._conf
)
7963 def _setActiveTab( self
):
7964 self
._tabNewBooking
.setActive()
7966 def _getTabContent( self
, params
):
7967 wc
= wcomponents
.WRoomBookingBookingForm( self
._rh
)
7968 return wc
.getHTML( params
)
7970 class WPConfModifRoomBookingConfirmBooking( WPConfModifRoomBookingBase
):
7972 def __init__( self
, rh
):
7974 WPConfModifRoomBookingBase
.__init
__( self
, rh
, rh
._conf
)
7976 def _setActiveTab( self
):
7977 self
._tabNewBooking
.setActive()
7979 def _getTabContent( self
, params
):
7980 wc
= wcomponents
.WRoomBookingConfirmBooking( self
._rh
, standalone
= False )
7981 return wc
.getHTML( params
)
7983 # ============================================================================
7984 # === Badges related =========================================================
7985 # ============================================================================
7987 ##------------------------------------------------------------------------------------------------------------
7989 Badge Printing classes
7991 class WConfModifBadgePrinting(wcomponents
.WTemplated
):
7992 """ This class corresponds to the screen where badge templates are
7993 listed and can be created, edited, deleted, and tried.
7996 def __init__(self
, conference
, user
=None):
7997 self
.__conf
= conference
8000 def _getBaseTemplateOptions(self
):
8001 dconf
= conference
.CategoryManager().getDefaultConference()
8002 templates
= dconf
.getBadgeTemplateManager().getTemplates()
8004 options
= [{'value': 'blank', 'label': _('Blank Page')}]
8006 for id, template
in templates
.iteritems():
8007 options
.append({'value': id, 'label': template
.getName()})
8014 sortedTemplates
= self
.__conf
.getBadgeTemplateManager().getTemplates().items()
8015 sortedTemplates
.sort(lambda x
, y
: cmp(x
[1].getName(), y
[1].getName()))
8017 for templateId
, template
in sortedTemplates
:
8021 'name': template
.getName(),
8022 'urlEdit': str(uh
.UHConfModifBadgeDesign
.getURL(self
.__conf
, templateId
)),
8023 'urlDelete': str(uh
.UHConfModifBadgePrinting
.getURL(self
.__conf
, deleteTemplateId
=templateId
)),
8024 'urlCopy': str(uh
.UHConfModifBadgePrinting
.getURL(self
.__conf
, copyTemplateId
=templateId
))
8027 templates
.append(data
)
8029 wcPDFOptions
= WConfModifBadgePDFOptions(self
.__conf
)
8030 vars = wcomponents
.WTemplated
.getVars(self
)
8031 vars['NewTemplateURL'] = str(uh
.UHConfModifBadgeDesign
.getURL(self
.__conf
,
8032 self
.__conf
.getBadgeTemplateManager().getNewTemplateId(),new
= True))
8033 vars['CreatePDFURL'] = str(uh
.UHConfModifBadgePrintingPDF
.getURL(self
.__conf
))
8034 vars['templateList'] = templates
8035 vars['PDFOptions'] = wcPDFOptions
.getHTML()
8036 vars['baseTemplates'] = self
._getBaseTemplateOptions
()
8041 class WConfModifBadgePDFOptions(wcomponents
.WTemplated
):
8043 def __init__(self
, conference
, showKeepValues
=True, showTip
=True):
8044 self
.__conf
= conference
8045 self
.__showKeepValues
= showKeepValues
8046 self
.__showTip
= showTip
8049 vars = wcomponents
.WTemplated
.getVars(self
)
8051 pagesizeNames
= PDFSizes().PDFpagesizes
.keys()
8052 pagesizeNames
.sort()
8053 vars['PagesizeNames'] = pagesizeNames
8054 vars['PDFOptions'] = self
.__conf
.getBadgeTemplateManager().getPDFOptions()
8055 vars['ShowKeepValues'] = self
.__showKeepValues
8056 vars['ShowTip'] = self
.__showTip
8061 class WPBadgeBase(WPConfModifToolsBase
):
8063 def getCSSFiles(self
):
8064 return WPConfModifToolsBase
.getCSSFiles(self
) + self
._asset
_env
['indico_badges_css'].urls()
8066 def getJSFiles(self
):
8067 return WPConfModifToolsBase
.getJSFiles(self
) + self
._includeJSPackage
('badges_js')
8070 class WPConfModifBadgePrinting(WPBadgeBase
):
8072 def _setActiveTab(self
):
8073 self
._tabBadges
.setActive()
8075 def _getTabContent(self
, params
):
8076 wc
= WConfModifBadgePrinting(self
._conf
)
8081 ##------------------------------------------------------------------------------------------------------------
8083 Badge Design classes
8085 class WConfModifBadgeDesign(wcomponents
.WTemplated
):
8086 """ This class corresponds to the screen where a template
8087 is designed inserting, dragging and editing items.
8090 def __init__(self
, conference
, templateId
, new
=False, user
=None):
8091 self
.__conf
= conference
8092 self
.__templateId
= templateId
8096 def getVars( self
):
8097 vars = wcomponents
.WTemplated
.getVars( self
)
8098 vars["baseURL"] = Config
.getInstance().getBaseURL() ##base url of the application, used for the ruler images
8099 vars["cancelURL"] = urlHandlers
.UHConfModifBadgePrinting
.getURL(self
.__conf
, templateId
= self
.__templateId
, cancel
= True)
8100 vars["saveBackgroundURL"] = urlHandlers
.UHConfModifBadgeSaveBackground
.getURL(self
.__conf
, self
.__templateId
)
8101 vars["loadingIconURL"] = quoteattr(str(Config
.getInstance().getSystemIconURL("loading")))
8102 vars["templateId"] = self
.__templateId
8104 badgeDesignConfiguration
= BadgeDesignConfiguration()
8105 from MaKaC
.services
.interface
.rpc
.json
import encode
as jsonEncode
8106 vars["translateName"]= jsonEncode(dict([(key
, value
[0]) for key
, value
in badgeDesignConfiguration
.items_actions
.iteritems()]))
8109 for itemKey
in badgeDesignConfiguration
.items_actions
.keys():
8111 case
.append('case "')
8112 case
.append(itemKey
)
8115 case
.append('items[itemId] = new Item(itemId, "')
8116 case
.append(itemKey
)
8119 case
.append('newDiv.html(items[itemId].toHTML());')
8121 case
.append('break;')
8122 cases
.append("".join(case
))
8124 vars['switchCases'] = "\n".join(cases
)
8127 for optgroupName
, options
in badgeDesignConfiguration
.groups
:
8129 optgroup
.append('<optgroup label="')
8130 optgroup
.append(optgroupName
)
8131 optgroup
.append('">')
8132 optgroup
.append('\n')
8133 for optionName
in options
:
8134 optgroup
.append('<option value="%s">'%optionName
)
8135 optgroup
.append(badgeDesignConfiguration
.items_actions
[optionName
][0])
8136 optgroup
.append('</option>')
8137 optgroup
.append('\n')
8138 optgroup
.append('</optgroup>')
8139 optgroups
.append("".join(optgroup
))
8141 vars['selectOptions'] = "\n".join(optgroups
)
8142 vars["backgroundPos"] = "Stretch"
8145 vars["saveTemplateURL"]=urlHandlers
.UHConfModifBadgePrinting
.getURL(self
.__conf
, new
=True)
8146 vars["titleMessage"]= _("Creating new badge template")
8147 vars["editingTemplate"]="false"
8148 vars["templateData"]="[]"
8149 vars["hasBackground"]="false"
8150 vars["backgroundURL"]="false"
8151 vars["backgroundId"]=-1
8153 elif self
.__templateId
is None:
8154 vars["saveTemplateURL"]=urlHandlers
.UHConfModifBadgePrinting
.getURL(self
.__conf
)
8155 vars["titleMessage"]= _("No template id given")
8156 vars["editingTemplate"]="false"
8157 vars["templateData"]="[]"
8158 vars["hasBackground"]="false"
8159 vars["backgroundURL"]="false"
8160 vars["backgroundId"]=-1
8163 vars["saveTemplateURL"]=urlHandlers
.UHConfModifBadgePrinting
.getURL(self
.__conf
)
8164 vars["titleMessage"]= _("Editing badge template")
8165 vars["editingTemplate"]="true"
8167 templateDataString
= jsonEncode(self
.__conf
.getBadgeTemplateManager().getTemplateData(self
.__templateId
))
8168 vars["templateData"]= templateDataString
8170 usedBackgroundId
= self
.__conf
.getBadgeTemplateManager().getTemplateById(self
.__templateId
).getUsedBackgroundId()
8171 vars["backgroundId"] = usedBackgroundId
8172 if usedBackgroundId
!= -1:
8173 vars["hasBackground"]="true"
8174 vars["backgroundURL"]=str(urlHandlers
.UHConfModifBadgeGetBackground
.getURL(self
.__conf
, self
.__templateId
, usedBackgroundId
))
8176 vars["hasBackground"]="false"
8177 vars["backgroundURL"]="false"
8183 class WPConfModifBadgeDesign(WPBadgeBase
):
8185 def __init__(self
, rh
, conf
, templateId
=None, new
=False, baseTemplateId
="blank"):
8186 WPBadgeBase
.__init
__(self
, rh
, conf
)
8187 self
.__templateId
= templateId
8189 self
.__baseTemplate
= baseTemplateId
8191 if baseTemplateId
!= 'blank':
8192 dconf
= conference
.CategoryManager().getDefaultConference()
8193 templMan
= conf
.getBadgeTemplateManager()
8195 dconf
.getBadgeTemplateManager().getTemplateById(baseTemplateId
).clone(templMan
, newId
)
8196 # now, let's pretend nothing happened, and let the code
8197 # handle the template as if it existed before
8200 def _setActiveTab(self
):
8201 self
._tabBadges
.setActive()
8203 def _getTabContent(self
, params
):
8204 wc
= WConfModifBadgeDesign(self
._conf
, self
.__templateId
, self
.__new
)
8207 ##------------------------------------------------------------------------------------------------------------
8209 Common PDF Options classes
8211 class WConfCommonPDFOptions( wcomponents
.WTemplated
):
8212 """ This class corresponds to a section of options
8213 that are common to each PDF in Indico.
8216 def __init__( self
, conference
, user
=None ):
8217 self
.__conf
= conference
8221 vars = wcomponents
.WTemplated
.getVars( self
)
8223 pagesizeNames
= PDFSizes().PDFpagesizes
.keys()
8224 pagesizeNames
.sort()
8225 pagesizeOptions
= []
8226 for pagesizeName
in pagesizeNames
:
8227 pagesizeOptions
.append('<option ')
8228 if pagesizeName
== 'A4':
8229 pagesizeOptions
.append('selected="selected"')
8230 pagesizeOptions
.append('>')
8231 pagesizeOptions
.append(pagesizeName
)
8232 pagesizeOptions
.append('</option>')
8234 vars['pagesizes'] = "".join(pagesizeOptions
)
8236 fontsizeOptions
= []
8237 for fontsizeName
in PDFSizes().PDFfontsizes
:
8238 fontsizeOptions
.append('<option ')
8239 if fontsizeName
== 'normal':
8240 fontsizeOptions
.append('selected="selected"')
8241 fontsizeOptions
.append('>')
8242 fontsizeOptions
.append(fontsizeName
)
8243 fontsizeOptions
.append('</option>')
8245 vars['fontsizes'] = "".join(fontsizeOptions
)
8250 # ============================================================================
8251 # === Posters related ========================================================
8252 # ============================================================================
8254 ##------------------------------------------------------------------------------------------------------------
8256 Poster Printing classes
8258 class WConfModifPosterPrinting(wcomponents
.WTemplated
):
8259 """ This class corresponds to the screen where poster templates are
8260 listed and can be created, edited, deleted, and tried.
8263 def __init__(self
, conference
, user
=None):
8264 self
.__conf
= conference
8267 def _getFullTemplateListOptions(self
):
8269 templates
['global'] = conference
.CategoryManager().getDefaultConference().getPosterTemplateManager().getTemplates()
8270 templates
['local'] = self
.__conf
.getPosterTemplateManager().getTemplates()
8273 def _iterTemplatesToObjectList(key
, templates
):
8276 for id, template
in templates
.iteritems():
8277 pKey
= ' (' + key
+ ')'
8278 # Only if the template is 'global' should it have the word prefixed.
8279 value
= key
+ str(id) if key
== 'global' else str(id)
8280 newList
.append({'value': value
,
8281 'label': template
.getName() + pKey
})
8285 for k
, v
in templates
.iteritems():
8286 options
.extend(_iterTemplatesToObjectList(k
, v
))
8290 def _getBaseTemplateListOptions(self
):
8291 templates
= conference
.CategoryManager().getDefaultConference().getPosterTemplateManager().getTemplates()
8292 options
= [{'value': 'blank', 'label': _('Blank Page')}]
8294 for id, template
in templates
.iteritems():
8295 options
.append({'value': id, 'label': template
.getName()})
8302 wcPDFOptions
= WConfModifPosterPDFOptions(self
.__conf
)
8303 sortedTemplates
= self
.__conf
.getPosterTemplateManager().getTemplates().items()
8304 sortedTemplates
.sort(lambda item1
, item2
: cmp(item1
[1].getName(), item2
[1].getName()))
8306 for templateId
, template
in sortedTemplates
:
8310 'name': template
.getName(),
8311 'urlEdit': str(uh
.UHConfModifPosterDesign
.getURL(self
.__conf
, templateId
)),
8312 'urlDelete': str(uh
.UHConfModifPosterPrinting
.getURL(self
.__conf
, deleteTemplateId
=templateId
)),
8313 'urlCopy': str(uh
.UHConfModifPosterPrinting
.getURL(self
.__conf
, copyTemplateId
=templateId
))
8316 templates
.append(data
)
8318 vars = wcomponents
.WTemplated
.getVars(self
)
8319 vars["NewTemplateURL"] = str(uh
.UHConfModifPosterDesign
.getURL(self
.__conf
, self
.__conf
.getPosterTemplateManager().getNewTemplateId(),new
=True))
8320 vars["CreatePDFURL"]= str(uh
.UHConfModifPosterPrintingPDF
.getURL(self
.__conf
))
8321 vars["templateList"] = templates
8322 vars['PDFOptions'] = wcPDFOptions
.getHTML()
8323 vars['baseTemplates'] = self
._getBaseTemplateListOptions
()
8324 vars['fullTemplateList'] = self
._getFullTemplateListOptions
()
8328 class WConfModifPosterPDFOptions(wcomponents
.WTemplated
):
8330 def __init__(self
, conference
, user
=None):
8331 self
.__conf
= conference
8335 vars = wcomponents
.WTemplated
.getVars(self
)
8337 pagesizeNames
= PDFSizes().PDFpagesizes
.keys()
8338 pagesizeNames
.sort()
8339 pagesizeOptions
= []
8341 for pagesizeName
in pagesizeNames
:
8342 pagesizeOptions
.append('<option ')
8344 if pagesizeName
== 'A4':
8345 pagesizeOptions
.append('selected="selected"')
8347 pagesizeOptions
.append('>')
8348 pagesizeOptions
.append(pagesizeName
)
8349 pagesizeOptions
.append('</option>')
8351 vars['pagesizes'] = "".join(pagesizeOptions
)
8355 class WPConfModifPosterPrinting(WPBadgeBase
):
8357 def _setActiveTab(self
):
8358 self
._tabPosters
.setActive()
8360 def _getTabContent(self
, params
):
8361 wc
= WConfModifPosterPrinting(self
._conf
)
8364 ##------------------------------------------------------------------------------------------------------------
8366 Poster Design classes
8368 class WConfModifPosterDesign( wcomponents
.WTemplated
):
8369 """ This class corresponds to the screen where a template
8370 is designed inserting, dragging and editing items.
8373 def __init__(self
, conference
, templateId
, new
=False, user
=None):
8374 self
.__conf
= conference
8375 self
.__templateId
= templateId
8381 vars = wcomponents
.WTemplated
.getVars( self
)
8382 vars["baseURL"] = Config
.getInstance().getBaseURL() # base url of the application, used for the ruler images
8383 vars["cancelURL"] = urlHandlers
.UHConfModifPosterPrinting
.getURL(self
.__conf
, templateId
= self
.__templateId
, cancel
= True)
8384 vars["saveBackgroundURL"] = urlHandlers
.UHConfModifPosterSaveBackground
.getURL(self
.__conf
, self
.__templateId
)
8385 vars["loadingIconURL"] = quoteattr(str(Config
.getInstance().getSystemIconURL("loading")))
8386 vars["templateId"] = self
.__templateId
8388 posterDesignConfiguration
= PosterDesignConfiguration()
8389 from MaKaC
.services
.interface
.rpc
.json
import encode
as jsonEncode
8390 vars["translateName"]= jsonEncode(dict([(key
, value
[0]) for key
, value
in posterDesignConfiguration
.items_actions
.iteritems()]))
8393 for itemKey
in posterDesignConfiguration
.items_actions
.keys():
8395 case
.append('case "')
8396 case
.append(itemKey
)
8399 case
.append('items[itemId] = new Item(itemId, "')
8400 case
.append(itemKey
)
8403 case
.append('newDiv.html(items[itemId].toHTML());')
8405 case
.append('break;')
8406 cases
.append("".join(case
))
8408 vars['switchCases'] = "\n".join(cases
)
8411 for optgroupName
, options
in posterDesignConfiguration
.groups
:
8413 optgroup
.append('<optgroup label="')
8414 optgroup
.append(optgroupName
)
8415 optgroup
.append('">')
8416 optgroup
.append('\n')
8417 for optionName
in options
:
8418 optgroup
.append('<option value="%s">'%optionName
)
8419 optgroup
.append(posterDesignConfiguration
.items_actions
[optionName
][0])
8420 optgroup
.append('</option>')
8421 optgroup
.append('\n')
8422 optgroup
.append('</optgroup>')
8423 optgroups
.append("".join(optgroup
))
8425 vars['selectOptions'] = "\n".join(optgroups
)
8428 vars["saveTemplateURL"]=urlHandlers
.UHConfModifPosterPrinting
.getURL(self
.__conf
, new
=True)
8429 vars["titleMessage"]= _("Creating new poster template")
8430 vars["hasBackground"]="false"
8431 vars["backgroundURL"]="false"
8432 vars["backgroundId"]=-1
8433 vars["backgroundPos"]="Stretch"
8434 vars["templateData"]="[]"
8435 vars["editingTemplate"]="false"
8438 elif self
.__templateId
is None:
8439 vars["saveTemplateURL"]=urlHandlers
.UHConfModifPosterPrinting
.getURL(self
.__conf
)
8440 vars["titleMessage"]= _("No template id given")
8441 vars["hasBackground"]="false"
8442 vars["backgroundURL"]="false"
8443 vars["backgroundId"]=-1
8444 vars["backgroundPos"]="Stretch"
8445 vars["templateData"] = "[]"
8446 vars["editingTemplate"]="false"
8450 vars["saveTemplateURL"]=urlHandlers
.UHConfModifPosterPrinting
.getURL(self
.__conf
)
8451 vars["titleMessage"]= _("Editing poster template")
8452 vars["editingTemplate"]="true"
8453 templateDataString
= jsonEncode(self
.__conf
.getPosterTemplateManager().getTemplateData(self
.__templateId
))
8454 vars["templateData"]= templateDataString
8456 usedBackgroundId
= self
.__conf
.getPosterTemplateManager().getTemplateById(self
.__templateId
).getUsedBackgroundId()
8457 vars["backgroundId"] = usedBackgroundId
8459 if usedBackgroundId
!= -1:
8460 vars["hasBackground"]="true"
8461 vars["backgroundURL"]=str(urlHandlers
.UHConfModifPosterGetBackground
.getURL(self
.__conf
, self
.__templateId
, usedBackgroundId
))
8462 vars["backgroundPos"]=self
.__conf
.getPosterTemplateManager().getTemplateById(self
.__templateId
).getBackgroundPosition(usedBackgroundId
)
8464 vars["hasBackground"]="false"
8465 vars["backgroundURL"]="false"
8466 vars["backgroundPos"]="Stretch"
8471 class WPConfModifPosterDesign(WPBadgeBase
):
8473 def __init__(self
, rh
, conf
, templateId
=None, new
=False, baseTemplateId
="blank"):
8474 WPBadgeBase
.__init
__(self
, rh
, conf
)
8475 self
.__templateId
= templateId
8477 self
.__baseTemplate
= baseTemplateId
8479 def _setActiveTab(self
):
8480 self
._tabPosters
.setActive()
8482 def _getTabContent(self
, params
):
8483 wc
= WConfModifPosterDesign(self
._conf
, self
.__templateId
, self
.__new
)
8486 def sortByName(x
,y
):
8487 return cmp(x
.getFamilyName(),y
.getFamilyName())
8489 class WPConfModifPreviewCSS( WPConferenceDefaultDisplayBase
):
8491 def __init__( self
, rh
, conf
, selectedCSSId
):
8492 WPConferenceDefaultDisplayBase
.__init
__( self
, rh
, conf
)
8495 self
._cssTplsModule
= ModuleHolder().getById("cssTpls")
8496 self
._styleMgr
= displayMgr
.ConfDisplayMgrRegistery().getDisplayMgr(self
._conf
).getStyleManager()
8498 self
._selectedCSS
= None
8499 if selectedCSSId
== "css": # local uploaded file choice
8500 self
._selectedCSS
= self
._styleMgr
.getLocalCSS()
8502 self
._selectedCSS
= self
._cssTplsModule
.getCssTplById(selectedCSSId
)
8504 def _applyDecoration( self
, body
):
8507 return "%s%s%s"%( self
._getHeader
(), body
, self
._getFooter
() )
8509 def _getBody( self
, params
):
8510 params
["URL2Back"] = urlHandlers
.UHConfModifDisplay
.getURL(self
._conf
)
8511 params
["cssurl"] = ""
8512 params
['selectedCSSId'] = ""
8513 if self
._selectedCSS
:
8514 params
["cssurl"] = self
._selectedCSS
.getURL()
8515 params
['selectedCSSId'] = self
._selectedCSS
.getId()
8516 elif self
._styleMgr
.getCSS():
8517 params
["cssurl"] = self
._styleMgr
.getCSS().getURL()
8518 params
['selectedCSSId'] = self
._styleMgr
.getCSS().getId()
8519 params
["saveCSS"]=urlHandlers
.UHUseCSS
.getURL(self
._conf
)
8520 params
['confId'] = self
._conf
.getId()
8521 params
["previewURL"]= urlHandlers
.UHConfModifPreviewCSS
.getURL(self
._conf
)
8522 params
["templatesList"]=[]
8523 if self
._styleMgr
.getLocalCSS():
8524 params
["templatesList"].append(self
._styleMgr
.getLocalCSS())
8525 params
["templatesList"].extend(self
._cssTplsModule
.getCssTplsList())
8527 ###############################
8528 # injecting ConferenceDisplay #
8529 ###############################
8530 p
= WPConferenceDisplay( self
._rh
, self
._conf
)
8531 p
._defineSectionMenu
()
8532 p
._toolBar
=wcomponents
.WebToolBar()
8534 params
["bodyConf"] = p
._applyConfDisplayDecoration
( p
._getBody
( params
) )
8535 ###############################
8536 ###############################
8539 return wc
.getHTML(params
)
8541 def _getHeadContent( self
):
8542 path
= self
._getBaseURL
()
8543 timestamp
= os
.stat(__file__
).st_mtime
8545 <link rel="stylesheet" type="text/css" href="%s/css/Conf_Basic.css?%d" >
8546 """ % (path
, timestamp
)
8548 if self
._selectedCSS
:
8549 printCSS
= printCSS
+ """<link rel="stylesheet" type="text/css" href="%s" >"""%self
._selectedCSS
.getURL()
8550 elif self
._styleMgr
.getCSS():
8551 printCSS
= printCSS
+ """<link rel="stylesheet" type="text/css" href="%s" >"""%self
._styleMgr
.getCSS().getURL()
8555 class WPreviewPage( wcomponents
.WTemplated
):