Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ikonky zobraziujúce stav riešenia. #1331

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions css/src/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,22 @@ table.floatThead-table {
margin: 10px;
}

.task-status-ok {
color: #9da827;
}

.task-status-submitted {
color: #3498db;
}

.task-status-wrong {
color: #f39c12;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ak tato farba nie je definovana niekde v nasich design dococh, tak do nej pridaj trocha cervenej / uber zelenu. Ak mas protanopiu alebo nejaku podobnu farboslepost tak je to nerozoznatelne od task-status-ok ak ich nemas hned pri sebe.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mám zmeniť brand-warning na niečo viac odlišné, keďže to vyplýva z toho?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vieme mat rozne ikonky pre rozne stavy?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dalo by sa to, ale výber glyphicons je dosť slabý :/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uprimne tie ikonky a farby mi toho moc nehovoria ked sa len tak na to pozrem. Co keby sme to rozdelili na 2 stlpce - stav popisu a stav programu? A potom mali -ok-circle ak je vsetko vpohode, -time ak sa caka na opravenie/sa testuje, -ban-circle ak nie je odovzdany, -remove-circle ak je program nedostal OK? Kazdy stav by zaroven mohol mat aj farbu, ale ikonka aj bez farby by definovala stav, cize by ani nebol problem s farboslepostou.


.task-status-empty {
color: #aaaaaa;
}


/* Submit protocols */
@import "trojsten/protocol.less";
36 changes: 30 additions & 6 deletions trojsten/contests/templates/trojsten/contests/parts/task_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
</th>
{% endif %}
<th width="15%">
Max. body
Body
</th>
{% if user.is_authenticated %}
<th width="15%">
Tvoje body
<th width="10%">
Tvoj stav
</th>
{% endif %}
</tr>
Expand All @@ -76,6 +76,7 @@
{% endfor %}
</td>
{% endif %}
{% if not user.is_authenticated %}
<td>
{% if task.description_points > 0 %}
<span class="points-item">popis:&nbsp;{{ task.description_points }}</span>
Expand All @@ -85,15 +86,38 @@
<span class="points-item">program:&nbsp;{{ task.source_points }}</span>
{% endif %}
</td>
{% if user.is_authenticated %}
{% else %}
{% lookup_as points.tasks task.id as task_points %}
<td>
{% if task.description_points > 0 %}
<span class="points-item">popis:&nbsp;{% if task_points.description_pending %}??{% else %}{{ task_points.description_points }}{% endif %}</span>
<span class="points-item">popis:&nbsp;<b>{% if task_points.description_pending %}??{% else %}{{ task_points.description_points }}{% endif %}</b>&nbsp;/&nbsp;{{ task.description_points }}</span>
{% if task.source_points > 0 %}<br/>{% endif %}
{% endif %}
{% if task.source_points > 0 %}
<span class="points-item">program:&nbsp;{{ task_points.source_points }}</span>
<span class="points-item">program:&nbsp;<b>{{ task_points.source_points }}</b>&nbsp;/&nbsp;{{ task.source_points }}</span>
{% endif %}
</td>
<td style="text-align: center;">
{% if task.description_points > 0 %}
{% if task_points.description_pending %}
<i class="glyphicon glyphicon-comment task-status-submitted" data-toggle="tooltip" data-placement="top" data-original-title="popis: čaká na opravenie"></i>
{% elif task_points.submitted_description %}
<i class="glyphicon glyphicon-comment task-status-ok" data-toggle="tooltip" data-placement="top" data-original-title="popis: opravený"></i>
{% else %}
<i class="glyphicon glyphicon-comment task-status-empty" data-toggle="tooltip" data-placement="top" data-original-title="popis: neodovzdaný"></i>
{% endif %}
{% endif %}

{% if task.source_points > 0 %}
{% if task_points.submitted_source %}
{% if task_points.source_points == task.source_points %}
<i class="glyphicon glyphicon-floppy-disk task-status-ok" data-toggle="tooltip" data-placement="top" data-original-title="program: odovzdaný ({{ task_points.source_points }}b)"></i>
{% else %}
<i class="glyphicon glyphicon-floppy-disk task-status-wrong" data-toggle="tooltip" data-placement="top" data-original-title="program: odovzdaný ({{ task_points.source_points }}b)"></i>
{% endif %}
{% else %}
<i class="glyphicon glyphicon-floppy-disk task-status-empty" data-toggle="tooltip" data-placement="top" data-original-title="program: neodovzdaný"></i>
{% endif %}
{% endif %}
</td>
{% endif %}
Expand Down
5 changes: 5 additions & 0 deletions trojsten/results/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def __init__(self):
self.source_points = 0
self.description_points = 0
self.submitted = False
self.submitted_source = False
self.submitted_description = False
self.description_pending = False

@property
Expand All @@ -24,14 +26,17 @@ def sum(self):

def add_source_points(self, points):
self.submitted = True
self.submitted_source = True
self.source_points += points

def set_description_points(self, points):
self.submitted = True
self.submitted_description = True
self.description_points = points

def set_description_pending(self):
self.submitted = True
self.submitted_description = True
self.description_pending = True
self.description_points = 0

Expand Down
2 changes: 1 addition & 1 deletion trojsten/static/css/fks/fks.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion trojsten/static/css/kms/kms.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion trojsten/static/css/ksp/ksp.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion trojsten/static/css/trojsten/trojsten.min.css

Large diffs are not rendered by default.