Merge pull request #173 from gazpachoking/module_static
Make modules contain their own static files and templates
This commit is contained in:
commit
f49ef01f52
|
@ -2,7 +2,7 @@ from flask import current_app, render_template, request, redirect, Blueprint, fl
|
|||
from flask.ext.login import logout_user
|
||||
from realms.modules.auth.models import Auth
|
||||
|
||||
blueprint = Blueprint('auth', __name__)
|
||||
blueprint = Blueprint('auth', __name__, template_folder='templates')
|
||||
|
||||
|
||||
@blueprint.route("/login", methods=['GET', 'POST'])
|
||||
|
|
|
@ -2,7 +2,7 @@ from flask import render_template, request, Blueprint, current_app
|
|||
from flask.ext.login import current_user
|
||||
from realms import search as search_engine
|
||||
|
||||
blueprint = Blueprint('search', __name__)
|
||||
blueprint = Blueprint('search', __name__, template_folder='templates')
|
||||
|
||||
|
||||
@blueprint.route('/_search')
|
||||
|
|
|
@ -7,4 +7,4 @@ assets.register('editor.js',
|
|||
'vendor/ace-builds/src/mode-markdown.js',
|
||||
'vendor/ace-builds/src/ext-keybinding_menu.js',
|
||||
'vendor/keymaster/keymaster.js',
|
||||
'js/aced.js')
|
||||
'wiki/js/aced.js')
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
var PAGE_NAME = '{{ name }}';
|
||||
</script>
|
||||
<script src="{{ url_for('static', filename='js/editor.js') }}"></script>
|
||||
<script src="{{ url_for('wiki.static', filename='js/editor.js') }}"></script>
|
||||
|
||||
{% if partials %}
|
||||
<script>
|
||||
|
@ -25,7 +25,7 @@
|
|||
{% endif %}
|
||||
|
||||
{% if config.get('COLLABORATION') %}
|
||||
<script src="{{ url_for('static', filename='js/collaboration/main.js') }}"></script>
|
||||
<script src="{{ url_for('wiki.static', filename='js/collaboration/main.js') }}"></script>
|
||||
{% endif %}
|
||||
|
||||
{% if config.get('COLLABORATION') == 'firepad' %}
|
||||
|
@ -34,11 +34,11 @@
|
|||
</script>
|
||||
<script src="https://cdn.firebase.com/js/client/1.0.17/firebase.js"></script>
|
||||
<script src="https://cdn.firebase.com/libs/firepad/1.0.0/firepad.min.js"></script>
|
||||
<script src="{{ url_for('static', filename='js/collaboration/firepad.js') }}"></script>
|
||||
<script src="{{ url_for('wiki.static', filename='js/collaboration/firepad.js') }}"></script>
|
||||
{% endif %}
|
||||
|
||||
{% if config.get('COLLABORATION') == 'togetherjs' %}
|
||||
<script src="{{ url_for('static', filename='js/collaboration/togetherjs.js') }}"></script>
|
||||
<script src="{{ url_for('wiki.static', filename='js/collaboration/togetherjs.js') }}"></script>
|
||||
<script src="https://togetherjs.com/togetherjs-min.js"></script>
|
||||
{% endif %}
|
||||
|
|
@ -6,7 +6,8 @@ from flask.ext.login import login_required, current_user
|
|||
from realms.lib.util import to_canonical, remove_ext, gravatar_url
|
||||
from .models import PageNotFound
|
||||
|
||||
blueprint = Blueprint('wiki', __name__)
|
||||
blueprint = Blueprint('wiki', __name__, template_folder='templates',
|
||||
static_folder='static', static_url_path='/static/wiki')
|
||||
|
||||
|
||||
@blueprint.route("/_commit/<sha>/<path:name>")
|
||||
|
|
Loading…
Reference in a new issue