mediatheque
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
{% extends "forms/field.html.twig" %}
|
||||
|
||||
{% block input %}
|
||||
<div class="form-list-wrapper {{ field.size }}">
|
||||
<div class="index-status">
|
||||
{% if tntsearch_index_status.status %}
|
||||
<button id="tntsearch-index" class="button reindex tntsearch-reindex">Re-Index Content</button>
|
||||
<span class="tntsearch-status success"><i class="fa fa-book"></i> {{ tntsearch_index_status.msg }}</span>
|
||||
{% else %}
|
||||
<button id="tntsearch-index" class="button critical tntsearch-reindex">Index Content</button>
|
||||
<span class="tntsearch-status error"><i class="fa fa-warning"></i> {{ tntsearch_index_status.msg }}</span>
|
||||
{% endif %}
|
||||
<div class="warning tntsearch-error-details"></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,30 @@
|
||||
{% set url = url|default(base_url|rtrim('/') ~ '/' ~ config.get('plugins.tntsearch.query_route', 's')|trim('/')) %}
|
||||
{% set limit = limit|default(config.get('plugins.tntsearch.limit', 20)) %}
|
||||
{% set snippet = snippet|default(config.get('plugins.tntsearch.snippet', 300)) %}
|
||||
{% set min = min|default(config.get('plugins.tntsearch.min', 3)) %}
|
||||
{% set search_type = search_type|default(config.get('plugins.tntsearch.search_type', 'auto')) %}
|
||||
{% set placeholder = placeholder|default('Search...') %}
|
||||
{% set live_update = in_page ? live_update|default(config.get('plugins.tntsearch.live_uri_update', 1)) : 0 %}
|
||||
{% set nojs_action = config.get('plugins.tntsearch.search_route', '/search')|trim('/') %}
|
||||
|
||||
{% set options = { uri: url, limit: limit, snippet: snippet, min: min, in_page: in_page, live_update: live_update, search_type: search_type } %}
|
||||
|
||||
<form role="form" class="tntsearch-form" action="{{ nojs_action }}" method="get">
|
||||
{% block tntsearch_input %}
|
||||
<div id="tntsearch-wrapper" class="form-group{{ dropdown ? ' tntsearch-dropdown' : '' }}">
|
||||
<input type="text" name="q" class="form-control form-input tntsearch-field{{ in_page ? ' tntsearch-field-inpage' : '' }}" data-tntsearch="{{ options|json_encode|e('html_attr') }}" placeholder="{{ placeholder }}" value="{{ not dropdown ? query|e : '' }}" autofocus>
|
||||
<span class="tntsearch-clear"{{ not query or dropdown ? ' style="display: none;"' : '' }}>×</span>
|
||||
</div>
|
||||
{% endblock %}
|
||||
<div class="tntsearch-results{{ in_page ? ' tntsearch-results-inpage' : '' }}">
|
||||
{% if tntsearch_results is defined and tntsearch_results is not empty and in_page %}
|
||||
{% include 'tntquery-ajax.html.twig' %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if config.get('plugins.tntsearch.powered_by') %}
|
||||
<p class="tntsearch-powered-by">
|
||||
{{ "PLUGIN_TNTSEARCH.POWERED_BY"|t("<a href='https://github.com/trilbymedia/grav-plugin-tntsearch' target='_blank'>TNTSearch</a>")|raw }}
|
||||
</p>
|
||||
{% endif %}
|
||||
</form>
|
||||
@@ -0,0 +1,7 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
{{ page.content|raw }}
|
||||
|
||||
{% include 'partials/tntsearch.html.twig' with { in_page: true }%}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,19 @@
|
||||
<div class="row">
|
||||
<p class="info">
|
||||
{% if config.get('plugins.tntsearch.display_hits') %}
|
||||
<span class="hits">{{ "PLUGIN_TNTSEARCH.FOUND_RESULTS"|t(tntsearch_results.number_of_hits)|raw }}</span>
|
||||
{% endif %}
|
||||
{% if config.get('plugins.tntsearch.display_time') %}
|
||||
<span class="time">{{ "PLUGIN_TNTSEARCH.FOUND_IN"|t(tntsearch_results.execution_time)|raw }}</span>
|
||||
{% endif %}
|
||||
</p>
|
||||
{% for key, val in tntsearch_results.hits %}
|
||||
<h5 class="title">
|
||||
<a href="{{ base_url ~ val.link }}">{{ val.title|raw }}</a>
|
||||
</h5>
|
||||
{% if config.get('plugins.tntsearch.display_route') %}
|
||||
<h6 class="route">{{ val.link|raw }}</h6>
|
||||
{% endif %}
|
||||
<p>{{ val.content|raw }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -0,0 +1,8 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="body-content">
|
||||
{{ vardump(tntsearch_results) }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{{ tntsearch_results|json_encode|raw }}
|
||||
Reference in New Issue
Block a user