const pagesInfo = (req, res, next) => {
    const page = req.originalUrl;
    switch (page) {
        case '/':
            res.locals.page = 'index';
            res.locals.title = '';
            res.locals.layout = './layouts/layout';
            break;
        case '/admin':
            res.locals.page = 'admin';
            res.locals.title = '國立臺北護理健康大學 課程委員會 使用者管理';
            res.locals.layout = './layouts/compiler';
            break;
        case '/create':
            res.locals.page = 'create';
            res.locals.title = '國立臺北護理健康大學 課程委員會 新增會議記錄';
            res.locals.layout = './layouts/compiler';
            break;
        case '/minutes':
            res.locals.page = 'minutes';
            res.locals.title = '國立臺北護理健康大學 課程委員會 會議記錄管理';
            res.locals.layout = './layouts/compiler';
            break;
        case '/search':
            res.locals.page = 'search';
            res.locals.title = '國立臺北護理健康大學 課程委員會 會議記錄查詢';
            res.locals.layout = './layouts/compiler';
            break;
        case '/register':
            res.locals.page = 'register';
            res.locals.title = '';
            res.locals.layout = './layouts/layout';
            break;
        case '/public':
            res.locals.page = 'public';
            res.locals.title = `<font size='6'>國立臺北護理健康大學課程委員會 會議記錄</font>`;
            res.locals.layout = './layouts/compiler';
            break;
    }
    return next();
};

module.exports = pagesInfo;
