Commit 5389bc28 authored by Daniel J. Ramirez's avatar Daniel J. Ramirez

Updated files results

parent 3a5915c5
......@@ -634,6 +634,14 @@ nav #eelo_links > * {
margin-top: 32px;
margin-bottom: 32px;
}
.result .result-template {
font-weight: bold;
text-transform: uppercase;
color: rgba(0, 0, 0, 0.4);
}
.result .result-template + .result_header {
margin-top: 0;
}
.result .result_header {
margin-bottom: 6px;
}
......@@ -641,15 +649,30 @@ nav #eelo_links > * {
width: 16px;
height: 16px;
}
.result .subheader > :not(:last-child),
.result .subheader > * > :not(:last-child) {
margin-right: 16px;
}
.result .result-content {
margin-top: 8px;
margin-bottom: 6px;
}
.result .result-content p {
margin-top: 8px;
margin-bottom: 8px;
}
.result.result-torrent .extra-info > :not(:last-child) {
margin-right: 16px;
}
.result .external-link {
font-size: 14px;
color: #39a441;
}
.result.result-default {
.result .extra-info {
color: rgba(0, 0, 0, 0.4);
}
.result.result-default,
.result.result-torrent {
margin-bottom: 32px;
}
.result.result-images {
......@@ -696,10 +719,12 @@ nav #eelo_links > * {
max-height: 120px;
overflow: hidden;
}
#suggestions form {
#suggestions form,
#corrections form {
display: inline-block;
}
#suggestions form .btn {
#suggestions form .btn,
#corrections form .btn {
text-transform: none;
}
.infobox {
......
This diff is collapsed.
......@@ -4,6 +4,13 @@
}
.result {
.result-template {
font-weight: bold;
text-transform: uppercase;
color: @text-muted-color;
& + .result_header { margin-top: 0; }
}
.result_header {
margin-bottom: @spacing_small;
......@@ -12,18 +19,34 @@
height: 16px;
}
}
.subheader > :not(:last-child), .subheader > * > :not(:last-child) {
margin-right: @spacing_large;
}
.result-content {
margin-top: @spacing_medium;
margin-bottom: @spacing_small;
p {
margin-top: @spacing_medium;
margin-bottom: @spacing_medium;
}
}
&.result-torrent {
.extra-info > :not(:last-child) { margin-right: @spacing_large; }
}
.external-link {
font-size: @fontsize_small;
color: #39a441;
}
.extra-info {
color: @text-muted-color;
}
}
.result.result-default {
.result.result-default, .result.result-torrent {
margin-bottom: @spacing_xx-large;
}
.result.result-images {
......@@ -78,7 +101,7 @@
}
#suggestions {
#suggestions, #corrections {
form {
display: inline-block;
.btn { text-transform: none; }
......
......@@ -41,9 +41,14 @@
<!-- Draw result sub header -->
{% macro result_sub_header(result) -%}
{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}
{% if result.magnetlink %}<small> &bull; {{ result_link(result.magnetlink, icon('magnet') + _('magnet link'), "magnetlink") }}</small>{% endif %}
{% if result.torrentfile %}<small> &bull; {{ result_link(result.torrentfile, icon('download-alt') + _('torrent file'), "torrentfile") }}</small>{% endif %}
<small class="subheader">
{% if result.publishedDate %}
<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>
{% endif %}
{% if caller %}
<span class="links">{{caller()}}</span>
{% endif %}
</small>
{%- endmacro %}
<!-- Draw result footer -->
......
{% from 'eelo/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
{% from 'eelo/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, result_link, icon %}
{{ result_header(result, favicons) }}
{{ result_sub_header(result) }}
{% call result_sub_header(result) %}
{% if result.magnetlink %}
{{ result_link(result.magnetlink, _('magnet link'), "magnetlink") }}
{% endif %}
{% if result.torrentfile %}
{{ result_link(result.torrentfile, _('torrent file'), "torrentfile") }}
{% endif %}
{% endcall %}
<p class="result-content">{{ icon('transfer') }} {{ _('Seeder') }} <span class="badge">{{ result.seed }}</span> &bull; {{ _('Leecher') }} <span class="badge">{{ result.leech }}</span>
{% if result.filesize %}<br />{{ icon('floppy-disk') }} {{ _('Filesize') }}
<span class="badge">
{% if result.filesize < 1024 %}{{ result.filesize }} {{ _('Bytes') }}
{% elif result.filesize < 1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024) }} {{ _('kiB') }}
{% elif result.filesize < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024) }} {{ _('MiB') }}
{% elif result.filesize < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024) }} {{ _('GiB') }}
{% else %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024/1024) }} {{ _('TiB') }}{% endif %}
</span>{% endif %}
{% if result.files %}<br />{{ icon('file') }} {{ _('Number of Files') }} <span class="badge">{{ result.files }}</span>{% endif %}
<div class="result-content">
{% if result.content %}<br />{{ result.content|safe }}{% endif %}
<div class="extra-info">
{% if result.seed and result.leech -%}
<span>{{ _('Seeders') }}: {{ result.seed }}</span>
<span>{{ _('Leechers') }}: {{ result.leech }}</span>
{%- endif %}
{% if result.filesize %}
<span class="badge"> {{ _('Filesize') }}:
{% if result.filesize < 1024 %}{{ result.filesize }} {{ _('Bytes') }}
{% elif result.filesize < 1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024) }} {{ _('kiB') }}
{% elif result.filesize < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024) }} {{ _('MiB') }}
{% elif result.filesize < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024) }} {{ _('GiB') }}
{% else %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024/1024) }} {{ _('TiB') }}{% endif %}
</span>
{% endif %}
{% if result.files %}
<span>
{{ _('Files') }}: {{ result.files }}
</span>
{% endif %}
</div>
</p>
<p>{% if result.content %}{{ result.content|safe }}{% endif %}</p>
</div>
{% if rtl %}
{{ result_footer_rtl(result) }}
......
......@@ -15,14 +15,13 @@
<div class="container contents {% if image_gallery %} full {% endif %}">
<div>
{% if corrections %}
<div class="result">
<span class="result_header text-muted form-inline pull-left suggestion_item">{{ _('Try searching for:') }}</span>
{% for correction in corrections %}
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation" class="form-inline pull-left suggestion_item">
<input type="hidden" name="q" value="{{ correction }}">
<button type="submit" class="btn btn-default btn-xs">{{ correction }}</button>
</form>
{% endfor %}
<div class="result" id="corrections">
<span class="text-muted">{{ _('Did you mean:') }}
{% for correction in corrections %}
{{ search_link(correction, correction, method) }}
{% endfor %}
</span>
?
</div>
{% endif %}
......@@ -40,9 +39,15 @@
{% include 'eelo/messages/no_results.html' %}
{% else %}
{% macro put_results(results_slice) -%}
{%- for result in results_slice %}
<div class="result {% if result['template'] %}result-{{ result.template|replace('.html', '') }}{% else %}result-default{% endif %}">
{% set template = result.template|replace('.html', '') if result['template'] else None %}
<div class="result {% if template %}result-{{ template }}{% else %} result-default {% endif %}">
{% if template in ["torrent"] %}
<small class="result-template">{{template}}</small>
{% endif %}
{% set index = loop.index %}
{% if result.template %}
{% include get_result_template('eelo', result['template']) %}
......@@ -53,6 +58,7 @@
{%- endfor %}
{%- endmacro %}
<div id="results" {% if image_gallery %} class="image-gallery" {% endif %}>
{{ put_results(results[:3]) }}
......
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