Browse Source

Style tweaks

master
Dylan Baker 3 years ago
parent
commit
b1ed623995
2 changed files with 15 additions and 2 deletions
  1. 8
    1
      templates/index.html
  2. 7
    1
      templates/layout.html

+ 8
- 1
templates/index.html View File

@@ -21,7 +21,14 @@
21 21
 <div class="posts">
22 22
   {% for post in posts %}
23 23
   <div class="posts__post post">
24
-    <h3 class="post__heading">{{ post.title }} :: {{ post.date }}</h3>
24
+    <h3 class="post__heading">
25
+      {% if logged_in %}
26
+        <a class="post__edit-link" href="/posts/{{ post.id }}/edit">edit</a>
27
+      {% endif %}
28
+      <span>
29
+        {{ post.title }} :: {{ post.date }}
30
+      </span>
31
+    </h3>
25 32
     <div class="post__body">
26 33
       {{ post.body | safe }}
27 34
     </div>

+ 7
- 1
templates/layout.html View File

@@ -66,10 +66,16 @@
66 66
       .post__heading {
67 67
         background: white;
68 68
         border: 1px solid #383e37;
69
+        display: flex;
69 70
         font-size: 12px;
70 71
         font-style: italic;
72
+        justify-content: space-between;
71 73
         padding: 0.5em;
72
-        text-align: right;
74
+      }
75
+
76
+      .post__edit-link {
77
+        font-style: normal;
78
+        font-weight: normal;
73 79
       }
74 80
 
75 81
       .post__body {

Loading…
Cancel
Save