Make modules contain their own static files and templates
This commit is contained in:
parent
4a38e896eb
commit
33aa2b851e
20 changed files with 9 additions and 8 deletions
18
realms/modules/search/templates/search/search.html
Normal file
18
realms/modules/search/templates/search/search.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% block body %}
|
||||
{% if results %}
|
||||
<h3>Results for <em class="text-info">{{ request.args.get('q') }}</em></h3>
|
||||
<div class="list-group">
|
||||
{% for r in results %}
|
||||
<a href="{{ url_for('wiki.page', name=r['name']) }}" class="list-group-item">
|
||||
<h4 class="list-group-item-heading">{{ r['name'] }}</h4>
|
||||
<p class="list-group-item-text">
|
||||
{{ r['content'][:100] }}
|
||||
</p>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<h3>No results found for <em class="text-info">{{ request.args.get('q') }}</em></h3>
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -1,7 +1,7 @@
|
|||
from flask import render_template, request, Blueprint
|
||||
from realms import search as search_engine
|
||||
|
||||
blueprint = Blueprint('search', __name__)
|
||||
blueprint = Blueprint('search', __name__, template_folder='templates')
|
||||
|
||||
|
||||
@blueprint.route('/_search')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue