Esempio n. 1
0
 def _getBody(self, params):
     params['calendar'] = RoomBookingCalendarWidget(
         params['occurrences'],
         params['start_dt'],
         params['end_dt'],
         rooms=params['rooms']).render()
     return WTemplated('RoomBookingCalendar').getHTML(params)
Esempio n. 2
0
 def _getPageContent(self, params):
     calendar = RoomBookingCalendarWidget(params['occurrences'], params['start_dt'], params['end_dt'],
                                          candidates=params['candidates'], rooms=params['rooms'],
                                          repeat_frequency=params['repeat_frequency'],
                                          repeat_interval=params['repeat_interval'],
                                          flexible_days=params['flexible_days'])
     params['calendar'] = calendar.render(show_summary=False, can_navigate=False, details_in_new_tab=True)
     return WTemplated('RoomBookingNewBookingSelectPeriod').getHTML(params)
Esempio n. 3
0
 def _getBody(self, params):
     params['startDT'] = datetime.combine(date.today(),
                                          Location.working_time_start)
     params['endDT'] = datetime.combine(date.today(),
                                        Location.working_time_end)
     params['startT'] = params['startDT'].strftime('%H:%M')
     params['endT'] = params['endDT'].strftime('%H:%M')
     return WTemplated('RoomBookingSearchRooms').getHTML(params)
Esempio n. 4
0
 def _getBody(self, params):
     params['period_options'] = [('pastmonth', _('Last 30 days')),
                                 (params['last_month'],
                                  _('Previous month')),
                                 ('thisyear', _('This year')),
                                 (params['last_year'], _('Previous year')),
                                 ('sinceever', _('Since ever'))]
     return WTemplated('RoomBookingRoomStats').getHTML(params)
Esempio n. 5
0
 def _getBody(self, params):
     cache_key = str(sorted(dict(request.args, lang=session.lang).items()))
     html = self.cache.get(cache_key)
     if html is None:
         params.update(self._get_widget_params())
         html = WTemplated('RoomBookingMapOfRoomsWidget').getHTML(params)
         self.cache.set(cache_key, html, 3600)
     return html
Esempio n. 6
0
 def _getPageContent(self, params):
     reservation = params['reservation']
     params['endpoints'] = self.endpoints
     params['assistance_emails'] = rb_settings.get('assistance_emails')
     params['repetition'] = RepeatMapping.get_message(*reservation.repetition)
     params['edit_logs'] = reservation.edit_logs.order_by(ReservationEditLog.timestamp.desc()).all()
     params['excluded_days'] = reservation.find_excluded_days().all()
     return WTemplated('RoomBookingDetails').getHTML(params)
Esempio n. 7
0
def inlineContextHelp(helpContent):
    """
    Allows you to put [?], the context help marker.
    Help content passed as argument helpContent.
    """
    from indico.legacy.webinterface.wcomponents import WTemplated
    params = {"helpContent" : helpContent,
              "imgSrc" : Config.getInstance().getSystemIconURL("help")}
    return WTemplated('InlineContextHelp').getHTML(params)
Esempio n. 8
0
def contextHelp(helpId):
    """
    Allows you to put [?], the context help marker.
    Help content is defined in <div id="helpId"></div>.
    """
    from indico.legacy.webinterface.wcomponents import WTemplated
    params = {"helpId" : helpId,
              "imgSrc" : Config.getInstance().getSystemIconURL("help")}
    return WTemplated('ContextHelp').getHTML(params)
Esempio n. 9
0
def inlineContextHelp(helpContent):
    """
    Allows you to put [?], the context help marker.
    Help content passed as argument helpContent.
    """
    from indico.legacy.webinterface.wcomponents import WTemplated
    params = {"helpContent": helpContent,
              "imgSrc": '{}/help.png'.format(config.IMAGES_BASE_URL)}
    return WTemplated('InlineContextHelp').getHTML(params)
Esempio n. 10
0
def contextHelp(helpId):
    """
    Allows you to put [?], the context help marker.
    Help content is defined in <div id="helpId"></div>.
    """
    from indico.legacy.webinterface.wcomponents import WTemplated
    params = {"helpId": helpId,
              "imgSrc": '{}/help.png'.format(config.IMAGES_BASE_URL)}
    return WTemplated('ContextHelp').getHTML(params)
Esempio n. 11
0
 def _getBody( self, params ):
     wc = WTemplated('LaTeXError')
     conf = self._error.params['conf']
     return wc.getHTML({
         'report_id': self._error.report_id,
         'is_manager': conf.as_event.can_manage(session.user),
         'log': open(self._error.log_file, 'r').read(),
         'source_code': open(self._error.source_file, 'r').read()
     })
