Skip to content
Snippets Groups Projects
Unverified Commit 064744c1 authored by Luke Murphy's avatar Luke Murphy
Browse files

Capitalize the columns and filters.

parent 771e2c26
No related branches found
No related tags found
No related merge requests found
Showing
with 23 additions and 19 deletions
......@@ -112,7 +112,11 @@ class ItemTable(tables.Table):
term['name'] for term in record['terms']
if term['taxonomy'] == 'tags'
])
ctx = {'tags': ', '.join(tags)}
tags = [' '.join([x.capitalize() for x in t.split()]) for t in tags]
ctx = {'tags': ', '.join(list(filter(
lambda tag: tag != 'None' and tag is not None,
tags
)))}
except KeyError:
ctx = {'tags': []}
......
{% if request %}
{% if record.body %}
<a href='{% url "edit-item" item_id=record.id %}?next={{ request.path }}'>{{ record.body }}</a>
<a href='{% url "edit-item" item_id=record.id %}?next={{ request.path }}'>{{ record.body | title }}</a>
{% else %}
<a href='{% url "edit-item" item_id=record.id %}?next={{ request.path }}'><p class="missing-body"> Missing text </p></a>
<a href='{% url "edit-item" item_id=record.id %}?next={{ request.path }}'><p class="missing-body"> Missing Text </p></a>
{% endif %}
{% else %}
{{ record.body }}
......
......@@ -2,7 +2,7 @@
<select name="category-{{ record.id }}" class="form-control">
<option value="" selected="selected">---------</option>
{% for cat in categories %}
<option value="{{ cat.0 }}"{% if cat.0 in selected %} selected="selected"{% endif %}>{{ cat.1 }}</option>
<option value="{{ cat.0 }}"{% if cat.0 in selected %} selected="selected"{% endif %}>{{ cat.1 | title }}</option>
{% endfor %}
</select>
{% endif %}
{{ record.ennumerator }}
{{ record.ennumerator | title }}
{{ record.gender }}
{{ record.gender | title }}
{{ record.location }}
{{ record.location | title }}
{{ record.source }}
{{ record.source | title }}
......@@ -6,7 +6,7 @@
<select style="width:80px;" id="age-selector" name="age" class="form-control">
<option value="All Ages" selected="selected">All Ages</option>
{% for age in age.items %}
<option value="{{ age }}">{{ age }}</option>
<option value="{{ age }}">{{ age | title }}</option>
{% endfor %}
</select>
</div>
......
......@@ -2,11 +2,11 @@
{% load i18n %}
<div class="filter-topic form-group input-group">
<div class="select-container">
<label class="col-sm-3 control-label" for="topic-selector">{% trans "Topics" %}</label>
<select style="width:90px;" id="category-selector" name="category" class="form-control">
<option value=""{% if not request.GET.category %} selected="selected"{% endif %}>{% trans "All topics" %}</option>
<label class="col-sm-3 control-label" for="topic-selector">{% trans "Themes" %}</label>
<select style="width:100px;" id="category-selector" name="category" class="form-control">
<option value=""{% if not request.GET.category %} selected="selected"{% endif %}>{% trans "All Themes" %}</option>
{% for cat in category_options %}
<option value="{{ cat.0 }}"{% if cat.0 == request.GET.category %} selected="selected"{% endif %}>{{ cat.1 }}</option>
<option value="{{ cat.0 }}"{% if cat.0 == request.GET.category %} selected="selected"{% endif %}>{{ cat.1 | title }}</option>
{% endfor %}
</select>
</div>
......
......@@ -6,7 +6,7 @@
<select style="width:135px;" id="ennumerator-selector" name="ennumerator" class="form-control">
<option value="All Ennumerators" selected="selected">All Ennumerators</option>
{% for ennumerator in ennumerator.items %}
<option value="{{ ennumerator }}">{{ ennumerator }}</option>
<option value="{{ ennumerator }}">{{ ennumerator | title }}</option>
{% endfor %}
</select>
</div>
......
......@@ -6,7 +6,7 @@
<select style="width:100px;" id="gender-selector" name="gender" class="form-control">
<option value="All Genders" selected="selected">All Genders</option>
{% for gender in gender.items %}
<option value="{{ gender }}">{{ gender }}</option>
<option value="{{ gender }}">{{ gender | title }}</option>
{% endfor %}
</select>
</div>
......
......@@ -6,7 +6,7 @@
<select style="width:110px;" id="location-selector" name="location" class="form-control">
<option value="All Locations" selected="selected">All Locations</option>
{% for location in locations.items %}
<option value="{{ location }}">{{ location }}</option>
<option value="{{ location }}">{{ location | title }}</option>
{% endfor %}
</select>
</div>
......
......@@ -6,7 +6,7 @@
<select style="width:100px;" id="source-selector" name="source" class="form-control">
<option value="All Sources" selected="selected">All Sources</option>
{% for source in source_filters.items %}
<option value="{{ source }}">{{ source }}</option>
<option value="{{ source }}">{{ source | title }}</option>
{% endfor %}
</select>
</div>
......
{% if request %}
<a href='{% url "edit-item" item_id=record.id %}?next={{ request.path }}'>{{ record.translation }}</a>
<a href='{% url "edit-item" item_id=record.id %}?next={{ request.path }}'>{{ record.translation | title }}</a>
{% else %}
{{ record.translation }}
{{ record.translation | title }}
{% endif %}
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