First full release
This commit is contained in:
@@ -97,6 +97,9 @@ router.get(
|
||||
dictionary.showImportFromFileForm
|
||||
)
|
||||
|
||||
// Import dictionary data from file.
|
||||
router.post('/slovarji/:dictionaryId/uvoz/datoteka', dictionary.importFromFile)
|
||||
|
||||
router.get(
|
||||
'/slovarji/:dictionaryId/uvoz/luscenje',
|
||||
dictionary.showImportFromExtractionForm
|
||||
|
||||
@@ -17,19 +17,22 @@ const {
|
||||
sendToReview,
|
||||
publish,
|
||||
updateQuestion,
|
||||
updateSharedAuthors
|
||||
updateSharedAuthors,
|
||||
sendPaginationData
|
||||
} = require('../../../controllers/api/v1/consultancy')
|
||||
|
||||
router.get('/entry-pagination', sendPaginationData)
|
||||
|
||||
router.get('/entry', listEntries)
|
||||
|
||||
router.get('/new-entry', listNewEntries)
|
||||
|
||||
// All routes require an authenticated user.
|
||||
router.use((req, res, next) => {
|
||||
if (req.isAuthenticated()) return next()
|
||||
res.status(400).send('Unauthenticated')
|
||||
})
|
||||
|
||||
router.get('/entry', listEntries)
|
||||
|
||||
router.get('/new-entry', listNewEntries)
|
||||
|
||||
router.post('/entry', createQuestion)
|
||||
|
||||
router.put('/entry', updateQuestion)
|
||||
|
||||
@@ -20,6 +20,18 @@ router.get('/:dictionaryId/listDomainLabels', dictionaries.listDomainLabels)
|
||||
// Change page in pagination
|
||||
router.get('/listSecondaryDomains', dictionaries.listSecondaryDomains)
|
||||
|
||||
// Change page in pagination
|
||||
router.get(
|
||||
'/:dictionaryId/showImportFromFileForm',
|
||||
dictionaries.showImportFromFileForm
|
||||
)
|
||||
|
||||
// Change page in pagination
|
||||
router.get(
|
||||
'/:dictionaryId/showExportToFileForm',
|
||||
dictionaries.showExportToFileForm
|
||||
)
|
||||
|
||||
// Delete all entries of specific dictionary.
|
||||
router.delete('/:dictionaryId/entries/all', dictionaries.deleteAllEntries)
|
||||
|
||||
@@ -28,8 +40,15 @@ router.put('/:dictionaryId/entries/all/publish', dictionaries.publishAllEntries)
|
||||
|
||||
// Import term candidates from extraction.
|
||||
router.post(
|
||||
'/:id/import/extraction/:extractionId',
|
||||
dictionaries.extractionImport
|
||||
'/:id/import-extraction/:extractionId',
|
||||
dictionaries.importFromExtraction
|
||||
)
|
||||
|
||||
// Export dictionary into a file.
|
||||
router.post('/:id/export-begin', dictionaries.exportBegin)
|
||||
|
||||
router.get('/:dictionaryId/domainLabels', dictionaries.listFilteredDomainLabels)
|
||||
|
||||
router.get('/secondaryDomains', dictionaries.listSecondaryDomainData)
|
||||
|
||||
module.exports = router
|
||||
|
||||
@@ -17,7 +17,7 @@ router.use((req, res, next) => {
|
||||
|
||||
router.get('/vprasanje/admin/novo', consultancyAdmin.new)
|
||||
|
||||
router.get('/vprasanje/admin/uporabniki', consultancyAdmin.users)
|
||||
router.get('/vprasanje/admin/svetovalci', consultancyAdmin.users)
|
||||
|
||||
router.get('/vprasanje/admin/zavrnjeno', consultancyAdmin.rejected)
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ router.get(
|
||||
// Show a page to preview, create or edit dictionary entries and their comments.
|
||||
router.get(
|
||||
'/:dictionaryId/vsebina',
|
||||
user.isDictionaryEditor,
|
||||
user.canContentEdit,
|
||||
dictionary.showContent
|
||||
)
|
||||
|
||||
@@ -127,4 +127,7 @@ router.get(
|
||||
dictionary.showImportFromExtractionForm
|
||||
)
|
||||
|
||||
// Download dictionary export file.
|
||||
router.get('/export-download/:exportId', dictionary.exportDownload)
|
||||
|
||||
module.exports = router
|
||||
|
||||
+23
-12
@@ -1,4 +1,5 @@
|
||||
const router = require('express-promise-router')()
|
||||
const { isAuthenticated: isUserAuthenticated } = require('../middleware/user')
|
||||
const db = require('../models/db')
|
||||
const cache = require('../models/cache')
|
||||
const { searchEngineClient } = require('../models/search-engine')
|
||||
@@ -67,12 +68,12 @@ router.get('/demo-paginacija', demoPaginacija.izrišiStran)
|
||||
|
||||
// Render help page
|
||||
router.get('/pomoc', (req, res) => {
|
||||
res.render('pages/help', { title: 'Pomoč' })
|
||||
res.render('pages/help', { title: req.t('Pomoč') })
|
||||
})
|
||||
|
||||
// Create a route to download pdf
|
||||
router.get('/pomoc/pdf', (req, res) => {
|
||||
res.download('public/documents/Podrocja_TP_2022-11-28.pdf')
|
||||
res.download('public/documents/Tabela.pdf')
|
||||
})
|
||||
|
||||
// Create a route to download guidance pdf
|
||||
@@ -80,6 +81,11 @@ router.get('/pomoc/guidance-pdf', (req, res) => {
|
||||
res.download('public/documents/RSDO_smernice.pdf')
|
||||
})
|
||||
|
||||
// Create a route to download schema
|
||||
router.get('/slovarji/xml-schema', (req, res) => {
|
||||
res.download('public/documents/dictionary_schema.xsd')
|
||||
})
|
||||
|
||||
// Render demo help pug page.
|
||||
router.get('/pomoc-pug-demo', (req, res) => {
|
||||
res.render('pages/help-pug-demo-frame', { title: 'Pomoč - pug demo' })
|
||||
@@ -93,24 +99,29 @@ router.post('/users/logout', user.logout)
|
||||
|
||||
// Render privacy policy page
|
||||
router.get('/politika-zasebnosti', (req, res) => {
|
||||
res.render('pages/privacy-policy', { title: 'Politika zasebnosti' })
|
||||
res.render(`pages/privacy-policy_${req.language}`, {
|
||||
title: req.t('titlePrivacyPolicy')
|
||||
})
|
||||
})
|
||||
|
||||
// Render terms of use page
|
||||
router.get('/pogoji-uporabe', (req, res) => {
|
||||
res.render('pages/terms-of-use', { title: 'Pogoji uporabe' })
|
||||
res.render(`pages/terms-of-use_${req.language}`, {
|
||||
title: req.t('titleTermsOfUse')
|
||||
})
|
||||
})
|
||||
|
||||
// All routes require an authenticated user.
|
||||
router.use((req, res, next) => {
|
||||
if (req.isAuthenticated()) return next()
|
||||
res.redirect('/')
|
||||
})
|
||||
router.get('/moj-racun', isUserAuthenticated, index.myProfile)
|
||||
|
||||
router.get('/moj-racun', index.myProfile)
|
||||
router.get('/izbrisi-racun', isUserAuthenticated, index.deleteProfile)
|
||||
|
||||
router.get('/spremeni-geslo', index.changePassword)
|
||||
router.get('/spremeni-geslo', isUserAuthenticated, index.changePassword)
|
||||
|
||||
router.get('/nastavitve-racuna', index.userSettings)
|
||||
router.get('/nastavitve-racuna', isUserAuthenticated, index.userSettings)
|
||||
|
||||
router.get('/ponastavitev-gesla', index.resetPassword)
|
||||
|
||||
// Change user locale.
|
||||
router.get('/spremeni-jezik/:languageCode', index.changeUserLanguage)
|
||||
|
||||
module.exports = router
|
||||
|
||||
Reference in New Issue
Block a user