-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #345 from MAKENTNU/feature/faq-categories-admin
Added categories on admin page
- Loading branch information
Showing
20 changed files
with
336 additions
and
77 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
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
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,3 @@ | ||
#page-title { | ||
margin-bottom: 1.5em; | ||
} |
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,3 @@ | ||
#page-title { | ||
margin-bottom: 1.5em; | ||
} |
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,7 @@ | ||
#outer-accordion { | ||
width: 100%; | ||
font-size: 150%; | ||
} | ||
|
||
.ui.accordion .title:not(.ui) { | ||
display: flex; | ||
#page-title { | ||
margin-bottom: 2em; | ||
} | ||
|
||
#page-title { | ||
margin-bottom: 5%; | ||
.questions.accordion .content .button { | ||
margin: -1em 0 1em; | ||
} |
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,6 @@ | ||
{% extends 'faq/admin_category_edit.html' %} | ||
{% load i18n %} | ||
|
||
|
||
{% block title %}{% trans "New Category" %}{% endblock title %} | ||
{% block form_header %}{% trans "New Category" %}{% endblock form_header %} |
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,31 @@ | ||
{% extends 'web/base.html' %} | ||
{% load static %} | ||
{% load i18n %} | ||
|
||
|
||
{% block title %}{% trans "Edit Category" %}{% endblock title %} | ||
|
||
{% block extra_head %} | ||
<script src="{% static 'ckeditor/ckeditor-init.js' %}"></script> | ||
<script src="{% static 'ckeditor/ckeditor/ckeditor.js' %}"></script> | ||
{% endblock extra_head %} | ||
|
||
{% block body %} | ||
<h1 class="ui centered header"> | ||
{% block form_header %}{% trans "Edit Category" %}{% endblock form_header %} | ||
</h1> | ||
<form class="ui form text container" method="POST" enctype="multipart/form-data"> | ||
{% csrf_token %} | ||
{{ form.non_field_errors }} | ||
|
||
<div class="field"> | ||
<label>{{ form.name.label }}</label> | ||
{{ form.name }} | ||
</div> | ||
|
||
<input class="ui make-bg-yellow right floated submit button" type="submit" value="{% trans "Save" %}"/> | ||
<a class="ui right floated red button" href="{% url 'admin_category_list' %}"> | ||
{% trans "Cancel" context "abort action" %} | ||
</a> | ||
</form> | ||
{% endblock body %} |
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,53 @@ | ||
{% extends 'web/base.html' %} | ||
{% load static %} | ||
{% load i18n %} | ||
|
||
|
||
{% block title %}{% trans "Categories" %}{% endblock title %} | ||
|
||
{% block extra_head %} | ||
<link rel="stylesheet" href="{% static 'faq/css/admin_category_list.css' %}"/> | ||
{% endblock extra_head %} | ||
|
||
{% block body %} | ||
<div class="ui container"> | ||
|
||
<h1 id="page-title" class="ui header"> | ||
<a href="{% url 'faq_admin_panel' %}"> | ||
<i class="blue chevron circle left icon"></i> | ||
</a> | ||
{% trans "Categories" %} | ||
{% if perms.faq.add_category %} | ||
<a href="{% url 'category_create' %}"> | ||
<i class="green plus icon"></i> | ||
</a> | ||
{% endif %} | ||
</h1> | ||
|
||
<div class="ui relaxed divided list"> | ||
{% for category in categories %} | ||
<div class="item"> | ||
<div class="content"> | ||
<div class="ui header"> | ||
{{ category.name }} | ||
{% if perms.faq.change_category %} | ||
<a href="{% url 'category_update' category.pk %}"> | ||
<i class="make-col-yellow pencil icon"></i> | ||
</a> | ||
{% endif %} | ||
|
||
{% if perms.faq.delete_category %} | ||
<a class="delete-modal-button" | ||
data-url="{% url 'category_delete' category.pk %}" | ||
data-obj-name="{{ category }}"> | ||
<i class="large red delete icon"></i> | ||
</a> | ||
{% endif %} | ||
</div> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
|
||
</div> | ||
{% endblock body %} |
2 changes: 1 addition & 1 deletion
2
faq/templates/faq/question_create.html → faq/templates/faq/admin_question_create.html
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,4 +1,4 @@ | ||
{% extends 'faq/question_edit.html' %} | ||
{% extends 'faq/admin_question_edit.html' %} | ||
{% load i18n %} | ||
|
||
|
||
|
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
20 changes: 15 additions & 5 deletions
20
faq/templates/faq/faq_admin.html → faq/templates/faq/admin_question_list.html
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
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,42 @@ | ||
{% extends 'web/base.html' %} | ||
{% load static %} | ||
{% load i18n %} | ||
{% load permission_tags %} | ||
|
||
|
||
{% block title %}{% trans "FAQ Admin Panel" %}{% endblock title %} | ||
|
||
{% block body %} | ||
<div class="ui container"> | ||
<h1 class="ui header"> | ||
<a href="{% url 'adminpanel' %}"> | ||
<i class="blue chevron circle left icon"></i> | ||
</a> | ||
{% trans "FAQ Admin Panel" %} | ||
</h1> | ||
<div class="ui four doubling stackable cards"> | ||
<div class="ui yellow card"> | ||
<a class="content" href="{% url 'admin_question_list' %}"> | ||
<div class="center aligned header"> | ||
<i class="grey question circle outline icon"></i> | ||
{% trans "Questions" %} | ||
</div> | ||
<div class="description"> | ||
{% trans "Here you can create, edit and delete questions" %}. | ||
</div> | ||
</a> | ||
</div> | ||
<div class="ui yellow card"> | ||
<a class="content" href="{% url 'admin_category_list' %}"> | ||
<div class="center aligned header"> | ||
<i class="grey newspaper outline icon"></i> | ||
{% trans "Categories" %} | ||
</div> | ||
<div class="description"> | ||
{% trans "Here you can create, edit and delete categories" %}. | ||
</div> | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock body %} |
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
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
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
Oops, something went wrong.