Commit 845ca5a8 authored by Jean Michel Rouly's avatar Jean Michel Rouly
Browse files

Moved question discussion onto a new page.

parent 5764f646
......@@ -8,8 +8,11 @@ urlpatterns = patterns('website.views',
#### STATIC PAGES ####
url(r'^instructions$', 'instructions', name='instructions'),
#### DYNAMIC PAGES ####
url(r'^submit$', 'submit_question', name='submit_question'),
url(r'^feedback$', 'feedback', name='feedback'),
url(r'^question/(?P<slug>[^\.]+)$', 'view_question', name='view_question'),
#### HOMEPAGE ####
url(r'^$', 'index', name='homepage'),
......
<p>{{ comment.user.first_name }} {{ comment.user.last_name }} says:</p>
<p>{{ comment.text }}</p>
<a data-toggle="collapse" data-target="#replies{{comment.pk}}"
style="cursor:pointer;">
<em>Replies ({{ comment.get_replies|length }})</em></a>
<div class="row collapse" id="replies{{comment.pk}}">
<div class="col-lg-12">
<div class="well well-sm well-replies">
{% if comment.get_replies %}
{% for reply in comment.get_replies %}
{% include 'components/reply.html' %}
{% endfor %}
{% else %}
No replies yet.
{% endif %}
</div>
</div>
</div>
<!--
<div class="well well-sm collapse" id="replies{{comment.pk}}">
{% if comment.get_replies %}
{% else %}
No replies yet.
{% endif %}
</div>
-->
<p>{{ reply.user.first_name }} {{ reply.user.last_name }} says:<br />
{{ reply.text }}</p>
......@@ -9,7 +9,7 @@ HNRS 110 &bull; Homepage
<div class="page-header" id="banner">
<div class="row">
<div class="col-lg-10 col-lg-offset-1">
<h1>Research Question Review</h1>
<h1>Research Questions</h1>
<p class="lead">Review and critique your peers' research questions.</p>
</div>
</div>
......@@ -17,7 +17,7 @@ HNRS 110 &bull; Homepage
{% if questions %}
{% for question in questions %}
{% include 'components/question.html' %}
{% include 'question_component.html' %}
{% endfor %}
{% else %}
<div class="row">
......
{% extends 'layouts/base.html' %}
{% block title %}
HNRS 110 &bull; Question Discussion
{% endblock %}
{% block content %}
<div class="page-header" id="banner">
<div class="row">
<div class="col-lg-10 col-lg-offset-1">
<h1>Question Discussion</h1>
<p class="lead">Description</p>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-lg-offset-1">
<h1>{{question.user.first_name}} {{question.user.last_name}}</h1>
{{ question.text }}
</div>
</div>
{% endblock %}
......@@ -17,8 +17,7 @@
</div>
<div class="panel-footer">
<a data-toggle="collapse" data-target="#comments{{question.pk}}"
style="cursor:pointer;">
<a href="{{ question.get_absolute_url }}">
<em>Comments ({{ question.get_comments|length }})</em>
</a>
</div>
......@@ -27,29 +26,3 @@
</div>
</div>
<div class="row collapse" id="comments{{question.pk}}">
<div class="col-lg-9 col-lg-offset-2">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">
Comments
</h3>
</div>
{% if question.get_comments %}
{% for comment in question.get_comments %}
<div class="panel-body">
{% include 'components/comment.html' %}
</div>
{% endfor %}
{% else %}
<div class="panel-body">
No comments yet.
</div>
{% endif %}
</div>
</div>
</div>
......@@ -14,6 +14,10 @@ class Question( models.Model ):
comments = Comment.objects.filter(parent__pk=self.pk)
return comments
def get_absolute_url(self):
from django.core.urlresolvers import reverse
return reverse('website.views.view_question', args=[str(self.pk)])
def __unicode__(self):
return '%s, %s' % ( self.user, self.date )
......
......@@ -60,3 +60,10 @@ def feedback(request):
},
RequestContext(request),
)
def view_question(request, slug):
return render_to_response('question.html', {
'question' : get_object_or_404(Question, pk=slug),
},
RequestContext(request),
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment