aboutsummaryrefslogtreecommitdiff
path: root/data/templates
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2016-09-01 08:11:44 +0200
committerChristian Weiske <cweiske@cweiske.de>2016-09-01 08:11:44 +0200
commit5b054d1fb39604419150051dd1d99dacbdeb2cba (patch)
treef11e9dc7e50b2d5210103d2b85f3ebcfaa5209a8 /data/templates
parent7aba8a17bae437bfba2cb6c6496f750d014f3636 (diff)
downloadphinde-5b054d1fb39604419150051dd1d99dacbdeb2cba.tar.gz
phinde-5b054d1fb39604419150051dd1d99dacbdeb2cba.zip
Make search result hit template configurable, add chat template
Resolves: #9
Diffstat (limited to 'data/templates')
-rw-r--r--data/templates/search/hit-chat.htm22
-rw-r--r--data/templates/search/list.htm2
2 files changed, 23 insertions, 1 deletions
diff --git a/data/templates/search/hit-chat.htm b/data/templates/search/hit-chat.htm
new file mode 100644
index 0000000..f44319d
--- /dev/null
+++ b/data/templates/search/hit-chat.htm
@@ -0,0 +1,22 @@
+{% set doc = hit._source %}
+<li class="hit hit-chat">
+ <span class="text">
+ {{doc.htmlText|raw}}
+ </span>
+ <br/>
+ <span class="meta">
+ {% if doc.author.name %}
+ <em>
+ {% if doc.author.url %}
+ <a href="{{doc.author.url}}">{{doc.author.name}}</a>
+ {% else %}
+ {{doc.author.name}}
+ {% endif %}
+ </em>
+ at
+ {% endif %}
+ {% if doc.modate %}
+ <a href="{{doc.extra.cleanUrl}}" class="date">{{doc.modate|date("Y-m-d H:i")}}</a>
+ {% endif %}
+ </span>
+</li>
diff --git a/data/templates/search/list.htm b/data/templates/search/list.htm
index c034dc2..97c1731 100644
--- a/data/templates/search/list.htm
+++ b/data/templates/search/list.htm
@@ -21,7 +21,7 @@
</p>
<ul class="hits">
{% for hit in hits %}
- {% include 'search/hit.htm' %}
+ {% include hitTemplate %}
{% endfor %}
</ul>
{% include 'pager.htm' %}