def _getPageContent(self, params): params['calendar'] = RoomBookingCalendarWidget( params['occurrences'], params['start_dt'], params['end_dt'], rooms=params['rooms']).render() return WTemplated('RoomBookingCalendar').getHTML(params)
def _getPageContent(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)
def _getPageContent(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)
def _getPageContent(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)
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
def inlineContextHelp(helpContent): """ Allows you to put [?], the context help marker. Help content passed as argument helpContent. """ from fossir.legacy.webinterface.wcomponents import WTemplated params = { "helpContent": helpContent, "imgSrc": '{}/help.png'.format(config.IMAGES_BASE_URL) } return WTemplated('InlineContextHelp').getHTML(params)
def contextHelp(helpId): """ Allows you to put [?], the context help marker. Help content is defined in <div id="helpId"></div>. """ from fossir.legacy.webinterface.wcomponents import WTemplated params = { "helpId": helpId, "imgSrc": '{}/help.png'.format(config.IMAGES_BASE_URL) } return WTemplated('ContextHelp').getHTML(params)
def _getPageContent(self, params): reservation = params['reservation'] params['endpoints'] = self.endpoints params['assistance_emails'] = rb_settings.get('assistance_emails') params['vc_equipment'] = ', '.join( eq.name for eq in reservation.get_vc_equipment()) 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)
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)
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)
def getVars(self): wvars = WTemplated.getVars(self) wvars['standalone'] = self._standalone room = wvars['room'] wvars['attrs'] = { attr.attribute.name: attr for attr in room.attributes if not attr.attribute.is_hidden or rb_is_admin(session.user) } wvars['owner_name'] = room.owner.full_name wvars['bookable_hours'] = room.bookable_hours.all() wvars['nonbookable_periods'] = room.nonbookable_periods.all() # URLs wvars['stats_url'] = url_for('rooms.roomBooking-roomStats', room) wvars['delete_room_url'] = url_for('rooms_admin.delete_room', room) wvars['modify_room_url'] = url_for('rooms_admin.modify_room', room) wvars['show_on_map'] = room.map_url if room.map_url else url_for( 'rooms.roomBooking-mapOfRooms', room) return wvars
def _getPageContent(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)
def _getTabContent(self, params): return WTemplated('RoomBookingEventChooseEvent').getHTML(params)
def _get_legacy_content(self, params): return WTemplated('RoomBookingRoomForm').getHTML(params)
def _getPageContent(self, params): return WTemplated('RoomBookingBlockingDetails').getHTML(params)
def _getPageContent(self, params): params['endpoints'] = self.endpoints return WTemplated('RoomBookingNewBookingConfirm').getHTML(params)
def _getPageContent(self, params): return WTemplated('RoomBookingSearchRoomsResults').getHTML(params)
def _get_legacy_content(self, params): return WTemplated('RoomBookingAdminLocation').getHTML(params)