Show links on cards, cycle alphabetically
authorRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Fri, 6 Dec 2013 15:37:09 +0000 (16:37 +0100)
committerRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Fri, 6 Dec 2013 15:59:23 +0000 (16:59 +0100)
src/copyspeak/static/css/base.scss
src/words/models.py

index ab19422..1be691c 100644 (file)
@@ -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;
 }
+
index a1c5fbd..cc1b1c1 100644 (file)
@@ -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]