Repository: EimerTulio/hobbysite-FG-16
Pull request #16: Made all features required for the CSCI final specs sheet.
Author: login: LegitAgent125
Labels: name: enhancement
description: New feature or request
Created: 2025-05-12T08:56:32Z | Merged: 2025-05-14T14:33:59Z



Diff:
diff --git a/hobbysite/hobbysite/settings.py b/hobbysite/hobbysite/settings.py
index a8938cc..c16f7f1 100644
--- a/hobbysite/hobbysite/settings.py
+++ b/hobbysite/hobbysite/settings.py
@@ -127,7 +127,6 @@
 # https://docs.djangoproject.com/en/5.1/howto/static-files/
 
 STATIC_URL = 'static/'
-
 STATICFILES_DIRS = [
     os.path.join(BASE_DIR, 'static'),
 ]
diff --git a/hobbysite/homepage/templates/homepage/home.html b/hobbysite/homepage/templates/homepage/home.html
index cc70ddd..1980777 100644
--- a/hobbysite/homepage/templates/homepage/home.html
+++ b/hobbysite/homepage/templates/homepage/home.html
@@ -9,10 +9,10 @@
 {% endblock %}
 
 {% block content %}
-<main>
-<h1>Add spiel here (HOME PAGE)</h1>
-</main>
-<footer>
-<h4>add developer information</h4>
-</footer>
+    <main>
+    <h1>Add spiel here (HOME PAGE)</h1>
+    </main>
+    <footer>
+    <h4>add developer information</h4>
+    </footer>
 {% endblock %}
diff --git a/hobbysite/templates/base.html b/hobbysite/templates/base.html
index 068c594..a6bc5ea 100644
--- a/hobbysite/templates/base.html
+++ b/hobbysite/templates/base.html
@@ -59,8 +59,6 @@
 				</li>
 			</ul>
 			</nav>
-			</header>
-		{% block content %}
-		{% endblock %}
+		</header>
 	</body>
 </html>
\ No newline at end of file
diff --git a/hobbysite/wiki/admin.py b/hobbysite/wiki/admin.py
index a418848..6b304f6 100644
--- a/hobbysite/wiki/admin.py
+++ b/hobbysite/wiki/admin.py
@@ -1,5 +1,5 @@
 from django.contrib import admin
-from .models import ArticleCategory, Article
+from .models import ArticleCategory, Article, Comment
 # Register your models here.
 
 class ArticleInline(admin.TabularInline):
@@ -12,6 +12,10 @@ class ArticleCategoryAdmin(admin.ModelAdmin):
     ordering = ['name']
     inlines = [
         ArticleInline,
-    ]    
-admin.site.register(ArticleCategory, ArticleCategoryAdmin)
+    ]
+    
+class CommentAdmin(admin.ModelAdmin):
+    model = Comment
 
+admin.site.register(ArticleCategory, ArticleCategoryAdmin)
+admin.site.register(Comment)
diff --git a/hobbysite/wiki/forms.py b/hobbysite/wiki/forms.py
new file mode 100644
index 0000000..33e5a4b
--- /dev/null
+++ b/hobbysite/wiki/forms.py
@@ -0,0 +1,23 @@
+from django import forms
+from .models import Comment, Article, ArticleImage
+
+
+class CommentForm(forms.ModelForm):
+    class Meta:
+        model = Comment
+        fields = ['entry']
+
+class ArticleForm(forms.ModelForm):
+    class Meta:
+        model = Article
+        fields = ['title', 'category', 'header_image', 'entry']
+
+class ArticleDetailForm(forms.ModelForm):
+    class Meta:
+        model = Article
+        fields = ['title', 'category', 'header_image', 'entry']
+        
+class ArticleImageForm(forms.ModelForm):
+    class Meta:
+        model = ArticleImage
+        exclude = ['article']
\ No newline at end of file
diff --git a/hobbysite/wiki/migrations/0003_article_author_article_header_image_and_more.py b/hobbysite/wiki/migrations/0003_article_author_article_header_image_and_more.py
new file mode 100644
index 0000000..662754c
--- /dev/null
+++ b/hobbysite/wiki/migrations/0003_article_author_article_header_image_and_more.py
@@ -0,0 +1,44 @@
+# Generated by Django 5.1.7 on 2025-05-11 16:35
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('user_management', '0001_initial'),
+        ('wiki', '0002_alter_article_options_alter_articlecategory_options'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='article',
+            name='author',
+            field=models.ForeignKey(default=1, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='articles', to='user_management.profile'),
+        ),
+        migrations.AddField(
+            model_name='article',
+            name='header_image',
+            field=models.ImageField(blank=True, null=True, upload_to='article_headers/'),
+        ),
+        migrations.AlterField(
+            model_name='article',
+            name='category',
+            field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='articles', to='wiki.articlecategory'),
+        ),
+        migrations.CreateModel(
+            name='Comment',
+            fields=[
+                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('entry', models.TextField()),
+                ('created_on', models.DateTimeField(auto_now_add=True)),
+                ('updated_on', models.DateTimeField(auto_now=True)),
+                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='wiki.article')),
+                ('author', models.ForeignKey(default=1, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='comments', to='user_management.profile')),
+            ],
+            options={
+                'ordering': ['-created_on'],
+            },
+        ),
+    ]
diff --git a/hobbysite/wiki/migrations/0004_alter_article_author_alter_comment_author.py b/hobbysite/wiki/migrations/0004_alter_article_author_alter_comment_author.py
new file mode 100644
index 0000000..6911691
--- /dev/null
+++ b/hobbysite/wiki/migrations/0004_alter_article_author_alter_comment_author.py
@@ -0,0 +1,25 @@
+# Generated by Django 5.1.7 on 2025-05-11 16:38
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('user_management', '0001_initial'),
+        ('wiki', '0003_article_author_article_header_image_and_more'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='article',
+            name='author',
+            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='articles', to='user_management.profile'),
+        ),
+        migrations.AlterField(
+            model_name='comment',
+            name='author',
+            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='comments', to='user_management.profile'),
+        ),
+    ]
diff --git a/hobbysite/wiki/migrations/0005_alter_articlecategory_options_alter_article_category_and_more.py b/hobbysite/wiki/migrations/0005_alter_articlecategory_options_alter_article_category_and_more.py
new file mode 100644
index 0000000..7b49ec5
--- /dev/null
+++ b/hobbysite/wiki/migrations/0005_alter_articlecategory_options_alter_article_category_and_more.py
@@ -0,0 +1,32 @@
+# Generated by Django 5.1.7 on 2025-05-11 21:29
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('wiki', '0004_alter_article_author_alter_comment_author'),
+    ]
+
+    operations = [
+        migrations.AlterModelOptions(
+            name='articlecategory',
+            options={'ordering': ['name'], 'verbose_name': 'Article Category', 'verbose_name_plural': 'Article Categories'},
+        ),
+        migrations.AlterField(
+            model_name='article',
+            name='category',
+            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='articles', to='wiki.articlecategory'),
+        ),
+        migrations.CreateModel(
+            name='ArticleImage',
+            fields=[
+                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('image', models.ImageField(null=True, upload_to='article_images/')),
+                ('description', models.CharField(max_length=255)),
+                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images', to='wiki.article')),
+            ],
+        ),
+    ]
diff --git a/hobbysite/wiki/models.py b/hobbysite/wiki/models.py
index 9f96c0e..d391e17 100644
--- a/hobbysite/wiki/models.py
+++ b/hobbysite/wiki/models.py
@@ -1,5 +1,6 @@
 from django.db import models
 from django.urls import reverse
+from user_management.models import Profile
 
 class ArticleCategory(models.Model):
     '''ArticleCategory model for wiki articles'''
@@ -9,28 +10,70 @@ def __str__(self):
         return '{}: ArticleCategory'.format(self.name)
     
     def get_absolute_url(self):
-        return reverse('wiki:article-detail', args=[self.pk])
+        return reverse('wiki:article-list')
     
     class Meta:
         ordering = ['name']
-    
+        verbose_name = 'Article Category'
+        verbose_name_plural = 'Article Categories'
+
 class Article(models.Model):
     '''Article model for wiki articles'''
     title = models.CharField(max_length=255)
+    author = models.ForeignKey(
+        Profile,
+        on_delete=models.SET_NULL,
+        related_name="article_author",
+        null=True,
+    )
     category = models.ForeignKey(
         ArticleCategory,
         on_delete=models.SET_NULL,
-        related_name="articles",
-        null=True
+        related_name="article_category",
+        null=True,
     )
     entry = models.TextField()
+    header_image = models.ImageField(upload_to='article_headers/', null=True, blank=True)
     created_on = models.DateTimeField(auto_now_add=True)
     updated_on = models.DateTimeField(auto_now=True)
     
     def __str__(self):
         return '{}: Article'.format(self.title)
     
+    def get_absolute_url(self):
+        return reverse('wiki:article-detail', args=[self.pk])
+    
     class Meta:
         ordering = ['-created_on']
+        
+class Comment(models.Model):
+    '''Comment model for wiki articles'''
+    author = models.ForeignKey(
+        Profile,
+        on_delete=models.SET_NULL,
+        related_name="comment_author",
+        null=True,
+    )
+    article = models.ForeignKey(
+        Article,
+        on_delete=models.CASCADE,
+        related_name="comment_article"
+    )
+    entry = models.TextField()
+    created_on = models.DateTimeField(auto_now_add=True)
+    updated_on = models.DateTimeField(auto_now=True)
+    def __str__(self):
+        return '{}: Comment'.format(self.author.user.username)
     
-    
+    class Meta:
+        ordering = ['-created_on']
+        
+class ArticleImage(models.Model):
+    '''ArticleImage model for wiki articles'''
+    image = models.ImageField(null=True, upload_to='article_images/')
+    description = models.CharField(max_length=255)
+    article = models.ForeignKey(
+        Article,
+        on_delete=models.CASCADE,
+        related_name="images"
+    )
diff --git a/hobbysite/wiki/templates/wiki_add.html b/hobbysite/wiki/templates/wiki_add.html
new file mode 100644
index 0000000..43d028a
--- /dev/null
+++ b/hobbysite/wiki/templates/wiki_add.html
@@ -0,0 +1,17 @@
+{% extends 'base.html' %}
+
+    {% block title %}
+        Add Article
+    {% endblock %}
+
+    {% block content %}
+        <h1>Add Article</h1>
+
+        <form method="POST" enctype="multipart/form-data">
+            {% csrf_token %}
+            {{ form }}
+            <button type="submit">Add Article</button>
+        </form>
+
+        <a href="{% url 'wiki:article-list' %}">Back</a>
+{% endblock %}
\ No newline at end of file
diff --git a/hobbysite/wiki/templates/wiki_detail.html b/hobbysite/wiki/templates/wiki_detail.html
index 8ee6b84..9becba8 100644
--- a/hobbysite/wiki/templates/wiki_detail.html
+++ b/hobbysite/wiki/templates/wiki_detail.html
@@ -8,15 +8,77 @@
 {% block content %} 
     <h1>Title: {{ article.title }}</h1> 
 
