Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add files via upload #1

Merged
merged 1 commit into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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')-%>