Esempio n. 12
0
 def _getBody(self, params):
     api_key = rb_settings.get('google_maps_api_key')
     cache_key = str(sorted(dict(request.args, lang=session.lang).items())) + str(crc32(api_key))
     html = self.cache.get(cache_key)
     if html is None:
         params.update(self._get_widget_params())
         params['api_key'] = api_key
         html = WTemplated('RoomBookingMapOfRoomsWidget').getHTML(params)
         self.cache.set(cache_key, html, 3600)
     return html
Esempio n. 13
0
 def _getPageContent(self, params):
     params['endpoints'] = self.endpoints
     calendar = RoomBookingCalendarWidget(params['occurrences'], params['start_dt'], params['end_dt'],
                                          candidates=params['candidates'], specific_room=params['room'],
                                          repeat_frequency=params['repeat_frequency'],
                                          repeat_interval=params['repeat_interval'])
     params['calendar'] = calendar.render(show_navbar=False, details_in_new_tab=True)
     params['serializable_room'] = Room.get(params['room'].id).to_serializable('__public_exhaustive__')
     params['booking_limit'] = rb_settings.get('booking_limit')
     return WTemplated('RoomBookingBookingForm').getHTML(params)
Esempio n. 14
0
 def _getBody(self, params):
     params['summary'] = self._get_criteria_summary(params)
     calendar = RoomBookingCalendarWidget(
         params['occurrences'],
         params['start_dt'],
         params['end_dt'],
         rooms=params['rooms'],
         show_blockings=params['show_blockings'])
     params['calendar'] = calendar.render(form_data=params['form_data'])
     return WTemplated('RoomBookingSearchBookingsResults').getHTML(params)
Esempio n. 15
0
    def render(self,
               show_empty_rooms=True,
               show_empty_days=True,
               form_data=None,
               show_summary=True,
               show_navbar=True,
               can_navigate=True,
               details_in_new_tab=False):
        bars = self.build_bars_data(show_empty_rooms, show_empty_days)
        days = self.build_days_attrs() if self.specific_room and bars else {}

        period = self.end_dt.date() - self.start_dt.date() + timedelta(days=1)

        return WTemplated('RoomBookingCalendarWidget').getHTML({
            'form_data':
            form_data,
            'bars':
            bars,
            'days':
            days,
            'start_dt':
            self.start_dt,
            'end_dt':
            self.end_dt,
            'period_name':
            _('day') if period.days == 1 else _('period'),
            'specific_room':
            bool(self.specific_room),
            'show_summary':
            show_summary,
            'show_navbar':
            show_navbar,
            'can_navigate':
            show_navbar and can_navigate,
            'details_in_new_tab':
            details_in_new_tab,
            'repeat_frequency':
            self.repeat_frequency,
            'flexible_days':
            self.flexible_days
        })
Esempio n. 16
0
 def _get_legacy_content(self, params):
     params['field_opts'] = {
         'assistance_emails': {
             'rows': 3,
             'cols': 40
         },
         'notification_hour': {
             'size': 2
         },
         'notification_before_days': {
             'size': 2
         },
         'vc_support_emails': {
             'rows': 3,
             'cols': 40
         },
         'booking_limit': {
             'size': 3
         },
     }
     return WTemplated('RoomBookingSettings').getHTML(params)
Esempio n. 17
0
 def _getBody(self, params):
     params['endpoints'] = self.endpoints
     return WTemplated('RoomBookingNewBookingConfirm').getHTML(params)
Esempio n. 18
0
 def _getBody(self, params):
     params['serializable_rooms'] = _get_serializable_rooms(
         [r.id for r in params['rooms']])
     params['booking_limit'] = rb_settings.get('booking_limit')
     return WTemplated('RoomBookingNewBookingSelectRoom').getHTML(params)
Esempio n. 19
0
 def _getTabContent(self, params):
     return WTemplated('RoomBookingEventChooseEvent').getHTML(params)
Esempio n. 20
0
 def _getBody(self, params):
     return WTemplated('RoomBookingBlockingDetails').getHTML(params)
Esempio n. 21
0
 def _getBody(self, params):
     return WTemplated('RoomBookingBlockingsForMyRooms').getHTML(params)
Esempio n. 22
0
 def _get_legacy_content(self, params):
     return WTemplated('RoomBookingAdmin').getHTML(params)
Esempio n. 23
0
 def _getTabContent(self, params):
     return WTemplated('RoomBookingAdminLocation').getHTML(params)
Esempio n. 24
0
 def _getPageContent(self, params):
     return WTemplated('RoomBookingSearchBookings').getHTML(params)
Esempio n. 25
0
 def _getPageContent(self, params):
     return WTemplated('RoomBookingBlockingsForMyRooms').getHTML(params)
Esempio n. 26
0
 def _getBody(self, params):
     return WTemplated('RoomBookingSearchBookings').getHTML(params)
Esempio n. 27
0
 def _getTabContent(self, params):
     return WTemplated('RoomBookingRoomForm').getHTML(params)