##// END OF EJS Templates
Added background to tripcodes, which is inverted tripcode color
neko259 -
r1294:e6412fea default
parent child Browse files
Show More
@@ -443,5 +443,15 b' class Post(models.Model, Viewable):'
443 443 def get_tripcode_color(self):
444 444 return self.tripcode[:6]
445 445
446 def get_tripcode_background(self):
447 code = self.get_tripcode_color()
448 result = ''
449
450 for i in range(0, len(code), 2):
451 p = code[i:i+2]
452 result += hex(255 - int(p, 16))[2:]
453
454 return result
455
446 456 def get_short_tripcode(self):
447 457 return self.tripcode[:10] No newline at end of file
@@ -9,7 +9,7 b''
9 9 <span class="title">{{ post.title }}</span>
10 10 <span class="pub_time"><time datetime="{{ post.pub_time|date:'c' }}">{{ post.pub_time }}</time></span>
11 11 {% if post.tripcode %}
12 <span style="color: #{{post.get_tripcode_color}}">{{ post.get_short_tripcode }}</span>
12 <span style="color: #{{ post.get_tripcode_color }}; background: #{{ post.get_tripcode_background }}">{{ post.get_short_tripcode }}</span>
13 13 {% endif %}
14 14 {% comment %}
15 15 Thread death time needs to be shown only if the thread is alredy archived
General Comments 0
You need to be logged in to leave comments. Login now