##// END OF EJS Templates
Merged with default branch
Merged with default branch

File last commit:

r1396:52abbcde default
r1441:f2404e3c merge decentral
Show More
normal.py
33 lines | 979 B | text/x-python | PythonLexer
neko259
Split thread view into separate views for each mode
r951 from boards.views.thread import ThreadView
neko259
Show max file size in the posting templates
r1396 from boards.views.mixins import FileUploadMixin
neko259
Split thread view into separate views for each mode
r951
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_BUMPLIMIT_PRG = 'bumplimit_progress'
CONTEXT_POSTS_LEFT = 'posts_left'
CONTEXT_BUMPABLE = 'bumpable'
neko259
Show max file size in the posting templates
r1396 PARAM_MAX_FILE_SIZE = 'max_file_size'
neko259
Split thread view into separate views for each mode
r951
neko259
Show max file size in the posting templates
r1396 class NormalThreadView(ThreadView, FileUploadMixin):
neko259
Split thread view into separate views for each mode
r951
def get_template(self):
return TEMPLATE_NORMAL
neko259
Added tree mode for the thread
r1180 def get_mode(self):
return 'normal'
neko259
Split thread view into separate views for each mode
r951 def get_data(self, thread):
params = dict()
bumpable = thread.can_bump()
params[CONTEXT_BUMPABLE] = bumpable
neko259
Save bump limit separately for every thread
r1052 max_posts = thread.max_posts
neko259
Added ability to disable bump limit of a thread
r1055 if bumpable and thread.has_post_limit():
neko259
Save bump limit separately for every thread
r1052 left_posts = max_posts - thread.get_reply_count()
neko259
Split thread view into separate views for each mode
r951 params[CONTEXT_POSTS_LEFT] = left_posts
params[CONTEXT_BUMPLIMIT_PRG] = str(
neko259
Save bump limit separately for every thread
r1052 float(left_posts) / max_posts * 100)
neko259
Show max file size in the posting templates
r1396 params[PARAM_MAX_FILE_SIZE] = self.get_max_upload_size()
neko259
Split thread view into separate views for each mode
r951
return params