realize_edl
This commit is contained in:
parent
2feb845824
commit
283520462e
|
@ -8,7 +8,7 @@ from .forms import (LoginForm, SignupForm, AccountSettingsForm,
|
|||
from .model import User, SourceDoc, Item, XanaDoc, XanaLink
|
||||
from .url import get_url
|
||||
from .mail import send_mail
|
||||
from .edl import fulfil_edl_with_sources
|
||||
from .edl import fulfil_edl_with_sources, fulfil_edl
|
||||
from .database import session
|
||||
from .text import iter_lines, add_highlight
|
||||
from werkzeug.debug.tbtools import get_current_traceback
|
||||
|
@ -186,6 +186,22 @@ def view_edl(username, hashid):
|
|||
iter_lines=iter_lines,
|
||||
nbsp_at_start=nbsp_at_start)
|
||||
|
||||
@bp.route('/<username>/<hashid>/realize')
|
||||
def realize_edl(username, hashid):
|
||||
item = get_item(username, hashid)
|
||||
if item.type != 'xanadoc':
|
||||
return abort(404)
|
||||
|
||||
spans = list(fulfil_edl(item.text))
|
||||
|
||||
doc_text = ''.join(span['text'] for span in spans)
|
||||
|
||||
return render_template('realize.html',
|
||||
doc=doc_text,
|
||||
iter_lines=iter_lines,
|
||||
item=item,
|
||||
nbsp_at_start=nbsp_at_start)
|
||||
|
||||
@bp.route('/<username>/<hashid>/raw')
|
||||
def view_item_raw(username, hashid):
|
||||
return view_item(username, hashid, raw=True)
|
||||
|
|
Loading…
Reference in a new issue