Commit fb6e7417 authored by Vladimír Štill's avatar Vladimír Štill
Browse files

evalweb: Add link support for convert

parent 29057a88
......@@ -151,10 +151,16 @@ def convert() -> str:
"task_form": task_form,
"student_area": ""}
if request.method == 'POST' and 'submit_button' in request.form:
student_string = request.form['student_string']
student_type = student_form.make.data
task = task_form.make.data
if (request.method == 'POST' and 'submit_button' in request.form) \
or (request.method == 'GET' and 'link' in request.args):
if request.method == 'POST':
student_string = request.form['student_string']
student_type = student_form.make.data
task = task_form.make.data
else:
student_string = request.args['inval']
student_type = request.args['inty']
task = request.args['outty']
convert_args["student_area"] = student_string
if student_string == "":
......@@ -175,6 +181,8 @@ def convert() -> str:
student_string=student_string,
student_type=types[student_type],
task=tasks[task],
raw_in_type=student_type,
raw_out_type=task,
output=output,
is_task=is_task)
......
{% extends 'base.html' %}
{% block header %}
<h1>Výsledek převodu</h1>
<h1>Výsledek převodu
<a class="anchor" href="?link&inty={{raw_in_type | urlencode}}&inval={{student_string | urlencode}}&outty={{raw_out_type | urlencode}}"></a></h1>
{% endblock %}
{% block content %}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment