Exemple #1
0
def topic_detail(request, pk, slug):
    topic = Topic.objects.get_public_or_404(pk, request.user)

    if topic.slug != slug:
        return HttpResponsePermanentRedirect(topic.get_absolute_url())

    topic_viewed.send(sender=topic.__class__, request=request, topic=topic)

    return render(request, 'foro/topic/topic_detail.html', {
        'topic': topic,
        'COMMENTS_PER_PAGE': settings.ST_COMMENTS_PER_PAGE
    })
Exemple #2
0
def private_detail(request, topic_id, slug):
    topic_private = get_object_or_404(TopicPrivate.objects.select_related('topic'),
                                      topic_id=topic_id, user=request.user)

    if topic_private.topic.slug != slug:
        return HttpResponsePermanentRedirect(topic_private.get_absolute_url())

    topic_viewed.send(sender=topic_private.topic.__class__, request=request, topic=topic_private.topic)

    return render(request,
                  'foro/topic_private/private_detail.html',
                  {'topic': topic_private.topic,
                   'topic_private': topic_private,
                   'COMMENTS_PER_PAGE': settings.ST_COMMENTS_PER_PAGE})
Exemple #3
0
def topic_detail(request, pk, slug):
    topic = Topic.objects.get_public_or_404(pk, request.user)
    miembros_email = User.objects.filter(es_destacado=True)
    miembros_count = User.objects.all().count()

    if topic.slug != slug:
        return HttpResponsePermanentRedirect(topic.get_absolute_url())

    topic_viewed.send(sender=topic.__class__, request=request, topic=topic)

    return render(request, 'foro/topic/topic_detail.html',
                  {'topic': topic,
                   'COMMENTS_PER_PAGE': settings.ST_COMMENTS_PER_PAGE,
                   'miembros_email': miembros_email,
                   'miembros_count': miembros_count})
Exemple #4
0
def topic_detail(request, pk, slug):
    topic = Topic.objects.get_public_or_404(pk, request.user)
    miembros_email = User.objects.filter(es_destacado=True)
    miembros_count = User.objects.all().count()

    if topic.slug != slug:
        return HttpResponsePermanentRedirect(topic.get_absolute_url())

    topic_viewed.send(sender=topic.__class__, request=request, topic=topic)

    return render(
        request, 'foro/topic/topic_detail.html', {
            'topic': topic,
            'COMMENTS_PER_PAGE': settings.ST_COMMENTS_PER_PAGE,
            'miembros_email': miembros_email,
            'miembros_count': miembros_count
        })