From b7aa1d8c57b70acccff704e4763eadd8a4a84900 Mon Sep 17 00:00:00 2001 From: Bobby Date: Sat, 12 Nov 2022 13:41:17 -0500 Subject: fixed few IE5 render issues, announcements auto add now false --- .../0004_alter_announcement_created_at.py | 18 ++++++++++++++ announcements/models.py | 8 +++++- static/css/main.css | 19 +++++++++------ static/images/site/Banner.gif | Bin 0 -> 54395 bytes templates/blog/partials/base.html | 27 ++++++++++++--------- 5 files changed, 53 insertions(+), 19 deletions(-) create mode 100644 announcements/migrations/0004_alter_announcement_created_at.py create mode 100644 static/images/site/Banner.gif diff --git a/announcements/migrations/0004_alter_announcement_created_at.py b/announcements/migrations/0004_alter_announcement_created_at.py new file mode 100644 index 00000000..e74ab4f5 --- /dev/null +++ b/announcements/migrations/0004_alter_announcement_created_at.py @@ -0,0 +1,18 @@ +# Generated by Django 4.0.6 on 2022-11-12 18:37 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('announcements', '0003_rename_body_announcement_content_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='announcement', + name='created_at', + field=models.DateTimeField(), + ), + ] diff --git a/announcements/models.py b/announcements/models.py index c836fe5d..58e434ea 100644 --- a/announcements/models.py +++ b/announcements/models.py @@ -1,10 +1,11 @@ +from django.utils import timezone from django.db import models from django.conf import settings # Create your models here. class Announcement(models.Model): content = models.TextField() - created_at = models.DateTimeField(auto_now_add=True) + created_at = models.DateTimeField() author = models.ForeignKey( settings.AUTH_USER_MODEL, on_delete=models.CASCADE, @@ -12,6 +13,11 @@ class Announcement(models.Model): is_public = models.BooleanField(default=False) is_new = models.BooleanField(default=True) + def save(self, *args, **kwargs): + if not self.id: + self.created_at = timezone.now() + return super(Announcement, self).save(*args, **kwargs) + def __str__(self): return self.content diff --git a/static/css/main.css b/static/css/main.css index 4bd4be2d..62093d11 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -11,11 +11,11 @@ body { } .header { - background-image: url("../images/site/banner.png"); + background-image: url("../images/site/banner.gif"); background-repeat: no-repeat; background-position: center; width: 1000px; - height: 300px; + height: 333px; margin: auto; } @@ -288,19 +288,24 @@ summary { border-left: 2px solid #6666FF; border-right: 2px solid #00007C; border-bottom: 2px solid #00007C; - font-family: 'TopNavbar', serif; - font-size: 12px; position: relative; - padding: 5px 10px; + padding: 2px 10px 5px 10px; + text-align: center; +} + +.navitem a { + color: #FFFFFF; text-decoration: none; + font-size: 12px; + font-family: 'TopNavbar', serif; } .new{ - /* Add a "new" image gif to top right corner. */ - /* content: url('../images/gifs/new.gif'); */ position: absolute; top: -9px; right: -10px; + width: 30px !important; + height: 15px !important; } .topnav > li > a { diff --git a/static/images/site/Banner.gif b/static/images/site/Banner.gif new file mode 100644 index 00000000..3ee73f43 Binary files /dev/null and b/static/images/site/Banner.gif differ diff --git a/templates/blog/partials/base.html b/templates/blog/partials/base.html index f33c6ffe..a7b85f9a 100644 --- a/templates/blog/partials/base.html +++ b/templates/blog/partials/base.html @@ -36,20 +36,25 @@
-
- - Source Code - - - {% if user.is_authenticated %} - Logout - {% endif %} -
-
+
+ + + + + {% if user.is_authenticated %} + + {% endif %} + +
+
+
- +
{% include 'blog/partials/sidebar.html' %}
{% block content %} {% endblock %}
{% block content %} {% endblock %}
-- cgit v1.2.3