Skip to content

Commit

Permalink
Merge pull request #1 from anniepauline/anniepauline-patch-1
Browse files Browse the repository at this point in the history
Add files via upload
  • Loading branch information
anniepauline authored Nov 25, 2022
2 parents 740d5f5 + 5c9262c commit 09a3dc3
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 0 deletions.
5 changes: 5 additions & 0 deletions views/about.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

<%-include('partials/header')-%>
<h1>About </h1>
<p> <%=aboutContent%> </p>
<%-include('partials/footer')-%>
9 changes: 9 additions & 0 deletions views/compose.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<%-include('partials/header')-%>
<h1>Compose</h1>
<form action = '/compose' method = "post">
<div class = "form-group">
<b>Title</b><br><input class = "form-control"type = "text" name ="postTitle"/>
<b>Post</b><br><textarea class = "form-control"name="postData" rows="5" cols="30"></textarea>
</div>
<button type = "submit" name = "submit" class = "btn btn-primary">Publish</button>
<%-include('partials/footer')-%>
4 changes: 4 additions & 0 deletions views/contact.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<%-include('partials/header')-%>
<h1>Contact </h1>
<p> <%=contactContent%> </p>
<%-include('partials/footer')-%>
16 changes: 16 additions & 0 deletions views/home.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- import header and footer from the partials folder -->
<!--the scriptlet tag allows us to write js inside the ejs file-->
<!-- <% used for js code in the ejs file%> -->
<%-include('partials/header.ejs')-%>
<h1>Home</h1>
<p> <%= homeContent %> </p>

<% posts.forEach(function(post) { %>
<h1> <%=post.title%> </h1>
<p>
<%=post.content.slice(0,100) +'...' %>
<a href = "/posts/<%=post.title%>">Read more</a>
</p>
<% }) %>
<%-include('partials/footer')-%>
9 changes: 9 additions & 0 deletions views/partials/footer.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

</div>
<div class="footer-padding"></div>
<div class="footer">
<p>Made with ❤️ by The App Brewery</p>
</div>
</div>
</body>
</html>
25 changes: 25 additions & 0 deletions views/partials/header.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">

<head>
<meta charset="utf-8">
<title>Daily Journal</title>
<meta charset="utf-8">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/styles.css">
<nav class="navbar navbar-default">
<div class="container">
<div class="navbar-header">
<p class="navbar-brand">DAILY JOURNAL</p>
</div>
<ul class="nav navbar-nav navbar-right">
<!-- 6 -->
<li id="home"><a href="/">HOME</a></li>
<li id="about"><a href="/about">ABOUT US</a></li>
<li id="contact"><a href="/contact">CONTACT US</a></li>
</ul>
</div>
</nav>

<body>
<div class="container">
4 changes: 4 additions & 0 deletions views/post.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<%-include('partials/header.ejs')-%>
<h1> <%= postTitle %> </h1>
<p> <%=postContent %> </p>
<%-include('partials/footer')-%>

0 comments on commit 09a3dc3

Please sign in to comment.