Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added styles
  • Loading branch information
BerMu147 committed Sep 29, 2023
2 parents ffe7760 + d321b4b commit 8e749df
Show file tree
Hide file tree
Showing 12 changed files with 132 additions and 7 deletions.
Binary file modified articles/__pycache__/forms.cpython-311.pyc
Binary file not shown.
Binary file modified articles/__pycache__/models.cpython-311.pyc
Binary file not shown.
Binary file modified articles/__pycache__/views.cpython-311.pyc
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions articles/templates/articles/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<h2><a href="{% url 'articles:detail' slug=article.slug %}">{{ article.title }}</a></h2>
<p>{{ article.snippet }}</p>
<p>{{ article.date }}</p>
<p class="author">Written by {{ article.author.username }}</p>
</div>
{% endfor %}
</div>
Expand Down
129 changes: 126 additions & 3 deletions assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,129 @@ a, a:hover, a:visited{
color: #fff;
}

p*{
width: 50%;
}
.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;
}
Binary file modified db.sqlite3
Binary file not shown.
Binary file modified djangot/__pycache__/settings.cpython-311.pyc
Binary file not shown.
Binary file modified djangot/__pycache__/urls.cpython-311.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion djangot/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
)
Expand Down
5 changes: 3 additions & 2 deletions djangot/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion templates/base_layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</head>
<body>
<header class="wrapper">
<h1><a href="{% url 'articles:list' %}" alt="djangot">All Articles</a></h1>
<h1><a href="{% url 'home' %}" alt="djangot">All Articles</a></h1>
<br><br>
<nav>
<ul>
Expand Down

0 comments on commit 8e749df

Please sign in to comment.