diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2018-01-12 12:43:03 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2018-01-12 12:43:03 +0100 |
commit | a77f6e9d27f98bc36d0911ce58c109f4a18bd835 (patch) | |
tree | d88d91a956e8107871d3bc8e1b8bf994579b90d3 /templates | |
parent | 35112f2357d6510a889c8e20604b11a2c0acf342 (diff) | |
download | rocket-blog-a77f6e9d27f98bc36d0911ce58c109f4a18bd835.tar.gz rocket-blog-a77f6e9d27f98bc36d0911ce58c109f4a18bd835.tar.bz2 rocket-blog-a77f6e9d27f98bc36d0911ce58c109f4a18bd835.zip |
Move post actions to partial.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/post_actions.html | 5 | ||||
-rw-r--r-- | templates/post_teaser.html | 6 | ||||
-rw-r--r-- | templates/show_post.html | 10 |
3 files changed, 11 insertions, 10 deletions
diff --git a/templates/post_actions.html b/templates/post_actions.html new file mode 100644 index 0000000..acc47d5 --- /dev/null +++ b/templates/post_actions.html @@ -0,0 +1,5 @@ +<div class="post-actions"> + <a href="/posts/{{ .id }}/edit">Edit</a> | + Publish | + <a href="/posts/{{ .id }}/delete">Delete</a> +</div> diff --git a/templates/post_teaser.html b/templates/post_teaser.html index 482cf73..4d412ba 100644 --- a/templates/post_teaser.html +++ b/templates/post_teaser.html @@ -1,11 +1,7 @@ <article class="post-teaser"> <header> <h1><a href="/posts/{{ .id }}">{{ .title }}</a></h1> - <div class="post-actions"> - <a href="/posts/{{ .id }}/edit">Edit</a> | - Publish | - <a href="/posts/{{ .id }}/delete">Delete</a> - </div> + {{> post_actions.html }} </header> <section class="teaser"> {{ .body }} diff --git a/templates/show_post.html b/templates/show_post.html index 5a7d806..31c2ca3 100644 --- a/templates/show_post.html +++ b/templates/show_post.html @@ -5,15 +5,15 @@ </head> <body> <article class="post-teaser"> + {{# post. }} <header> - <h1>{{ post.title }}</h1> - <div class="post-actions"> - Edit | Publish | Delete - </div> + <h1>{{ .title }}</h1> + {{> post_actions.html }} </header> <section class="teaser"> - {{ post.body }} + {{ .body }} </section> + {{/ post }} </article> </body> </html> |