Fix scope order when importing partials with metadata.

Render error when importing wiki pages that do not exist.
This commit is contained in:
Chase Sterling 2016-08-09 21:45:07 -04:00
parent 55e2ceccaa
commit 9a730a947e
4 changed files with 18 additions and 34 deletions

View file

@ -8,22 +8,6 @@
</script>
<script src="{{ url_for('static', filename='js/editor.js') }}"></script>
{% if partials %}
<script>
$(function() {
{% for name, value in partials.items() %}
{% if name and value %}
try {
Handlebars.registerPartial({{ name|tojson|safe }}, {{ value|tojson|safe }});
} catch (e) {
// no data?
}
{% endif %}
{% endfor %}
});
</script>
{% endif %}
{% if config.get('COLLABORATION') %}
<script src="{{ url_for('static', filename='js/collaboration/main.js') }}"></script>
{% endif %}