comparison forums/views/main.py @ 1164:68811c583bfb

WIP forum to V3 design commit.
author Brian Neal <bgneal@gmail.com>
date Wed, 12 Apr 2017 20:26:45 -0500
parents a60aabced346
children 130ac1e98cf4
comparison
equal deleted inserted replaced
1163:44e55e4317f8 1164:68811c583bfb
202 visit_time = datetime.datetime.now() 202 visit_time = datetime.datetime.now()
203 else: 203 else:
204 visit_time = last_post_on_page.creation_date 204 visit_time = last_post_on_page.creation_date
205 _update_last_visit(request.user, topic, visit_time) 205 _update_last_visit(request.user, topic, visit_time)
206 206
207 # we do this for the template since it is rendered twice
208 page_nav = render_to_string('forums/pagination.html', {'page': page})
209
210 can_moderate = perms.can_moderate(topic.forum, request.user) 207 can_moderate = perms.can_moderate(topic.forum, request.user)
211 208
212 can_reply = request.user.is_authenticated() and ( 209 can_reply = request.user.is_authenticated() and (
213 not topic.locked or can_moderate) 210 not topic.locked or can_moderate)
214 211
220 217
221 return render(request, 'forums/topic.html', { 218 return render(request, 'forums/topic.html', {
222 'forum': topic.forum, 219 'forum': topic.forum,
223 'topic': topic, 220 'topic': topic,
224 'page': page, 221 'page': page,
225 'page_nav': page_nav,
226 'last_page': last_page, 222 'last_page': last_page,
227 'can_moderate': can_moderate, 223 'can_moderate': can_moderate,
228 'can_reply': can_reply, 224 'can_reply': can_reply,
229 'form': NewPostForm(initial={'topic_id': topic.id}), 225 'form': NewPostForm(initial={'topic_id': topic.id}),
230 'is_favorite': is_favorite, 226 'is_favorite': is_favorite,
231 'is_subscribed': is_subscribed, 227 'is_subscribed': is_subscribed,
228 'V3_DESIGN': True,
232 }) 229 })
233 230
234 231
235 def topic_unread(request, id): 232 def topic_unread(request, id):
236 """ 233 """