Fix up submit view; #635

This commit is contained in:
Quantum 2017-12-06 04:46:20 -05:00
parent bb34fdc800
commit c1881b1187
2 changed files with 11 additions and 12 deletions

View File

@ -234,10 +234,9 @@
<div id="language-select">
<select id="id_language" name="language">
{% for lang in form.fields.language.queryset %}
{% set runtime_versions = lang.runtime_versions %}
<option id="{{ lang.id }}" data-id="{{ lang.id }}" data-name="{{ lang.name }}"
<option value="{{ lang.id }}" data-id="{{ lang.id }}" data-name="{{ lang.name }}"
data-info="{{ lang.info }}" data-ace="{{ lang.ace }}"
data-judge-info="{{ runtime_versions(lang.runtime_versions) }}"
data-judge-info="{{ runtime_versions(lang.runtime_versions()) }}"
{% if lang.id == default_lang.id %}selected{% endif %}>{{ lang.name }}</option>
{% endfor %}
</select>

View File

@ -1,12 +1,12 @@
{% for name, versions in runtime_versions %}
{% if versions %}
{% if versions[0] != versions|last %}
{% for name, versions in runtime_versions -%}
{%- if versions -%}
{%- if versions[0] != versions|last -%}
{{ name }} {{ versions[0] }} - {{ versions|last }}
{% else %}
{%- else -%}
{{ name }} {{ versions[0] }}
{% endif %}
{% else %}
{%- endif -%}
{%- else -%}
{{ name }}
{% endif %}
{% if not loop.last %}, {% endif %}
{% endfor %}
{%- endif -%}
{%- if not loop.last %}, {% endif -%}
{%- endfor -%}