Browse Source

Merge pull request 'Otevírání článků na správné straně' (!54) from clanek-strana into master

Reviewed-on: #54
pull/55/head
Jonas Havelka 5 months ago
parent
commit
476f8263d4
  1. 18
      seminar/migrations/0130_clanek_strana.py
  2. 2
      seminar/models/tvorba.py
  3. 2
      seminar/templates/seminar/clanky/resitelske_clanky.html

18
seminar/migrations/0130_clanek_strana.py

@ -0,0 +1,18 @@
# 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'),
),
]

2
seminar/models/tvorba.py

@ -600,6 +600,8 @@ class Clanek(Problem):
cislo = models.ForeignKey(Cislo, blank=True, null=True, on_delete=models.PROTECT,
verbose_name='číslo vydání', related_name='vydane_clanky')
strana = models.PositiveIntegerField(verbose_name="první strana", blank=True, null=True)
@cached_property
def kod_v_rocniku(self):

2
seminar/templates/seminar/clanky/resitelske_clanky.html

@ -17,7 +17,7 @@
{% endifchanged %}
<li>
{% if clanek.cislo.pdf %}
<a href="{{ clanek.cislo.pdf.url }}">
<a href="{{clanek.cislo.pdf.url}}{% if clanek.strana %}#page={{ clanek.strana }}{% endif %}">
{{ clanek.nazev }}
({% for r in clanek.reseni_set.first.resitele.all %}{{r}}{% if not forloop.last %}, {% endif %}{% endfor %})
</a>

Loading…
Cancel
Save