Commits

Nikolaj Sjujskij committed bb6f985

Improve links to other years and display non-current year (next to month)

  • Participants
  • Parent commits d323b28

Comments (0)

Files changed (2)

 
     # create calendars
     calendar.setfirstweekday(calendar.MONDAY)
-    cal_year = year
     month, year = (basedate.month, basedate.year)
     context = {
                'devs': DEVLIST,
                'devlist': DEVS,
                'month_data': month_data,
                'next_month': next_month,
-               'next_year': next_year,
+               'next_year': next_year if next_year != today.year else "",
                'prev_month': prev_month,
-               'prev_year': prev_year,
+               'prev_year': prev_year if prev_year != today.year else "",
                'calendar': calendar.monthcalendar(year, month),
                'weekhdr': calendar.weekheader(3).split(' '),
                'stylesheet': stylesheet,
                'daytmpl': monthstr.replace('%', '%02d'),
                'month_name': calendar.month_name[month],
                'month': month,
-               'year': cal_year,
+               'year': year if year != today.year else "",
                'today': today_day,
                'opened': opened,
                'closed': closed,

File templates/index.html

     <h2 id="{{ login }}">{{ name }}</h2>
     <h3>
         <a href="/{{ '%02d' | format(prev_month) }}/{{ prev_year }}#{{ login }}">◄</a>
-        {{ month_name }}
+        {{ month_name }} {{ year }}
         <a href="/{{ '%02d' | format(next_month) }}/{{ next_year }}#{{ login }}">►</a>
     </h3>
     <table class="cal">