From d1bfcda90ec1f973cd84d346a395ede87f793802 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 6 Dec 2013 16:37:09 +0100 Subject: [PATCH] Show links on cards, cycle alphabetically --- src/copyspeak/static/css/base.scss | 59 ++++++++++++++++++++++-------- src/words/models.py | 10 ++--- 2 files changed, 48 insertions(+), 21 deletions(-) diff --git a/src/copyspeak/static/css/base.scss b/src/copyspeak/static/css/base.scss index ab19422..1be691c 100644 --- a/src/copyspeak/static/css/base.scss +++ b/src/copyspeak/static/css/base.scss @@ -68,21 +68,6 @@ h1.main { background-color: #222; } -.desc-container { - display: flex; - flex-direction: column; - justify-content: space-around; - position: absolute; - left: 4.75em; - top: 6.75em; - bottom: 6.75em; - right: 4.75em; -} - -.right-desc-container { - @extend .desc-container; - top: 10em; -} .card-container { display: block; @@ -207,6 +192,38 @@ h1.main { .inside-card { margin: 0 5em; } + + .desc-container { + display: flex; + flex-direction: column; + justify-content: space-around; + position: absolute; + left: 4.75em; + top: 6.75em; + bottom: 6.75em; + right: 4.75em; + + a { + color: #ccc; + border-bottom-width: 1px; + border-bottom-color: #ccc; + border-bottom-style: dotted; + + &:hover { + color: white; + border-bottom-color: white; + text-decoration: none; + } + } + a[href^="http://"] { + border-bottom-style: dashed; + } + } + + .right-desc-container { + @extend .desc-container; + top: 10em; + } } .chaotic { @@ -219,6 +236,17 @@ h1.main { color: #555; a { color: #555; } + + .desc-container { + a { + color: #555; + border-bottom-color: #555; + &:hover { + color: black; + border-bottom-color: black; + } + } + } } .lawful { background-image: url(/static/img/bg/lawful.png); @@ -341,3 +369,4 @@ footer { @extend %prevnext; right: 0; } + diff --git a/src/words/models.py b/src/words/models.py index a1c5fbd..cc1b1c1 100644 --- a/src/words/models.py +++ b/src/words/models.py @@ -31,15 +31,13 @@ class Word(models.Model): def get_next(self): try: - return Word.objects.filter(alignment=self.alignment, word__gt=self.word)[0] + return Word.objects.filter(word__gt=self.word)[0] except IndexError: - next_alignment = ALIGNMENTS[([a[0] for a in ALIGNMENTS].index(self.alignment) + 1) % len(ALIGNMENTS)][0] - return Word.objects.filter(alignment=next_alignment)[0] + return Word.objects.all()[0] def get_previous(self): words = Word.objects.order_by('-word') try: - return words.filter(alignment=self.alignment, word__lt=self.word)[0] + return words.filter(word__lt=self.word)[0] except IndexError: - prev_alignment = ALIGNMENTS[([a[0] for a in ALIGNMENTS].index(self.alignment) - 1) % len(ALIGNMENTS)][0] - return words.filter(alignment=prev_alignment)[0] + return words[0] -- 2.20.1