-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added default index page, default startPage, removed iframe (#250)
* Removed iframe, added default index page, made startPage optional parameter * Renamed class for landing content * Added paddings for message in index page, removed iframe link from index * Renamed landing to greeting * rm extra margins, upd svg Co-authored-by: Peter Savchenko <[email protected]>
- Loading branch information
Showing
7 changed files
with
50 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,31 @@ | ||
import express, { Request, Response } from 'express'; | ||
import verifyToken from './middlewares/token.js'; | ||
import PagesOrder from '../controllers/pagesOrder.js'; | ||
import Pages from '../controllers/pages.js'; | ||
|
||
|
||
const router = express.Router(); | ||
|
||
/* GET home page. */ | ||
router.get('/', verifyToken, async (req: Request, res: Response) => { | ||
const config = req.app.locals.config; | ||
|
||
// Check if config consists startPage | ||
if (config.startPage) { | ||
return res.redirect(config.startPage); | ||
} else { | ||
const pageOrder = await PagesOrder.getRootPageOrder(); | ||
|
||
// Check if page order consists | ||
if (pageOrder.order.length > 0) { | ||
// Get the first parent page | ||
const page = await Pages.get(pageOrder.order[0]); | ||
|
||
res.redirect(page.uri!); | ||
} else { | ||
res.render('pages/index', { isAuthorized: res.locals.isAuthorized }); | ||
} | ||
} | ||
res.render('pages/index', { isAuthorized: res.locals.isAuthorized }); | ||
}); | ||
|
||
export default router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
.greeting-body { | ||
display: flex; | ||
flex-direction: column; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.greeting-content { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
margin: auto; | ||
|
||
& > svg { | ||
width: 62px; | ||
height: 71px; | ||
} | ||
|
||
&__message { | ||
margin: 0; | ||
padding: 26px 0 26px 0; | ||
font-weight: 500; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.