source: indico/indico/MaKaC/plugins/Collaboration/EVO/pages.py @ 68ad7e

burotelhello-world-walkthroughipv6new-webexprov-dual-interfacev0.97-seriesv0.98-seriesv0.98.2v0.98.3v0.98b1v0.98b2v0.99v1.0v1.1
Last change on this file since 68ad7e was 626e2c, checked in by David Martín Clavo <david.martin.clavo@…>, 4 years ago

[ADDED/FIXED] Many fixes

  • new force-no-db flag in setup install
  • better mails for service exceptions
  • recording / webcast request improvements
  • some EVO fixes
  • some badge fixes
  • added fossilize mechanism

# This is a combination of 19 commits.
# The first commit's message is:
[ADDED] setup: force-no-db flag

# This is the 2nd commit message:

[FIXED] Mail messages for service exceptions

# This is the 3rd commit message:

[ADDED/FIXES] Several RR and WR improvements / fixes

# This is a combination of 11 commits.
# The first commit's message is:
[ADDED] RR: check if room is empty for warning msg

# This is the 2nd commit message:

[ADDED] RR and WR: not show talk selection for lectures

# This is the 3rd commit message:

[ADDED] Added event dates to VS mails

-Created formatTwoDates helper function in utils.py.
-Linkified title of event.
-Added event dates

# This is the 4th commit message:

[MINOR] RR and WR: moved list of talks to end of email

# This is the 5th commit message:

[ADDED] RR and WR talk list mail improvements

-Ordered by date.
-Date is shown in nice format.

# This is the 6th commit message:

[FIXED] Problems with mails print traceback in log

# This is the 7th commit message:

[FIXED] Sort contributions by date even for non scheduled contribs

-Also made sure event id is printed on log
in case of sent mail problems.

# This is the 8th commit message:

[FIXED] Small fix to maxDatetime and minDatetime

# This is the 9th commit message:

[FIXED] Another bug with non scheduled contribs...

# This is the 10th commit message:

[ADDED] RR and WR: contributions have start date and duration in mails

-Added a simple formatDuration function

# This is the 11th commit message:

[MINOR] XXhYYm duration is now zero-padded for minutes

# This is the 4th commit message:

[ADDED] Fossilize mechanism

# This is the 5th commit message:

[FIXED] Fossilize fixes

# This is the 6th commit message:

[ADDED] 'name' tag to change attrib name

# This is the 7th commit message:

[ADDED] fossilize: key args for converters

-Key args for converters, such as tz (timezone)
-Added a new Conversion.duration converter

# This is the 8th commit message:

[ADDED] RR and WR: contribs now shown by date

-Used fossilize
-No more 2 columns
-Cosmetic improvements

# This is the 9th commit message:

[ADDED] RR and WR: some cosmetic fixes

-Added week day for contribution dates in page.
-Dont show room if same as event

# This is the 10th commit message:

[FIXED] Regression in VS Overview

# This is the 11th commit message:

[FIXED] Regression in VS Overview

# This is the 12th commit message:

[FIXED] RR and WR: room was not showing sometimes

# This is the 13th commit message:

[FIXED] Regression with formatDuration

# This is the 14th commit message:

[FIXED] RR and WR: regression in VS Overview

# This is the 15th commit message:

[FIXED] Some minor EVO problems

# This is a combination of 3 commits.
# The first commit's message is:
[FIXED] EVO: communities appear in alphabetical order

# This is the 2nd commit message:

[MINOR] Better logging of EVO answer

# This is the 3rd commit message:

[FIXED] EVO: problem with update and ' and " characters

# This is the 16th commit message:

[FIXED] Add first part of EVO auto-join URL if not present

-For some reason this changed on the EVO side.

# This is the 17th commit message:

[FIXED] Check if EVO url correct for existing bookings

# This is the 18th commit message:

[FIX] Epayment and RB plugin systems marked as ignored

# This is the 19th commit message:

[FIXED] Some JS problems with badges and IE

