Pavel "LEdoian" Turinsky
7 months ago
26 changed files with 435 additions and 115 deletions
@ -1,29 +1,35 @@ |
|||||
/* Rozlišení mezi lokálním, test a produkčním webem */ |
/* Rozlišení mezi lokálním, test a produkčním webem */ |
||||
|
|
||||
.localweb { |
body.localweb:before, body.localweb:after, |
||||
border-left: 20px solid greenyellow; |
body.testweb:before, body.testweb:after, |
||||
border-right: 20px solid greenyellow; |
body.suprodweb:before, body.suprodweb:after { |
||||
|
content: ""; |
||||
|
position: fixed; |
||||
|
width: 20px; |
||||
|
height: 100%; |
||||
|
top: 0; |
||||
} |
} |
||||
|
|
||||
.localweb .login-bar { |
body.localweb:before, |
||||
margin-left: -20px; |
body.testweb:before, |
||||
|
body.suprodweb:before { |
||||
|
left: 0; |
||||
} |
} |
||||
|
|
||||
.testweb { |
body.localweb:after, |
||||
border-left: 20px solid darkorange; |
body.testweb:after, |
||||
border-right: 20px solid darkorange; |
body.suprodweb:after { |
||||
|
right: 0; |
||||
} |
} |
||||
|
|
||||
.testweb .login-bar { |
body.localweb:before, body.localweb:after { |
||||
margin-left: -20px; |
background: greenyellow; |
||||
} |
} |
||||
|
|
||||
/* Produkční web z pohledu superuživatele */ |
body.testweb:before, body.testweb:after { |
||||
.suprodweb { |
background: darkorange; |
||||
border-left: 20px solid red; |
|
||||
border-right: 20px solid red; |
|
||||
} |
} |
||||
|
|
||||
.suprodweb .login-bar { |
body.suprodweb:before, body.suprodweb:after { |
||||
margin-left: -20px; |
background: red; |
||||
} |
} |
||||
|
@ -1,8 +1,10 @@ |
|||||
from django.contrib import admin |
from django.contrib import admin |
||||
|
|
||||
from .models import OdpovedUcastnika, SpravnaOdpoved |
from .models import OdpovedUcastnika, SpravnaOdpoved, NapovezenoUcastnikovi, Napoveda |
||||
|
|
||||
# Register your models here. |
# Register your models here. |
||||
|
|
||||
admin.site.register(OdpovedUcastnika) |
admin.site.register(OdpovedUcastnika) |
||||
admin.site.register(SpravnaOdpoved) |
admin.site.register(SpravnaOdpoved) |
||||
|
admin.site.register(Napoveda) |
||||
|
admin.site.register(NapovezenoUcastnikovi) |
||||
|
@ -0,0 +1,65 @@ |
|||||
|
# Generated by Django 4.2.8 on 2024-04-14 12:57 |
||||
|
|
||||
|
from django.db import migrations, models |
||||
|
import django.db.models.deletion |
||||
|
import django.utils.timezone |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
dependencies = [ |
||||
|
( |
||||
|
"seminar", |
||||
|
"0114_related_name_se_zmenilo_a_django_chce_migraci_tak_dostane_migraci", |
||||
|
), |
||||
|
("sifrovacka", "0003_odpoveducastnika_uspech"), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.CreateModel( |
||||
|
name="Napoveda", |
||||
|
fields=[ |
||||
|
( |
||||
|
"id", |
||||
|
models.AutoField( |
||||
|
auto_created=True, |
||||
|
primary_key=True, |
||||
|
serialize=False, |
||||
|
verbose_name="ID", |
||||
|
), |
||||
|
), |
||||
|
("text", models.TextField()), |
||||
|
("sifra", models.IntegerField()), |
||||
|
], |
||||
|
), |
||||
|
migrations.CreateModel( |
||||
|
name="NapovezenoUcastnikovi", |
||||
|
fields=[ |
||||
|
( |
||||
|
"id", |
||||
|
models.AutoField( |
||||
|
auto_created=True, |
||||
|
primary_key=True, |
||||
|
serialize=False, |
||||
|
verbose_name="ID", |
||||
|
), |
||||
|
), |
||||
|
("sifra", models.IntegerField(verbose_name="Číslo šifry")), |
||||
|
( |
||||
|
"timestamp", |
||||
|
models.DateTimeField( |
||||
|
default=django.utils.timezone.now, verbose_name="Timestamp" |
||||
|
), |
||||
|
), |
||||
|
( |
||||
|
"resitel", |
||||
|
models.ForeignKey( |
||||
|
on_delete=django.db.models.deletion.CASCADE, |
||||
|
to="seminar.resitel", |
||||
|
), |
||||
|
), |
||||
|
], |
||||
|
options={ |
||||
|
"ordering": ["-timestamp"], |
||||
|
}, |
||||
|
), |
||||
|
] |
@ -0,0 +1,50 @@ |
|||||
|
{% extends "base.html" %} |
||||
|
|
||||
|
{% block content %} |
||||
|
|
||||
|
<br> |
||||
|
|
||||
|
<h1>{% block nadpis1a %}M&Mí šifrovačka{% endblock nadpis1a %}</h1> |
||||
|
|
||||
|
<br> |
||||
|
|
||||
|
<h2>Získat nápovědu k šifře:</h2> |
||||
|
|
||||
|
<form action="{% url 'sifrovacka_napoveda' %}" method="post"> |
||||
|
<table class="form"> |
||||
|
{{form.non_field_errors}} |
||||
|
{% for field in form %} |
||||
|
<tr> |
||||
|
<td> |
||||
|
<label class="field-label{% if field.field.required %} field-required{% endif %}" for="{{ field.id_for_label }}"> |
||||
|
{{ field.label }} |
||||
|
</label> |
||||
|
|
||||
|
</td> |
||||
|
|
||||
|
<td {% if field.help_text %} class="field-with-comment"{% endif %}> |
||||
|
{{ field }} |
||||
|
<span class="field-comment">{{ field.help_text|safe }}</span> |
||||
|
</td> |
||||
|
|
||||
|
</tr> |
||||
|
|
||||
|
|
||||
|
{% if field.errors %} |
||||
|
<tr> |
||||
|
<td colspan="2"><span class="field-error">{{ field.errors }}</span></td> |
||||
|
</tr> |
||||
|
{% endif %} |
||||
|
{% endfor %} |
||||
|
</table> |
||||
|
|
||||
|
{% csrf_token %} |
||||
|
|
||||
|
<input type="submit" value="Chci nápovědu"> |
||||
|
</form> |
||||
|
|
||||
|
<p><a href="{% url 'sifrovacka' %}">Nechceme nápovědu, známe řešení!</a></p> |
||||
|
|
||||
|
<p><a href="{% url 'sifrovacka_preskoceni' %}">Přeskoč šifru</a></p> |
||||
|
|
||||
|
{% endblock content %} |
@ -0,0 +1,23 @@ |
|||||
|
{% extends "base.html" %} |
||||
|
|
||||
|
{% block content %} |
||||
|
|
||||
|
<h1>{% block nadpis1a %}Šifrovačka vzaté nápovědy{% endblock nadpis1a %}</h1> |
||||
|
|
||||
|
<table class="dosla_reseni"> |
||||
|
<tr> |
||||
|
<th>Timestamp</th> |
||||
|
<th>Řešitel</th> |
||||
|
<th>Šifra</th> |
||||
|
</tr> |
||||
|
|
||||
|
{% for u in object_list %} |
||||
|
<tr> |
||||
|
<td>{{ u.timestamp }}</td> |
||||
|
<td>{{ u.resitel }}</td> |
||||
|
<td>{{ u.sifra }}</td> |
||||
|
</tr> |
||||
|
{% endfor %} |
||||
|
</table> |
||||
|
|
||||
|
{% endblock content %} |
@ -0,0 +1,54 @@ |
|||||
|
{% extends "base.html" %} |
||||
|
|
||||
|
{% block content %} |
||||
|
|
||||
|
<br> |
||||
|
|
||||
|
<h1>{% block nadpis1a %}M&Mí šifrovačka{% endblock nadpis1a %}</h1> |
||||
|
|
||||
|
<br> |
||||
|
|
||||
|
<h2>Přeskočit šifru:</h2> |
||||
|
|
||||
|
<form action="{% url 'sifrovacka_preskoceni' %}" method="post"> |
||||
|
<table class="form"> |
||||
|
{{form.non_field_errors}} |
||||
|
{% for field in form %} |
||||
|
{% if field.id_for_label != "id_odpoved" %} |
||||
|
<tr> |
||||
|
<td> |
||||
|
<label class="field-label{% if field.field.required %} field-required{% endif %}" for="{{ field.id_for_label }}"> |
||||
|
{{ field.label }} |
||||
|
</label> |
||||
|
|
||||
|
</td> |
||||
|
|
||||
|
<td {% if field.help_text %} class="field-with-comment"{% endif %}> |
||||
|
{{ field }} |
||||
|
<span class="field-comment">{{ field.help_text|safe }}</span> |
||||
|
</td> |
||||
|
|
||||
|
</tr> |
||||
|
|
||||
|
|
||||
|
{% if field.errors %} |
||||
|
<tr> |
||||
|
<td colspan="2"><span class="field-error">{{ field.errors }}</span></td> |
||||
|
</tr> |
||||
|
{% endif %} |
||||
|
{% else %} |
||||
|
{{ field.as_hidden }} |
||||
|
{% endif %} |
||||
|
{% endfor %} |
||||
|
</table> |
||||
|
|
||||
|
{% csrf_token %} |
||||
|
|
||||
|
<input type="submit" value="Chceme další stanoviště bez vyřešení šifry"> |
||||
|
</form> |
||||
|
|
||||
|
<p><a href="{% url 'sifrovacka' %}">Nechceme přeskočit, známe řešení!</a></p> |
||||
|
|
||||
|
<p><a href="{% url 'sifrovacka_napoveda' %}">Nechceme přeskakovat, ale nápověda by se šikla.</a></p> |
||||
|
|
||||
|
{% endblock content %} |
Loading…
Reference in new issue