Commit 430fc0f3 authored by Dennis Appel's avatar Dennis Appel

Add wiki link to checklist category

parent b66499e4
# Generated by Django 2.1.3 on 2018-12-17 17:59
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('checklist', '0006_auto_20181217_1833'),
]
operations = [
migrations.AddField(
model_name='checklistcategory',
name='checklistCategory',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.SET_DEFAULT, to='checklist.CheckListCategory'),
),
]
......@@ -2,6 +2,8 @@ from django.db import models
class CheckListCategory(models.Model):
checklistCategory = models.ForeignKey(
'checklist.CheckListCategory', on_delete=models.SET_DEFAULT, default=1)
categoryTitle = models.CharField(max_length=100)
def getEntries(self):
......
......@@ -36,6 +36,9 @@
<div class="grid-x">
<div class="cell cell-background-lg" id="category_{{category.id}}" name="category_{{category.id}}">
<h3>{{category.categoryTitle}}</h3>
{% if category.wikiEntry.id %}
<a class="link" href="{% url 'wiki:index' %}#item_{{category.wikiEntry.id}}"><button class="hollow button">Wiki</button></a>
{% endif %}
</div>
{% for entry in category.getEntries %}
<div class="cell cell-background-lg" id="entry_{{entry.id}}" name="entry_{{entry.id}}">
......
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