Skip to content

Instantly share code, notes, and snippets.

@capooti
Created August 8, 2017 13:57
Show Gist options
  • Save capooti/77fb92ebaa505760488fbb524e917923 to your computer and use it in GitHub Desktop.
Save capooti/77fb92ebaa505760488fbb524e917923 to your computer and use it in GitHub Desktop.
Solr search application template for FOSS4G 2017
{% extends "site_base.html" %}
{% load i18n %}
{% load url from future %}
{% block title %} {{ block.super }} {% endblock %}
{% block body_class %}Solr Search{% endblock %}
{% block body_outer %}
{% block body %}
<h3>Search Metadata</h3>
<form type="GET" action=".">
<input id="search_text" type="text" name="search_text" placeholder="Search..." >
<button id="search_submit" type="submit" >Submit</button>
</form>
<p>Displaying 10 of {{ count }} results</p>
{% for document in docs %}
<h4>{{ document.title }}</h4>
<ul>
<li>Score: {{ document.score }}</li>
<li>Abstract: {{ document.abstract | truncatechars:200 }}
<li>Category: {{ document.category }}</li>
<li>Date: {{ document.modified_date.0 }}</li>
<li>Regions:</li>
<ul>
{% for region in document.regions %}
<li>{{ region }}</li>
{% endfor %}
</ul>
<li>Keywords:</li>
<ul>
{% for keyword in document.keywords %}
<li>{{ keyword }}</li>
{% endfor %}
</ul>
</ul>
{% endfor %}
{% endblock body %}
{% block sidebar %}{% endblock sidebar %}
{% endblock body_outer %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment