2023-10-25 21:48:36 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8" />
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
2023-11-08 10:08:40 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="/css/blogNew.css" />
|
2023-10-25 21:48:36 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="/css/theme.css" />
|
|
|
|
<script src="/js/generic.js"></script>
|
|
|
|
<title><%= website_name %> | New Blog</title>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<%- include("partials/header.ejs", {selected: 'home'}) %>
|
|
|
|
|
|
|
|
<div class="page">
|
|
|
|
<div class="e-header">
|
|
|
|
<div class="e-thumbnail">
|
2023-11-08 10:08:40 +00:00
|
|
|
<%if(existing_blog?.thumbnail) {%>
|
|
|
|
<img src="<%= existing_blog?.thumbnail %>" />
|
|
|
|
<%} else {%>
|
2023-10-25 21:48:36 +00:00
|
|
|
<img src="/img/.dev/square.png" />
|
2023-11-08 10:08:40 +00:00
|
|
|
<% } %>
|
2023-10-25 21:48:36 +00:00
|
|
|
</div>
|
|
|
|
<div class="e-description">
|
2023-11-08 10:08:40 +00:00
|
|
|
<input id="title" type="text" placeholder="Title..." value="<%= existing_blog.title %>" />
|
|
|
|
<textarea id="description" placeholder="Description..."><%= existing_blog.description %></textarea>
|
2023-10-25 21:48:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="e-image-area">
|
2023-11-08 10:08:40 +00:00
|
|
|
<% if(existing_blog.raw_images?.length) { %> <% for (image in existing_blog.raw_images) {%>
|
|
|
|
<div class="image">
|
|
|
|
<img data-image_id="<%=existing_blog.raw_images[image]%>" src="<%= existing_blog.images[image] %>" />
|
|
|
|
<div><a onclick="deleteImage('<%= existing_blog.raw_images[image] %>')">X</a></div>
|
|
|
|
</div>
|
|
|
|
<%}%> <% } else {%>
|
2023-10-27 22:26:28 +00:00
|
|
|
<div class="placeholder">Drop images here</div>
|
2023-11-08 10:08:40 +00:00
|
|
|
<% } %>
|
2023-10-25 21:48:36 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="e-content">
|
2023-11-08 10:08:40 +00:00
|
|
|
<textarea id="content" placeholder="Tell us about your subject..."><%= existing_blog.raw_content %></textarea>
|
2023-10-25 21:48:36 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="e-settings">
|
|
|
|
<div class="publish-date">
|
|
|
|
<div>Publish On</div>
|
2023-11-08 10:08:40 +00:00
|
|
|
<% if(existing_blog.publish_date) {%>
|
|
|
|
<input id="date" type="date" value="<%= existing_blog.publish_date %>" />
|
|
|
|
<%} else { %>
|
|
|
|
<input id="date" type="date" value="1990-01-01" />
|
|
|
|
<% } %>
|
|
|
|
<!-- -->
|
|
|
|
<% if(existing_blog.publish_date) {%>
|
|
|
|
<input id="time" type="time" step="3600" value="<%= existing_blog.publish_time %>" />
|
|
|
|
<%} else { %>
|
|
|
|
<input id="time" type="time" value="13:00" step="3600" />
|
|
|
|
<% } %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="e-settings">
|
|
|
|
<div class="horizontal-buttons">
|
|
|
|
<button onclick="publishBlog(true)" class="yellow"><span>Unlisted</span></button>
|
|
|
|
<% if(existing_blog.id){%>
|
|
|
|
<button onclick="publishBlog(false, true)"><span>Edit</span></button>
|
|
|
|
<% } else {%>
|
|
|
|
<button onclick="publishBlog()"><span>Publish</span></button>
|
|
|
|
<% } %>
|
2023-10-25 21:48:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<%- include("partials/footer.ejs") %>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|
2023-10-27 09:24:39 +00:00
|
|
|
<script defer src="/js/newBlog.js"></script>
|