diff --git a/articles/__pycache__/forms.cpython-311.pyc b/articles/__pycache__/forms.cpython-311.pyc index 38ab43a..4204f86 100644 Binary files a/articles/__pycache__/forms.cpython-311.pyc and b/articles/__pycache__/forms.cpython-311.pyc differ diff --git a/articles/__pycache__/models.cpython-311.pyc b/articles/__pycache__/models.cpython-311.pyc index 6378e6b..478daec 100644 Binary files a/articles/__pycache__/models.cpython-311.pyc and b/articles/__pycache__/models.cpython-311.pyc differ diff --git a/articles/__pycache__/views.cpython-311.pyc b/articles/__pycache__/views.cpython-311.pyc index da9aa54..ae4de6c 100644 Binary files a/articles/__pycache__/views.cpython-311.pyc and b/articles/__pycache__/views.cpython-311.pyc differ diff --git a/articles/migrations/__pycache__/0003_article_author.cpython-311.pyc b/articles/migrations/__pycache__/0003_article_author.cpython-311.pyc index e16aebe..d2f4d35 100644 Binary files a/articles/migrations/__pycache__/0003_article_author.cpython-311.pyc and b/articles/migrations/__pycache__/0003_article_author.cpython-311.pyc differ diff --git a/articles/templates/articles/article.html b/articles/templates/articles/article.html index 366ad8b..e2d6f1f 100644 --- a/articles/templates/articles/article.html +++ b/articles/templates/articles/article.html @@ -6,6 +6,7 @@

{{ article.title }}

{{ article.snippet }}

{{ article.date }}

+

Written by {{ article.author.username }}

{% endfor %} diff --git a/assets/style.css b/assets/style.css index 14ed2de..5608bb5 100644 --- a/assets/style.css +++ b/assets/style.css @@ -20,6 +20,129 @@ a, a:hover, a:visited{ color: #fff; } -p*{ - width: 50%; -} \ No newline at end of file +.wrapper{ + max-width: 80%; + margin: 0 auto; +} + +div.wrapper h1{ + text-align: center; + margin: 100px auto; + font-size: 2.4em; +} + +header{ + display: grid; + grid-template-columns: 1fr 1fr; + padding: 3% 0; +} + +nav{ + justify-self: end; +} + +nav li{ + display: inline-block; + margin-left: 35px; +} + +nav button{ + background: none; + color: #b0b0b0; + cursor: pointer; + border: 0; + font-size: 1em; +} + +.articles{ + display: grid; + grid-template-columns: 1fr 1fr 1fr; + grid-gap: 30px; +} + +.article{ + padding: 6px; + padding-bottom: 50px; + border: 3px solid #2d0800; + position: relative; +} + +.article .author{ + padding: 8px; + background: #2d0800; + text-align: center; + position: absolute; + right: 0; + bottom: 0; + margin: 0; +} + +.article h2{ + font-size: 1.2em; +} + +.article-detail .article{ + padding: 0; +} + +.article-detail .article img{ + max-width: 80%; + padding-left: 10%; +} + +.article-detail .article h2{ + text-align: center; + margin: 15px auto; + font-size: 2.5em; +} + +.article-detail .article p{ + text-align: center; +} + +.site-form{ + margin-top: 50px; + border: 1px solid #2d0800; + padding: 20px; +} + +.site-form input, .site-form textarea{ + display: block; + margin: 15px 0 0 0; + padding: 10px; +} + +.site-form input[type="submit"]{ + background: #2d0800; + border: 0; + color: #fff; + font-size: 1.3em; + border-radius: 5px; + margin: 10px 0; +} + +a.highlight{ + border: 1px solid #2d0800; + padding: 10px; + border-radius: 5px; + color: #2d0800 +} + +.helptext, .helptext ul{ + margin: 0 auto; + color: #2ee7ff; + font-size: 0.85em; + display: block; +} + +.errorlist li{ + padding: 10px; + list-style-type: none; + border: 1px solid #2ee7ff; + color: #2ee7ff; + margin: 10px 0; +} + +.errorlist{ + padding: 0; +} diff --git a/db.sqlite3 b/db.sqlite3 index c4b5c97..7e09cbf 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/djangot/__pycache__/settings.cpython-311.pyc b/djangot/__pycache__/settings.cpython-311.pyc index b5b1d84..b13823f 100644 Binary files a/djangot/__pycache__/settings.cpython-311.pyc and b/djangot/__pycache__/settings.cpython-311.pyc differ diff --git a/djangot/__pycache__/urls.cpython-311.pyc b/djangot/__pycache__/urls.cpython-311.pyc index 85ae49e..1ec050c 100644 Binary files a/djangot/__pycache__/urls.cpython-311.pyc and b/djangot/__pycache__/urls.cpython-311.pyc differ diff --git a/djangot/settings.py b/djangot/settings.py index e34051d..eef46ba 100644 --- a/djangot/settings.py +++ b/djangot/settings.py @@ -118,7 +118,7 @@ # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/4.2/howto/static-files/ -STATIC_URL = 'static/' +STATIC_URL = "static/" STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'assets'), ) diff --git a/djangot/urls.py b/djangot/urls.py index aa8e0e2..026389d 100644 --- a/djangot/urls.py +++ b/djangot/urls.py @@ -20,12 +20,13 @@ from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.conf.urls.static import static from django.conf import settings +from articles import views as article_views urlpatterns = [ path('admin/', admin.site.urls), path('accounts/', include('accounts.urls')), - path('', views.home), - path('home/', views.home), + path('', article_views.articles, name="home"), + path('home/', article_views.articles, name="home"), path('story/', views.story), path('articles/', include('articles.urls')), path('about/', views.about), diff --git a/templates/base_layout.html b/templates/base_layout.html index cf0a9c7..910fb7e 100644 --- a/templates/base_layout.html +++ b/templates/base_layout.html @@ -9,7 +9,7 @@
-

All Articles

+

All Articles