Add logged in edit link

This commit is contained in:
2018-12-09 16:55:22 +00:00
parent 26e43feac4
commit 907f4f4f3e
4 changed files with 49 additions and 82 deletions

View File

@@ -109,6 +109,10 @@
text-align: center; text-align: center;
} }
.article .wp-caption a {
display: inline-block;
}
.article .wp-caption a:after { .article .wp-caption a:after {
display: none; display: none;
} }

View File

@@ -28,12 +28,14 @@
.metadata__comments, .metadata__comments,
.metadata__categories, .metadata__categories,
.metadata__editor,
.metadata__share { .metadata__share {
margin-bottom: var(--space-sm); margin-bottom: var(--space-sm);
} }
.metadata__comments-text, .metadata__comments-text,
.metadata__categories-text, .metadata__categories-text,
.metadata__editor-text,
.metadata__date-text { .metadata__date-text {
line-height: 2.3; line-height: 2.3;
margin-left: 10px; margin-left: 10px;
@@ -60,12 +62,14 @@
*/ */
.metadata__comments-text, .metadata__comments-text,
.metadata__categories-link { .metadata__categories-link,
.metadata__editor-text {
position: relative; position: relative;
} }
.metadata__comments-text:after, .metadata__comments-text:after,
.metadata__categories-link:after { .metadata__categories-link:after,
.metadata__editor-text:after {
background-color: var(--color-light-blue); background-color: var(--color-light-blue);
bottom: -1px; bottom: -1px;
content: ''; content: '';
@@ -80,13 +84,17 @@
.metadata__comments-link:focus, .metadata__comments-link:focus,
.metadata__comments-link:hover, .metadata__comments-link:hover,
.metadata__categories-link:focus, .metadata__categories-link:focus,
.metadata__categories-link:hover { .metadata__categories-link:hover,
.metadata__editor-link:focus,
.metadata__editor-link:hover {
color: var(--color-light-blue); color: var(--color-light-blue);
} }
.metadata__comments-link:focus .metadata__comments-text:after, .metadata__comments-link:focus .metadata__comments-text:after,
.metadata__comments-link:hover .metadata__comments-text:after, .metadata__comments-link:hover .metadata__comments-text:after,
.metadata__categories-link:focus:after, .metadata__categories-link:focus:after,
.metadata__categories-link:hover:after { .metadata__categories-link:hover:after,
.metadata__editor-link:focus .metadata__editor-text:after,
.metadata__editor-link:hover .metadata__editor-text:after {
opacity: 1; opacity: 1;
} }

View File

@@ -1,80 +1,23 @@
<svg style="position: absolute;width: 0;height: 0;overflow: hidden;"> <svg style="position: absolute;width: 0;height: 0;overflow: hidden;">
<symbol id="icon-calendar" viewBox="0 0 448 512"> <symbol id="icon-calendar" viewBox="0 0 448 512">
<path fill="currentColor" d="M148 288h-40c-6.6 <path fill="currentColor" d="M148 288h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm108-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 96v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm192 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96-260v352c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h48V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h128V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h48c26.5 0 48 21.5 48 48zm-48 346V160H48v298c0 3.3 2.7 6 6 6h340c3.3 0 6-2.7 6-6z"></path>
0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 </symbol>
12zm108-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 <symbol id="icon-comments" viewBox="0 0 576 512">
12h40c6.6 0 12-5.4 12-12zm96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 <path fill="currentColor" d="M532 386.2c27.5-27.1 44-61.1 44-98.2 0-80-76.5-146.1-176.2-157.9C368.4 72.5 294.3 32 208 32 93.1 32 0 103.6 0 192c0 37 16.5 71 44 98.2-15.3 30.7-37.3 54.5-37.7 54.9-6.3 6.7-8.1 16.5-4.4 25 3.6 8.5 12 14 21.2 14 53.5 0 96.7-20.2 125.2-38.8 9.1 2.1 18.4 3.7 28 4.8 31.5 57.5 105.5 98 191.8 98 20.8 0 40.8-2.4 59.8-6.8 28.5 18.5 71.6 38.8 125.2 38.8 9.2 0 17.5-5.5 21.2-14 3.6-8.5 1.9-18.3-4.4-25-.5-.4-22.6-24.2-37.9-54.9zM142.2 311l-11.4 7.4c-20.1 13.1-50.5 28.2-87.7 32.5 8.8-11.3 20.2-27.6 29.5-46.4L83 283.7l-16.5-16.3C50.7 251.9 32 226.2 32 192c0-70.6 79-128 176-128s176 57.4 176 128-79 128-176 128c-17.7 0-35.4-2-52.6-6l-13.2-3zm303 103.4l-11.4-7.4-13.2 3.1c-17.2 4-34.9 6-52.6 6-65.1 0-122-25.9-152.4-64.3C326.9 348.6 416 278.4 416 192c0-9.5-1.3-18.7-3.3-27.7C488.1 178.8 544 228.7 544 288c0 34.2-18.7 59.9-34.5 75.4L493 379.7l10.3 20.7c9.4 18.9 20.8 35.2 29.5 46.4-37.1-4.2-67.5-19.4-87.6-32.4zm-37.8-267.7c.1.2.1.4.2.6-.1-.2-.1-.4-.2-.6z"></path>
12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 </symbol>
96v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 <symbol id="icon-edit" viewBox="0 0 576 512">
12-5.4 12-12zm-96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 <path fill="currentColor" d="M402.3 344.9l32-32c5-5 13.7-1.5 13.7 5.7V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h273.5c7.1 0 10.7 8.6 5.7 13.7l-32 32c-1.5 1.5-3.5 2.3-5.7 2.3H48v352h352V350.5c0-2.1.8-4.1 2.3-5.6zm156.6-201.8L296.3 405.7l-90.4 10c-26.2 2.9-48.5-19.2-45.6-45.6l10-90.4L432.9 17.1c22.9-22.9 59.9-22.9 82.7 0l43.2 43.2c22.9 22.9 22.9 60 .1 82.8zM460.1 174L402 115.9 216.2 301.8l-7.3 65.3 65.3-7.3L460.1 174zm64.8-79.7l-43.2-43.2c-4.1-4.1-10.8-4.1-14.8 0L436 82l58.1 58.1 30.9-30.9c4-4.2 4-10.8-.1-14.9z"></path>
12 12 12h40c6.6 0 12-5.4 12-12zm192 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 </symbol>
5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96-260v352c0 26.5-21.5 <symbol id="icon-facebook" viewBox="0 0 512 512">
48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h48V12c0-6.6 5.4-12 <path fill="currentColor" d="M448 56.7v398.5c0 13.7-11.1 24.7-24.7 24.7H309.1V306.5h58.2l8.7-67.6h-67v-43.2c0-19.6 5.4-32.9 33.5-32.9h35.8v-60.5c-6.2-.8-27.4-2.7-52.2-2.7-51.6 0-87 31.5-87 89.4v49.9h-58.4v67.6h58.4V480H24.7C11.1 480 0 468.9 0 455.3V56.7C0 43.1 11.1 32 24.7 32h398.5c13.7 0 24.8 11.1 24.8 24.7z"></path>
12-12h40c6.6 0 12 5.4 12 12v52h128V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 </symbol>
12v52h48c26.5 0 48 21.5 48 48zm-48 346V160H48v298c0 3.3 2.7 6 6 6h340c3.3 0 <symbol id="icon-hash" viewBox="0 0 448 512">
6-2.7 6-6z"></path> <path fill="currentColor" d="M440.667 182.109l7.143-40c1.313-7.355-4.342-14.109-11.813-14.109h-74.81l14.623-81.891C377.123 38.754 371.468 32 363.997 32h-40.632a12 12 0 0 0-11.813 9.891L296.175 128H197.54l14.623-81.891C213.477 38.754 207.822 32 200.35 32h-40.632a12 12 0 0 0-11.813 9.891L132.528 128H53.432a12 12 0 0 0-11.813 9.891l-7.143 40C33.163 185.246 38.818 192 46.289 192h74.81L98.242 320H19.146a12 12 0 0 0-11.813 9.891l-7.143 40C-1.123 377.246 4.532 384 12.003 384h74.81L72.19 465.891C70.877 473.246 76.532 480 84.003 480h40.632a12 12 0 0 0 11.813-9.891L151.826 384h98.634l-14.623 81.891C234.523 473.246 240.178 480 247.65 480h40.632a12 12 0 0 0 11.813-9.891L315.472 384h79.096a12 12 0 0 0 11.813-9.891l7.143-40c1.313-7.355-4.342-14.109-11.813-14.109h-74.81l22.857-128h79.096a12 12 0 0 0 11.813-9.891zM261.889 320h-98.634l22.857-128h98.634l-22.857 128z"></path>
</symbol> </symbol>
<symbol id="icon-comments" viewBox="0 0 576 512"> <symbol id="icon-rss" viewBox="0 0 448 512">
<path fill="currentColor" d="M532 386.2c27.5-27.1 44-61.1 <path fill="currentColor" d="M400 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zM112 416c-26.51 0-48-21.49-48-48s21.49-48 48-48 48 21.49 48 48-21.49 48-48 48zm157.533 0h-34.335c-6.011 0-11.051-4.636-11.442-10.634-5.214-80.05-69.243-143.92-149.123-149.123-5.997-.39-10.633-5.431-10.633-11.441v-34.335c0-6.535 5.468-11.777 11.994-11.425 110.546 5.974 198.997 94.536 204.964 204.964.352 6.526-4.89 11.994-11.425 11.994zm103.027 0h-34.334c-6.161 0-11.175-4.882-11.427-11.038-5.598-136.535-115.204-246.161-251.76-251.76C68.882 152.949 64 147.935 64 141.774V107.44c0-6.454 5.338-11.664 11.787-11.432 167.83 6.025 302.21 141.191 308.205 308.205.232 6.449-4.978 11.787-11.432 11.787z"></path>
44-98.2 0-80-76.5-146.1-176.2-157.9C368.4 72.5 294.3 32 208 32 93.1 32 0 </symbol>
103.6 0 192c0 37 16.5 71 44 98.2-15.3 30.7-37.3 54.5-37.7 54.9-6.3 6.7-8.1 <symbol id="icon-twitter" viewBox="0 0 512 512">
16.5-4.4 25 3.6 8.5 12 14 21.2 14 53.5 0 96.7-20.2 125.2-38.8 9.1 2.1 18.4 <path fill="currentColor" d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"></path>
3.7 28 4.8 31.5 57.5 105.5 98 191.8 98 20.8 0 40.8-2.4 59.8-6.8 28.5 18.5 </symbol>
71.6 38.8 125.2 38.8 9.2 0 17.5-5.5 21.2-14
3.6-8.5 1.9-18.3-4.4-25-.5-.4-22.6-24.2-37.9-54.9zM142.2 311l-11.4 7.4c-20.1
13.1-50.5 28.2-87.7 32.5 8.8-11.3 20.2-27.6 29.5-46.4L83
283.7l-16.5-16.3C50.7 251.9 32 226.2 32 192c0-70.6 79-128 176-128s176 57.4
176 128-79 128-176 128c-17.7 0-35.4-2-52.6-6l-13.2-3zm303
103.4l-11.4-7.4-13.2 3.1c-17.2 4-34.9 6-52.6 6-65.1 0-122-25.9-152.4-64.3C326.9
348.6 416 278.4 416 192c0-9.5-1.3-18.7-3.3-27.7C488.1 178.8 544 228.7 544 288c0
34.2-18.7 59.9-34.5 75.4L493 379.7l10.3 20.7c9.4 18.9 20.8 35.2 29.5
46.4-37.1-4.2-67.5-19.4-87.6-32.4zm-37.8-267.7c.1.2.1.4.2.6-.1-.2-.1-.4-.2-.6z"></path>
</symbol>
<symbol id="icon-facebook" viewBox="0 0 512 512">
<path fill="currentColor" d="M448 56.7v398.5c0
13.7-11.1 24.7-24.7 24.7H309.1V306.5h58.2l8.7-67.6h-67v-43.2c0-19.6 5.4-32.9
33.5-32.9h35.8v-60.5c-6.2-.8-27.4-2.7-52.2-2.7-51.6 0-87 31.5-87
89.4v49.9h-58.4v67.6h58.4V480H24.7C11.1 480 0 468.9 0 455.3V56.7C0 43.1 11.1 32
24.7 32h398.5c13.7 0 24.8 11.1 24.8 24.7z"></path>
</symbol>
<symbol id="icon-hash" viewBox="0 0 448 512">
<path fill="currentColor" d="M440.667
182.109l7.143-40c1.313-7.355-4.342-14.109-11.813-14.109h-74.81l14.623-81.891C377.123
38.754 371.468 32 363.997 32h-40.632a12 12 0 0 0-11.813 9.891L296.175
128H197.54l14.623-81.891C213.477 38.754 207.822 32 200.35 32h-40.632a12 12 0 0
0-11.813 9.891L132.528 128H53.432a12 12 0 0 0-11.813 9.891l-7.143 40C33.163
185.246 38.818 192 46.289 192h74.81L98.242 320H19.146a12 12 0 0 0-11.813
9.891l-7.143 40C-1.123 377.246 4.532 384 12.003 384h74.81L72.19 465.891C70.877
473.246 76.532 480 84.003 480h40.632a12 12 0 0 0 11.813-9.891L151.826
384h98.634l-14.623 81.891C234.523 473.246 240.178 480 247.65 480h40.632a12 12 0
0 0 11.813-9.891L315.472 384h79.096a12 12 0 0 0
11.813-9.891l7.143-40c1.313-7.355-4.342-14.109-11.813-14.109h-74.81l22.857-128h79.096a12
12 0 0 0 11.813-9.891zM261.889 320h-98.634l22.857-128h98.634l-22.857
128z"></path>
</symbol>
<symbol id="icon-rss" viewBox="0 0 448 512">
<path fill="currentColor" d="M400 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49
48 48 48h352c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zM112 416c-26.51
0-48-21.49-48-48s21.49-48 48-48 48 21.49 48 48-21.49 48-48 48zm157.533
0h-34.335c-6.011 0-11.051-4.636-11.442-10.634-5.214-80.05-69.243-143.92-149.123-149.123-5.997-.39-10.633-5.431-10.633-11.441v-34.335c0-6.535
5.468-11.777 11.994-11.425 110.546 5.974 198.997 94.536 204.964 204.964.352
6.526-4.89 11.994-11.425 11.994zm103.027 0h-34.334c-6.161 0-11.175-4.882-11.427-11.038-5.598-136.535-115.204-246.161-251.76-251.76C68.882
152.949 64 147.935 64 141.774V107.44c0-6.454 5.338-11.664 11.787-11.432
167.83 6.025 302.21 141.191 308.205 308.205.232 6.449-4.978 11.787-11.432
11.787z"></path>
</symbol>
<symbol id="icon-twitter" viewBox="0 0 512 512">
<path fill="currentColor" d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0
138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106
8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568
130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624
19.818 1.624 9.421 0 18.843-1.3
27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797
30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492
5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365
109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934
104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32
66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273
41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"></path>
</symbol>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@@ -7,6 +7,18 @@
<?php the_time(get_option('date_format')) ?> <?php the_time(get_option('date_format')) ?>
</span> </span>
</div> </div>
<?php if (is_user_logged_in()): ?>
<div class="metadata__editor">
<a class="metadata__editor-link" href="<?php echo get_edit_post_link() ?>">
<svg class="icon">
<use href="#icon-edit"></use>
</svg>
<span class="metadata__editor-text">
Edit post
</span>
</a>
</div>
<?php endif; ?>
<div class="metadata__comments"> <div class="metadata__comments">
<a class="metadata__comments-link" href="<?php the_permalink() ?>"> <a class="metadata__comments-link" href="<?php the_permalink() ?>">
<svg class="icon"> <svg class="icon">