-    <h5> {{ article.category }} 
+    <h5> {{ article.category }} <br>
 
+    {% if article.author %} 
+        <b> Created by: {{ article.author }} </b>
+    {% else %}
+        <b> Created by: Anonymous </b>
+    {% endif %}
     <br> Created on {{ article.created_on }} 
-
     <br> Last Updated on {{ article.updated_on }} </h5> 
 
-    <br> {{ article.entry }} 
+    {% if request.user == article.author.user %}
+        <a href="{% url 'wiki:article-update' article.pk %}">Edit this article</a>
+    {% endif %}
+
+    <h3> Header </h3>
+    {% if article.header_image %} 
+        <img src="{{ article.header_image.url }}" alt="Image" style="width: 500px; height: 500px;">
+    {% else %}
+        <h5> No header image uploaded </h5>
+    {% endif %}  
+
+    <h3> Article Content </h3>
+    {{ article.entry }} <br>
+
+    <h3> Article Picture Gallery </h3>
+    {% if article.images.all %}
+        {% for picture in article.images.all %}
+            <img src="{{ picture.image.url }}" alt="Image" style="width: 500px; height: 200px;">
+        {% endfor %}
+    {% else %}
+        <h5> No pictures uploaded </h5>
+    {% endif %}
+    
+    <h3> Read more about <i>{{ category.name }}</i></h3>
+    {% if related_articles %}
+        {% for articles in related_articles %}
+            {% if articles != article %}
+                {% if request.user.is_authenticated %}
+                    <li><a href="{% url 'wiki:article-detail' articles.id %}">{{ articles.title }}</a></li>
+                {% else %}
+                    {% if not articles.author %}
+                        <li><a href="{% url 'wiki:article-detail' articles.id %}">{{ articles.title }}</a></li>
+                    {% endif %}
+                {% endif %}
+            {% endif %}
+        {% endfor %}
+    {% else %}
+        <h5> No related articles available </h5>
+    {% endif %}
+    <br>
+    
 
-    <br> 
+    <h3> Comments </h3>
+    {% if request.user.is_authenticated %}
+        {% if article.comment_article.all %}
+            {% for comment in article.comment_article.all %}
+                <h5> {{ comment.entry }} </h5>
+                <p> Commented by: {{ comment.author }} </p>
+                <p> Commented on: {{ comment.created_on }} </p>
+            {% endfor %}
+        {% else %}
+            <h5> No comments available, be the first one to comment! </h5>
+        {% endif %}
+        <form method="post">
+        {% csrf_token %}
+            {{ form.as_p }}  
+            <button type="submit">Post Comment</button>
+        </form>
+    {% else %}
+        <h5> You need to be logged in to comment </h5>
+    {% endif %}
 
     <a href="{% url 'wiki:article-list' %}">Back</a> 
 {% endblock %}
\ No newline at end of file
diff --git a/hobbysite/wiki/templates/wiki_list.html b/hobbysite/wiki/templates/wiki_list.html
index d158b53..fece19f 100644
--- a/hobbysite/wiki/templates/wiki_list.html
+++ b/hobbysite/wiki/templates/wiki_list.html
@@ -6,14 +6,72 @@
 {% block content %}
     <h1 class="page-title-list">Wiki Articles</h1>
     <br>
-    {% for articles in articles %}
-        <h2> {{articles.name}} </h2>
-        <h5> {{articles.description}} </h5>
-        {% for article in articles.articles.all %}
-            <a href="{% url 'wiki:article-detail' article.id %}">{{article.title}}</a>
-            <p> Created on : {{article.created_on}} </p>
-            <p> Last Updated on : {{article.updated_on}} </p>
+
+    {% if request.user.is_authenticated %}
+
+        <h1> Articles from Users </h1>
+        {% for articles in articles %}
+            <h2> {{ articles.name }} </h2>
+            <h5> {{ articles.description }} </h5>
+            {% if articles.article_category.all %}
+                {% for article in articles.article_category.all %}
+                    {% if article.author %}
+                        <li>
+                            <a href="{% url 'wiki:article-detail' article.id %}">{{ article.title }}</a>
+                            <p> Created by : {{ article.author }} </p>
+                            <p> Created on : {{ article.created_on }} </p>
+                            <p> Last Updated on : {{ article.updated_on }} </p>
+                        </li>
+                    {% endif %}
+                {% endfor %}
+            {% else %}
+                <h5> No articles available </h5>
+            {% endif %}
         {% endfor %}
+
         <br>
