From e6c588b4c60eacb24c6d0b380c76238f740e7446 Mon Sep 17 00:00:00 2001 From: Faisal N Date: Tue, 17 Oct 2023 10:19:23 -0400 Subject: [PATCH] alts, bug fixes --- frontend/pages/about.ejs | 4 ++-- frontend/pages/article.ejs | 2 +- frontend/pages/articles.ejs | 2 +- frontend/pages/artwork.ejs | 4 ++-- frontend/pages/artworks.ejs | 2 +- frontend/pages/index.ejs | 4 ++-- frontend/pages/newspaper.ejs | 2 +- frontend/pages/newspapers.ejs | 2 +- frontend/pages/poll.ejs | 2 +- frontend/pages/search.ejs | 10 +++++----- frontend/pages/tag.ejs | 2 +- frontend/partials/footer.ejs | 2 +- frontend/partials/suggested.ejs | 2 +- frontend/public/css/styles.css | 14 +++++++++++--- 14 files changed, 31 insertions(+), 23 deletions(-) diff --git a/frontend/pages/about.ejs b/frontend/pages/about.ejs index 508a29a..3fe4af4 100644 --- a/frontend/pages/about.ejs +++ b/frontend/pages/about.ejs @@ -8,12 +8,12 @@ <%- include('../partials/header.ejs'); %>
- <% if (cms.about[0].image != null) { %><% } %> + <% if (cms.about[0].image != null) { %>alt="<%= cms.about[0].image.description %>"<% } %> /><% } %>
<%- cms.about[0].content %>
- <% if (cms.about[0].image-2 != null) { %><% } %> + <% if (cms.about[0].image-2 != null) { %>alt="<%= cms.about[0]['image-2'].description %>"<% } %> /><% } %>
<%- include('../partials/footer.ejs'); %> diff --git a/frontend/pages/article.ejs b/frontend/pages/article.ejs index 07ebd0a..5830c5f 100644 --- a/frontend/pages/article.ejs +++ b/frontend/pages/article.ejs @@ -26,7 +26,7 @@ <% if (article.tags != null) { %>

Tags: <% for (tag of article.tags) { %>#<%= tag.toLowerCase().replaceAll(" ", "-") %> <% } %>

<% } %>
- <%= cms.siteDetails[0].unknown.path %><% } else { %><%= cms.siteDetails[0].favicon.path %><% } %>" /> + <%= cms.siteDetails[0].unknown.path %><% } else { %><%= cms.siteDetails[0].favicon.path %><% } %>" alt="Author" />

<% if ((article.author != "") && (article.author != null)) { %><%= article.author %><% } else { %><%= cms.siteDetails[0].title %><% } %>

<%= cms.siteDetails[0].title %> - Writer<% if ((article.author != "") && (article.author != null)) { %><% } else { %>s<% } %>
diff --git a/frontend/pages/articles.ejs b/frontend/pages/articles.ejs index 99ae911..ab33f2c 100644 --- a/frontend/pages/articles.ejs +++ b/frontend/pages/articles.ejs @@ -21,7 +21,7 @@ <% const articles = cms.articles.sort((a, b) => new Date(b.date) - new Date(a.date)); for (let i = 0; i < articles.length; i++) { const article = articles[i]; %>
- <%= cms.siteDetails[0].unknown.path %><% } else { %><%= cms.siteDetails[0].favicon.path %><% } %>" /> + <%= cms.siteDetails[0].unknown.path %><% } else { %><%= cms.siteDetails[0].favicon.path %><% } %>" alt="Author" />

<% if ((artwork.author != "") && (artwork.author != null)) { %><%= artwork.author %><% } else { %><%= cms.siteDetails[0].title %><% } %>

<%= cms.siteDetails[0].title %> - Writer<% if ((artwork.author != "") && (artwork.author != null)) { %><% } else { %>s<% } %>
@@ -44,7 +44,7 @@
- + alt="<%= artwork.artwork.description %>"<% } %> />

<%= artwork.description %>

Comments

diff --git a/frontend/pages/artworks.ejs b/frontend/pages/artworks.ejs index d25c41e..5ab3c48 100644 --- a/frontend/pages/artworks.ejs +++ b/frontend/pages/artworks.ejs @@ -21,7 +21,7 @@ <% const artworks = cms.artworks.sort((a, b) => new Date(b.date) - new Date(a.date)); for (let i = 0; i < artworks.length; i++) { const artwork = artworks[i]; %>
- style="width: min-content;" <% } } else { %> "<% } %> /> + style="width: min-content;" <% } } else { %> "<% } %><% if (artwork.artwork.description != "") { %>alt="<%= artwork.artwork.description %>"<% } %> />

<%= artwork.title %>

<% if (artwork.description != null) { %>

<%= artwork.description.slice(0, 50) %>...

<% } %>

<% var date = new Date(artwork.date); if (date.isToday()) { %>Today<% } else if (ifYesterday(date)) { %>Yesterday<% } else { %><%= date.toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric' }) %><% } %><% if ((artwork.author != "") && (artwork.author != null)) { %> / <%= artwork.author %><% } %>

diff --git a/frontend/pages/index.ejs b/frontend/pages/index.ejs index 88c31fa..7fcc1c3 100644 --- a/frontend/pages/index.ejs +++ b/frontend/pages/index.ejs @@ -40,7 +40,7 @@ <% for (let i = 0; i < 3 && i < cms.articles.length; i++) { const article = cms.articles.sort((a, b) => new Date(b.date) - new Date(a.date))[i]; %>
- style="width: min-content;" <% } } else { %> "<% } %> /> + style="width: min-content;" <% } } else { %> "<% } %><% if (article.images[0].description != "") { %>alt="<%= article.images[0].description %>"<% } %> />

