Commit e0ad044b authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

default is stable

--HG--
branch : stable
......@@ -12,3 +12,5 @@ a7b92f0f1000d760f37036ffbd3700d2bc5d0904 cubicweb-calendar-debian-version-0.3.0-
af89811432f2b360dff1632fad095d9c52f0aff7 cubicweb-calendar-debian-version-0.4.0-1
e81e20d9a24f07c3b1a12555c16e74ebfa0c3692 cubicweb-calendar-version-0.5.0
d194794ace878a5c007d2e687b4e2ec4284aecda cubicweb-calendar-debian-version-0.5.0-1
1ea9959e951566606707512bb9a74b2f9f988b10 cubicweb-calendar-version-0.6.0
b46042bc855fea7897b8c56c1985c5617479d280 cubicweb-calendar-debian-version-0.6.0-1
......@@ -4,7 +4,7 @@
modname = 'calendar'
distname = 'cubicweb-calendar'
numversion = (0, 5, 0)
numversion = (0, 6, 0)
version = '.'.join(str(num) for num in numversion)
license = 'LGPL'
......
cubicweb-calendar (0.6.0-1) unstable; urgency=low
* new upstream release
-- Sylvain Thénault <sylvain.thenault@logilab.fr> Fri, 18 Feb 2011 16:22:08 +0100
cubicweb-calendar (0.5.0-1) unstable; urgency=low
* new upstream release
......
......@@ -8,7 +8,6 @@ from cubicweb.schema import display_name
from cubicweb.view import EntityView
from cubicweb.selectors import is_instance
from cubicweb.web.views.calendar import CalendarItemView, OneMonthCal
from cubicweb.web.views.old_calendar import _CalendarView
from cubes.calendar import NON_WORKING, WORKING, WORKING_AM, WORKING_PM
from cubes.calendar.views import get_date_range_from_reqform
......@@ -18,44 +17,6 @@ CALENDARS_PAGE = u"""<table class="bigCalendars">
</table>
"""
class ActivityMonthCalendarView(_CalendarView):
"""this viewca renders a 3x1 calendars' table"""
__regid__ = 'calendaronemonth'
title = _('calendar (one month)')
def nav_header(self, curdate):
self._cw.add_js('cubicweb.ajax.js')
prevdate = previous_month(curdate)
nextdate = next_month(curdate)
rql = self._cw.url_quote(self.cw_rset.printable_rql())
prevlink = self._cw.ajax_replace_url('onemonthcal', rql=rql,
vid='calendaronemonth',
year=prevdate.year,
month=prevdate.month)
nextlink = self._cw.ajax_replace_url('onemonthcal', rql=rql,
vid='calendaronemonth',
year=nextdate.year,
month=nextdate.month)
self.w(u"""<table class="calendarPageHeader">
<tr><td class="prev"><a href="%s">&lt;&lt;</a></td>
<td class="next"><a href="%s">&gt;&gt;</a></td></tr>
</table>""" % (xml_escape(prevlink), xml_escape(nextlink)))
def call(self, year=None, month=None):
_today = pydate.today()
year = int(self._cw.form.get('year', _today.year))
month = int(self._cw.form.get('month', _today.month))
center_date = pydate(year, month, 1)
begin, end = self.get_date_range(day=center_date, shift=0)
schedule = self._mk_schedule(begin, end)
calendars = self.build_calendars(schedule, begin, end)
self.w(u'<div id="onemonthcal">')
self.nav_header(center_date)
self.w(CALENDARS_PAGE % tuple(calendars))
self.w(u'</div>')
class EuserCalendar(EntityView):
__select__ = is_instance('Calendar',)
__regid__ = 'user_calendar'
......@@ -147,7 +108,8 @@ class TimeperiodCalendarItemView(EntityView):
__regid__ = 'calendaritem'
__select__ = is_instance('Timeperiod',)
def cell_call(self, row, col):
entity = self.complete_entity(row, col)
entity = self.cw_rset.complete_entity(row, col)
day_types = u' '.join(self._cw._(dt.type) for dt in entity.day_type)
calendar = entity.from_calendar
self.w(xml_escape(u'%s : %s (%s)' % (calendar.title, day_types, self._cw._(entity.state))))
state = entity.cw_adapt_to('IWorkflowable').printable_state
self.w(xml_escape(u'%s : %s (%s)' % (entity.from_calendar.title,
day_types, state)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment