##// END OF EJS Templates
Removed hiding the form row with CSS as it causes problems with error rows
Removed hiding the form row with CSS as it causes problems with error rows

File last commit:

r400:abd3a5d6 default
r450:c3103f8c default
Show More
board.py
23 lines | 610 B | text/x-python | PythonLexer
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404
from boards.models import Post
from boards.views import thread
from django import template
register = template.Library()
@register.simple_tag(name='post_url')
def post_url(*args, **kwargs):
post_id = args[0]
post = get_object_or_404(Post, id=post_id)
if not post.is_opening():
link = reverse(thread, kwargs={
'post_id': post.thread_new.get_opening_post().id}) + '#' + str(
post_id)
else:
link = reverse(thread, kwargs={'post_id': post_id})
return link