-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
faq front end implementation, closes #69
- Loading branch information
1 parent
39637c2
commit e537fe6
Showing
4 changed files
with
68 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{% extends "base.html" %} | ||
{% load static %} | ||
|
||
{% block head %} | ||
<title>FAQ #{{ faq.pk }} - {{ SITE_NAME }}</title> | ||
{% endblock %} | ||
|
||
{% block body %} | ||
<h1>{{ faq.category.name }}</h1> | ||
<h2>{{ faq.question }}</h2> | ||
<p>{{ faq.anaswer }}</p> | ||
<p>Creator: {{ faq.creator }}</p> | ||
<p>Created: {{ faq.created }}, Updated: {{ faq.updated }}</p> | ||
|
||
{% endblock %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{% extends "base.html" %} | ||
{% load static %} | ||
|
||
{% block head %} | ||
<title>FAQ - {{ SITE_NAME }}</title> | ||
{% endblock %} | ||
|
||
{% block body %} | ||
{% if questions.count == 0 %} | ||
<h2>There's nothing here yet! Check back soon!</h2> | ||
{% endif %} | ||
|
||
<table class="table table-hover"> | ||
<tr id="header"> | ||
<thead> | ||
<th>Category</th> | ||
<th>Question</th> | ||
<th>Answer</th> | ||
<th>Last Updated</th> | ||
</thead> | ||
</tr> | ||
{% for q in questions %} | ||
<tbody> | ||
<tr> | ||
<td>{{ q.category.name }}</td> | ||
<td><a href="{% url 'support:faq_detail' pk=q.pk %}">{{ q.question }}</a></td> | ||
<td><a href="{% url 'support:faq_detail' pk=q.pk %}">{{ q.answer|truncatewords:20 }}</a></td> | ||
<td>{{ q.updated }}</td> | ||
</tr> | ||
</tbody> | ||
{% endfor %} | ||
</table> | ||
|
||
|
||
{% endblock %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
from django.contrib.auth.decorators import login_required | ||
from django.urls import path | ||
|
||
from support.views import MyTicketListView, MyTicketDetailView, TicketCreateView | ||
from support.views import MyTicketListView, MyTicketDetailView, TicketCreateView, FAQDetail, FAQListView | ||
|
||
app_name = 'support' | ||
|
||
urlpatterns = [ | ||
path('', login_required(MyTicketListView.as_view()), name='list'), | ||
path('my/<int:pk>/', login_required(MyTicketDetailView.as_view()), name='detail'), | ||
path('create/', login_required(TicketCreateView.as_view()), name='create'), | ||
path('faq/', FAQListView, name='faq_list'), | ||
path('faq/<int:pk>/', FAQDetail, name='faq_detail') | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters