You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
112 lines
4.3 KiB
HTML
112 lines
4.3 KiB
HTML
{% extends "layout/basic.html" %}
|
|
{% block content %}
|
|
<div class="row">
|
|
<div class="medium-9 columns">
|
|
<div class="section">
|
|
<div class="section__body">
|
|
<form method="post">
|
|
<div class="row">
|
|
<div class="medium-7 columns">
|
|
<label>
|
|
{{ _('Title') }}
|
|
<input name="title" placeholder="{{ _('title') }}" value="{{ pdoc['title']|default('') }}" class="textbox"{% if page_name == 'problem_create' %} autofocus{% endif %}>
|
|
</label>
|
|
</div>
|
|
<div class="medium-3 columns">
|
|
<label>
|
|
{{ _('pid') }}
|
|
<br>
|
|
<label>
|
|
<input name="pid" placeholder="P1000" value="{{ pdoc['pid']|default('') }}" class="textbox">
|
|
</label>
|
|
</label>
|
|
</div>
|
|
<div class="medium-2 columns">
|
|
<label>
|
|
<br>
|
|
<label class="checkbox">
|
|
<input type="checkbox" name="hidden" value="on"{% if pdoc['hidden'] %} checked{% endif %}>{{ _('Hidden') }}
|
|
</label>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
{{ form.form_text({
|
|
row:false,
|
|
columns:6,
|
|
label:'Tags',
|
|
help_text:'Split by \', \'.',
|
|
name:'tag',
|
|
value:pdoc['tag']|default([])|join(', ')
|
|
}) }}
|
|
{{ form.form_text({
|
|
row:false,
|
|
columns:3,
|
|
label:'Assign',
|
|
placeholder:_('Group / UID'),
|
|
name:'assign',
|
|
value:pdoc.assign|default([])|join(', ')
|
|
}) }}
|
|
{{ form.form_text({
|
|
row:false,
|
|
columns:3,
|
|
label:'Difficulty',
|
|
help_text:'From 1-10',
|
|
name:'difficulty',
|
|
value:pdoc['difficulty']
|
|
}) }}
|
|
</div>
|
|
<div class="section__tab-container nojs--hide">
|
|
<div class="section__tab-header-wrapper">
|
|
<ul class="section__tab-header">
|
|
<li class="section__tab-header-item tab--active" data-lang="{{ _('__id') }}">{{ _('__langname') }}</li>
|
|
{% for k, v in model.setting.SETTINGS_BY_KEY['viewLang'].range %}
|
|
{% if k != handler.user.viewLang %}
|
|
<li class="section__tab-header-item" data-lang="{{ k }}">{{ v }}</li>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div><textarea data-editor{% if page_name == 'problem_edit' %} autofocus{% endif %} class="textbox auto-resize nojs--hide"></textarea></div>
|
|
<textarea name="content" class="textbox hasjs--hide" data-markdown-upload style="height: 500px">{% if pdoc %}{{ pdoc['content']|toString }}{% else %}{% include 'partials/problem_default.md' %}{% endif %}</textarea>
|
|
<div class="row"><div class="columns">
|
|
<input type="hidden" name="csrfToken" value="{{ handler.csrfToken }}">
|
|
{% if page_name == 'problem_edit' %}
|
|
<button type="submit" class="rounded primary button">
|
|
{{ _('Update') }}
|
|
</button>
|
|
{% if handler.user.own(pdoc, perm.PERM_EDIT_PROBLEM_SELF) or handler.user.hasPerm(perm.PERM_EDIT_PROBLEM) %}
|
|
<button name="operation" value="delete" type="submit" class="rounded button">
|
|
{{ _('Delete') }}
|
|
</button>
|
|
{% endif %}
|
|
{% else %}
|
|
<button type="submit" class="rounded primary button">
|
|
{{ _('Create') }}
|
|
</button>
|
|
{% endif %}
|
|
</div></div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="medium-3 columns">
|
|
<div class="section side visiable nojs--hide">
|
|
<div class="section__header">
|
|
<h1 class="section__title">{{ _('Categories') }} ({{ _('click to add') }})</h1>
|
|
</div>
|
|
<div class="section__body">
|
|
{% include "partials/category.html" %}
|
|
</div>
|
|
</div>
|
|
{% if page_name == 'problem_edit' %}
|
|
{% set owner_udoc = udoc %}
|
|
{% include "partials/problem_sidebar.html" %}
|
|
{% else %}
|
|
{% include 'components/md_hint.html' %}
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|