Add row_class support to /activity tables.

(imported from commit 69dcbeccc3b048053b2dcca82c628b0cfccddfbb)
This commit is contained in:
Steve Howell
2013-11-18 10:26:56 -05:00
parent 818ef42d05
commit dd53b92efc
2 changed files with 9 additions and 3 deletions

View File

@@ -14,7 +14,13 @@ import time
import pytz
eastern_tz = pytz.timezone('US/Eastern')
def make_table(title, cols, rows):
def make_table(title, cols, rows, has_row_class=False):
if not has_row_class:
def fix_row(row):
return dict(cells=row, row_class=None)
rows = map(fix_row, rows)
data = dict(title=title, cols=cols, rows=rows)
content = loader.render_to_string(

View File

@@ -12,8 +12,8 @@
</thead>
<tbody>
{% for row in data.rows %}
<tr>
{% for field in row %}
<tr {% if row.row_class %}class="{{ row.row_class }}"{% endif %}>
{% for field in row.cells %}
<td sortable>{{ field }}</td>
{% endfor %}
</tr>