diff options
| -rw-r--r-- | announcements/migrations/0004_alter_announcement_created_at.py | 18 | ||||
| -rw-r--r-- | announcements/models.py | 8 | ||||
| -rw-r--r-- | static/css/main.css | 19 | ||||
| -rw-r--r-- | static/images/site/Banner.gif | bin | 0 -> 54395 bytes | |||
| -rw-r--r-- | templates/blog/partials/base.html | 27 |
5 files changed, 53 insertions, 19 deletions
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 Binary files differnew file mode 100644 index 00000000..3ee73f43 --- /dev/null +++ b/static/images/site/Banner.gif 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 @@ </head> <body> <div class="header"></div> - <div style="width: 1000px; margin: 20px auto; text-align: right;"> - <a href="{% url 'dev_status:repo' 'thatcomputerscientist' %}" class="navitem"> - Source Code - <img class="new" src="{% static 'images/gifs/new.gif' %}" border="0"/> - </a> - {% if user.is_authenticated %} - <a href="{% url 'users:logout' %}" class="navitem">Logout</a> - {% endif %} - <hr /> - </div> <center> + <div style="width: 1000px;" align="right"> + <table> + <tr> + <td class="navitem"> + <a href="{% url 'dev_status:repo' 'thatcomputerscientist' %}">Source Code</a> + <img class="new" src="{% static 'images/gifs/new.gif' %}" border="0"/> + </td> + <td></td> + {% if user.is_authenticated %} + <td class="navitem"><a href="{% url 'users:logout' %}">Logout</a></td> + {% endif %} + </tr> + </table> + <hr /> + </div> <table style="table-layout: fixed; width: 1000px;"> <td width="25%" style="vertical-align:top;">{% include 'blog/partials/sidebar.html' %}</td> - <td><div class="content" style="vertical-align:top;">{% block content %} {% endblock %}</div></td> + <td style="vertical-align:top;"><div class="content">{% block content %} {% endblock %}</div></td> </table> </center> <div style="width: 1000px; margin: 0px auto 40px auto"> |
