Commit 3a5915c5 authored by Daniel J. Ramirez's avatar Daniel J. Ramirez

Improved suggestions

parent 96638df2
......@@ -696,6 +696,12 @@ nav #eelo_links > * {
max-height: 120px;
overflow: hidden;
}
#suggestions form {
display: inline-block;
}
#suggestions form .btn {
text-transform: none;
}
.infobox {
margin-top: 32px;
}
......
This diff is collapsed.
......@@ -78,6 +78,14 @@
}
#suggestions {
form {
display: inline-block;
.btn { text-transform: none; }
}
}
.infobox {
margin-top: @spacing_xx-large;
......
......@@ -84,3 +84,21 @@
</span>
{% endif %}
{%- endmacro %}
{% macro search_link(text, q, method=None, time_range=None, lang=None, category=None) -%}
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation">
<input type="hidden" name="q" value="{{ q }}" />
{% if time_range %}
<input type="hidden" name="time_range" value="{{ time_range }}" />
{% endif %}
{% if time_range %}
<input type="hidden" name="language" value="{{ lang }}" />
{% endif %}
{% if category %}
<input type="hidden" name="category" value="images" />
{% endif %}
<button type="submit" class="btn btn-flat" >{{ text }}</button>
</form>
{% endmacro %}
\ No newline at end of file
{% extends "eelo/base.html" %}
{% from "eelo/macros.html" import search_link %}
{%- macro search_url() %}{{ base_url }}?q={{ q|urlencode }}{% if selected_categories %}&amp;categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if pageno > 1 %}&amp;pageno={{ pageno }}{% endif %}{% if time_range %}&amp;time_range={{ time_range }}{% endif %}{% if current_language != 'all' %}&amp;language={{ current_language }}{% endif %}{% endmacro -%}
......@@ -58,13 +59,7 @@
{% if image_results %}
<div id="image_result_mini_gallery_header">
<h1>{{_("Images")}}</h1>
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
<input type="hidden" name="q" value="{{ q|e }}" />
<input type="hidden" name="time_range" value="{{ time_range }}" />
<input type="hidden" name="language" value="{{ current_language }}" />
<input type="hidden" name="category" value="images" />
<button type="submit" class="btn btn-flat" >{{_("More")}}</button>
</form>
{{ search_link(_("More"), q|e, method=method, time_range=time_range, lang=current_language, category="images") }}
</div>
<div id="default_images_container">
{{ put_results(image_results) }}
......@@ -109,18 +104,13 @@
{% if suggestions %}
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">{{ _('Suggestions') }}</h4>
</div>
<div class="panel-body">
<div id="suggestions" class="infobox">
<h4 class="panel-title">{{ _('Suggestions') }}</h4>
<p>
{% for suggestion in suggestions %}
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} suggestion_item">
<input type="hidden" name="q" value="{{ suggestion }}">
<button type="submit" class="btn btn-default btn-xs">{{ suggestion }}</button>
</form>
{{ search_link(suggestion, suggestion, method) }}
{% endfor %}
</div>
</p>
</div>
{% endif %}
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment