mirror of
https://github.com/tjsga/scavenger-hunt-2021.git
synced 2025-04-15 16:40:17 -04:00
feat: added descriptions to categories
This commit is contained in:
parent
e446db893e
commit
244503d305
23
hunt/apps/main/migrations/0009_auto_20210920_1019.py
Normal file
23
hunt/apps/main/migrations/0009_auto_20210920_1019.py
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# Generated by Django 3.2.7 on 2021-09-20 10:19
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('main', '0008_rename_available_challenge_unblocked'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='category',
|
||||||
|
name='slug',
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='category',
|
||||||
|
name='description',
|
||||||
|
field=models.CharField(default='', max_length=200),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
]
|
17
hunt/apps/main/migrations/0010_remove_category_category.py
Normal file
17
hunt/apps/main/migrations/0010_remove_category_category.py
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# Generated by Django 3.2.7 on 2021-09-20 10:20
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('main', '0009_auto_20210920_1019'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='category',
|
||||||
|
name='category',
|
||||||
|
),
|
||||||
|
]
|
|
@ -5,7 +5,7 @@ from ckeditor.fields import RichTextField
|
||||||
class Category(models.Model):
|
class Category(models.Model):
|
||||||
id = models.AutoField(primary_key=True, null=False, blank=False)
|
id = models.AutoField(primary_key=True, null=False, blank=False)
|
||||||
name = models.CharField(max_length=200, null=False, blank=False)
|
name = models.CharField(max_length=200, null=False, blank=False)
|
||||||
category = models.CharField(max_length=200, null=False, blank=False)
|
description = models.CharField(max_length=200, null=False, blank=False)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
|
@ -38,6 +38,9 @@
|
||||||
<h1 class="ml-3">{{ category.name }}</h1>
|
<h1 class="ml-3">{{ category.name }}</h1>
|
||||||
<p style="cursor: pointer;" onclick="document.getElementById('c-{{ category.id }}').style.display = document.getElementById('c-{{ category.id }}').style.display === 'none' ? 'flex' : 'none'" class="ml-auto mr-3 btn btn-primary">toggle</p>
|
<p style="cursor: pointer;" onclick="document.getElementById('c-{{ category.id }}').style.display = document.getElementById('c-{{ category.id }}').style.display === 'none' ? 'flex' : 'none'" class="ml-auto mr-3 btn btn-primary">toggle</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<p class="ml-2 font-italic">{{category.description}}</p>
|
||||||
|
</div>
|
||||||
<div id="c-{{ category.id }}" class='row'>
|
<div id="c-{{ category.id }}" class='row'>
|
||||||
{% for challenge, status in challenges.items %}
|
{% for challenge, status in challenges.items %}
|
||||||
{% if status.0.unblocked %}
|
{% if status.0.unblocked %}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user