CJVT updates August and September 2026

This commit is contained in:
Luka Romih
2026-10-01 00:49:26 +02:00
parent fd02e25719
commit 83f73aeb58
135 changed files with 6146 additions and 1970 deletions
+16 -12
View File
@@ -181,11 +181,19 @@ consultancyAdmin.statistics = async (req, res) => {
res.render('pages/consultancy/admin/statistics')
}
// Maps a consultancy entry's status to the sidebar item it should highlight
// and the URL slug that list page lives at (used as a fallback "back" link
// target when the page wasn't reached via that list page's own link).
const STATUS_META = {
new: { new: true, slug: 'novo' },
rejected: { rejected: true, slug: 'zavrnjeno' },
'in progress': { inProgress: true, slug: 'v-delu' },
review: { prepared: true, slug: 'pripravljeno' },
published: { published: true, slug: 'objavljeno' }
}
consultancyAdmin.edit = async (req, res) => {
const { id } = req.params
const key = req.query.sentFrom
const sentFrom = {}
sentFrom[key] = true
const moderator = await ConsultancyEntry.getModerator(id)
// TODO i18n TIME FORMAT
@@ -197,9 +205,13 @@ consultancyAdmin.edit = async (req, res) => {
const isPublished = entry.status === 'published'
const { slug, ...meta } = STATUS_META[entry.status] ?? STATUS_META.new
const sentFrom = req.query.sentFrom || slug
res.render('pages/consultancy/admin/edit', {
id,
sentFrom: key,
sentFrom,
meta,
entry: entry,
allPrimaryDomains,
moderator,
@@ -392,14 +404,6 @@ async function consultancyRequest(
}
}
if (entry.timeCreated) {
const date = new Date(entry.timeCreated)
entry.formattedTimeCreated = `${date.getDate()}. ${
date.getMonth() + 1
}. ${date.getFullYear()}`
}
return entry
})