Otevírání článků na správné straně #54
3 changed files with 31 additions and 1 deletions
|
@ -0,0 +1,28 @@
|
||||||
|
# Generated by Django 4.2.13 on 2024-06-15 21:24
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('seminar', '0129_novinky_post'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='clanek',
|
||||||
|
name='strana',
|
||||||
|
field=models.PositiveIntegerField(blank=True, null=True, verbose_name='první strana'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='text',
|
||||||
|
name='id',
|
||||||
|
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='treenode',
|
||||||
|
name='id',
|
||||||
|
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -601,6 +601,8 @@ class Clanek(Problem):
|
||||||
cislo = models.ForeignKey(Cislo, blank=True, null=True, on_delete=models.PROTECT,
|
cislo = models.ForeignKey(Cislo, blank=True, null=True, on_delete=models.PROTECT,
|
||||||
verbose_name='číslo vydání', related_name='vydane_clanky')
|
verbose_name='číslo vydání', related_name='vydane_clanky')
|
||||||
|
|
||||||
|
strana = models.PositiveIntegerField(verbose_name="první strana", blank=True, null=True)
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def kod_v_rocniku(self):
|
def kod_v_rocniku(self):
|
||||||
if self.stav == Problem.STAV_ZADANY or self.stav == Problem.STAV_VYRESENY:
|
if self.stav == Problem.STAV_ZADANY or self.stav == Problem.STAV_VYRESENY:
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
{% endifchanged %}
|
{% endifchanged %}
|
||||||
<li>
|
<li>
|
||||||
{% if clanek.cislo.pdf %}
|
{% if clanek.cislo.pdf %}
|
||||||
<a href="{{ clanek.cislo.pdf.url }}">
|
<a href="{{clanek.cislo.pdf.url}}{% if clanek.strana %}#page={{ clanek.cislo.strana }}{% endif %}">
|
||||||
{{ clanek.nazev }}
|
{{ clanek.nazev }}
|
||||||
({% for r in clanek.reseni_set.first.resitele.all %}{{r}}{% if not forloop.last %}, {% endif %}{% endfor %})
|
({% for r in clanek.reseni_set.first.resitele.all %}{{r}}{% if not forloop.last %}, {% endif %}{% endfor %})
|
||||||
</a>
|
</a>
|
||||||
|
|
Loading…
Reference in a new issue