-There was a i18n function ( _ ) inside a string.
String did not finish properly. Corrected this.
-Sometimes badge templates did not load correctly with IE.
This happened when the badge template had ' or " in the title
or a fixed text element. Changed it to use jsonEncode instead
of eval.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# Not currently on any branch.
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: indico/MaKaC/common/Conversion.py
# new file: indico/MaKaC/common/fossilize.py
# modified: indico/MaKaC/common/timezoneUtils.py
# modified: indico/MaKaC/common/utils.py
# modified: indico/MaKaC/conference.py
# modified: indico/MaKaC/consoleScripts/installBase.py
# new file: indico/MaKaC/fossils/init.py
# new file: indico/MaKaC/fossils/contribution.py
# new file: indico/MaKaC/fossils/subcontribution.py
# modified: indico/MaKaC/plugins/Collaboration/EVO/collaboration.py
# modified: indico/MaKaC/plugins/Collaboration/EVO/common.py
# modified: indico/MaKaC/plugins/Collaboration/EVO/pages.py
# modified: indico/MaKaC/plugins/Collaboration/EVO/tpls/NewBookingForm.tpl
# modified: indico/MaKaC/plugins/Collaboration/RecordingRequest/Style.css
# modified: indico/MaKaC/plugins/Collaboration/RecordingRequest/collaboration.py
# modified: indico/MaKaC/plugins/Collaboration/RecordingRequest/common.py
# new file: indico/MaKaC/plugins/Collaboration/RecordingRequest/fossils.py
# modified: indico/MaKaC/plugins/Collaboration/RecordingRequest/mail.py
# modified: indico/MaKaC/plugins/Collaboration/RecordingRequest/pages.py
# new file: indico/MaKaC/plugins/Collaboration/RecordingRequest/services.py
# modified: indico/MaKaC/plugins/Collaboration/RecordingRequest/tpls/Extra.js
# modified: indico/MaKaC/plugins/Collaboration/RecordingRequest/tpls/Main.js
# modified: indico/MaKaC/plugins/Collaboration/RecordingRequest/tpls/NewBookingForm.tpl
# modified: indico/MaKaC/plugins/Collaboration/WebcastRequest/Style.css
# modified: indico/MaKaC/plugins/Collaboration/WebcastRequest/collaboration.py
# new file: indico/MaKaC/plugins/Collaboration/WebcastRequest/fossils.py
# modified: indico/MaKaC/plugins/Collaboration/WebcastRequest/mail.py
# modified: indico/MaKaC/plugins/Collaboration/WebcastRequest/pages.py
# modified: indico/MaKaC/plugins/Collaboration/WebcastRequest/services.py
# modified: indico/MaKaC/plugins/Collaboration/WebcastRequest/tpls/Extra.js
# modified: indico/MaKaC/plugins/Collaboration/WebcastRequest/tpls/Main.js
# modified: indico/MaKaC/plugins/Collaboration/WebcastRequest/tpls/NewBookingForm.tpl
# modified: indico/MaKaC/plugins/Collaboration/collaborationTools.py
# modified: indico/MaKaC/plugins/EPayment/init.py
# modified: indico/MaKaC/plugins/RoomBooking/init.py
# modified: indico/MaKaC/plugins/init.py
# modified: indico/MaKaC/services/interface/rpc/common.py
# modified: indico/MaKaC/services/interface/rpc/json.py
# modified: indico/MaKaC/services/interface/rpc/process.py
# modified: indico/MaKaC/webinterface/pages/conferences.py
# modified: indico/MaKaC/webinterface/tpls/ConfModifBadgeDesign.tpl
# modified: indico/MaKaC/webinterface/tpls/ConfModifCollaboration.tpl
# modified: indico/MaKaC/webinterface/tpls/ConfModifCollaborationMultipleBookings.tpl
# modified: indico/MaKaC/webinterface/tpls/ConfModifCollaborationSingleBookings.tpl
# modified: indico/htdocs/js/indico/Legacy/Util.js
# modified: setup.py
# new file: tests/MaKaC_tests/common_tests/testFossilize.py
#

  • Property mode set to 100644
