##// END OF EJS Templates
Added ability to disable bump limit of a thread
neko259 -
r1055:e5eaf6eb default
parent child Browse files
Show More
@@ -78,8 +78,11 b' class Thread(models.Model):'
78
78
79 logger.info('Bumped thread %d' % self.id)
79 logger.info('Bumped thread %d' % self.id)
80
80
81 def has_post_limit(self):
82 return self.max_posts > 0
83
81 def update_bump_status(self):
84 def update_bump_status(self):
82 if self.get_reply_count() >= self.max_posts:
85 if self.has_post_limit() and self.get_reply_count() >= self.max_posts:
83 self.bumpable = False
86 self.bumpable = False
84 self.update_posts_time()
87 self.update_posts_time()
85
88
@@ -25,7 +25,7 b''
25 {% endblock %}
25 {% endblock %}
26
26
27 {% cache 600 thread_meta thread.last_edit_time moderator LANGUAGE_CODE %}
27 {% cache 600 thread_meta thread.last_edit_time moderator LANGUAGE_CODE %}
28 <span id="reply-count">{{ thread.get_reply_count }}</span>/{{ thread.max_posts }} {% trans 'messages' %},
28 <span id="reply-count">{{ thread.get_reply_count }}</span>{% if thread.has_post_limit %}/{{ thread.max_posts }}{% endif %} {% trans 'messages' %},
29 <span id="image-count">{{ thread.get_images_count }}</span> {% trans 'images' %}.
29 <span id="image-count">{{ thread.get_images_count }}</span> {% trans 'images' %}.
30 {% trans 'Last update: ' %}<span id="last-update"><time datetime="{{ thread.last_edit_time|date:'c' }}">{{ thread.last_edit_time|date:'r' }}</time></span>
30 {% trans 'Last update: ' %}<span id="last-update"><time datetime="{{ thread.last_edit_time|date:'c' }}">{{ thread.last_edit_time|date:'r' }}</time></span>
31 [<a href="rss/">RSS</a>]
31 [<a href="rss/">RSS</a>]
@@ -15,7 +15,7 b''
15 <a href="{% url 'thread_gallery' opening_post.id %}">{% trans 'Gallery mode' %}</a>
15 <a href="{% url 'thread_gallery' opening_post.id %}">{% trans 'Gallery mode' %}</a>
16 </div>
16 </div>
17
17
18 {% if bumpable %}
18 {% if bumpable and thread.has_post_limit %}
19 <div class="bar-bg">
19 <div class="bar-bg">
20 <div class="bar-value" style="width:{{ bumplimit_progress }}%" id="bumplimit_progress">
20 <div class="bar-value" style="width:{{ bumplimit_progress }}%" id="bumplimit_progress">
21 </div>
21 </div>
@@ -20,7 +20,7 b' class NormalThreadView(ThreadView):'
20 bumpable = thread.can_bump()
20 bumpable = thread.can_bump()
21 params[CONTEXT_BUMPABLE] = bumpable
21 params[CONTEXT_BUMPABLE] = bumpable
22 max_posts = thread.max_posts
22 max_posts = thread.max_posts
23 if bumpable:
23 if bumpable and thread.has_post_limit():
24 left_posts = max_posts - thread.get_reply_count()
24 left_posts = max_posts - thread.get_reply_count()
25 params[CONTEXT_POSTS_LEFT] = left_posts
25 params[CONTEXT_POSTS_LEFT] = left_posts
26 params[CONTEXT_BUMPLIMIT_PRG] = str(
26 params[CONTEXT_BUMPLIMIT_PRG] = str(
General Comments 0
You need to be logged in to leave comments. Login now