aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-11-12 03:48:19 -0500
committerBobby <[email protected]>2022-11-12 03:48:19 -0500
commite1b1b47269822663aef63d1e7d607426fcdaae1c (patch)
tree5748981909d8b03d34bec6d4250b7e1a1411aa90
parent6d365f24e6b37128b302b1f11cc843f67a9d94f2 (diff)
downloadthatcomputerscientist-e1b1b47269822663aef63d1e7d607426fcdaae1c.tar.xz
thatcomputerscientist-e1b1b47269822663aef63d1e7d607426fcdaae1c.zip
fixing homepage for older browsers
-rw-r--r--static/css/fonts.css2
-rw-r--r--static/css/main.css60
-rw-r--r--static/images/site/banner.pngbin206270 -> 170661 bytes
-rw-r--r--static/images/site/bg.gifbin0 -> 1841 bytes
-rw-r--r--static/images/site/bg.jpegbin131609 -> 0 bytes
-rw-r--r--templates/blog/partials/base.html57
-rw-r--r--templates/blog/partials/sidebar.html54
-rw-r--r--thatcomputerscientist/settings.py6
8 files changed, 63 insertions, 116 deletions
diff --git a/static/css/fonts.css b/static/css/fonts.css
index 58e4199f..c035afaf 100644
--- a/static/css/fonts.css
+++ b/static/css/fonts.css
@@ -1,6 +1,6 @@
@font-face {
font-family: 'TopNavbar';
- src: url('../fonts/pdos.ttf');
+ src: url('../fonts/pdos.ttf') format('truetype');
font-weight: normal;
font-style: normal;
} \ No newline at end of file
diff --git a/static/css/main.css b/static/css/main.css
index 4b6fde36..4bd4be2d 100644
--- a/static/css/main.css
+++ b/static/css/main.css
@@ -1,7 +1,6 @@
body {
- background-image: url("../images/site/bg.jpeg");
- background-size: cover;
- background-repeat: no-repeat;
+ background-image: url("../images/site/bg.gif");
+ background-repeat: repeat;
background-attachment: fixed;
background-position: center;
font-family: serif;
@@ -13,7 +12,6 @@ body {
.header {
background-image: url("../images/site/banner.png");
- background-size: contain;
background-repeat: no-repeat;
background-position: center;
width: 1000px;
@@ -21,22 +19,8 @@ body {
margin: auto;
}
-.mc {
- display: inline-flex;
- flex-direction: row;
- flex-wrap: wrap;
- width: 1000px;
- border: solid 1px cecece;
- padding: 2px;
- text-align: initial;
-}
-
.sidebar {
- /* padding: 20px; */
- overflow-x: hidden;
overflow-y: auto;
- min-width: 15rem;
- max-width: 15rem;
}
/* COLORS SECTION ACCORIDING TO DARK MODE */
@@ -61,27 +45,10 @@ fieldset, legend {
color: #cecece;
}
-
-.sidebar-lg {
- min-width: 20rem;
- max-width: 20rem;
-}
-
-.sidebar-bg-blue {
- background-color: #bad9ff;
-}
-
-.sidebar-border {
- border: 1px solid #e6e6e6;
-}
-
-
.content {
- flex: 1;
padding: 9px 20px 20px 20px;
overflow-x: hidden;
overflow-y: auto;
- /* min-height: calc(100vh - 40px); */
}
.title:visited {
@@ -133,13 +100,13 @@ fieldset {
padding: 10px 20px;
}
-nav > ul {
+.sidenav {
list-style: none;
padding: 0;
margin: 0;
}
-nav > ul > li {
+.sidenavitem {
margin: 5px 0;
}
@@ -312,28 +279,25 @@ summary {
max-width: 100%;
}
-.topnav {
- list-style: none;
- padding: 0;
- margin: 0;
- text-align: right;
-}
-
-.topnav > li {
+.navitem {
display: inline-block;
margin-left: 10px;
background: #0000FF;
+ color: #FFFFFF;
border-top: 2px solid #6666FF;
border-left: 2px solid #6666FF;
border-right: 2px solid #00007C;
border-bottom: 2px solid #00007C;
- font-family: 'TopNavbar', sans-serif;
+ font-family: 'TopNavbar', serif;
+ font-size: 12px;
position: relative;
+ padding: 5px 10px;
+ text-decoration: none;
}
-li.new::before{
+.new{
/* Add a "new" image gif to top right corner. */
- content: url('../images/gifs/new.gif');
+ /* content: url('../images/gifs/new.gif'); */
position: absolute;
top: -9px;
right: -10px;
diff --git a/static/images/site/banner.png b/static/images/site/banner.png
index b437579f..64225037 100644
--- a/static/images/site/banner.png
+++ b/static/images/site/banner.png
Binary files differ
diff --git a/static/images/site/bg.gif b/static/images/site/bg.gif
new file mode 100644
index 00000000..65465770
--- /dev/null
+++ b/static/images/site/bg.gif
Binary files differ
diff --git a/static/images/site/bg.jpeg b/static/images/site/bg.jpeg
deleted file mode 100644
index 396e3bca..00000000
--- a/static/images/site/bg.jpeg
+++ /dev/null
Binary files differ
diff --git a/templates/blog/partials/base.html b/templates/blog/partials/base.html
index e3bf685a..f33c6ffe 100644
--- a/templates/blog/partials/base.html
+++ b/templates/blog/partials/base.html
@@ -36,39 +36,38 @@
</head>
<body>
<div class="header"></div>
- <div style="width: 1000px; margin: 20px auto;">
- <ul class="topnav">
- {% comment %} <img src="{% static 'images/gifs/new.gif' %}" alt="new" style="margin-left: 5px;"> {% endcomment %}
- <li class="new"><a href="{% url 'dev_status:repo' 'thatcomputerscientist' %}">
- Source Code
- </a></li>
- {% if user.is_authenticated %}
- <li><a href="{% url 'users:logout' %}">Logout</a></li>
- {% endif %}
- </ul>
- <hr>
+ <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>
- <div class="mc">
- {% include 'blog/partials/sidebar.html' %}
- <div class="content">{% block content %} {% endblock %}</div>
- {% comment %} <div class="sidebar sidebar-lg" style="border-left: dotted 1px black">
-
- </div> {% endcomment %}
- </div>
- <div style="width: 1000px; margin: 0px auto 40px auto;">
- <hr style="margin: 2rem 0;">
- <footer style="text-align: center;">
- {% load ad %}
- {% for i in '12345789'|make_list %}
- <img src="{{'buttons'|ad }}" alt="Ad" width="88px" height="31px">
+ <center>
+ <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>
+ </table>
+ </center>
+ <div style="width: 1000px; margin: 0px auto 40px auto">
+ <hr style="margin: 2rem 0" />
+ <footer style="text-align: center">
+ {% load ad %} {% for i in '12345789'|make_list %}
+ <img src="{{'buttons'|ad }}" alt="Ad" width="88px" height="31px" />
{% endfor %}
- <br>
+ <br />
{% for i in '12345'|make_list %}
- <img src="{{'buttons'|ad }}" alt="Ad" width="88px" height="31px">
+ <img src="{{'buttons'|ad }}" alt="Ad" width="88px" height="31px" />
{% endfor %}
- <br>
- <br>
- &copy; {% now "Y" %} That Computer Scientist. Source code available on <a href="https://github.com/luciferreeves/thatcomputerscientist">GitHub</a>.
+ <br />
+ <br />
+ &copy; {% now "Y" %} That Computer Scientist. Source code available on
+ <a href="https://github.com/luciferreeves/thatcomputerscientist"
+ >GitHub</a
+ >.
</footer>
</div>
</body>
diff --git a/templates/blog/partials/sidebar.html b/templates/blog/partials/sidebar.html
index 8bf55602..3eb79161 100644
--- a/templates/blog/partials/sidebar.html
+++ b/templates/blog/partials/sidebar.html
@@ -1,10 +1,5 @@
{% load static %}
<div class="sidebar">
-
- {% comment %} <a href="/" class="title">
- <img src="{% static 'images/logo.png' %}" alt="That Computer Scientist Logo" width="10rem" height="3.23rem">
- <!-- Login Box -->
- </a> {% endcomment %}
<div class="lgn-area">
<div>
{% if user.is_authenticated %}
@@ -14,9 +9,9 @@
<form method="post" action="{% url 'users:login' %} ">
{% csrf_token %}
<label for="username">Username</label>
- <input type="text" id="username" name="username" placeholder="Username" autocomplete="off">
+ <input type="text" id="username" name="username" placeholder="Username" autocomplete="off" value="{{ request.GET.username }}" required>
<label for="password">Password</label>
- <input type="password" id="password" name="password" placeholder="Password">
+ <input type="password" id="password" name="password" placeholder="Password" autocomplete="off" required>
<input type="hidden" name="next" value="{{ request.path }}">
<input type="submit" value="Login">
</form>
@@ -41,19 +36,19 @@
{% else %}
<legend>Navigation</legend>
{% endif %}
- <nav>
- <ul>
- <li><a href="/">Home</a></li>
- <li><a href="/about">About</a></li>
- <li><a href="/contact">Contact</a></li>
- <li><a href="/blog">Blog</a></li>
+ <div>
+ <ul class="sidenav">
+ <li class="sidenavitem"><a href="/">Home</a></li>
+ <li class="sidenavitem"><a href="/about">About</a></li>
+ <li class="sidenavitem"><a href="/contact">Contact</a></li>
+ <li class="sidenavitem"><a href="/blog">Blog</a></li>
{% if user.is_authenticated %}
- <li><a href="{% url 'blog:account' %}">My Account</a></li>
+ <li class="sidenavitem"><a href="{% url 'blog:account' %}">My Account</a></li>
{% else %}
- <li><a href="/register">Register</a></li>
+ <li class="sidenavitem"><a href="/register">Register</a></li>
{% endif %}
</ul>
- </nav>
+ </div>
</fieldset>
<br>
<div class="ad">
@@ -64,16 +59,16 @@
<fieldset>
<legend>Admin</legend>
<nav>
- <ul>
+ <ul class="sidenav">
{% if user.is_superuser %}
- <li><a href="{% url 'admin:index' %}">Admin Area</a></li>
+ <li class="sidenavitem"><a href="{% url 'admin:index' %}">Admin Area</a></li>
{% endif %}
- <li><a href="{% url 'blog-admin:users' %}">Manage Users</a></li>
- <li><a href="{% url 'blog-admin:posts' %}">Manage Posts</a></li>
- <li><a href="{% url 'blog-admin:comments' %}">Manage Comments</a></li>
- <li><a href="{% url 'blog-admin:categories' %}">Manage Categories</a></li>
- <li><a href="{% url 'blog-admin:tags' %}">Manage Tags</a></li>
- <li><a href="{% url 'blog-admin:new' %}">Create New Post</a></li>
+ <li class="sidenavitem"><a href="{% url 'blog-admin:users' %}">Manage Users</a></li>
+ <li class="sidenavitem"><a href="{% url 'blog-admin:posts' %}">Manage Posts</a></li>
+ <li class="sidenavitem"><a href="{% url 'blog-admin:comments' %}">Manage Comments</a></li>
+ <li class="sidenavitem"><a href="{% url 'blog-admin:categories' %}">Manage Categories</a></li>
+ <li class="sidenavitem"><a href="{% url 'blog-admin:tags' %}">Manage Tags</a></li>
+ <li class="sidenavitem"><a href="{% url 'blog-admin:new' %}">Create New Post</a></li>
</ul>
</nav>
{% endif %}
@@ -82,14 +77,3 @@
<br>
</div>
</div>
-
-<script>
- // get the username parameter from the url
- var username = new URLSearchParams(window.location.search).get('username');
- // if the username parameter is not empty, set the username input to the value of the username parameter
- if (username) {
- document.getElementsByName("username").forEach(function(input) {
- input.value = username;
- });
- }
-</script>
diff --git a/thatcomputerscientist/settings.py b/thatcomputerscientist/settings.py
index 16e481d9..36932259 100644
--- a/thatcomputerscientist/settings.py
+++ b/thatcomputerscientist/settings.py
@@ -31,9 +31,9 @@ SECRET_KEY = os.getenv('AUTHORIZATION_STRING')
DEBUG = True if os.getenv('ENVIRONMENT') == 'development' else False
ALLOWED_HOSTS = ["*"]
-CSRF_TRUSTED_ORIGINS = ['http://*.localhost', 'https://*.thatcomputerscientist.com', 'http://*.thatcomputerscientist.com']
-SESSION_COOKIE_DOMAIN = "localhost" if os.getenv('ENVIRONMENT') == 'development' else ".thatcomputerscientist.com"
-DOMAIN_NAME = "localhost" if os.getenv('ENVIRONMENT') == 'development' else "thatcomputerscientist.com"
+CSRF_TRUSTED_ORIGINS = ['http://*.67.20.192.102', 'https://*.thatcomputerscientist.com', 'http://*.thatcomputerscientist.com']
+SESSION_COOKIE_DOMAIN = "67.20.192.102" if os.getenv('ENVIRONMENT') == 'development' else ".thatcomputerscientist.com"
+DOMAIN_NAME = "67.20.192.102" if os.getenv('ENVIRONMENT') == 'development' else "thatcomputerscientist.com"
# Application definition