##// END OF EJS Templates
If the username was not changed during settings form saving, don't reset...
If the username was not changed during settings form saving, don't reset notifications count

File last commit:

r1044:623bbefd default
r1051:3388bcbc default
Show More
normal.py
31 lines | 876 B | text/x-python | PythonLexer
neko259
Split thread view into separate views for each mode
r951 from boards import settings
from boards.views.thread import ThreadView
neko259
Made normal and gallery view use the same super-template with the same...
r1042 TEMPLATE_NORMAL = 'boards/thread_normal.html'
neko259
Split thread view into separate views for each mode
r951
CONTEXT_OP = 'opening_post'
CONTEXT_BUMPLIMIT_PRG = 'bumplimit_progress'
CONTEXT_POSTS_LEFT = 'posts_left'
CONTEXT_BUMPABLE = 'bumpable'
class NormalThreadView(ThreadView):
def get_template(self):
return TEMPLATE_NORMAL
def get_data(self, thread):
params = dict()
bumpable = thread.can_bump()
params[CONTEXT_BUMPABLE] = bumpable
if bumpable:
left_posts = settings.MAX_POSTS_PER_THREAD \
- thread.get_reply_count()
params[CONTEXT_POSTS_LEFT] = left_posts
params[CONTEXT_BUMPLIMIT_PRG] = str(
float(left_posts) / settings.MAX_POSTS_PER_THREAD * 100)
params[CONTEXT_OP] = thread.get_opening_post()
return params