diff --git a/boards/templates/boards/index.html b/boards/templates/boards/index.html index dcceb85..ddf71a4 100644 --- a/boards/templates/boards/index.html +++ b/boards/templates/boards/index.html @@ -8,7 +8,7 @@ {% for category in categories %} {% with category.get_children as boards %} {% with None as board %} -
+

{{ category.name }}

diff --git a/boards/templates/boards/new_topic.html b/boards/templates/boards/new_topic.html index bfff057..e5b248a 100644 --- a/boards/templates/boards/new_topic.html +++ b/boards/templates/boards/new_topic.html @@ -9,7 +9,7 @@ {% endblock %} {% block content %} -
+
New Topic
diff --git a/boards/templates/boards/reply_topic.html b/boards/templates/boards/reply_topic.html index 7cbf578..44b3eda 100644 --- a/boards/templates/boards/reply_topic.html +++ b/boards/templates/boards/reply_topic.html @@ -15,11 +15,11 @@ {% endblock %} {% block content %} -
+
New Topic
-
+
{% csrf_token %} {% include 'includes/form.html' %} diff --git a/boards/templates/boards/topic_posts.html b/boards/templates/boards/topic_posts.html index 340df51..72b9bd4 100644 --- a/boards/templates/boards/topic_posts.html +++ b/boards/templates/boards/topic_posts.html @@ -21,11 +21,11 @@ {% for post in topic.posts.all %}
+ class="card bg-dark mb-2 {% if forloop.first %} {% if is_paginated == False or page_obj.number == 1 %}mb-4 border-dark{% else %} mb-2 {% endif %}{% endif %}"> {% if forloop.first %}
{{ topic.subject }}
{% endif %} -
+
{{ post.created_by.username }} diff --git a/pages/admin.py b/pages/admin.py index 0c49af2..f050e51 100644 --- a/pages/admin.py +++ b/pages/admin.py @@ -1,8 +1,9 @@ from django.contrib import admin -from .models import Page +from .models import Page, Link from .forms.PageForm import PageForm, PageFormAdmin fields = ['image_tag'] admin.site.register(Page, PageFormAdmin) +admin.site.register(Link) diff --git a/pages/migrations/0003_link.py b/pages/migrations/0003_link.py new file mode 100644 index 0000000..0b61aa6 --- /dev/null +++ b/pages/migrations/0003_link.py @@ -0,0 +1,21 @@ +# Generated by Django 2.2.3 on 2019-07-10 03:11 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('pages', '0002_auto_20190709_1035'), + ] + + operations = [ + migrations.CreateModel( + name='Link', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('text', models.CharField(max_length=100)), + ('link', models.URLField()), + ], + ), + ] diff --git a/pages/models/Link.py b/pages/models/Link.py new file mode 100644 index 0000000..04fca7e --- /dev/null +++ b/pages/models/Link.py @@ -0,0 +1,9 @@ +from django.db import models + + +class Link(models.Model): + text = models.CharField(max_length=100) + link = models.URLField() + + def __str__(self): + return self.text diff --git a/pages/models.py b/pages/models/Page.py similarity index 96% rename from pages/models.py rename to pages/models/Page.py index 9b2a511..d40b323 100644 --- a/pages/models.py +++ b/pages/models/Page.py @@ -32,5 +32,4 @@ class Page(models.Model): def image_tag(self): return mark_safe('' % self.logo) - image_tag.short_description = 'Image' - + image_tag.short_description = 'Image' \ No newline at end of file diff --git a/pages/models/__init__.py b/pages/models/__init__.py new file mode 100644 index 0000000..b666cf0 --- /dev/null +++ b/pages/models/__init__.py @@ -0,0 +1,2 @@ +from .Page import Page +from .Link import Link \ No newline at end of file diff --git a/pages/templates/base.html b/pages/templates/base.html index fc41949..97c16b4 100644 --- a/pages/templates/base.html +++ b/pages/templates/base.html @@ -37,9 +37,9 @@ {% get_main_page as main_page %} {% with "/pages/"|add:main_page.slug|add:"/" as path %} {% if path == request.path or request.path == '' or request.path == '/' %} - Main Page + Main Page {% else %} - Main Page + Main Page {% endif %} {% endwith %} {% endif %} @@ -49,10 +49,9 @@ {% if page.is_mainpage == False %} {% with "/pages/"|add:page.slug|add:"/" as path %} {% if path == request.path %} - {{ page.page_name }} + {{ page.page_name }} {% else %} - {{ page.page_name }} + {{ page.page_name }} {% endif %} {% endwith %} {% endif %} @@ -60,18 +59,28 @@ {% endfor %} {% if boards_installed %} {% if '/boards/' in request.path %} - Forums + Forums {% else %} - Forums + Forums {% endif %} {% endif %} - Page list + Page list + {% if user.is_authenticated %} -