##// END OF EJS Templates
Do not show IP colored lines and feed selectors when there is no saved IP
neko259 -
r1678:a45f98f4 default
parent child Browse files
Show More
@@ -8,7 +8,7 b' from boards.models import Attachment, Ke'
8 from boards.models.attachment import FILE_TYPES_IMAGE
8 from boards.models.attachment import FILE_TYPES_IMAGE
9 from boards.models.base import Viewable
9 from boards.models.base import Viewable
10 from boards.models.post.export import get_exporter, DIFF_TYPE_JSON
10 from boards.models.post.export import get_exporter, DIFF_TYPE_JSON
11 from boards.models.post.manager import PostManager
11 from boards.models.post.manager import PostManager, NO_IP
12 from boards.utils import datetime_to_epoch
12 from boards.utils import datetime_to_epoch
13 from django.core.exceptions import ObjectDoesNotExist
13 from django.core.exceptions import ObjectDoesNotExist
14 from django.core.urlresolvers import reverse
14 from django.core.urlresolvers import reverse
@@ -403,3 +403,7 b' class Post(models.Model, Viewable):'
403
403
404 def get_ip_color(self):
404 def get_ip_color(self):
405 return hashlib.md5(self.poster_ip.encode()).hexdigest()[:6]
405 return hashlib.md5(self.poster_ip.encode()).hexdigest()[:6]
406
407 def has_ip(self):
408 return self.poster_ip != NO_IP
409
@@ -7,7 +7,7 b''
7 <div class="post-info">
7 <div class="post-info">
8 <a class="post_id" href="{{ post.get_absolute_url }}">#{{ post.id }}</a>
8 <a class="post_id" href="{{ post.get_absolute_url }}">#{{ post.id }}</a>
9 <span class="title">{{ post.title }}</span>
9 <span class="title">{{ post.title }}</span>
10 {% if perms.boards.change_post %}
10 {% if perms.boards.change_post and post.has_ip %}
11 <a href="{% url 'feed' %}?ip={{ post.poster_ip }}">*</a>
11 <a href="{% url 'feed' %}?ip={{ post.poster_ip }}">*</a>
12 <span class="pub_time" style="border-bottom: solid 2px #{{ post.get_ip_color }};" title="{{ post.poster_ip }}">
12 <span class="pub_time" style="border-bottom: solid 2px #{{ post.get_ip_color }};" title="{{ post.poster_ip }}">
13 {% else %}
13 {% else %}
General Comments 0
You need to be logged in to leave comments. Login now