<%= article.title %>

<% if (article.description != null) { %>

<%= article.description.slice(0, 50) %>...

<% } %>

<% var date = new Date(article.date); if (date.isToday()) { %>Today<% } else if (ifYesterday(date)) { %>Yesterday<% } else { %><%= date.toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric' }) %><% } %><% if ((article.author != "") && (article.author != null)) { %> / <%= article.author %><% } %>

@@ -56,7 +56,7 @@ <% for (let i = 0; i < 3 && i < cms.artworks.length; i++) { const artwork = cms.artworks.sort((a, b) => new Date(b.date) - new Date(a.date))[i]; %>
- style="width: min-content;" <% } %> /> + style="width: min-content;" <% } %><% if (artwork.artwork.description != "") { %>alt="<%= artwork.artwork.description %>"<% } %> />

<%= artwork.title %>

<% var date = new Date(artwork.date); if (date.isToday()) { %>Today<% } else if (ifYesterday(date)) { %>Yesterday<% } else { %><%= date.toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric' }) %><% } %><% if ((artwork.author != "") && (artwork.author != null)) { %> / <%= artwork.author %><% } %>

diff --git a/frontend/pages/newspaper.ejs b/frontend/pages/newspaper.ejs index 1fac926..f2fd48c 100644 --- a/frontend/pages/newspaper.ejs +++ b/frontend/pages/newspaper.ejs @@ -21,7 +21,7 @@ <% if (newspaper.tags != null) { %>

Tags: <% for (tag of newspaper.tags) { %>#<%= tag.toLowerCase().replaceAll(" ", "-") %> <% } %>

<% } %>
- + Author
- + Author

By <% if ((poll.author != "") && (poll.author != null)) { %><%= poll.author %><% } else { %><%= cms.siteDetails[0].title %> Writers, <%= cms.siteDetails[0].title %><% } %>

Published <% var date = new Date(poll.date); if (date.isToday()) { %>today<% } else if (ifYesterday(date)) { %>yesterday<% } else { %><%= date.toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric' }) %><% } %>
diff --git a/frontend/pages/search.ejs b/frontend/pages/search.ejs index 1385ba2..b435108 100644 --- a/frontend/pages/search.ejs +++ b/frontend/pages/search.ejs @@ -53,7 +53,7 @@
<% filteredNewspapers.sort((a, b) => b._created - a._created).forEach(newspaper => { %> - + alt="<%= newspaper.image.description %>"<% } %> />

Newspaper: <%= newspaper.title %>

<% var date = new Date(newspaper.date); if (date.isToday()) { %>Today<% } else if (ifYesterday(date)) { %>Yesterday<% } else { %><%= date.toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric' }) %><% } %>

@@ -62,7 +62,7 @@ <% }); %> <% filteredArticles.sort((a, b) => new Date(b.date) - new Date(a.date)).forEach(article => { %>
- + alt="<%= article.images[0].description %>"<% } %> />

Article: <%= article.title %>

<% if (article.description != null) { %>

<%= article.description.slice(0, 50) %>...

<% } %> @@ -72,7 +72,7 @@ <% }); %> <% filteredTags.sort((a, b) => a.localeCompare(b)).forEach(tag => { %>
- +

Tag: <%= tag %>

<%- tags[tag].length %> Article<% if (tags[tag].length != 1) { %>s<% } %>

@@ -81,7 +81,7 @@ <% }); %> <% filteredPolls.sort((a, b) => new Date(b.date) - new Date(a.date)).forEach(poll => { %>
- +

Poll: <%= poll.question %>

<%= poll.description %>

@@ -91,7 +91,7 @@ <% }); %> <% filteredArtworks.sort((a, b) => new Date(b.date) - new Date(a.date)).forEach(artwork => { %>
- + alt="<%= artwork.artwork.description %>"<% } %> />

Artwork: <%= artwork.title %>

<% var date = new Date(article.date); if (date.isToday()) { %>Today<% } else if (ifYesterday(date)) { %>Yesterday<% } else { %><%= date.toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric' }) %><% } %><% if ((article.author != "") && (article.author != null)) { %> / <%= article.author %><% } %>

diff --git a/frontend/pages/tag.ejs b/frontend/pages/tag.ejs index 4cdb1e9..25d3175 100644 --- a/frontend/pages/tag.ejs +++ b/frontend/pages/tag.ejs @@ -28,7 +28,7 @@ <% if (filteredArticles.length != 0) { const articles = filteredArticles.sort((a, b) => b._created - a._created); for (let i = 0; i < articles.length; i++) { const article = articles[i]; %>
- style="width: min-content;" <% } } else { %> "<% } %> /> + style="width: min-content;" <% } } else { %> "<% } %><% if (article.images[0].description != "") { %>alt="<%= article.images[0].description %>"<% } %> />

<%= article.title %>

<% if (article.description != null) { %>

<%= article.description.slice(0, 50) %>...

<% } %>

<% var date = new Date(article.date); if (date.isToday()) { %>Today<% } else if (ifYesterday(date)) { %>Yesterday<% } else { %><%= date.toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric' }) %><% } %><% if ((article.author != "") && (article.author != null)) { %> / <%= article.author %><% } %>

diff --git a/frontend/partials/footer.ejs b/frontend/partials/footer.ejs index d2e1b72..188f869 100644 --- a/frontend/partials/footer.ejs +++ b/frontend/partials/footer.ejs @@ -1,4 +1,4 @@ -<% if (cms.siteDetails[0].advertisement != null) { %>
<% } %> +<% if (cms.siteDetails[0].advertisement != null) { %><% } %>