Fix datepicker arrows style on hover
[cds-indico.git] / indico / MaKaC / webinterface / pages / static.py
blob66b5b9df9e898e44fea4508e47656c4b99b0c023
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):
33 return "static"
35 def _getHeader(self):
36 return ""
38 def _getFooter(self):
39 return ""
41 def _getMenu(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)
46 def getJSFiles(self):
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):
54 info = {}
55 for key in ['sessId', 'slotId', 'contId', 'subContId']:
56 info[key] = 'null'
57 info['confId'] = self._conf.getId()
58 return info
60 def _getVariables(self, conf):
61 variables = WPTPLConferenceDisplay._getVariables(self, conf)
62 variables['registrationOpen'] = False
63 variables['evaluationLink'] = False
64 return variables
67 class WPStaticConferenceDisplay(WPStaticEventBase, WPConferenceDisplay):
69 def _defineSectionMenu(self):
70 WPConferenceDisplay._defineSectionMenu(self)
71 self._getMenu()
74 class WPStaticConferenceTimeTable(WPStaticEventBase, WPConferenceTimeTable):
76 def _defineSectionMenu(self):
77 WPConferenceTimeTable._defineSectionMenu(self)
78 self._getMenu()
80 def getJSFiles(self):
81 return WPStaticEventBase.getJSFiles(self) + self._includeJSPackage('Timetable')
84 class WPStaticConferenceProgram(WPStaticEventBase, WPConferenceProgram):
86 def _defineSectionMenu(self):
87 WPConferenceProgram._defineSectionMenu(self)
88 self._getMenu()
91 class WPStaticContributionList(WPStaticEventBase, WPContributionList):
93 def _defineSectionMenu(self):
94 WPContributionList._defineSectionMenu(self)
95 self._getMenu()
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, "")
103 return wc.getHTML()
106 class WPStaticInternalPageDisplay(WPStaticEventBase, WPInternalPageDisplay):
108 def _defineSectionMenu(self):
109 WPInternalPageDisplay._defineSectionMenu(self)
110 self._getMenu()
113 class WPStaticAuthorIndex(WPStaticEventBase, WPAuthorIndex):
115 def _defineSectionMenu(self):
116 WPAuthorIndex._defineSectionMenu(self)
117 self._getMenu()
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)
127 self._getMenu()
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)
137 self._getMenu()
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)
147 self._getMenu()
150 class WPStaticConfRegistrantsList(WPStaticEventBase, WPConfRegistrantsList):
152 def _defineSectionMenu(self):
153 WPConfRegistrantsList._defineSectionMenu(self)
154 self._getMenu()
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")
163 return wc.getHTML()
166 class WPStaticSubContributionDisplay(WPStaticEventBase, WPSubContributionDisplay):
168 def _defineSectionMenu(self):
169 WPSubContributionDisplay._defineSectionMenu(self)
170 self._getMenu()
173 class WPStaticAuthorDisplay(WPStaticEventBase, WPAuthorDisplay):
175 def _defineSectionMenu(self):
176 WPAuthorDisplay._defineSectionMenu(self)
177 self._getMenu()
179 def getJSFiles(self):
180 return WPStaticEventBase.getJSFiles(self) + WPAuthorDisplay.getJSFiles(self)