diff options
| author | Bobby <[email protected]> | 2022-10-02 11:55:14 -0400 |
|---|---|---|
| committer | Bobby <[email protected]> | 2022-10-02 11:55:14 -0400 |
| commit | 1e624f30c11e22699e6f6933b18a7a257a2ab73b (patch) | |
| tree | 2dbe7838a7ada5e1cd61339119d6b43de3e148d5 | |
| parent | fb1225d85d9291a394e9b371231b02a85272d121 (diff) | |
| download | thatcomputerscientist-1e624f30c11e22699e6f6933b18a7a257a2ab73b.tar.xz thatcomputerscientist-1e624f30c11e22699e6f6933b18a7a257a2ab73b.zip | |
Added announcements
| -rw-r--r-- | announcements/__init__.py | 0 | ||||
| -rw-r--r-- | announcements/admin.py | 6 | ||||
| -rw-r--r-- | announcements/apps.py | 6 | ||||
| -rw-r--r-- | announcements/migrations/0001_initial.py | 29 | ||||
| -rw-r--r-- | announcements/migrations/0002_rename_date_announcement_created_at.py | 18 | ||||
| -rw-r--r-- | announcements/migrations/__init__.py | 0 | ||||
| -rw-r--r-- | announcements/models.py | 18 | ||||
| -rw-r--r-- | announcements/tests.py | 3 | ||||
| -rw-r--r-- | announcements/views.py | 3 | ||||
| -rw-r--r-- | static/css/main.css | 4 | ||||
| -rw-r--r-- | static/images/gifs/underconstruction.gif | bin | 0 -> 5554 bytes | |||
| -rw-r--r-- | static/images/gifs/update.gif | bin | 0 -> 43010 bytes | |||
| -rw-r--r-- | static/images/logo/logo.png (renamed from static/images/logo.png) | bin | 14179 -> 14179 bytes | |||
| -rw-r--r-- | static/images/site/banner.png (renamed from static/images/banner.png) | bin | 206270 -> 206270 bytes | |||
| -rw-r--r-- | static/images/site/bg.jpeg (renamed from static/images/bg.jpeg) | bin | 131609 -> 131609 bytes | |||
| -rw-r--r-- | templates/blog/home.html | 33 | ||||
| -rw-r--r-- | thatcomputerscientist/settings.py | 1 |
17 files changed, 115 insertions, 6 deletions
diff --git a/announcements/__init__.py b/announcements/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/announcements/__init__.py diff --git a/announcements/admin.py b/announcements/admin.py new file mode 100644 index 00000000..7121e093 --- /dev/null +++ b/announcements/admin.py @@ -0,0 +1,6 @@ +from django.contrib import admin + +# Register your models here. +from .models import Announcement + +admin.site.register(Announcement) diff --git a/announcements/apps.py b/announcements/apps.py new file mode 100644 index 00000000..0fe0715d --- /dev/null +++ b/announcements/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class AnnouncementsConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'announcements' diff --git a/announcements/migrations/0001_initial.py b/announcements/migrations/0001_initial.py new file mode 100644 index 00000000..aca74adf --- /dev/null +++ b/announcements/migrations/0001_initial.py @@ -0,0 +1,29 @@ +# Generated by Django 4.0.6 on 2022-10-02 15:22 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Announcement', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=100)), + ('body', models.TextField()), + ('date', models.DateTimeField(auto_now_add=True)), + ('is_public', models.BooleanField(default=False)), + ('is_new', models.BooleanField(default=True)), + ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + ), + ] diff --git a/announcements/migrations/0002_rename_date_announcement_created_at.py b/announcements/migrations/0002_rename_date_announcement_created_at.py new file mode 100644 index 00000000..89943636 --- /dev/null +++ b/announcements/migrations/0002_rename_date_announcement_created_at.py @@ -0,0 +1,18 @@ +# Generated by Django 4.0.6 on 2022-10-02 15:23 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('announcements', '0001_initial'), + ] + + operations = [ + migrations.RenameField( + model_name='announcement', + old_name='date', + new_name='created_at', + ), + ] diff --git a/announcements/migrations/__init__.py b/announcements/migrations/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/announcements/migrations/__init__.py diff --git a/announcements/models.py b/announcements/models.py new file mode 100644 index 00000000..06dea701 --- /dev/null +++ b/announcements/models.py @@ -0,0 +1,18 @@ +from django.db import models +from django.conf import settings +# Create your models here. + +class Announcement(models.Model): + title = models.CharField(max_length=100) + body = models.TextField() + created_at = models.DateTimeField(auto_now_add=True) + author = models.ForeignKey( + settings.AUTH_USER_MODEL, + on_delete=models.CASCADE, + ) + is_public = models.BooleanField(default=False) + is_new = models.BooleanField(default=True) + + def __str__(self): + return self.title + diff --git a/announcements/tests.py b/announcements/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/announcements/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/announcements/views.py b/announcements/views.py new file mode 100644 index 00000000..91ea44a2 --- /dev/null +++ b/announcements/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/static/css/main.css b/static/css/main.css index 5db4ab57..1cf23d41 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -1,5 +1,5 @@ body { - background-image: url("../images/bg.jpeg"); + background-image: url("../images/site/bg.jpeg"); background-size: cover; background-repeat: no-repeat; background-attachment: fixed; @@ -12,7 +12,7 @@ body { } .header { - background-image: url("../images/banner.png"); + background-image: url("../images/site/banner.png"); background-size: contain; background-repeat: no-repeat; background-position: center; diff --git a/static/images/gifs/underconstruction.gif b/static/images/gifs/underconstruction.gif Binary files differnew file mode 100644 index 00000000..a8e4ad6c --- /dev/null +++ b/static/images/gifs/underconstruction.gif diff --git a/static/images/gifs/update.gif b/static/images/gifs/update.gif Binary files differnew file mode 100644 index 00000000..4ff3a313 --- /dev/null +++ b/static/images/gifs/update.gif diff --git a/static/images/logo.png b/static/images/logo/logo.png Binary files differindex 3546d8b2..3546d8b2 100644 --- a/static/images/logo.png +++ b/static/images/logo/logo.png diff --git a/static/images/banner.png b/static/images/site/banner.png Binary files differindex b437579f..b437579f 100644 --- a/static/images/banner.png +++ b/static/images/site/banner.png diff --git a/static/images/bg.jpeg b/static/images/site/bg.jpeg Binary files differindex 396e3bca..396e3bca 100644 --- a/static/images/bg.jpeg +++ b/static/images/site/bg.jpeg diff --git a/templates/blog/home.html b/templates/blog/home.html index 3c9880de..7fc4bcfc 100644 --- a/templates/blog/home.html +++ b/templates/blog/home.html @@ -1,5 +1,11 @@ {% extends 'blog/partials/base.html' %} {% block content %} +{% load static %} <div class="main"> + <div style="text-align:center;"> + <img src="{% static 'images/gifs/underconstruction.gif' %}" style="" height="120px"> + {% comment %} <img src="https://anlucas.neocities.org/happynewyear.gif" style="" height="60px"> {% endcomment %} + </div> + <br /> <div class="alert"> {% comment %} <h1 class="center">That Computer Scientist</h1> @@ -12,12 +18,31 @@ <a href="/contact">Contact</a> page. Please use the sidebar to navigate the site. </p> + <p> + This website is a work in progress. I am currently working on adding more + features to this website. I aim to build a retro looking personal website, + where I will share my articles and Ideas, which will be built entirely + around the idea of "collaborative writing" — where anyone can write new + articles or edit existing ones. + </p> </div> <br /> - <div style="text-align:center;"> - <img src="https://exo.pet/images/wip/webweaving.gif" style="" height="60px"> - <img src="https://anlucas.neocities.org/happynewyear.gif" style="" height="60px"> - </div> + <fieldset> + <legend> + <img src = "{% static 'images/gifs/update.gif' %}" height="16px"> + </legend> + <marquee behavior="scroll" direction="up" height="250" scrollamount="2" scrolldelay="10" onmouseover="this.stop()" onmouseout="this.start()"> + <p> + <b>2021-01-01</b> - Happy New Year! I hope you all had a great holiday + season. I am excited to announce that I have started a new blog series + called <a href="/blog/series/programming-projects">Programming + Projects</a>. This series will be a collection of posts that will + document my journey as I learn new programming languages and frameworks. + I will be using these projects to learn new skills and to build my + portfolio. I hope you enjoy this new series! + </p> + </marquee> + </fieldset> {% if recent_posts %} <h3 style="margin-bottom: 0px"><em>Recent Posts</em></h3> <hr /> diff --git a/thatcomputerscientist/settings.py b/thatcomputerscientist/settings.py index 43dbdd17..d0fe2ff5 100644 --- a/thatcomputerscientist/settings.py +++ b/thatcomputerscientist/settings.py @@ -50,6 +50,7 @@ INSTALLED_APPS = [ 'userpages', 'blog_admin', 'dev_status', + 'announcements', ] MIDDLEWARE = [ |
