Skip to content

Commit

Permalink
#628 vorige zoekopdracht onthouden toegevoegd
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickkuypers committed Oct 20, 2020
1 parent 194ab52 commit a26bbe2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
19 changes: 13 additions & 6 deletions atramhasis/templates/header-page.jinja2
Expand Up @@ -22,7 +22,7 @@
<select id="scheme">
<option value="" selected>{% trans %}select_scheme{% endtrans %}</option>
{% for item in conceptschemes %}
<option value="{{ request.route_path('search_result', scheme_id=item.id) }}">
<option {% if item.id == scheme_id %} selected="selected" {% endif %} value="{{ request.route_path('search_result', scheme_id=item.id) }}">
{{ get_conceptscheme_label(item.conceptscheme, request.locale_name) }}
</option>
{% endfor %}
Expand All @@ -31,16 +31,23 @@
<li class="divider"></li>
<li>
<select id="ctype" name="ctype">
<option value="all" selected>{% trans %}select_type{% endtrans %}</option>
<option value="all">{% trans %}type_all{% endtrans %}</option>
<option value="concept">{% trans %}type_concept{% endtrans %}</option>
<option value="collection">{% trans %}type_collection{% endtrans %}</option>
<option value="all">{% trans %}select_type{% endtrans %}</option>
<option {% if ctype == 'all' %} selected="selected" {% endif %} value="all">{% trans %}type_all{% endtrans %}</option>
<option {% if ctype == 'concept' %} selected="selected" {% endif %} value="concept">{% trans %}type_concept{% endtrans %}</option>
<option {% if ctype == 'collection' %} selected="selected" {% endif %} value="collection">{% trans %}type_collection{% endtrans %}</option>
</select>
</li>
<li class="divider"></li>
<li class="has-form">
<div class="row collapse">
<div class="left"><input name="label" id="label" type="text" class="search-input-top" placeholder="{% trans %}search_for{% endtrans %} {% trans %}labels{% endtrans %}"/></div>
<div class="left">
<input {% if label is not none %} value="{{label}}" {% endif %}
name="label"
id="label"
type="text"
class="search-input-top"
placeholder="{% trans %}search_for{% endtrans %} {% trans %}labels{% endtrans %}"/>
</div>
<div class="left"><a onclick="submitForm();"><span class="ico ico-mglass"></span></a></div>
</div>
</li>
Expand Down
2 changes: 1 addition & 1 deletion atramhasis/views/views.py
Expand Up @@ -196,7 +196,7 @@ def search_result(self):
concepts = provider.find({'type': ctype}, language=self.request.locale_name, sort='label')
else:
concepts = provider.get_all(language=self.request.locale_name, sort='label')
return {'concepts': concepts, 'scheme_id': scheme_id, 'conceptschemes': conceptschemes}
return {'concepts': concepts, 'scheme_id': scheme_id, 'conceptschemes': conceptschemes, 'ctype': ctype, 'label': label}
return Response(content_type='text/plain', status_int=404)

@view_config(route_name='locale')
Expand Down

0 comments on commit a26bbe2

Please sign in to comment.