mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
Add row_class support to /activity tables.
(imported from commit 69dcbeccc3b048053b2dcca82c628b0cfccddfbb)
This commit is contained in:
@@ -14,7 +14,13 @@ import time
|
|||||||
import pytz
|
import pytz
|
||||||
eastern_tz = pytz.timezone('US/Eastern')
|
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)
|
data = dict(title=title, cols=cols, rows=rows)
|
||||||
|
|
||||||
content = loader.render_to_string(
|
content = loader.render_to_string(
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for row in data.rows %}
|
{% for row in data.rows %}
|
||||||
<tr>
|
<tr {% if row.row_class %}class="{{ row.row_class }}"{% endif %}>
|
||||||
{% for field in row %}
|
{% for field in row.cells %}
|
||||||
<td sortable>{{ field }}</td>
|
<td sortable>{{ field }}</td>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user