-    {% endfor %}
-{% endblock %}
\ No newline at end of file
+
+        <h1> Articles from Anonymous Users </h1>
+        {% for articles in articles %}
+            <h2> {{ articles.name }} </h2>
+            <h5> {{ articles.description }} </h5>
+            {% if articles.article_category.all %}
+                {% for article in articles.article_category.all %}
+                    {% if not article.author %}
+                        <li>
+                            <a href="{% url 'wiki:article-detail' article.id %}">{{ article.title }}</a>
+                            <p> Created on : {{ article.created_on }} </p>
+                            <p> Last Updated on : {{ article.updated_on }} </p>
+                        </li>
+                    {% endif %}
+                {% endfor %}
+            {% else %}
+                <h5> No articles available </h5>
+            {% endif %}
+        {% endfor %}
+
+    {% else %}
+
+        <h1> All Articles </h1>
+        {% for articles in articles %}
+            <h2> {{ articles.name }} </h2>
+            <h5> {{ articles.description }} </h5>
+            {% if articles.article_category.all %}
+                {% for article in articles.article_category.all %}
+                    {% if not article.author %}
+                        <li>
+                            <a href="{% url 'wiki:article-detail' article.id %}">{{ article.title }}</a>
+                        </li>
+                    {% endif %}
+                {% endfor %}
+            {% else %}
+                <h5> No articles available </h5>
+            {% endif %}
+        {% endfor %}
+
+    {% endif %}
+
+    <br>
+    <a href="{% url 'wiki:article-add' %}" style="font-size: 24px; padding: 10px 20px; background-color: #007bff; color: white; text-decoration: none; border-radius: 5px; display: inline-block;">Add Article</a>
+    <br>
+{% endblock %}
diff --git a/hobbysite/wiki/templates/wiki_update.html b/hobbysite/wiki/templates/wiki_update.html
new file mode 100644
index 0000000..2b48a61
--- /dev/null
+++ b/hobbysite/wiki/templates/wiki_update.html
@@ -0,0 +1,22 @@
+{% extends 'base.html' %}
+
+{% block title %}
+    Update Article: {{ article.title }}
+{% endblock %}
+
+{% if request.user.is_authenticated %}
+    {% block content %}
+        <h1>Update Article</h1>
+
+        <form method="POST" enctype="multipart/form-data">
+            {% csrf_token %}
+            {{ form.as_p }}
+            <h3>Upload Image(s)</h3>
+            <input type="file" name="image" multiple>
+
+            <button type="submit">Update</button>
+        </form>
+
+        <a href="{% url 'wiki:article-detail' article.pk %}">Back</a>
+    {% endblock %}
+{% endif %}
\ No newline at end of file
diff --git a/hobbysite/wiki/urls.py b/hobbysite/wiki/urls.py
index 44e4d03..503ef4d 100644
--- a/hobbysite/wiki/urls.py
+++ b/hobbysite/wiki/urls.py
@@ -1,9 +1,11 @@
 from django.urls import path
-from .views import article_list, article_detail
+from .views import article_list, article_detail, article_add, article_update
 
 urlpatterns = [
 path('articles', article_list, name="article-list"),
 path('article/<int:pk>', article_detail, name="article-detail"),
+path('article/add', article_add, name="article-add"),
+path('article/<int:pk>/edit', article_update, name="article-update"),
 ]
 # This might be needed, depending on your Django version
 app_name = "wiki"
diff --git a/hobbysite/wiki/views.py b/hobbysite/wiki/views.py
index 0063e3f..ac15c35 100644
--- a/hobbysite/wiki/views.py
+++ b/hobbysite/wiki/views.py
@@ -1,19 +1,87 @@
-from django.shortcuts import render
-from .models import ArticleCategory, Article
+from django.shortcuts import render, redirect
+from .models import ArticleCategory, Article, Comment, ArticleImage
+from .forms import ArticleForm, CommentForm, ArticleDetailForm, ArticleImageForm
 
-    
 def article_list(request):
     '''Article list view for wiki articles'''
     articles = ArticleCategory.objects.all()
     ctx = {
-        "articles" : articles
+        "articles": articles
     }
     return render(request, 'wiki_list.html', ctx)
 
 def article_detail(request, pk):
     '''Article detail view for wiki articles'''
-    article = Article.objects.get(pk=pk)# .order_by('-created_on')
+    article = Article.objects.get(pk=pk)
+    category = article.category
+    comments = article.comment_article.all()
+    images = ArticleImage.objects.filter(article=article)
+    
+    if request.method == 'POST':
+        form = CommentForm(request.POST)
+        if form.is_valid():
+            comment = form.save(commit=False)
+            comment.article = article
+            comment.author = request.user.profile
+            comment.save()
+            return redirect('wiki:article-detail', pk=article.pk)
+    else:
+        form = CommentForm()
+    
+    if category:  # Check if the article has a category so it won't get null.
+        if request.user.is_authenticated:
+            related_articles = category.article_category.exclude(pk=article.pk)
+        else:
+            related_articles = category.article_category.exclude(pk=article.pk).filter(author__isnull=True)
+    else:
+        related_articles = []
+
+    ctx = {
+        "article": article,
+        "related_articles": related_articles,
+        "comments": comments,
+        "form": form,
+        "images": images,
+    }
+    return render(request, 'wiki_detail.html', ctx)
+
+def article_add(request):
+    '''Article create view for wiki articles'''
+    form = ArticleForm()
+    if request.method == 'POST':
+        form = ArticleForm(request.POST, request.FILES)
+        if form.is_valid():
+            article = form.save(commit=False)
+            if request.user.is_authenticated:
+                article.author = request.user.profile
+            else:
+                article.author = None
+            article.save()
+            return redirect('wiki:article-list')
+    
+    ctx = {'form': form}
+    return render(request, 'wiki_add.html', ctx)
+
+def article_update(request, pk):
+    '''Article update view for wiki articles'''
+    article = Article.objects.get(pk=pk)
+    if request.method == 'POST':
+        form = ArticleDetailForm(request.POST, request.FILES, instance=article)
+        if form.is_valid():
+            form.save() 
+        # Handle multiple image uploads
+        if 'image' in request.FILES:
+            for img in request.FILES.getlist('image'):
+                description = request.POST.get('description', '')
+                ArticleImage.objects.create(article=article, image=img, description=description)
+
+        return redirect('wiki:article-detail', pk=article.pk)
+    
+    else:
+        form = ArticleDetailForm(instance=article)
+
     ctx = {
-        "article" : article
+        'form': form,
+        'article': article
     }