File size: 5.1 KB
Line 
1# -*- coding: utf-8 -*-
2##
3## $Id: pages.py,v 1.9 2009/04/25 13:56:04 dmartinc Exp $
4##
5## This file is part of CDS Indico.
6## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 CERN.
7##
8## CDS Indico is free software; you can redistribute it and/or
9## modify it under the terms of the GNU General Public License as
10## published by the Free Software Foundation; either version 2 of the
11## License, or (at your option) any later version.
12##
13## CDS Indico is distributed in the hope that it will be useful, but
14## WITHOUT ANY WARRANTY; without even the implied warranty of
15## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16## General Public License for more details.
17##
18## You should have received a copy of the GNU General Public License
19## along with CDS Indico; if not, write to the Free Software Foundation, Inc.,
20## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
21
22from MaKaC.plugins.Collaboration.base import WCSPageTemplateBase, WJSBase
23from MaKaC.common.utils import formatDateTime
24from datetime import timedelta
25from MaKaC.webinterface.common.tools import strip_ml_tags, unescape_html
26from MaKaC.plugins.Collaboration.EVO.common import getMinStartDate,\
27    getMaxEndDate
28from MaKaC.plugins.Collaboration.collaborationTools import CollaborationTools
29from MaKaC.i18n import _
30from MaKaC.common.timezoneUtils import nowutc, getAdjustedDate
31
32class WNewBookingForm(WCSPageTemplateBase):
33       
34    def getVars(self):
35        vars = WCSPageTemplateBase.getVars( self )
36       
37        vars["EventTitle"] = self._conf.getTitle()
38        vars["EventDescription"] = unescape_html(strip_ml_tags( self._conf.getDescription())).strip()
39       
40        defaultStartDate = self._conf.getAdjustedStartDate() - timedelta(0,0,0,0,CollaborationTools.getCollaborationOptionValue("startMinutes"))
41        nowStartDate = getAdjustedDate(nowutc() - timedelta(0,0,0,0, self._EVOOptions["allowedPastMinutes"].getValue() / 2), self._conf)
42        vars["DefaultStartDate"] = formatDateTime(max(defaultStartDate, nowStartDate))
43       
44        defaultEndDate = self._conf.getAdjustedEndDate()
45        nowEndDate = nowStartDate + timedelta(0,0,0,0, self._EVOOptions["allowedMinutes"].getValue())
46        vars["DefaultEndDate"] = formatDateTime(max(defaultEndDate, nowEndDate))
47       
48        communities = self._EVOOptions["communityList"].getValue() #a dict communityId : communityName
49        communityItems = communities.items() # a list of tuples (communityId, communityName)
50        communityItems.sort(key = lambda t: t[1]) # we sort by the second member of the tuple (the name)
51        vars["Communities"] = communityItems
52       
53        return vars
54
55class WMain (WJSBase):
56   
57    def getVars(self):
58        vars = WJSBase.getVars( self )
59       
60        vars["AllowedStartMinutes"] = self._EVOOptions["allowedPastMinutes"].getValue()
61        vars["MinStartDate"] = formatDateTime(getMinStartDate(self._conf))
62        vars["MaxEndDate"] = formatDateTime(getMaxEndDate(self._conf))
63        vars["AllowedMarginMinutes"] = self._EVOOptions["allowedMinutes"].getValue()
64       
65        return vars
66   
67class WExtra (WJSBase):
68   
69    def getVars(self):
70        vars = WJSBase.getVars( self )
71       
72        vars["AllowedStartMinutes"] = self._EVOOptions["allowedPastMinutes"].getValue()
73        if self._conf:
74            vars["MinStartDate"] = formatDateTime(getMinStartDate(self._conf), format = "%a %d/%m %H:%M")
75            vars["MaxEndDate"] = formatDateTime(getMaxEndDate(self._conf), format = "%a %d/%m %H:%M")
76        else:
77            vars["MinStartDate"] = ''
78            vars["MaxEndDate"] = ''
79       
80        return vars
81   
82class WIndexing(WJSBase):
83    pass
84   
85class WInformationDisplay(WCSPageTemplateBase):
86   
87    def __init__(self, booking, displayTz):
88        WCSPageTemplateBase.__init__(self, booking.getConference(), 'EVO', None)
89        self._booking = booking
90        self._displayTz = displayTz
91   
92    def getVars(self):
93        vars = WCSPageTemplateBase.getVars( self )
94       
95        vars["Booking"] = self._booking
96       
97        return vars
98   
99class XMLGenerator(object):
100   
101    @classmethod
102    def getDisplayName(cls):
103        return "EVO"
104           
105    @classmethod
106    def getCustomBookingXML(cls, booking, displayTz, out):
107        booking.checkCanStart()
108        if (booking.canBeStarted()):
109            out.openTag("launchInfo")
110            out.writeTag("launchText", _("Join Now!"))
111            out.writeTag("launchLink", booking.getURL())
112            out.writeTag("launchTooltip", _('Click here to join the EVO meeting!'))
113            out.closeTag("launchInfo")
114
115        out.openTag("information")
116       
117        if booking.getHasAccessPassword():
118            out.openTag("section")
119            out.writeTag("title", _('Protection:'))
120            out.writeTag("line", _('This EVO meeting is protected by a password'))
121            out.closeTag("section")
122        out.openTag("section")
123        out.writeTag("title", _('Description:'))
124        out.writeTag("line", booking._bookingParams["meetingDescription"])
125        out.closeTag("section")
126        out.closeTag("information")
127                   
Note: See TracBrowser for help on using the repository browser.