Show More
@@ -2,13 +2,19 b' import re' | |||||
2 | from django.shortcuts import get_object_or_404 |
|
2 | from django.shortcuts import get_object_or_404 | |
3 | from django import template |
|
3 | from django import template | |
4 |
|
4 | |||
5 | ELLIPSIZER = '...' |
|
|||
6 |
|
||||
7 | REGEX_LINES = re.compile(r'(<div class="br"></div>)', re.U | re.S) |
|
|||
8 | REGEX_TAG = re.compile(r'<(/)?([^ ]+?)(?:(\s*/)| .*?)?>', re.S) |
|
|||
9 |
|
5 | |||
10 | IMG_ACTION_URL = '[<a href="{}">{}</a>]' |
|
6 | IMG_ACTION_URL = '[<a href="{}">{}</a>]' | |
11 |
|
7 | |||
|
8 | PARAM_POST = 'post' | |||
|
9 | PARAM_MODERATOR = 'moderator' | |||
|
10 | PARAM_OP = 'is_opening' | |||
|
11 | PARAM_THREAD = 'thread' | |||
|
12 | PARAM_CSS_CLASS = 'css_class' | |||
|
13 | PARAM_OPEN_LINK = 'need_open_link' | |||
|
14 | PARAM_TRUNCATED = 'truncated' | |||
|
15 | PARAM_OP_ID = 'opening_post_id' | |||
|
16 | PARAM_REPLY_LINK = 'reply_link' | |||
|
17 | ||||
12 |
|
18 | |||
13 | register = template.Library() |
|
19 | register = template.Library() | |
14 |
|
20 | |||
@@ -65,14 +71,14 b' def post_view(post, moderator=False, nee' | |||||
65 | css_class += ' dead_post' |
|
71 | css_class += ' dead_post' | |
66 |
|
72 | |||
67 | return { |
|
73 | return { | |
68 |
|
|
74 | PARAM_POST: post, | |
69 |
|
|
75 | PARAM_MODERATOR: moderator, | |
70 |
|
|
76 | PARAM_OP: is_opening, | |
71 |
|
|
77 | PARAM_THREAD: thread, | |
72 |
|
|
78 | PARAM_CSS_CLASS: css_class, | |
73 |
|
|
79 | PARAM_OPEN_LINK: need_open_link, | |
74 |
|
|
80 | PARAM_TRUNCATED: truncated, | |
75 |
|
|
81 | PARAM_OP_ID: opening_post_id, | |
76 |
|
|
82 | PARAM_REPLY_LINK: reply_link, | |
77 | } |
|
83 | } | |
78 |
|
84 |
General Comments 0
You need to be logged in to leave comments.
Login now