Show More
@@ -443,5 +443,15 b' class Post(models.Model, Viewable):' | |||||
443 | def get_tripcode_color(self): |
|
443 | def get_tripcode_color(self): | |
444 | return self.tripcode[:6] |
|
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 | def get_short_tripcode(self): |
|
456 | def get_short_tripcode(self): | |
447 | return self.tripcode[:10] No newline at end of file |
|
457 | return self.tripcode[:10] |
@@ -9,7 +9,7 b'' | |||||
9 | <span class="title">{{ post.title }}</span> |
|
9 | <span class="title">{{ post.title }}</span> | |
10 | <span class="pub_time"><time datetime="{{ post.pub_time|date:'c' }}">{{ post.pub_time }}</time></span> |
|
10 | <span class="pub_time"><time datetime="{{ post.pub_time|date:'c' }}">{{ post.pub_time }}</time></span> | |
11 | {% if post.tripcode %} |
|
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 | {% endif %} |
|
13 | {% endif %} | |
14 | {% comment %} |
|
14 | {% comment %} | |
15 | Thread death time needs to be shown only if the thread is alredy archived |
|
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