mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: problem_edit tools
This commit is contained in:
1 parent
1910a57dbb
commit
3664df4202
10 files changed
+187
-58
No files matched your search
@@ -1,5 +1,5 @@
|
||||
{% macro render_status_td(rdoc, rid_key='_id') %}
|
||||
<td class="col--status record-status--border {{ model.builtin.STATUS_CODES[rdoc.status] }}">
|
||||
{% macro render_status_td(rdoc, rid_key='_id', class='') %}
|
||||
<td class="col--status record-status--border {{ class }} {{ model.builtin.STATUS_CODES[rdoc.status] }}">
|
||||
<div class="col--status__text">
|
||||
<span class="icon record-status--icon {{ model.builtin.STATUS_CODES[rdoc.status] }}"></span>
|
||||
<a href="{{ url('record_detail', rid=rdoc[rid_key]) }}" class="record-status--text {{ model.builtin.STATUS_CODES[rdoc.status] }}">
|
||||
|
||||
@@ -8,8 +8,12 @@
|
||||
{% else %}
|
||||
<table class="data-table">
|
||||
<colgroup>
|
||||
{% if handler.user.hasPerm(perm.PERM_EDIT_PROBLEM) %}
|
||||
<col class="col--checkbox display-mode-hide">
|
||||
<col class="col--pid display-mode-hide">
|
||||
{% endif %}
|
||||
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
||||
<col class="col--status">
|
||||
<col class="col--status edit-mode-hide">
|
||||
{% endif %}
|
||||
<col class="col--name">
|
||||
<col class="col--submit_n">
|
||||
@@ -18,8 +22,16 @@
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
{% if handler.user.hasPerm(perm.PERM_EDIT_PROBLEM) %}
|
||||
<th class="col--checkbox display-mode-hide">
|
||||
<label class="compact checkbox">
|
||||
<input type="checkbox" name="select_all" data-checkbox-toggle="problem">
|
||||
</label>
|
||||
</th>
|
||||
<th class="col--pid display-mode-hide">{{ _('ID') }}</th>
|
||||
{% endif %}
|
||||
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
||||
<th class="col--status record-status--border">{{ _('Status') }}</th>
|
||||
<th class="col--status record-status--border edit-mode-hide">{{ _('Status') }}</th>
|
||||
{% endif %}
|
||||
<th class="col--name">{{ _('Problem') }}</th>
|
||||
<th class="col--submit_n">{{ _('Submit') }}</th>
|
||||
@@ -28,17 +40,24 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{%- for pdoc in pdocs -%}
|
||||
{% set psdoc = psdict[pdoc['docId']] %}
|
||||
<tr>
|
||||
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
||||
{% if psdoc['rid'] %}
|
||||
{{ record.render_status_td(psdoc, rid_key='rid') }}
|
||||
{% else %}
|
||||
<td class="col--status record-status--border">
|
||||
</td>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{%- for pdoc in pdocs -%}
|
||||
{% set psdoc = psdict[pdoc['docId']] %}
|
||||
<tr data-pid="{{ pdoc.docId }}">
|
||||
{% if handler.user.hasPerm(perm.PERM_EDIT_PROBLEM) %}
|
||||
<td class="col--checkbox display-mode-hide">
|
||||
<label class="compact checkbox">
|
||||
<input type="checkbox" data-checkbox-group="problem" data-checkbox-range>
|
||||
</label>
|
||||
</td>
|
||||
<td class="col--pid display-mode-hide">{{ pdoc.docId }}</td>
|
||||
{% endif %}
|
||||
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
||||
{% if psdoc['rid'] %}
|
||||
{{ record.render_status_td(psdoc, rid_key='rid', class="edit-mode-hide") }}
|
||||
{% else %}
|
||||
<td class="col--status record-status--border edit-mode-hide"></td>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<td class="col--name col--problem-name">
|
||||
{{ problem.render_problem_title(pdoc) }}
|
||||
</td>
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
<div class="section__body">
|
||||
<button class="rounded button" name="download_selected_testdata">{{ _('Download Selected') }}</button>
|
||||
<button class="rounded button" name="remove_selected_testdata">{{ _('Remove Selected') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -129,5 +129,4 @@
|
||||
{% include "partials/problem_sidebar.html" %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -16,14 +16,42 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="medium-3 columns">
|
||||
{% if handler.user.hasPerm(perm.PERM_EDIT_PROBLEM) %}
|
||||
<div class="section side">
|
||||
<ol class="menu">
|
||||
<a href="javascript:;" class="menu__link edit-mode-hide" name="enter-edit-mode">
|
||||
<span class="icon icon-edit"></span>
|
||||
{{ _('Enter Edit Mode') }}
|
||||
</a>
|
||||
<a href="javascript:;" class="menu__link display-mode-hide" name="leave-edit-mode">
|
||||
<span class="icon icon-edit"></span>
|
||||
{{ _('Leave Edit Mode') }}
|
||||
</a>
|
||||
{% if pdocs.length %}
|
||||
<a href="javascript:;" class="menu__link display-mode-hide" name="hide_selected_problems">
|
||||
<span class="icon icon-close"></span>
|
||||
{{ _('Hide Selected') }}
|
||||
</a>
|
||||
<a href="javascript:;" class="menu__link display-mode-hide" name="unhide_selected_problems">
|
||||
<span class="icon icon-check"></span>
|
||||
{{ _('Unhide Selected') }}
|
||||
</a>
|
||||
<a href="javascript:;" class="menu__link display-mode-hide" name="remove_selected_problems">
|
||||
<span class="icon icon-delete"></span>
|
||||
{{ _('Remove Selected') }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</ol>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="section side">
|
||||
<div class="section__header">
|
||||
<div class="section__header edit-mode-hide">
|
||||
<h1 class="section__title">{{ _('Categories') }}</h1>
|
||||
</div>
|
||||
<div class="section__body">
|
||||
{% include "partials/category.html" %}
|
||||
</div>
|
||||
<div class="section__body">
|
||||
<div class="section__body edit-mode-hide">
|
||||
{% include "partials/problem_lucky.html" %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -36,7 +64,7 @@
|
||||
<label>
|
||||
<input name="q" type="text" class="textbox" value="{{ category }}" placeholder="1001">
|
||||
</label>
|
||||
<button type="submit" class="primary button">{{ _('Search') }}</button>
|
||||
<button type="submit" id="search" class="primary button">{{ _('Search') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user