mirror of https://github.com/calzoneman/sync.git
Add HTML template config, fixes to account profile page
This commit is contained in:
parent
e70be5df42
commit
8313e7b006
|
@ -24,6 +24,11 @@ https:
|
|||
passphrase: ''
|
||||
certfile: 'localhost.cert'
|
||||
|
||||
# Page template values
|
||||
html-template:
|
||||
title: 'CyTube',
|
||||
description: 'Free, open source synchtube'
|
||||
|
||||
# Socket.IO server details
|
||||
io:
|
||||
port: 1337
|
||||
|
|
|
@ -57,6 +57,10 @@ var defaults = {
|
|||
aliases: {
|
||||
"purge-interval": 3600000,
|
||||
"max-age": 2592000000
|
||||
},
|
||||
"html-template": {
|
||||
title: "CyTube Beta",
|
||||
description: "Free, open source synchtube"
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1,29 +1,21 @@
|
|||
/**
|
||||
* web/jade.js - Provides functionality for rendering/serving jade templates
|
||||
*
|
||||
* @author Calvin Montgomery <cyzon@cyzon.us>
|
||||
*/
|
||||
|
||||
var jade = require('jade');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var templates = path.join(__dirname, '..', '..', 'templates');
|
||||
var jade = require("jade");
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
var Config = require("../config");
|
||||
var templates = path.join(__dirname, "..", "..", "templates");
|
||||
|
||||
var cache = {};
|
||||
|
||||
/**
|
||||
* Merges locals with globals for jade rendering
|
||||
*
|
||||
* @param {Object} locals - The locals to merge
|
||||
* @return {Object} an object containing globals and locals
|
||||
*/
|
||||
function merge(locals) {
|
||||
var _locals = {
|
||||
siteTitle: 'CyTube Beta',
|
||||
siteDescription: 'Free, open source synchtube',
|
||||
siteAuthor: 'Calvin "calzoneman" "cyzon" Montgomery'
|
||||
siteTitle: Config.get("html-template.title"),
|
||||
siteDescription: Config.get("html-template.description"),
|
||||
siteAuthor: "Calvin 'calzoneman' 'cyzon' Montgomery"
|
||||
};
|
||||
if (typeof locals !== 'object') {
|
||||
if (typeof locals !== "object") {
|
||||
return _locals;
|
||||
}
|
||||
for (var key in locals) {
|
||||
|
@ -34,14 +26,10 @@ function merge(locals) {
|
|||
|
||||
/**
|
||||
* Renders and serves a jade template
|
||||
*
|
||||
* @param res - The HTTP response
|
||||
* @param view - The view to render
|
||||
* @param locals - The locals to pass to the renderer
|
||||
*/
|
||||
function sendJade(res, view, locals) {
|
||||
if (!(view in cache) || process.env['DEBUG']) {
|
||||
var file = path.join(templates, view + '.jade');
|
||||
if (!(view in cache) || process.env["DEBUG"]) {
|
||||
var file = path.join(templates, view + ".jade");
|
||||
var fn = jade.compile(fs.readFileSync(file), {
|
||||
filename: file,
|
||||
pretty: true
|
||||
|
|
|
@ -26,7 +26,7 @@ html(lang="en")
|
|||
.alert.alert-danger.center.messagebox
|
||||
strong Profile Error
|
||||
p= profileError
|
||||
.profile-box(style="position: inherit")
|
||||
.profile-box(style="position: inherit; z-index: auto;")
|
||||
img.profile-image(src=profileImage)
|
||||
strong= loginName
|
||||
p= profileText
|
||||
|
|
|
@ -29,7 +29,7 @@ mixin navdefaultlinks(page)
|
|||
if loggedIn
|
||||
li: a(href="/logout?redirect=#{page}") Logout
|
||||
li.divider
|
||||
li: a(href="/account/channels") My Channels
|
||||
li: a(href="/account/channels") Channels
|
||||
li: a(href="/account/profile") Profile
|
||||
li: a(href="/account/edit") Change Password/Email
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue