##// END OF EJS Templates
Update all posts in thread diff when the thread become not bumpable (BB-66)
neko259 -
r1029:a6020bc2 default
parent child Browse files
Show More
@@ -113,8 +113,8 b' class PostManager(models.Manager):'
113 if new_thread:
113 if new_thread:
114 boards.models.thread.Thread.objects.process_oldest_threads()
114 boards.models.thread.Thread.objects.process_oldest_threads()
115 else:
115 else:
116 thread.last_edit_time = posting_time
116 thread.bump()
117 thread.bump()
117 thread.last_edit_time = posting_time
118 thread.save()
118 thread.save()
119
119
120 post.connect_replies()
120 post.connect_replies()
@@ -42,6 +42,7 b' class ThreadManager(models.Manager):'
42 thread.archived = True
42 thread.archived = True
43 thread.bumpable = False
43 thread.bumpable = False
44 thread.last_edit_time = timezone.now()
44 thread.last_edit_time = timezone.now()
45 thread.update_posts_time()
45 thread.save(update_fields=['archived', 'last_edit_time', 'bumpable'])
46 thread.save(update_fields=['archived', 'last_edit_time', 'bumpable'])
46
47
47
48
@@ -70,10 +71,11 b' class Thread(models.Model):'
70 """
71 """
71
72
72 if self.can_bump():
73 if self.can_bump():
73 self.bump_time = timezone.now()
74 self.bump_time = self.last_edit_time
74
75
75 if self.get_reply_count() >= settings.MAX_POSTS_PER_THREAD:
76 if self.get_reply_count() >= settings.MAX_POSTS_PER_THREAD:
76 self.bumpable = False
77 self.bumpable = False
78 self.update_posts_time()
77
79
78 logger.info('Bumped thread %d' % self.id)
80 logger.info('Bumped thread %d' % self.id)
79
81
@@ -183,4 +185,7 b' class Thread(models.Model):'
183 return 'T#{}/{}'.format(self.id, self.get_opening_post_id())
185 return 'T#{}/{}'.format(self.id, self.get_opening_post_id())
184
186
185 def get_tag_url_list(self):
187 def get_tag_url_list(self):
186 return boards.models.Tag.objects.get_tag_url_list(self.get_tags()) No newline at end of file
188 return boards.models.Tag.objects.get_tag_url_list(self.get_tags())
189
190 def update_posts_time(self):
191 self.post_set.update(last_edit_time=self.last_edit_time)
@@ -219,7 +219,6 b' function updateBumplimitProgress(postDel'
219 var newPostsToLimit = bumplimit - postCount;
219 var newPostsToLimit = bumplimit - postCount;
220 if (newPostsToLimit <= 0) {
220 if (newPostsToLimit <= 0) {
221 $('.bar-bg').remove();
221 $('.bar-bg').remove();
222 $('.thread').children('.post').addClass('dead_post');
223 } else {
222 } else {
224 postsToLimitElement.text(newPostsToLimit);
223 postsToLimitElement.text(newPostsToLimit);
225 progressBar.width((100 - postCount / bumplimit * 100.0) + '%');
224 progressBar.width((100 - postCount / bumplimit * 100.0) + '%');
General Comments 0
You need to be logged in to leave comments. Login now