aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat/templates
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-06-21 18:23:09 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-06-21 18:23:09 -0700
commit3075f0ab8853fd97c68d3f0b8086dfa5c863c7f2 (patch)
tree5bb022e5dc1dc57cd663afc9feec33e6b5039bb1 /python/fatcat/templates
parent416117af51592b2a60b317427dc034544347b435 (diff)
downloadfatcat-3075f0ab8853fd97c68d3f0b8086dfa5c863c7f2.tar.gz
fatcat-3075f0ab8853fd97c68d3f0b8086dfa5c863c7f2.zip
copy some of paper-search over
Diffstat (limited to 'python/fatcat/templates')
-rw-r--r--python/fatcat/templates/base.html10
-rw-r--r--python/fatcat/templates/release_search.html33
2 files changed, 39 insertions, 4 deletions
diff --git a/python/fatcat/templates/base.html b/python/fatcat/templates/base.html
index ae487a18..ac6fef43 100644
--- a/python/fatcat/templates/base.html
+++ b/python/fatcat/templates/base.html
@@ -26,10 +26,12 @@
<a href="#" class="item">Guide</a>
<div class="right menu">
<div class="item">
- <div class="ui transparent inverted icon input">
- <i class="search icon"></i>
- <input type="text" placeholder="Search...">
- </div>
+ <form class="" role="search" action="/release/search" method="get">
+ <div class="ui transparent inverted icon input">
+ <i class="search icon"></i>
+ <input type="text" placeholder="Search..." name="q">
+ </div>
+ </form>
</div>
<div class="ui simple dropdown item">
demo-user <i class="dropdown icon"></i>
diff --git a/python/fatcat/templates/release_search.html b/python/fatcat/templates/release_search.html
new file mode 100644
index 00000000..39c9bbe6
--- /dev/null
+++ b/python/fatcat/templates/release_search.html
@@ -0,0 +1,33 @@
+{% extends "base.html" %}
+{% block body %}
+
+{% if found %}
+<h1>Search Results</h1>
+<i>Showing top {{ found.count_returned }} out of {{ found.count_found }} results for: <code>{{ found.query.q }}</code></i>
+{% for paper in found.results %}
+<div>
+ <h4 style="margin-top: 1em; margin-bottom: 4px;"><a href="/release/lookup?doi={{ paper.doi }}" style="color: #2224c7;">{{ paper['title'] }}</a></h4>
+ <h5 style="margin-top: 4px; margin-bottom: 4px;">{{ ", ".join(paper.authors) }}</h5>
+ DOI: <a href="http://oadoi.org/{{paper.doi }}" style="color: green;">{{ paper.doi }}</a>
+ <br>Journal: {{ paper.journal }}
+ <!-- <br>Date: {{ paper.date }} -->
+</div>
+{% else %}
+<br/>
+<p>Try:</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 class="featurette-inner text-center" style="padding-top: 25%;">
+<h3>Found nothing!</h3>
+</div>
+{% endfor %}
+{% else %}
+<div class="featurette-inner text-center" style="padding-top: 25%;">
+<h3>Enter a query above</h3>
+</div>
+{% endif %}
+
+{% endblock %}