Source

c5t / c5t / core / templates / calendar / event / get_all.mak

Full commit
<%inherit file="local:templates.master"/>
<%! from c5t.core.lib import helpers as h %>

<%def name="page_name()">calendars</%def>
<%! import calendar %>
<%! from datetime import date %>

<%def name="title()">${cal and 'Calendar: %s' % cal.title or 'All events'}</%def>

<%def name="head()">\
  ${parent.head()}
  <link rel='stylesheet' type='text/css' href='/css/fullcalendar.css' />
  <script type="text/javascript" src="/javascript/jquery/jquery.min.js"></script>
  <script type='text/javascript' src='/javascript/fullcalendar/fullcalendar.js'></script>
  <script type='text/javascript'>
  $(document).ready(function() {
    $('#calendar').fullCalendar({
      header: {
  			left: 'prev,next today',
  			center: 'title',
  			right: 'month,agendaWeek,agendaDay'
			},
			events: "json"
    })
  });
  </script>
</%def>
%if page:
  ${page.text | n}
%endif
%if h.can_edit(page):
  %if cal:
    %if page:
      <a href="/cal${cal._id}/edit">[edit content]</a>
    %else:
      <a href="/cal${cal._id}/new">[add content]</a>
    %endif
  %else:
    %if page:
      <a href="/events_content/edit">[edit content]</a>
    %else:
      <a href="/events_content/new">[add content]</a>
    %endif
  %endif
%endif

<h2>${title()}</h2>
%if cal and cal.text:
    <p>Description: ${cal.text}</p>
%endif

%if h.can_add(None):
<p><a href="new">Add Event</a></p>
%endif
<div id="calendar"></div>

<br/><br/>

%if cal:
  <a href="../edit">[edit]</a>
  <a href="../delete">[delete]</a>
%endif