Hack some citations into the review form

This commit is contained in:
Tim Van Baak 2020-04-28 08:56:28 -07:00
parent e63be96dac
commit b8a604e61b
2 changed files with 13 additions and 4 deletions

View File

@ -172,7 +172,9 @@ def review(name):
return redirect(url_for('session.session', name=name)) return redirect(url_for('session.session', name=name))
parsed_draft = parse_raw_markdown(draft.contents) parsed_draft = parse_raw_markdown(draft.contents)
rendered_html = parsed_draft.render(PreviewHtmlRenderer(g.lexicon)) preview = parsed_draft.render(PreviewHtmlRenderer(g.lexicon))
rendered_html = preview.contents
citations = preview.citations
# If the article is ready and awaiting review # If the article is ready and awaiting review
if not draft.status.approved: if not draft.status.approved:
@ -197,7 +199,8 @@ def review(name):
return render_template( return render_template(
"session.review.jinja", "session.review.jinja",
form=form, form=form,
article_html=Markup(rendered_html)) article_html=Markup(rendered_html),
citations=citations)
@bp_session.route('/editor/', methods=['GET']) @bp_session.route('/editor/', methods=['GET'])

View File

@ -17,8 +17,14 @@
</form> </form>
{% endblock %} {% endblock %}
{% block citationblock %}
{% for citation in citations %}
{{ citation }}<br>
{% endfor %}
{% endblock %}
{% if form %} {% if form %}
{% set template_content_blocks = [self.article(), self.evaluation()] %} {% set template_content_blocks = [self.article(), self.citationblock(), self.evaluation()] %}
{% else %} {% else %}
{% set template_content_blocks = [self.article()] %} {% set template_content_blocks = [self.article(), self.citationblock()] %}
{% endif %} {% endif %}