diff options
author | Minteck <contact@minteck.org> | 2021-12-16 23:06:28 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2021-12-16 23:06:28 +0100 |
commit | 45557cdd61850abc30959c39054d29b45fefb8c2 (patch) | |
tree | 60f0ec310aae36eeb020b7ba5796bdd4b84d4607 /htdocs/public/archive/index.ejs | |
parent | 7769ba124e9325a4848ca2925241de0526bd6a4e (diff) | |
download | wolfeye-js-45557cdd61850abc30959c39054d29b45fefb8c2.tar.gz wolfeye-js-45557cdd61850abc30959c39054d29b45fefb8c2.tar.bz2 wolfeye-js-45557cdd61850abc30959c39054d29b45fefb8c2.zip |
It's finally done!
Diffstat (limited to 'htdocs/public/archive/index.ejs')
-rw-r--r-- | htdocs/public/archive/index.ejs | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/htdocs/public/archive/index.ejs b/htdocs/public/archive/index.ejs deleted file mode 100644 index 8d5ca25..0000000 --- a/htdocs/public/archive/index.ejs +++ /dev/null @@ -1,54 +0,0 @@ -<% global.title = lang.archives.title; %> -<%- include(`${private}/header.ejs`) %> - -<a href="/<%- slang %>">← <%- lang.global.back %></a> - -<hr class="rnbwsquare-separator rnbwsquare-outer"> - -<h1><%- lang.archives.title %></h1> - -<div class="grid-3 projects"> - <% - const monthNames = lang.archives.months; - archives = []; - for (let archive of fs.readdirSync(serverRoot + "/data/archives")) { - data = {}; - if (archive.endsWith(".json")) { - json = JSON.parse(fs.readFileSync(serverRoot + "/data/archives/" + archive).toString()) - - data.id = archive.substr(0, archive.length - 5); - data.name = json.title; - data.description = json.description[slang] ?? json.description.en; - data.date = (json.date.substr(3) + json.date.substr(0, 2)) - 1 + 1; - - if (json.unreleased) { - let date = new Date(json.date.substr(3) + "-" + json.date.substr(0, 2) + "-01"); - data.info = "<span style='color:gold;'>" + lang.archives.never + "</span> · " + monthNames[date.getMonth()] + " " + date.getFullYear(); - } else { - let date = new Date(json.date.substr(3) + "-" + json.date.substr(0, 2) + "-01"); - data.info = lang.archives.released + " · " + monthNames[date.getMonth()] + " " + date.getFullYear(); - } - - archives.push(data); - } - } - archives = archives.sort((a, b) => a.date - b.date).reverse() - %> - <% for (let archive of archives) { %> - <div class="project"> - <img class="project-icon" - src="<%- fs.existsSync(serverRoot + "/htdocs/public/assets/archive/" + archive.id + ".png") ? "/assets/archive/" + archive.id + ".png" : "/assets/icons/project.svg" %>"> - <h2 class="project-name"><%- archive.name %></h2> - <p class="project-description"><%- archive.description %></p> - <p class="project-buttons"> - <a - href="https://archive.cdn.minteck.org/<%- archive.id %>.zip" - target="_blank" - class="big-button big-button-bg3"><%- lang.archives.download %></a> - </p> - <p style="text-align: center;"><small><%- archive.info %></small></p> - </div> - <% } %> -</div> - -<%- include(`${private}/footer.ejs`) %>
\ No newline at end of file |