-    return render(request, 'wiki_detail.html', ctx)
\ No newline at end of file
+    return render(request, 'wiki_update.html', ctx)


Reviews:
user: login: youth-of-may
body: I'll try to review/comment on the rest of the files later
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-12T23:24:36Z
user: login: youth-of-may
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-13T00:16:58Z
user: login: LegitAgent125
state: COMMENTED
author_association: OWNER
submitted_at: 2025-05-13T00:51:38Z
user: login: LegitAgent125
state: COMMENTED
author_association: OWNER
submitted_at: 2025-05-13T00:52:35Z
user: login: LegitAgent125
state: COMMENTED
author_association: OWNER
submitted_at: 2025-05-13T00:53:28Z
user: login: youth-of-may
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-13T07:10:28Z
user: login: youth-of-may
body: Good to go. I'll merge it na with the master branch later
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-05-13T08:03:07Z

Review comments:
diff_hunk: @@ -7,59 +7,28 @@
 	</head>
 	<body>
 		<header>
-			<nav>
-			<ul>
-				<li>
-					{% url 'homepage:index' as home_url %}
-					{% if request.path == home_url %}
-						<span>Home</span>
-					{% else %}
-						<a href="{{ home_url }}">Home</a>
-					{% endif %}
-				</li>
-				<li>
-					{% url 'merchstore:merch-list' as merch_url %}
-					{% if request.path == merch_url %}
-						<span>Merchstore</span>
-					{% else %}
-						<a href="{{ merch_url }}">Merchstore</a>
-					{% endif %}
-				</li>
-				<li>
-					{% url 'commissions:commission_list' as commissions_url %}
-					{% if request.path == commissions_url %}
-						<span>Commissions</span>
-					{% else %}
-						<a href="{{ commissions_url }}">Commissions</a>
-					{% endif %}
-				</li>
-				<li>
-					{% url 'wiki:article-list' as wiki_url %}
-					{% if request.path == wiki_url %}
-						<span>Wiki</span>
-					{% else %}
-						<a href="{{ wiki_url }}">Wiki</a>
-					{% endif %}
-				</li>
-				<li>
-					{% url 'blog:article_list' as blog_url %}
-					{% if request.path == blog_url %}
-						<span>Blog</span>
-					{% else %}
-						<a href="{{ blog_url }}">Blog</a>
-					{% endif %}
-				</li>
-				<li>
-					{% url 'forum:post-category' as forum_url %}
-					{% if request.path == forum_url %}
-						<span>Forum</span>
-					{% else %}
-						<a href="{{ forum_url }}">Forum</a>
-					{% endif %}
-				</li>
-			</ul>
-			</nav>
-			</header>
+			{% url 'homepage:index' as home_url %}
+			{% if request.path == home_url %}
+				<h1>Home</h1>
+			{% else %}
+				<a href="{% url 'homepage:index' %}" style="font-size: 24px; padding: 10px 20px; background-color: #007bff; color: white; text-decoration: none; border-radius: 5px; display: inline-block;">Home</a>
+			{% endif %}
+		</header>
+
+		{% if request.user.is_authenticated %}
+        	{% block user_status %}
+        		<p>Welcome, {{ request.user.username }}!</p>
+				<form method="POST" action="{% url 'logout' %}">
+					{% csrf_token %}
+					<button type="submit">Logout</button>
+				</form>
+        	{% endblock %}
+      	{% else %}
+        	{% block guest_status %}
+          		
+        	{% endblock %}
+      	{% endif %}
+		
path: hobbysite/templates/base.html
user: login: youth-of-may
body: undo. magkakacoconflict kasi sa design na ginawa ko sa design branch
created_at: 2025-05-12T23:16:59Z
author_association: COLLABORATOR
diff_hunk: @@ -9,10 +9,60 @@
 {% endblock %}
 
 {% block content %}
