Project

General

Profile

« Previous | Next » 

Revision 008d1263

Added by Frédéric Péters over 15 years ago

List both events and remote calendars on events page, in columns

View differences:

extra/modules/events_ui.ptl
return Directory._q_traverse(self, path)
def _q_index [html] (self):
html_top('events', _('Remote Calendars'))
'<ul id="main-actions">'
' <li><a class="new-item" href="new">%s</a></li>' % _('New')
'</ul>'
events = RemoteCalendar.select()
'<ul class="biglist" id="events-list">'
for l in events:
event_id = l.id
'<li class="biglistitem" id="itemId_%s">' % event_id
'<strong class="label">%s</strong>' % l.label
'<p class="details">'
l.url
if l.error:
'<br /><span class="error-message">%s</span>' % l.get_error_message()
'</p>'
'<p class="commands">'
command_icon('%s/' % event_id, 'view')
command_icon('%s/edit' % event_id, 'edit')
command_icon('%s/delete' % event_id, 'remove')
'</p></li>'
'</ul>'
return redirect('..')
def new [html] (self):
calendar_ui = RemoteCalendarDirectory(RemoteCalendar())
......
html_top('events', _('Events'))
'<ul id="main-actions">'
' <li><a class="new-item" href="new">%s</a></li>' % _('New')
' <li><a href="remote/">%s</a></li>' % _('Remote Calendars')
' <li><a class="new-item" href="new">%s</a></li>' % _('New Event')
' <li><a class="new-item" href="remote/new">%s</a></li>' % _('New Remote Calendar')
'</ul>'
events = Event.select()
'<div class="splitcontent-left">'
'<div class="bo-block">'
events = Event.select()
'<h2>%s</h2>' % _('Events')
if not events:
'<p>'
_('There is no event defined at the moment.')
'</p>'
'<ul class="biglist" id="events-list">'
for l in events:
event_id = l.id
'<li class="biglistitem" id="itemId_%s">' % event_id
'<strong class="label">%s</strong>' % l.title
'<p class="details">'
label = l.description
if len(label) > 60:
label = label[:55] + ' (...)'
label
'</p>'
'<strong class="label"><a href="%s/">%s</a></strong>' % (event_id, l.title)
' - '
l.format_date()
'<p class="commands">'
command_icon('%s/' % event_id, 'view')
command_icon('%s/edit' % event_id, 'edit')
command_icon('%s/delete' % event_id, 'remove')
'</p></li>'
'</ul>'
'</div>'
'</div>'
'<div class="splitcontent-right">'
'<div class="bo-block">'
rcalendars = RemoteCalendar.select()
'<h2>%s</h2>' % _('Remote Calendars')
if not rcalendars:
'<p>'
_('There is no remote calendars defined at the moment.')
'</p>'
'<ul class="biglist" id="events-list">'
for l in rcalendars:
rcal_id = l.id
'<li class="biglistitem" id="itemId_%s">' % rcal_id
'<strong class="label"><a href="remote/%s/">%s</a></strong>' % (rcal_id, l.label)
'<p class="details">'
l.url
if l.error:
'<br /><span class="error-message">%s</span>' % l.get_error_message()
'</p>'
'<p class="commands">'
command_icon('remote/%s/edit' % rcal_id, 'edit')
command_icon('remote/%s/delete' % rcal_id, 'remove')
'</p></li>'
'</ul>'
'</div>'
'</div>'
def new [html] (self):
event_ui = EventDirectory(Event())

Also available in: Unified diff