Layout improvements

master
Laurent 6 years ago
parent 67a537ec82
commit 209dd1be5b
  1. 84
      news/static/news/css/app.css
  2. 32
      news/templates/news/index.html

@ -35,24 +35,28 @@ body {
.imgcontainer { .imgcontainer {
position: relative; position: relative;
/* text-align: center; */
color: white; color: white;
} }
/* Bottom left text */ /* @media print, screen and (min-width: 40em) {
.bottom-left { .imgcontainer {
width: 800px; position: relative;
position: absolute; color: white;
bottom: 8px; }
left: 16px; } */
}
.crop { .crop {
width: 1000px; width: 1000px;
/* width: 1000px; */ /* width: 1000px; */
height: 200px; height: 200px;
overflow: hidden; overflow: hidden;
border-radius: 20px;/*0px 20px 20px 0px;*/ border-radius: 0px;/*0px 20px 20px 0px;*/
}
@media print, screen and (min-width: 40em) {
.crop {
border-radius: 20px;
}
} }
.crop img { .crop img {
@ -67,17 +71,26 @@ body {
margin-top: 20px; margin-top: 20px;
} }
.content { /* .content {
/* background-color: #eee; */ padding: 0px;
padding: 16px; } */
article {
margin-bottom: 20px;
}
@media print, screen and (min-width: 40em) {
article {
padding: 16px;
}
} }
.content h1 { /* .content h1 {
font-family: 'LibreBaskervilleBold'; font-family: 'LibreBaskervilleBold';
font-size: 28px; font-size: 28px;
margin: 10px 0px 0px 0px; margin: 10px 0px 0px 0px;
padding: 0px; padding: 0px;
} } */
.imgcontainer a { .imgcontainer a {
color: #fff; color: #fff;
@ -87,16 +100,55 @@ body {
color: #aaa; color: #aaa;
} }
.contentbody { /* .content {
font-family: 'LibreBaskerville';
padding: 12px 12px 0px 12px; padding: 12px 12px 0px 12px;
} }
.content p {
font-family: 'LibreBaskerville';
} */
.body {
padding: 0px 12px;
}
.body p {
font-family: 'LibreBaskerville';
}
.post { .post {
padding: 10px 0px; padding: 10px 0px;
margin-bottom: 10px; margin-bottom: 10px;
} }
/*
.bottom-left {
position: absolute;
top: 8px;
left: 16px;
}
@media print, screen and (min-width: 32em) {
.bottom-left {
width: 24em;
}
} */
article h1 {
font-family: 'LibreBaskervilleBold';
font-size: 18px;
position: absolute;
top: 12px;
left: 12px;
}
@media print, screen and (min-width: 40em) {
article h1 {
font-size: 28px;
width: 24em;
bottom: 8px;
top: auto;
}
}
.padded { .padded {
padding: 8px; padding: 8px;
} }

@ -14,29 +14,33 @@
<!-- A post --> <!-- A post -->
{% if post.style == 0 %} {% if post.style == 0 %}
<div class="post"> <article>
<div class="imgcontainer"> <div class="imgcontainer">
<a href="{{ post.url }}"> <a href="{{ post.url }}">
<img class="crop" src="{% static 'media/' %}{{ post.image_url }}"/> <img class="crop" src="{% static 'media/' %}{{ post.image_url }}"/>
<div class="bottom-left"> <div>
<h1>{{ post.title }}</h1> <h1>{{ post.title }}</h1>
</div> </div>
</a> </a>
</div> </div>
<p class="contentbody">
{{ post.body }} <div class="body">
</p> <p>
<div class="info"> {{ post.body }}
{{ post.date }} - {{ post.author.username }} - <a href="{% url 'news:post' post.id %}">{% if post.comment_set.count > 0 %}{{ post.comment_set.count }} comments{% else %}write comment{% endif %}</a> </p>
</div> <div class="info">
<!-- Some comments --> {{ post.date }} - {{ post.author.username }} - <a href="{% url 'news:post' post.id %}">{% if post.comment_set.count > 0 %}{{ post.comment_set.count }} comments{% else %}write comment{% endif %}</a>
<div class="comments"> </div>
{% for comment in post.top_comments %} <!-- Some comments -->
<span>{{ comment.body }} - {{ comment.author.username }}</span><br/> <div class="comments">
{% endfor %} {% for comment in post.top_comments %}
<span>{{ comment.body }} - {{ comment.author.username }}</span><br/>
{% endfor %}
</div>
</div> </div>
</div> </article>
<!-- <div class="grid-x post"> <!-- <div class="grid-x post">
<div class="cell large-2 large-offset-2 info"> <div class="cell large-2 large-offset-2 info">

Loading…
Cancel
Save