Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odevzdávací Systém MO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
Odevzdávací Systém MO
Commits
e24aa9f0
Commit
e24aa9f0
authored
3 years ago
by
Jan Prachař
Browse files
Options
Downloads
Patches
Plain Diff
org_rounds: Předělán vzhled z tabulky na panely
parent
5916799b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
mo/web/org_round.py
+2
-2
2 additions, 2 deletions
mo/web/org_round.py
mo/web/templates/org_rounds.html
+60
-28
60 additions, 28 deletions
mo/web/templates/org_rounds.html
with
62 additions
and
30 deletions
mo/web/org_round.py
+
2
−
2
View file @
e24aa9f0
...
@@ -53,7 +53,7 @@ def org_rounds():
...
@@ -53,7 +53,7 @@ def org_rounds():
return
render_template
(
return
render_template
(
'
org_rounds.html
'
,
'
org_rounds.html
'
,
rounds
=
rounds
,
participants_count
=
participants_count
,
public
=
public
gk
=
g
.
gatekeeper
,
rounds
=
rounds
,
participants_count
=
participants_count
,
public
=
public
)
)
...
@@ -81,7 +81,7 @@ def org_rounds_history():
...
@@ -81,7 +81,7 @@ def org_rounds_history():
)
)
return
render_template
(
'
org_rounds.html
'
,
return
render_template
(
'
org_rounds.html
'
,
rounds
=
rounds
,
participants_count
=
participants_count
,
history
=
True
,
gk
=
g
.
gatekeeper
,
rounds
=
rounds
,
participants_count
=
participants_count
,
history
=
True
,
)
)
...
...
This diff is collapsed.
Click to expand it.
mo/web/templates/org_rounds.html
+
60
−
28
View file @
e24aa9f0
...
@@ -2,48 +2,80 @@
...
@@ -2,48 +2,80 @@
{% block title %}Soutěžní kola{% endblock %}
{% block title %}Soutěžní kola{% endblock %}
{% set ns = namespace(year = 0) %}
{% set ns = namespace(year = 0
, category = ''
) %}
{% block body %}
{% block body %}
{% for r in rounds %}
{% for r in rounds %}
{% if ns.year != r.year %}
{% if ns.year != r.year %}
{% if ns.year != 0 %}
{% if ns.year != 0 %}
</
table
>
</
div
>
{% endif %}
{% endif %}
{% set ns.year = r.year %}
{% set ns.year = r.year %}
<h3>
{{ r.year }}. ročník
</h3>
{% set ns.category = '' %}
<table
class=
"table table-bordered"
>
<h3>
{{ r.year }}. ročník
</h3><hr>
<thead><tr>
<th>
Kategorie
<th>
Název
<th>
Stav
<th>
Počet účastníků
<th>
Akce
</thead>
{% endif %}
{% endif %}
{% if ns.category != r.category %}
{% if ns.category != '' %}
</div>
{% endif %}
{% set ns.category = r.category %}
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
<h4>
Kategorie
<b>
{{ r.category }}
</b></h4>
</div>
{% endif %}
<div
class=
"col-sm-4"
>
<div
{%
if
r.state =
=
RoundState.preparing
%}
{%
if
r.state =
=
RoundState.preparing
%}
<tr
class=
"warning"
>
class=
"
panel panel-
warning"
{%
elif
r.state =
=
RoundState.running
%}
{%
elif
r.state =
=
RoundState.running
%}
<tr
class=
"success"
>
class=
"
panel panel-
success"
{%
elif
r.state =
=
RoundState.grading
%}
{%
elif
r.state =
=
RoundState.grading
%}
<tr
class=
"info"
>
class=
"
panel panel-
info"
{%
elif
r.state =
=
RoundState.delegate
%}
{%
elif
r.state =
=
RoundState.delegate
%}
<tr
class=
"
active"
>
class=
"
panel panel-info"
{%
else
%}
{%
else
%}
<tr>
class=
"panel panel-default"
{% endif %}
{%
endif
%}
>
<td
class=
"text-center"
style=
"font-size: 1.2em"
><b>
{{ r.category }}
</b>
<div
class=
"panel-heading"
>
<td>
{{ r.name }}
<small
class=
"pull-right"
>
{{ r.state.friendly_name() }}
</small>
<td>
{{ r.state.friendly_name() }}
<h5
class=
"panel-title"
>
{{ r.name }}
<b>
{{ r.category }}
</b></h5>
<td>
{{ participants_count[r.round_id] if participants_count[r.round_id] else '–' }}
</div>
<td>
<div
class=
"panel-body"
>
<a
class=
"btn btn-xs btn-primary"
href=
'{{ url_for('
org_round
',
round_id=
r.round_id)
}}'
>
Detail
</a>
<a
class=
"btn btn-sm btn-primary"
href=
'{{ url_for('
org_round
',
round_id=
r.round_id)
}}'
>
<a
class=
"btn btn-xs btn-default"
href=
'{{ url_for('
org_generic_list
',
round_id=
r.round_id)
}}'
>
Účastníci
</a>
<span
class=
"glyphicon glyphicon-search"
></span>
Detail
</a>
<a
class=
"btn btn-sm btn-default"
href=
'{{ url_for('
org_generic_list
',
round_id=
r.round_id)
}}'
>
<span
class=
"glyphicon glyphicon-user"
></span>
Účastníci
{%if participants_count[r.round_id] %}
<span
class=
"badge"
>
{{ participants_count[r.round_id] }}
</span>
{% endif %}
</a>
{% if r.state == RoundState.closed %}
{% if r.state == RoundState.closed %}
<a
class=
"btn btn-xs btn-default"
href=
'{{ url_for('
org_score
',
round_id=
r.round_id)
}}'
>
Výsledky
</a>
<a
class=
"btn btn-sm btn-warning"
href=
'{{ url_for('
org_score
',
round_id=
r.round_id)
}}'
>
<span
class=
"glyphicon glyphicon-bullhorn"
></span>
Výsledky
</a>
{% endif %}
</div>
<div
class=
"panel-footer"
>
{% if gk.rights_for_round(r).have_right(Right.manage_round) %}
<a
class=
"btn btn-xs btn-default pull-right"
href=
'{{ url_for('
org_round_edit
',
round_id=
r.round_id)
}}'
>
<span
class=
"glyphicon glyphicon-cog"
></span>
Nastavení
</a>
{% endif %}
{% endif %}
</td>
<span
class=
"glyphicon glyphicon-time"
></span>
{{ r.ct_submit_end|timeformat_date|none_value('Termín nezadán') }}
</div>
</div>
</div>
{% endfor %}
{% endfor %}
</
table
>
</
div
>
{% if history %}
{% if history %}
<p><a
class=
'btn btn-default'
href=
'{{ url_for('
org_rounds
')
}}'
>
Aktuální ročník
</a>
<p><a
class=
'btn btn-default'
href=
'{{ url_for('
org_rounds
')
}}'
>
Aktuální ročník
</a>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment