forked from indymedia/epicyon
Buttons for previous and next month
parent
2bb7e5f898
commit
4d35b7d5ad
|
@ -139,3 +139,11 @@ tr:nth-child(even) > .calendar__day__cell:nth-child(even) {
|
||||||
height: 5rem;
|
height: 5rem;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
.buttonprev {
|
||||||
|
width: 2%;
|
||||||
|
}
|
||||||
|
.buttonnext {
|
||||||
|
width: 2%;
|
||||||
|
-webkit-transform: scaleX(-1);
|
||||||
|
transform: scaleX(-1);
|
||||||
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
|
@ -2838,6 +2838,18 @@ def htmlCalendar(translate: {}, \
|
||||||
year=currDate.year
|
year=currDate.year
|
||||||
monthNumber=currDate.month
|
monthNumber=currDate.month
|
||||||
|
|
||||||
|
prevYear=year
|
||||||
|
prevMonthNumber=monthNumber-1
|
||||||
|
if prevMonthNumber<1:
|
||||||
|
prevMonthNumber=12
|
||||||
|
prevYear=year-1
|
||||||
|
|
||||||
|
nextYear=year
|
||||||
|
nextMonthNumber=monthNumber+1
|
||||||
|
if nextMonthNumber>12:
|
||||||
|
nextMonthNumber=1
|
||||||
|
nextYear=year+1
|
||||||
|
|
||||||
print('Calendar year='+str(year)+' month='+str(monthNumber)+ ' '+str(weekDayOfMonthStart(monthNumber,year)))
|
print('Calendar year='+str(year)+' month='+str(monthNumber)+ ' '+str(weekDayOfMonthStart(monthNumber,year)))
|
||||||
|
|
||||||
nickname=getNicknameFromActor(actor)
|
nickname=getNicknameFromActor(actor)
|
||||||
|
@ -2866,7 +2878,11 @@ def htmlCalendar(translate: {}, \
|
||||||
calendarStr=htmlHeader(cssFilename,calendarStyle)
|
calendarStr=htmlHeader(cssFilename,calendarStyle)
|
||||||
calendarStr+='<main><table class="calendar">\n'
|
calendarStr+='<main><table class="calendar">\n'
|
||||||
calendarStr+='<caption class="calendar__banner--month">\n'
|
calendarStr+='<caption class="calendar__banner--month">\n'
|
||||||
|
calendarStr+=' <a href="'+actor+'/calendar?year='+str(prevYear)+'?month='+str(prevMonthNumber)+'">'
|
||||||
|
calendarStr+=' <img src="/icons/prev.png" class="buttonprev"/></a>\n'
|
||||||
calendarStr+=' <h1>'+monthName+'</h1>\n'
|
calendarStr+=' <h1>'+monthName+'</h1>\n'
|
||||||
|
calendarStr+=' <a href="'+actor+'/calendar?year='+str(nextYear)+'?month='+str(nextMonthNumber)+'">'
|
||||||
|
calendarStr+=' <img src="/icons/prev.png" class="buttonnext"/></a>\n'
|
||||||
calendarStr+='</caption>\n'
|
calendarStr+='</caption>\n'
|
||||||
calendarStr+='<thead>\n'
|
calendarStr+='<thead>\n'
|
||||||
calendarStr+='<tr>\n'
|
calendarStr+='<tr>\n'
|
||||||
|
|
Loading…
Reference in New Issue