def render(self, context): month = int(self.month.resolve(context)) year = int(self.year.resolve(context)) week = int(self.month.resolve(context)) day = int(self.day.resolve(context)) try: string = "" previousMonth = month - 1 previousYear = year if (month == 1): previousMonth = 12 previousYear = year - 1 string += "<a href='%s'> < </a>" % (urlresolvers.reverse( 'app.hourregistrations.views.calendar', args=("%s" % previousYear, "%s" % previousMonth, week, day))) string += "%s %s" % (get_month_by_number(month), year) nextMonth = month + 1 nextYear = year if (month == 12): nextMonth = 1 nextYear = year + 1 string += "<a href='%s'> > </a>" % (urlresolvers.reverse( 'app.hourregistrations.views.calendar', args=("%s" % nextYear, "%s" % nextMonth, week, day))) return string except template.VariableDoesNotExist: return ''
def render(self, context): user_id = int(self.user_id.resolve(context)) months = (self.month.resolve(context)) year = int(self.year.resolve(context)) try: string = "" for month in sorted(months): string += " <a href='%s'>%s</a>" % (urlresolvers.reverse( 'app.hourregistrations.views.view_archived_month', args=("%s" % user_id, "%s" % year, "%s" % month)), get_month_by_number(month)) return string except template.VariableDoesNotExist: return ''
def render(self, context): user_id = int(self.user_id.resolve(context)) months = self.month.resolve(context) year = int(self.year.resolve(context)) try: string = "" for month in sorted(months): string += " <a href='%s'>%s</a>" % ( urlresolvers.reverse( "app.hourregistrations.views.view_archived_month", args=("%s" % user_id, "%s" % year, "%s" % month), ), get_month_by_number(month), ) return string except template.VariableDoesNotExist: return ""
def render(self, context): month = int(self.month.resolve(context)) year = int(self.year.resolve(context)) week = int(self.month.resolve(context)) day = int(self.day.resolve(context)) try: string = "" previousMonth = month - 1 previousYear = year if month == 1: previousMonth = 12 previousYear = year - 1 string += "<a href='%s'> < </a>" % ( urlresolvers.reverse( "app.hourregistrations.views.calendar", args=("%s" % previousYear, "%s" % previousMonth, week, day) ) ) string += "%s %s" % (get_month_by_number(month), year) nextMonth = month + 1 nextYear = year if month == 12: nextMonth = 1 nextYear = year + 1 string += "<a href='%s'> > </a>" % ( urlresolvers.reverse( "app.hourregistrations.views.calendar", args=("%s" % nextYear, "%s" % nextMonth, week, day) ) ) return string except template.VariableDoesNotExist: return ""