summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2020-04-23 18:26:11 -0700
committerBryan Newbold <bnewbold@robocracy.org>2020-04-23 18:26:13 -0700
commitf3d286d92088a2f7038e0635a85a09c7de322147 (patch)
tree04dcd10813b06fdb2f94dc174d69c8c5db586c7f /python
parente749b576bdb9bbec3bcef7e4e389e7fbbf916c84 (diff)
downloadfatcat-f3d286d92088a2f7038e0635a85a09c7de322147.tar.gz
fatcat-f3d286d92088a2f7038e0635a85a09c7de322147.zip
web search: improve indentation, fix missing div tags
These are back-ported fixes from covid19.fatcat.wiki
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_web/templates/container_search.html89
-rw-r--r--python/fatcat_web/templates/release_search.html59
2 files changed, 81 insertions, 67 deletions
diff --git a/python/fatcat_web/templates/container_search.html b/python/fatcat_web/templates/container_search.html
index 1a089643..1a804595 100644
--- a/python/fatcat_web/templates/container_search.html
+++ b/python/fatcat_web/templates/container_search.html
@@ -9,6 +9,7 @@
{% endif %}
{% endblock %}
+
{% block fullmain %}
<div class="ui vertical stripe segment" style="background-color: #EEE; padding-top: 4.5em;">
@@ -17,8 +18,7 @@
<form class="" role="search" action="/container/search" method="get">
<div class="ui form">
<div class="ui action input huge fluid">
- <input type="text" placeholder="Query..." name="q" value="{% if query %}{{ query }}{% endif %}" aria-label="search container metadata">
- <button class="ui button">Search</button>
+ <input type="text" placeholder="Query..." name="q" value="{% if query %}{{ query }}{% endif %}" aria-label="search container metadata"> <button class="ui button">Search</button>
</div>
<br>Can also lookup by <b><a href="/container/lookup">identifier</a></b> or search <b><a href="/release/search?q={{ query or "" }}">releases</a></b>.
</div>
@@ -30,49 +30,56 @@
<br>
{% if found %}
-{% if found.results %}
- {{ entity_macros.top_results(found) }}
+ {% if found.results %}
-{% for entity in found.results %}
-<div>
- <h4 style="margin-top: 1em; margin-bottom: 4px; font-size: 1.1em;">
- <a href="/container/{{ entity.ident }}" style="color: #2224c7;">{{ entity['name'] }}</a>
- {% if entity.is_oa %}<i class="icon unlock orange small"></i>{% endif %}
- </h4>
- {% if entity.publisher %}
- <h5 style="margin-top: 4px; margin-bottom: 4px; font-size: 1em;">{{ entity.publisher }}</h5>
- {% endif %}
- {% if entity.issnl %}
- <a href="https://portal.issn.org/resource/ISSN/{{entity.issnl }}" style="color: green;">issn:{{ entity.issnl }}</a>
- {% endif %}
- {% if entity.container_type %}
- &nbsp;{{ entity.container_type }}
- {% endif %}
-</div>
-{% endfor %}
-{% if found.results|length > 8 %}
- <div class="ui divider"></div>
- <div style="text-align: center">
- {{ entity_macros.bottom_results(found, endpoint='container_search')}}
- </div>
-{% endif %}
-{% else %}
+ {{ entity_macros.top_results(found) }}
-Raw query was: <i>{{ found.query.q }}</i>
+ {% for entity in found.results %}
+ <div>
+ <h4 style="margin-top: 1em; margin-bottom: 4px; font-size: 1.1em;">
+ <a href="/container/{{ entity.ident }}" style="color: #2224c7;">{{ entity['name'] }}</a>
+ {% if entity.is_oa %}<i class="icon unlock orange small"></i>{% endif %}
+ </h4>
+ {% if entity.publisher %}
+ <h5 style="margin-top: 4px; margin-bottom: 4px; font-size: 1em;">{{ entity.publisher }}</h5>
+ {% endif %}
+ {% if entity.issnl %}
+ <a href="https://portal.issn.org/resource/ISSN/{{entity.issnl }}" style="color: green;">issn:{{ entity.issnl }}</a>
+ {% endif %}
+ {% if entity.container_type %}
+ &nbsp;{{ entity.container_type }}
+ {% endif %}
+ </div>
+ {% endfor %}
+
+ {% if found.results|length > 8 %}
+ <div class="ui divider"></div>
+ <div style="text-align: center">
+ {{ entity_macros.bottom_results(found, endpoint='container_search') }}
+ </div>
+ {% endif %}
-<div class="ui centered stackable grid" style="padding-top: 15%;">
- <div class="row">
- <div class="four wide column">
- <img src="/static/paper_man_confused.gif" alt="confused paper man">
+ {% else %}
+
+ Raw query was: <i>{{ found.query.q }}</i>
+
+ <div class="ui centered stackable grid" style="padding-top: 15%;">
+ <div class="row">
+ <div class="four wide column">
+ <img src="/static/paper_man_confused.gif" alt="confused paper man">
+ </div>
+ <div class="six wide column">
+ <h2>No results found!</h2>
+ <p>You could try elsewhere:</p>
+ <ul>
+ <li>Search <a href="https://scholar.google.com/scholar?q={{ found.query.q | urlencode }}">Google Scholar</a></li>
+ </ul>
+ </div>
+ </div>
</div>
- <div class="six wide column">
- <h2>No results found!</h2>
- <p>You could try elsewhere:</p>
- <ul>
- <li>Search <a href="https://scholar.google.com/scholar?q={{ found.query.q | urlencode }}">Google Scholar</a></li>
- </ul>
-</div>
-{% endif %}
+
+ {% endif %}
+
{% endif %}
</div>
diff --git a/python/fatcat_web/templates/release_search.html b/python/fatcat_web/templates/release_search.html
index 47f4330a..70c46c0a 100644
--- a/python/fatcat_web/templates/release_search.html
+++ b/python/fatcat_web/templates/release_search.html
@@ -35,37 +35,44 @@
<br>
{% if found %}
-{% if found.results %}
+ {% if found.results %}
+
{{ entity_macros.top_results(found) }}
- {% for paper in found.results %}
- {{ entity_macros.release_search_result_row(paper) }}
-{% endfor %}
-{% if found.results|length > 8 %}
- <div class="ui divider"></div>
- <div style="text-align: center">
- {{ entity_macros.bottom_results(found)}}
- </div>
-{% endif %}
-{% else %}
+ {% for paper in found.results %}
+ {{ entity_macros.release_search_result_row(paper) }}
+ {% endfor %}
+
+ {% if found.results|length > 8 %}
+ <div class="ui divider"></div>
+ <div style="text-align: center">
+ {{ entity_macros.bottom_results(found, endpoint='release_search') }}
+ </div>
+ {% endif %}
+
+ {% else %}
-Raw query was: <i>{{ found.query.q }}</i>
+ Raw query was: <i>{{ found.query.q }}</i>
-<div class="ui centered stackable grid" style="padding-top: 15%;">
- <div class="row">
- <div class="four wide column">
- <img src="/static/paper_man_confused.gif" alt="confused paper man">
+ <div class="ui centered stackable grid" style="padding-top: 15%;">
+ <div class="row">
+ <div class="four wide column">
+ <img src="/static/paper_man_confused.gif" alt="confused paper man">
+ </div>
+ <div class="six wide column">
+ <h2>No results found!</h2>
+ <p>You could try elsewhere:</p>
+ <ul>
+ <li>Search <a href="https://dissem.in/search?q={{ found.query.q | urlencode }}">dissem.in</a></li>
+ <li>Search <a href="https://www.base-search.net/Search/Results?lookfor={{ found.query.q | urlencode }}">BASE</a></li>
+ <li>Search <a href="https://scholar.google.com/scholar?q={{ found.query.q | urlencode }}">Google Scholar</a></li>
+ </ul>
+ </div>
+ </div>
</div>
- <div class="six wide column">
- <h2>No results found!</h2>
- <p>You could try elsewhere:</p>
- <ul>
- <li>Search <a href="https://dissem.in/search?q={{ found.query.q | urlencode }}">dissem.in</a></li>
- <li>Search <a href="https://www.base-search.net/Search/Results?lookfor={{ found.query.q | urlencode }}">BASE</a></li>
- <li>Search <a href="https://scholar.google.com/scholar?q={{ found.query.q | urlencode }}">Google Scholar</a></li>
- </ul>
-</div>
-{% endif %}
+
+ {% endif %}
+
{% endif %}
</div>