From: Radek Czajka Date: Thu, 3 Jan 2013 13:21:12 +0000 (+0100) Subject: forgotten stuff X-Git-Url: https://git.mdrn.pl/turniej.git/commitdiff_plain/db566020a374d0e81e8274ab0e5ba8061f8903ad forgotten stuff --- diff --git a/apps/poetry/models.py b/apps/poetry/models.py index ef8bf94..63bf8f2 100644 --- a/apps/poetry/models.py +++ b/apps/poetry/models.py @@ -53,6 +53,9 @@ class Poet(models.Model): p.save() return self.poem_set.filter(for_contest=True) + def contest_poems(self): + return self.poem_set.filter(in_contest=True) + class Poem(models.Model): slug = models.SlugField(max_length=50, db_index=True) @@ -68,8 +71,7 @@ class Poem(models.Model): def __unicode__(self): oneliner = u"%s, %s" % (self.poet.name, self.pretty_title()) - if not self.title: - oneliner += u" [%s…]" % self.text[:20] + oneliner += u" [%s…]" % (u" ".join(self.text.split()[:5])) return oneliner def get_absolute_url(self): diff --git a/apps/poetry/templates/poetry/contest.html b/apps/poetry/templates/poetry/contest.html new file mode 100644 index 0000000..9f153b9 --- /dev/null +++ b/apps/poetry/templates/poetry/contest.html @@ -0,0 +1,39 @@ +{% extends "base.html" %} +{% load url from future %} + +{% block "body" %} + +

+ +Turniej Elektrybałtów: utwory wybrane do konkursu

+ +
+ +
+
+ + +
+ +
+ +{% for poet in poets %} +

{{ poet }}

+ +{% endfor %} + + +{% endblock %} diff --git a/apps/poetry/templates/poetry/main.html b/apps/poetry/templates/poetry/main.html index 6e316e4..7d4c91d 100644 --- a/apps/poetry/templates/poetry/main.html +++ b/apps/poetry/templates/poetry/main.html @@ -36,6 +36,15 @@ Turniej Elektrybałtów Twórz-że się! +

Utwory do konkursu zostały wybrane!

+ +

Spośród wygenerowanych przz nas propozycji autorzy programów wybrali po trzy utwory.

+

Zobacz wiersze startujące w konkursie!

+

+ + + +

Ostatnio opublikowane utwory: