def getVars(self): v = wcomponents.WTemplated.getVars( self ) v['site_name'] = core_settings.get('site_title') v['social'] = social_settings.get_all() event = self._conf.as_event v['image'] = event.logo_url if event.has_logo else (config.IMAGES_BASE_URL + '/logo_indico.png') v['description'] = strip_ml_tags(self._conf.as_event.description[:500].encode('utf-8')) return v
def getVars(self): v = wcomponents.WTemplated.getVars( self ) v['site_name'] = core_settings.get('site_title') v['social'] = social_settings.get_all() event = self._conf.as_event v['image'] = event.logo_url if event.has_logo else Config.getInstance().getSystemIconURL("logo_indico") v['description'] = strip_ml_tags(self._conf.as_event.description[:500].encode('utf-8')) return v
def __init__(self, rh, event_, **kwargs): assert event_ == kwargs.setdefault('event', event_) WPDecorated.__init__(self, rh, **kwargs) self._navigationTarget = self._conf = event_.as_legacy self._tz = event_.display_tzinfo.zone start_dt_local = event_.start_dt_display.astimezone(event_.display_tzinfo) end_dt_local = event_.end_dt_display.astimezone(event_.display_tzinfo) dates = " (%s)" % format_date(start_dt_local, format='long') if start_dt_local.strftime("%d%B%Y") != end_dt_local.strftime("%d%B%Y"): if start_dt_local.strftime("%B%Y") == end_dt_local.strftime("%B%Y"): dates = " (%s-%s)" % (start_dt_local.strftime("%d"), format_date(end_dt_local, format='long')) else: dates = " (%s - %s)" % (format_date(start_dt_local, format='long'), format_date(end_dt_local, format='long')) self._setTitle("%s %s" % (strip_ml_tags(self._conf.as_event.title.encode('utf-8')), dates))
class InvenioRecordConverter(InvenioRecordConverterBase): """ Main converter class. Converts record from InvenioConverter in format readable by a plugin. """ conversion = [('088', 'reportNumbers', lambda x: [number for number in x[0]['a'][0].split(' ') if number != '(Confidential)']), ('100', 'primaryAuthor', lambda x: x[0] if 'Primary Author' in x[0].get('e', []) else {}, InvenioAuthorConverter), ('100', 'speaker', lambda x: x[0] if 'Speaker' in x[0].get('e', []) else {}, InvenioAuthorConverter), ('111', APPEND, None, InvenioPlaceTimeConverter111), ('245', 'title', lambda x: x[0]['a'][0]), ('518', APPEND, None, InvenioPlaceTimeConverter518), ('520', 'summary', lambda x: strip_ml_tags(x[0]['a'][0])), ('700', 'secondaryAuthor', None, InvenioAuthorConverter), ('61124', 'meetingName', lambda x: str(x[0]['a'][0])), ('8564', 'materials', lambda x: x, InvenioLinkConverter)]
def __init__(self, rh, conference, **kwargs): event = conference.as_event WPDecorated.__init__(self, rh, **kwargs) self._navigationTarget = self._conf = conference self._tz = event.display_tzinfo.zone start_dt_local = event.start_dt_display.astimezone( event.display_tzinfo) end_dt_local = event.end_dt_display.astimezone(event.display_tzinfo) dates = " (%s)" % format_date(start_dt_local, format='long') if start_dt_local.strftime("%d%B%Y") != end_dt_local.strftime( "%d%B%Y"): if start_dt_local.strftime("%B%Y") == end_dt_local.strftime( "%B%Y"): dates = " (%s-%s)" % (start_dt_local.strftime("%d"), format_date(end_dt_local, format='long')) else: dates = " (%s - %s)" % (format_date( start_dt_local, format='long'), format_date(end_dt_local, format='long')) self._setTitle( "%s %s" % (strip_ml_tags(self._conf.as_event.title.encode('utf-8')), dates))