summaryrefslogtreecommitdiffstats
path: root/python/fatcat_web/templates/entity_macros.html
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-06-05 15:56:52 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-06-05 15:56:52 -0700
commit388503d92ff8a1f26a0376cc42cefb077a1d6401 (patch)
treeb2329cb6951bfbc5f98a0663f2e4b7991a1949ca /python/fatcat_web/templates/entity_macros.html
parent805a8b1001754fb8397e539dbc15a6cfd65661f2 (diff)
downloadfatcat-388503d92ff8a1f26a0376cc42cefb077a1d6401.tar.gz
fatcat-388503d92ff8a1f26a0376cc42cefb077a1d6401.zip
more lookup views
Diffstat (limited to 'python/fatcat_web/templates/entity_macros.html')
-rw-r--r--python/fatcat_web/templates/entity_macros.html18
1 files changed, 18 insertions, 0 deletions
diff --git a/python/fatcat_web/templates/entity_macros.html b/python/fatcat_web/templates/entity_macros.html
index c47782a8..a2b2f996 100644
--- a/python/fatcat_web/templates/entity_macros.html
+++ b/python/fatcat_web/templates/entity_macros.html
@@ -96,3 +96,21 @@
</tbody>
</table>
{%- endmacro %}
+
+{% macro lookup_form(entity_type, key, example, lookup_key, lookup_value, lookup_error) -%}
+<form class="ui form" role="search" action="/{{ entity_type }}/lookup" method="get">
+ <div class="ui form">
+ <div class="field {% if key == lookup_key %}{% if lookup_error == 400 %}error{% elif lookup_error == 404 %}warning{% endif %}{% endif %}">
+ {% if key == lookup_key and lookup_error == 400 %}
+ <div class="ui pointing below red label">
+ Not correct syntax. Expected, eg, {{ example }}
+ </div>
+ {% endif %}
+ <div class="ui action input big fluid">
+ <input type="text" placeholder="{% if example %}eg, {{ example }}{% endif %}" name="{{ key }}" value="{% if key == lookup_key %}{{ lookup_value }}{% endif %}" aria-label="{{ key }} lookup">
+ <button class="ui button">Go!</button>
+ </div>
+ </div>
+ </div>
+</form>
+{%- endmacro %}