Commits

Anonymous committed e308ba2

Minor template and database changes.

  • Participants
  • Parent commits b928c1d

Comments (0)

Files changed (3)

 
 class Content(polymodel.PolyModel):
     thread = db.ReferenceProperty(Thread)
+    hash = db.ByteStringProperty(required = True)
     author = db.UserProperty(required = True)
     created = db.DateTimeProperty(auto_now_add = True)
     edited = db.DateTimeProperty(auto_now = True)
-    distinctVisibility = db.BooleanProperty(default = False)
+    hide = db.BooleanProperty(default = False)
 
 class Link(Content):
     title = db.StringProperty()
     for u in l:
         m = hashlib.md5()
         m.update(u)
-        r.append((u, m.hexdigest()))
+        r.append((u, m.hexdigest(), 10 + int(m.hexdigest()[7], 16)%8))
 
     return render_template('main.html', 
                            user = user, 

templates/main.html

     <section id='links'>
         <ul>
             {% for link in links %}
-            <li class="{{ loop.cycle('odd', 'even') }}"><canvas style="width:{{ loop.cycle('15', '20') }}px; height:10px; background-color:#{{ link[1][:6] }};"></canvas> <a href="{{ link[0] }}">{{ link[0][7:]|truncate(80, True, '...') }}</a></li>
+            <li class="{{ loop.cycle('odd', 'even') }}"><canvas style="width:{{ link[2] }}px; height:10px; background-color:#{{ link[1][:6] }};"></canvas> <a href="{{ link[0] }}">{{ link[0][7:]|truncate(80, True, '...') }}</a></li>
             {% endfor %}
         </ul>
     </section>