Make modules contain their own static files and templates

This commit is contained in:
Chase Sterling 2016-08-15 23:06:05 -04:00
parent 4a38e896eb
commit 33aa2b851e
20 changed files with 9 additions and 8 deletions

View 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 %}

View file

@ -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')