-<main>
-<h1>Add spiel here (HOME PAGE)</h1>
-</main>
-<footer>
-<h4>add developer information</h4>
-</footer>
+    <header>
+        <nav>
+        <ul>
+            <li>
+                {% url 'merchstore:merch-list' as merch_url %}
+                {% if request.path == merch_url %}
+                    <span>Merchstore</span>
+                {% else %}
+                    <a href="{{ merch_url }}">Merchstore</a>
+                {% endif %}
+            </li>
+            <li>
+                {% url 'commissions:commission_list' as commissions_url %}
+                {% if request.path == commissions_url %}
+                    <span>Commissions</span>
+                {% else %}
+                    <a href="{{ commissions_url }}">Commissions</a>
+                {% endif %}
+            </li>
+            <li>
+                {% url 'wiki:article-list' as wiki_url %}
+                {% if request.path == wiki_url %}
+                    <span>Wiki</span>
+                {% else %}
+                    <a href="{{ wiki_url }}">Wiki</a>
+                {% endif %}
+            </li>
+            <li>
+                {% url 'blog:article_list' as blog_url %}
+                {% if request.path == blog_url %}
+                    <span>Blog</span>
+                {% else %}
+                    <a href="{{ blog_url }}">Blog</a>
+                {% endif %}
+            </li>
+            <li>
+                {% url 'forum:post-category' as forum_url %}
+                {% if request.path == forum_url %}
+                    <span>Forum</span>
+                {% else %}
+                    <a href="{{ forum_url }}">Forum</a>
+                {% endif %}
+            </li>
+        </ul>
+    </nav>
+    </header>
+    <main>
+    <h1>Add spiel here (HOME PAGE)</h1>
+    </main>
+    <footer>
+    <h4>add developer information</h4>
+    </footer>
+    {% if user.is_authenticated %}
+    {% else %}
+        <p><a href="{% url 'login' %}">Login</a></p>
+    {% endif %}
path: hobbysite/homepage/templates/homepage/home.html
user: login: youth-of-may
body: undo rin ito. magkakaconflict since different ang code niya from the design branch
created_at: 2025-05-12T23:17:50Z
author_association: COLLABORATOR
diff_hunk: @@ -128,15 +128,15 @@
 
 STATIC_URL = 'static/'
 
-STATICFILES_DIRS = [
-    os.path.join(BASE_DIR, 'static'),
-]
path: hobbysite/hobbysite/settings.py
user: login: youth-of-may
body: bring this back. sinearch ko and need daw natin siya if merong global static folder (meron tayo since isang css file lang for everything ang gagamitin)
created_at: 2025-05-12T23:22:39Z
author_association: COLLABORATOR
diff_hunk: @@ -9,28 +10,70 @@ def __str__(self):
         return '{}: ArticleCategory'.format(self.name)
     
     def get_absolute_url(self):
-        return reverse('wiki:article-detail', args=[self.pk])
+        return reverse('wiki:article-list')
     
     class Meta:
         ordering = ['name']
-    
+        verbose_name = 'Article Category'
+        verbose_name_plural = 'Article Categories'
+
 class Article(models.Model):
     '''Article model for wiki articles'''
     title = models.CharField(max_length=255)
