Skip to content
Snippets Groups Projects
Commit 2457ee0a authored by lwm's avatar lwm
Browse files

Merge branch 'fix-table-styles' into 'staging'

Add column styles for widths.

See merge request !70
parents 0270df33 d58e5501
No related branches found
No related tags found
1 merge request!70Add column styles for widths.
Pipeline #2347 passed with warnings
......@@ -21,31 +21,38 @@ class ItemTable(tables.Table):
select_item = tables.TemplateColumn(
template_name='hid/select_item_id_checkbox_column.html',
verbose_name=_('Select')
verbose_name=_('Select'),
attrs={'td': {'class': 'col-md-1'}}
)
created = tables.columns.DateTimeColumn(
verbose_name=_('Imported'),
format=settings.SHORT_DATETIME_FORMAT,
attrs={'td': {'class': 'col-md-1'}}
)
timestamp = tables.columns.DateTimeColumn(
verbose_name=_('Created'),
format=settings.SHORT_DATETIME_FORMAT,
attrs={'td': {'class': 'col-md-1'}}
)
body = tables.TemplateColumn(
template_name='hid/body_column.html',
verbose_name=_('Original')
verbose_name=_('Original'),
attrs={'td': {'class': 'col-md-4'}}
)
translation = tables.TemplateColumn(
template_name='hid/translation_column.html',
verbose_name=_('Translation')
verbose_name=_('Translation'),
attrs={'td': {'class': 'col-md-4'}}
)
network_provider = tables.Column(
verbose_name=_('Network Provider')
verbose_name=_('Network Provider'),
attrs={'td': {'class': 'col-md-4'}}
)
category = tables.TemplateColumn(
verbose_name=_('Question Type'),
template_name='hid/categories_column.html',
accessor='terms'
accessor='terms',
attrs={'td': {'class': 'col-md-4'}}
)
def __init__(self, *args, **kwargs):
......
......@@ -26,7 +26,10 @@
{% block table.tbody.row %}
<tr class="{% cycle "even" "odd" %}">
{% for column, cell in row.items %}
<td {{ column.attrs.td.as_html }}>{% if column.localize == None %}{{ cell }}{% else %}{% if column.localize %}{{ cell|localize }}{% else %}{{ cell|unlocalize }}{% endif %}{% endif %}</td>
<td {{ column.attrs.td.as_html }}>
{% if column.localize == None %} {{ cell }} {% else %}
{% if column.localize %} {{ cell|localize }} {% else %} {{ cell|unlocalize }} {% endif %}
{% endif %}</td>
{% endfor %}
</tr>
{% endblock table.tbody.row %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment