mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 14:35:27 +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
|
||||
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(
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user