+    author = models.ForeignKey(
+        Profile,
+        on_delete=models.SET_NULL,
+        related_name="articles",
+        null=True,
+    )
     category = models.ForeignKey(
         ArticleCategory,
         on_delete=models.SET_NULL,
         related_name="articles",
path: hobbysite/wiki/models.py
user: login: youth-of-may
body: maybe try to use a different related name for this kasi baka magkaconflict sa author since they have the same related name
created_at: 2025-05-13T00:06:43Z
author_association: COLLABORATOR
diff_hunk: @@ -9,28 +10,70 @@ def __str__(self):
         return '{}: ArticleCategory'.format(self.name)
     
     def get_absolute_url(self):
-        return reverse('wiki:article-detail', args=[self.pk])
+        return reverse('wiki:article-list')
     
     class Meta:
         ordering = ['name']
-    
+        verbose_name = 'Article Category'
+        verbose_name_plural = 'Article Categories'
+
 class Article(models.Model):
     '''Article model for wiki articles'''
     title = models.CharField(max_length=255)
+    author = models.ForeignKey(
+        Profile,
+        on_delete=models.SET_NULL,
+        related_name="articles",
+        null=True,
+    )
     category = models.ForeignKey(
         ArticleCategory,
         on_delete=models.SET_NULL,
         related_name="articles",
-        null=True
+        null=True,
     )
     entry = models.TextField()
+    header_image = models.ImageField(upload_to='article_headers/', null=True, blank=True)
     created_on = models.DateTimeField(auto_now_add=True)
     updated_on = models.DateTimeField(auto_now=True)
     
     def __str__(self):
         return '{}: Article'.format(self.title)
     
+    def get_absolute_url(self):
+        return reverse('wiki:article-detail', args=[self.pk])
+    
     class Meta:
         ordering = ['-created_on']
+        
+class Comment(models.Model):
+    '''Comment model for wiki articles'''
+    author = models.ForeignKey(
+        Profile,
+        on_delete=models.SET_NULL,
+        related_name="comments",
+        null=True,
+    )
+    article = models.ForeignKey(
+        Article,
+        on_delete=models.CASCADE,
+        related_name="comments"
path: hobbysite/wiki/models.py
user: login: youth-of-may
body: same lang with my other comment. use a different name for this 
created_at: 2025-05-13T00:08:03Z
author_association: COLLABORATOR
diff_hunk: @@ -9,28 +10,70 @@ def __str__(self):
         return '{}: ArticleCategory'.format(self.name)
     
     def get_absolute_url(self):
-        return reverse('wiki:article-detail', args=[self.pk])
+        return reverse('wiki:article-list')
     
     class Meta:
         ordering = ['name']
-    
+        verbose_name = 'Article Category'
+        verbose_name_plural = 'Article Categories'
+
 class Article(models.Model):
     '''Article model for wiki articles'''
     title = models.CharField(max_length=255)
+    author = models.ForeignKey(
+        Profile,
+        on_delete=models.SET_NULL,
+        related_name="articles",
+        null=True,
+    )
     category = models.ForeignKey(
         ArticleCategory,
         on_delete=models.SET_NULL,
         related_name="articles",
-        null=True
+        null=True,
     )
     entry = models.TextField()
+    header_image = models.ImageField(upload_to='article_headers/', null=True, blank=True)
path: hobbysite/wiki/models.py
user: login: youth-of-may
body: not a comment but a question lang pero natest mo na ba kung saan 'to nagcrecreate ng folder? like inside the app or outside (like project-level)?
created_at: 2025-05-13T00:09:49Z
author_association: COLLABORATOR
diff_hunk: @@ -1,5 +1,6 @@
-from django.shortcuts import render
-from .models import ArticleCategory, Article
+from django.shortcuts import render, redirect
+from .models import ArticleCategory, Article, Comment, ArticleImage
+from .forms import ArticleForm, CommentForm, ArticleDetailForm, ArticleImageForm
 
     
 def article_list(request):
path: hobbysite/wiki/views.py
user: login: youth-of-may
body: If you tested it on your end and it worked as intended then I think good to go na yung views, urls, and templates mo.
created_at: 2025-05-13T00:16:50Z
author_association: COLLABORATOR
diff_hunk: @@ -9,28 +10,70 @@ def __str__(self):
         return '{}: ArticleCategory'.format(self.name)
     
     def get_absolute_url(self):
-        return reverse('wiki:article-detail', args=[self.pk])
+        return reverse('wiki:article-list')
     
     class Meta:
         ordering = ['name']
-    
+        verbose_name = 'Article Category'
+        verbose_name_plural = 'Article Categories'
+
 class Article(models.Model):
     '''Article model for wiki articles'''
     title = models.CharField(max_length=255)
+    author = models.ForeignKey(
+        Profile,
+        on_delete=models.SET_NULL,
+        related_name="articles",
+        null=True,
+    )
     category = models.ForeignKey(
         ArticleCategory,
         on_delete=models.SET_NULL,
         related_name="articles",
-        null=True
+        null=True,
     )
     entry = models.TextField()
+    header_image = models.ImageField(upload_to='article_headers/', null=True, blank=True)
path: hobbysite/wiki/models.py
user: login: LegitAgent125
body: Yes, it goes to the project level media folder, then it proceeds to go to a folder named article_headers. similar to the other wiki gallery, it goes directly to media as well at the project level, then goes to another folder, which I think is named article_images.
created_at: 2025-05-13T00:51:38Z
author_association: OWNER
diff_hunk: @@ -9,10 +9,60 @@
 {% endblock %}
 
 {% block content %}
-<main>
-<h1>Add spiel here (HOME PAGE)</h1>
-</main>
-<footer>
-<h4>add developer information</h4>
-</footer>
+    <header>
+        <nav>
+        <ul>
+            <li>
+                {% url 'merchstore:merch-list' as merch_url %}
+                {% if request.path == merch_url %}
+                    <span>Merchstore</span>
+                {% else %}
+                    <a href="{{ merch_url }}">Merchstore</a>
+                {% endif %}
+            </li>
+            <li>
+                {% url 'commissions:commission_list' as commissions_url %}
+                {% if request.path == commissions_url %}
+                    <span>Commissions</span>
+                {% else %}
+                    <a href="{{ commissions_url }}">Commissions</a>
+                {% endif %}
+            </li>
+            <li>
+                {% url 'wiki:article-list' as wiki_url %}
+                {% if request.path == wiki_url %}
+                    <span>Wiki</span>
+                {% else %}
+                    <a href="{{ wiki_url }}">Wiki</a>
+                {% endif %}
+            </li>
+            <li>
+                {% url 'blog:article_list' as blog_url %}
+                {% if request.path == blog_url %}
+                    <span>Blog</span>
+                {% else %}
+                    <a href="{{ blog_url }}">Blog</a>
+                {% endif %}
+            </li>
+            <li>
+                {% url 'forum:post-category' as forum_url %}
+                {% if request.path == forum_url %}
+                    <span>Forum</span>
+                {% else %}
+                    <a href="{{ forum_url }}">Forum</a>
+                {% endif %}
+            </li>
+        </ul>
+    </nav>
+    </header>
+    <main>
+    <h1>Add spiel here (HOME PAGE)</h1>
+    </main>
+    <footer>
+    <h4>add developer information</h4>
+    </footer>
+    {% if user.is_authenticated %}
+    {% else %}
+        <p><a href="{% url 'login' %}">Login</a></p>
+    {% endif %}
path: hobbysite/homepage/templates/homepage/home.html
user: login: LegitAgent125
body: okayu, pero just to be sure, naayos na un home page noh?
created_at: 2025-05-13T00:52:35Z
author_association: OWNER
diff_hunk: @@ -7,59 +7,28 @@
 	</head>
 	<body>
 		<header>
-			<nav>
-			<ul>
-				<li>
-					{% url 'homepage:index' as home_url %}
-					{% if request.path == home_url %}
-						<span>Home</span>
-					{% else %}
-						<a href="{{ home_url }}">Home</a>
-					{% endif %}
-				</li>
-				<li>
-					{% url 'merchstore:merch-list' as merch_url %}
-					{% if request.path == merch_url %}
-						<span>Merchstore</span>
-					{% else %}
-						<a href="{{ merch_url }}">Merchstore</a>
-					{% endif %}
-				</li>
-				<li>
-					{% url 'commissions:commission_list' as commissions_url %}
-					{% if request.path == commissions_url %}
-						<span>Commissions</span>
-					{% else %}
-						<a href="{{ commissions_url }}">Commissions</a>
-					{% endif %}
-				</li>
-				<li>
-					{% url 'wiki:article-list' as wiki_url %}
-					{% if request.path == wiki_url %}
-						<span>Wiki</span>
-					{% else %}
-						<a href="{{ wiki_url }}">Wiki</a>
-					{% endif %}
-				</li>
-				<li>
-					{% url 'blog:article_list' as blog_url %}
-					{% if request.path == blog_url %}
-						<span>Blog</span>
-					{% else %}
-						<a href="{{ blog_url }}">Blog</a>
-					{% endif %}
-				</li>
-				<li>
-					{% url 'forum:post-category' as forum_url %}
-					{% if request.path == forum_url %}
-						<span>Forum</span>
-					{% else %}
-						<a href="{{ forum_url }}">Forum</a>
-					{% endif %}
-				</li>
-			</ul>
-			</nav>
-			</header>
+			{% url 'homepage:index' as home_url %}
+			{% if request.path == home_url %}
+				<h1>Home</h1>
+			{% else %}
+				<a href="{% url 'homepage:index' %}" style="font-size: 24px; padding: 10px 20px; background-color: #007bff; color: white; text-decoration: none; border-radius: 5px; display: inline-block;">Home</a>
+			{% endif %}
+		</header>
+
+		{% if request.user.is_authenticated %}
+        	{% block user_status %}
+        		<p>Welcome, {{ request.user.username }}!</p>
+				<form method="POST" action="{% url 'logout' %}">
+					{% csrf_token %}
+					<button type="submit">Logout</button>
+				</form>
+        	{% endblock %}
+      	{% else %}
+        	{% block guest_status %}
+          		
+        	{% endblock %}
+      	{% endif %}
+		
path: hobbysite/templates/base.html
user: login: LegitAgent125
body: just did this as a placeholder para makita ko if gumagana un login and not logged in user features. Undoing.
created_at: 2025-05-13T00:53:28Z
author_association: OWNER
diff_hunk: @@ -9,10 +9,60 @@
 {% endblock %}
 
 {% block content %}
-<main>
-<h1>Add spiel here (HOME PAGE)</h1>
-</main>
-<footer>
-<h4>add developer information</h4>
-</footer>
+    <header>
+        <nav>
+        <ul>
+            <li>
+                {% url 'merchstore:merch-list' as merch_url %}
+                {% if request.path == merch_url %}
+                    <span>Merchstore</span>
+                {% else %}
+                    <a href="{{ merch_url }}">Merchstore</a>
+                {% endif %}
+            </li>
+            <li>
+                {% url 'commissions:commission_list' as commissions_url %}
+                {% if request.path == commissions_url %}
+                    <span>Commissions</span>
+                {% else %}
+                    <a href="{{ commissions_url }}">Commissions</a>
+                {% endif %}
+            </li>
+            <li>
+                {% url 'wiki:article-list' as wiki_url %}
+                {% if request.path == wiki_url %}
+                    <span>Wiki</span>
+                {% else %}
+                    <a href="{{ wiki_url }}">Wiki</a>
+                {% endif %}
+            </li>
+            <li>
+                {% url 'blog:article_list' as blog_url %}
+                {% if request.path == blog_url %}
+                    <span>Blog</span>
+                {% else %}
+                    <a href="{{ blog_url }}">Blog</a>
+                {% endif %}
+            </li>
+            <li>
+                {% url 'forum:post-category' as forum_url %}
+                {% if request.path == forum_url %}
+                    <span>Forum</span>
+                {% else %}
+                    <a href="{{ forum_url }}">Forum</a>
+                {% endif %}
+            </li>
+        </ul>
+    </nav>
+    </header>
+    <main>
+    <h1>Add spiel here (HOME PAGE)</h1>
+    </main>
+    <footer>
+    <h4>add developer information</h4>
+    </footer>
+    {% if user.is_authenticated %}
+    {% else %}
+        <p><a href="{% url 'login' %}">Login</a></p>
+    {% endif %}
path: hobbysite/homepage/templates/homepage/home.html
user: login: youth-of-may
body: yup
created_at: 2025-05-13T07:10:28Z
author_association: COLLABORATOR

PR comments:
user: login: LegitAgent125
created_at: 2025-05-13T01:19:28Z
body: still fixing some stuff, i.e. the placeholder HTML stuff.
author_association: OWNER
user: login: youth-of-may
created_at: 2025-05-13T13:42:35Z
body: Okay so I tried to run the app on my end and I think it doesn't separate yung articles created by the logged in user from all articles (like nasa iisang place lang siya lagi)

Logged in user is the creator of the article:
![Screenshot 2025-05-13 214042](https://github.com/user-attachments/assets/0110fd75-5f93-4322-b4d3-15be0ae398c4)



Logged in user is not the creator of the article:
![Screenshot 2025-05-13 214158](https://github.com/user-attachments/assets/53e6324d-0c77-4297-b444-4e53cd8a60bd)

author_association: COLLABORATOR
user: login: youth-of-may
created_at: 2025-05-13T13:51:17Z
body: Also, can you add an admin for the other models? Yung important lang. Kahit wala na siguro yung sa image
author_association: COLLABORATOR
user: login: LegitAgent125
created_at: 2025-05-14T14:27:13Z
body: I think I'm pretty sure na dapat ganyan. It is separated by headings, I don't think necessarily sites.

author_association: OWNER