Nikolaj Sjujskij avatar Nikolaj Sjujskij committed 738282a

Hightlight "today" in calendars

Comments (0)

Files changed (4)

     stylesheet = session.get('css', 'light')
     other_ssheet = other_colour(stylesheet)
     # prepare search string, with today as default
+    today = datetime.date.today()
     basedate = datetime.date.today()
     replace_dict = {'day': 1}
     if month is not None:
     except ValueError:
         #TODO: prettify 404, add info
         abort(404)
+    if today.month == basedate.month and today.year == basedate.year:
+        today = today.day
+    else:
+        today = None
     del replace_dict
     monthstr = basedate.strftime("%%.%m.%Y")
 
                'month_name': calendar.month_name[month],
                'month': month,
                'year': cal_year,
+               'today': today,
                'opened': opened,
                'closed': closed,
                }
     color: #999;
 }
 
+.today {
+    background-color: #444;
+}
+
 .holiday {
     background-color: #272727;
 }
     color: #999999;
 }
 
+.today {
+    background-color: #fbbfbf;
+}
+
 .holiday {
     background-color: #eee;
 }

templates/index.html

         <tr>
             {% for day in week %}
             {% set daystr = daytmpl % day %}
-            <td{%if loop.index > 5 %} class="holiday"{% endif %}>
+            <td
+                {%- if today == day %} class="today"
+                {%- elif loop.index > 5 %} class="holiday"{% endif %}>
                 <span class="day">{{ day or '' }}</span>
                 {% for trac, tickets in usertckts.pop(daystr, {}).items() %}
                     <span class="project_name">{{ trac }}</span>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.