1 # This file is part of Indico.
2 # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
4 # Indico is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3 of the
7 # License, or (at your option) any later version.
9 # Indico is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with Indico; if not, see <http://www.gnu.org/licenses/>.
18 from MaKaC
.webinterface
.pages
.conferences
import (WPTPLConferenceDisplay
, WPConferenceDisplay
, WPConferenceTimeTable
,
19 WPConferenceProgram
, WPContributionList
, WPInternalPageDisplay
,
20 WPAuthorIndex
, WPSpeakerIndex
)
21 from MaKaC
.webinterface
.pages
.sessions
import WPSessionDisplay
22 from MaKaC
.webinterface
.pages
.contributions
import WPContributionDisplay
23 from MaKaC
.webinterface
.pages
.registrants
import WPConfRegistrantsList
, WConfRegistrantsList
24 from MaKaC
.webinterface
.pages
.subContributions
import WPSubContributionDisplay
25 from MaKaC
.webinterface
.pages
.authors
import WPAuthorDisplay
26 from MaKaC
.webinterface
.displayMgr
import SystemLink
27 from indico
.util
.contextManager
import ContextManager
30 class WPStaticEventBase
:
32 def _getBaseURL(self
):
42 for link
in self
._sectionMenu
.getLinkList():
43 if isinstance(link
, SystemLink
) and link
.getName() not in ContextManager
.get("_menu_offline_items"):
44 link
.setVisible(False)
47 return (self
._asset
_env
['base_js'].urls() + self
._asset
_env
['modules_event_display_js'].urls() +
48 self
._asset
_env
['modules_attachments_js'].urls())
51 class WPTPLStaticConferenceDisplay(WPStaticEventBase
, WPTPLConferenceDisplay
):
53 def _extractInfoForButton(self
, item
):
55 for key
in ['sessId', 'slotId', 'contId', 'subContId']:
57 info
['confId'] = self
._conf
.getId()
60 def _getVariables(self
, conf
):
61 variables
= WPTPLConferenceDisplay
._getVariables
(self
, conf
)
62 variables
['registrationOpen'] = False
63 variables
['evaluationLink'] = False
67 class WPStaticConferenceDisplay(WPStaticEventBase
, WPConferenceDisplay
):
69 def _defineSectionMenu(self
):
70 WPConferenceDisplay
._defineSectionMenu
(self
)
74 class WPStaticConferenceTimeTable(WPStaticEventBase
, WPConferenceTimeTable
):
76 def _defineSectionMenu(self
):
77 WPConferenceTimeTable
._defineSectionMenu
(self
)
81 return WPStaticEventBase
.getJSFiles(self
) + self
._includeJSPackage
('Timetable')
84 class WPStaticConferenceProgram(WPStaticEventBase
, WPConferenceProgram
):
86 def _defineSectionMenu(self
):
87 WPConferenceProgram
._defineSectionMenu
(self
)
91 class WPStaticContributionList(WPStaticEventBase
, WPContributionList
):
93 def _defineSectionMenu(self
):
94 WPContributionList
._defineSectionMenu
(self
)
97 def _getBody(self
, params
):
98 from MaKaC
.webinterface
.rh
.conferenceDisplay
import RHContributionList
99 from MaKaC
.webinterface
.pages
.conferences
import WConfContributionList
100 # Getting an contribution list empty filter
101 filterCriteria
= RHContributionList
.create_filter(self
._conf
, params
)
102 wc
= WConfContributionList(self
._getAW
(), self
._conf
, filterCriteria
, "")
106 class WPStaticInternalPageDisplay(WPStaticEventBase
, WPInternalPageDisplay
):
108 def _defineSectionMenu(self
):
109 WPInternalPageDisplay
._defineSectionMenu
(self
)
113 class WPStaticAuthorIndex(WPStaticEventBase
, WPAuthorIndex
):
115 def _defineSectionMenu(self
):
116 WPAuthorIndex
._defineSectionMenu
(self
)
119 def getJSFiles(self
):
120 return WPStaticEventBase
.getJSFiles(self
) + WPAuthorIndex
.getJSFiles(self
) + self
._includeJSPackage
('authors')
123 class WPStaticSpeakerIndex(WPStaticEventBase
, WPSpeakerIndex
):
125 def _defineSectionMenu(self
):
126 WPSpeakerIndex
._defineSectionMenu
(self
)
129 def getJSFiles(self
):
130 return WPStaticEventBase
.getJSFiles(self
) + WPSpeakerIndex
.getJSFiles(self
)
133 class WPStaticSessionDisplay(WPStaticEventBase
, WPSessionDisplay
):
135 def _defineSectionMenu(self
):
136 WPSessionDisplay
._defineSectionMenu
(self
)
139 def getJSFiles(self
):
140 return WPStaticEventBase
.getJSFiles(self
) + self
._includeJSPackage
('Timetable')
143 class WPStaticContributionDisplay(WPStaticEventBase
, WPContributionDisplay
):
145 def _defineSectionMenu(self
):
146 WPContributionDisplay
._defineSectionMenu
(self
)
150 class WPStaticConfRegistrantsList(WPStaticEventBase
, WPConfRegistrantsList
):
152 def _defineSectionMenu(self
):
153 WPConfRegistrantsList
._defineSectionMenu
(self
)
156 def _getBody(self
, params
):
157 from MaKaC
.webinterface
.rh
.registrantsDisplay
import RHRegistrantsList
158 from MaKaC
.webinterface
.common
import regFilters
160 sortingCrit
= regFilters
.SortingCriteria([params
.get("sortBy", "Name").strip()])
161 filterCrit
= RHRegistrantsList
.create_filter(self
._conf
, params
)
162 wc
= WConfRegistrantsList(self
._conf
, filterCrit
, sortingCrit
, None, "session")
166 class WPStaticSubContributionDisplay(WPStaticEventBase
, WPSubContributionDisplay
):
168 def _defineSectionMenu(self
):
169 WPSubContributionDisplay
._defineSectionMenu
(self
)
173 class WPStaticAuthorDisplay(WPStaticEventBase
, WPAuthorDisplay
):
175 def _defineSectionMenu(self
):
176 WPAuthorDisplay
._defineSectionMenu
(self
)
179 def getJSFiles(self
):
180 return WPStaticEventBase
.getJSFiles(self
) + WPAuthorDisplay
.getJSFiles(self
)