From 188527c6b55a2d64d5f76c5d3e094da45c69b0c9 Mon Sep 17 00:00:00 2001 From: BakedSnake Date: Wed, 17 Mar 2021 12:58:53 +0100 Subject: Public version --- views/blog/blog.ejs | 35 +++++++++++++++++++++++++++++++++++ views/blog/edit.ejs | 42 ++++++++++++++++++++++++++++++++++++++++++ views/blog/new.ejs | 42 ++++++++++++++++++++++++++++++++++++++++++ views/blog/show.ejs | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 172 insertions(+) create mode 100644 views/blog/blog.ejs create mode 100644 views/blog/edit.ejs create mode 100644 views/blog/new.ejs create mode 100644 views/blog/show.ejs (limited to 'views/blog') diff --git a/views/blog/blog.ejs b/views/blog/blog.ejs new file mode 100644 index 0000000..2afe769 --- /dev/null +++ b/views/blog/blog.ejs @@ -0,0 +1,35 @@ +<%- include('../partials/header') %> + +
+
+ +
+
+ <% posts.map((post) => { %> +
+

<%= post.title %>

+ ... +

<%- post.body.substring(0, 300) %>...

+
+ <% }) %> +

<%= account.username.toUpperCase() %>

+
+
+ +<%- include('../partials/footer') %> \ No newline at end of file diff --git a/views/blog/edit.ejs b/views/blog/edit.ejs new file mode 100644 index 0000000..00d9b57 --- /dev/null +++ b/views/blog/edit.ejs @@ -0,0 +1,42 @@ +<%- include('../partials/header') %> + +
+
+ +
+
+

<%= currentUser.username.toUpperCase() %>

+

New blog post.

+
+ + + + + + + + + +
+
+
+ +<%- include('../partials/footer') %> \ No newline at end of file diff --git a/views/blog/new.ejs b/views/blog/new.ejs new file mode 100644 index 0000000..2800c6f --- /dev/null +++ b/views/blog/new.ejs @@ -0,0 +1,42 @@ +<%- include('../partials/header') %> + +
+
+ +
+
+

<%= currentUser.username.toUpperCase() %>

+

New blog post.

+
+ + + + + + + + + +
+
+
+ +<%- include('../partials/footer') %> \ No newline at end of file diff --git a/views/blog/show.ejs b/views/blog/show.ejs new file mode 100644 index 0000000..0133499 --- /dev/null +++ b/views/blog/show.ejs @@ -0,0 +1,53 @@ +<%- include('../partials/header') %> + +
+
+ +
+
+

<%= account.toUpperCase() %>

+
+

<%= post.title %>

+ ... + +

<%- post.body %>

+ <% if(currentUser && post.author.id.equals(currentUser._id)) { %> + Edit +
+ +
+ <% } %> + <% post.comments.map((comment) => { %> +
+
<%= comment.author.username.toUpperCase() %>:
+

<%- comment.text %>

+ <% if(currentUser && comment.author.id.equals(currentUser._id)) { %> +
+ + Edit + +
+ +
+
+ <% } %> +
+ <% }) %> + Add a comment +
+
+
+ +<%- include('../partials/footer') %> -- cgit v1.2.3