Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • to/sifrovacka
  • djz.88/sifrovacka
2 results
Show changes
Commits on Source (2)
......@@ -39,20 +39,26 @@
<hr>
{% if request.user.is_authenticated %}
{% if not sifrovacka_stage_count == 0 %}
{% if not sifrovacka_current_stage_urlhash %}
<form action="{% url 'home' %}" method="post">
{% csrf_token %}
<button class="btn btn--autowidth btn--hoveractive btn--to-grey-500" type="submit" value={{ sifrovacka_id }} name='signupsif'>
<div class="btn__body ">Přihlásit se k šifrovačce</div>
</button>
</form>
{% if not is_archived_sifrovacka %}
{% if not sifrovacka_current_stage_urlhash %}
<form action="{% url 'home' %}" method="post">
{% csrf_token %}
<button class="btn btn--autowidth btn--hoveractive btn--to-grey-500" type="submit" value={{ sifrovacka_id }} name='signupsif'>
<div class="btn__body ">Přihlásit se k šifrovačce</div>
</button>
</form>
{% else %}
<h1 class="head-alt-sm">Vaše Aktuální úroveň</h1>
{% for stage in sifrovacka_stages %}
{% if sifrovacka_current_stage_urlhash.at_stage == stage.stage_urlhash %}
<li><a href={% url 'stage' stage.sifrovacka_id stage.stage_urlhash %}>{{ stage }}</a></li>
{% endif %}
{% endfor %}
{% endif %}
{% else %}
<h1 class="head-alt-sm">Vaše Aktuální úroveň</h1>
{% for stage in sifrovacka_stages %}
{% if sifrovacka_current_stage_urlhash.at_stage == stage.stage_urlhash %}
<li><a href={% url 'stage' stage.sifrovacka_id stage.stage_urlhash %}>{{ stage }}</a></li>
{% endif %}
{% endfor %}
<div class="alert alert--grey-125">
<span> Šifrovačka skončila a není možné se k ní přihlásit.</span>
</div>
{% endif %}
{% else %}
<div class="alert alert--grey-125">
......
......@@ -148,6 +148,8 @@ def detail(request, sifrovacka_id):
#sifrovacka_detail = Sifrovacka.objects.get(id = sifrovacka_id)
sifrovacka_stages = Stages.objects.filter(sifrovacka__sifrovacka_name = sifrovacka_detail)
sifrovacka_stage_count = sifrovacka_stages.count()
is_archived_sifrovacka = Sifrovacka.objects.filter(id = sifrovacka_id,
enddate_sifrovacka__lt = timezone.now())
if request.user.is_authenticated:
sifrovacka_all_user_current_stages= Participants.objects.filter(user = \
request.user).filter(sifrovacka_id = \
......@@ -167,7 +169,8 @@ def detail(request, sifrovacka_id):
"sifrovacka_stage_count": sifrovacka_stage_count,
"sifrovacka_current_id": sifrovacka_current_id,
"sifrovacka_current_stage_urlhash":
sifrovacka_current_stage_urlhash
sifrovacka_current_stage_urlhash,
"is_archived_sifrovacka": is_archived_sifrovacka
}
return render(request, 'sifrovacka.html', context)
......