Skip to content

Commit

Permalink
Add number and Modify Homework style (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wotagei authored Sep 7, 2023
1 parent f4eb7fa commit 8b336bf
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion packages/ui-default/misc/tailwindstylus.styl
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
background-color: #F00 !important

.bg-green
background-color: #0F0
background-color: #0F0 !important

.bg-blue
background-color: #4540E1 !important
Expand Down
23 changes: 13 additions & 10 deletions packages/ui-default/templates/homework_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,32 @@ <h1 class="section__title font-bold">{{ _('Problem') }}</h1>
<col class="col--submit-at">
{% endif %}
<col class="col--problem">
<col class="col--problem">
</colgroup>

<thead>
<tr>
<th class="col--status record-status--border text-black font-bold">{{ _('Status') }}</th>
<th class="col--problem text-black font-bold">{{ _('Problem') }}</th>
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
<th class="col--status record-status--border">{{ _('Status') }}</th>
<th class="col--submit-at">{{ _('Last Submit At') }}</th>
<th class="col--status record-status--border text-black font-bold">{{ _('Status') }}</th>
<th class="col--submit-at text-black font-bold">{{ _('Last Submit At') }}</th>
{% endif %}
<th class="col--problem">{{ _('Problem') }}</th>
</tr>
</thead>
<tbody>
{% set isAdmin = handler.user.own(tdoc) or handler.user.hasPerm(perm.PERM_VIEW_HOMEWORK_HIDDEN_SCOREBOARD) %}
{% set ntdoc = model.contest.isDone(tdoc) or (tsdoc.attend and not model.contest.isNotStarted(tdoc)) %}
{%- for pid in tdoc.pids -%}
<tr>
<td class="col--problem col--problem-name">{{ String.fromCharCode(65+loop.index0) }}</td>
<td class="col--problem col--problem-name">
{% if isAdmin and not ntdoc %}
{{ problem.render_problem_title(pdict[pid], show_invisible_flag=false, show_tags=false) }}
{% else %}
{{ problem.render_problem_title(pdict[pid], tdoc=tdoc, show_invisible_flag=false, show_tags=false) }}
{% endif %}
</td>
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
{% if psdict[pid] and psdict[pid].rid %}
{% set rdoc = rdict[psdict[pid].rid] %}
Expand All @@ -55,13 +65,6 @@ <h1 class="section__title font-bold">{{ _('Problem') }}</h1>
<td class="col--submit-at">-</td>
{% endif %}
{% endif %}
<td class="col--problem col--problem-name">
{% if isAdmin and not ntdoc %}
{{ problem.render_problem_title(pdict[pid], show_invisible_flag=false, show_tags=false) }}
{% else %}
{{ problem.render_problem_title(pdict[pid], tdoc=tdoc, show_invisible_flag=false, show_tags=false) }}
{% endif %}
</td>
</tr>
{%- endfor -%}
</tbody>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-default/templates/homework_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
{{ _('Clone') }}
</button>
{% if handler.user.own(tdoc) or handler.user.hasPerm(perm.PERM_EDIT_HOMEWORK) %}
<button name="operation" value="delete" type="submit" class="rounded button">
<button name="operation" value="delete" type="submit" class="rounded button bg-red text-white">
{{ _('Delete') }}
</button>
{% endif %}
Expand Down
8 changes: 4 additions & 4 deletions packages/ui-default/templates/homework_main.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,25 @@
</form>
{% endif %}
{% if handler.user.hasPerm(perm.PERM_CREATE_HOMEWORK) %}
<a class="compact button" href="{{ url('homework_create') }}">{{ _('Create Homework') }}</a>
<a class="compact primary button" href="{{ url('homework_create') }}">{{ _('Create Homework') }}</a>
{% endif %}
</div>
</div>

{# <div class="section__body no-padding">
<div class="section__body no-padding">
<form class="flex items-center justify-start medium-6" method="get" id="searchForm" action="{{ url('homework_main') }}">
<div class="search items-center flex-1 mr-2">
<input class="search-input" name="q" type="text" value="{{ qs }}" placeholder="比赛名...">
<button type="submit">
<span class="icon icon-search search-icon"></span>
<img src="{{ UiContext.cdn_prefix }}img/icon_search.svg" width="20" height="20">
{# <img src="{{ UiContext.cdn_prefix }}img/icon_search.svg" width="20" height="20"> #}
</button>
</div>
<button type="submit" class="button rounded-lg border-none show_all_homework">
显示所有作业比赛
</button>
</form>
</div> #}
</div>

<div class="section__body no-padding mt-5">
{% if not tdocs.length %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ <h1>{{ tdoc['title'] }}</h1>
<span class="icon icon-flag"></span> {{ _('My Recent Submissions') }}
</a></li>
{% endif %}
<li class="menu__item"><a class="menu__link" href="{{ url('wiki', page='help', anchor='homework') }}">
<li class="menu__item"><a class="menu__link" href="{{ url('wiki_help', anchor='homework') }}">
<span class="icon icon-help"></span> {{ _('Help') }}
</a></li>
<li class="menu__seperator"></li>
Expand Down

0 comments on commit 8b336bf

Please sign in to comment.