Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sifrovacka
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
sifrovacka
Compare revisions
603a9e1a04675f94222d2b40789afd6339371289 to 658c44ccb2dcc1fd0f08e71b50393d3300564e01
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
to/sifrovacka
Select target project
No results found
658c44ccb2dcc1fd0f08e71b50393d3300564e01
Select Git revision
Branches
main
Swap
Target
to/sifrovacka
Select target project
to/sifrovacka
djz.88/sifrovacka
2 results
603a9e1a04675f94222d2b40789afd6339371289
Select Git revision
Branches
main
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
join sifrovacka only when it is active
· acb490e3
zdenek.kubala
authored
2 years ago
and
jan.bednarik
committed
2 years ago
acb490e3
Merge branch 'main' into 'main'
· 658c44cc
jan.bednarik
authored
2 years ago
join sifrovacka only when it is active See merge request
!8
658c44cc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sifrovacka/templates/sifrovacka.html
+19
-13
19 additions, 13 deletions
sifrovacka/templates/sifrovacka.html
sifrovacka/views.py
+4
-1
4 additions, 1 deletion
sifrovacka/views.py
with
23 additions
and
14 deletions
sifrovacka/templates/sifrovacka.html
View file @
658c44cc
...
...
@@ -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">
...
...
This diff is collapsed.
Click to expand it.
sifrovacka/views.py
View file @
658c44cc
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.