mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-01-12 22:27:09 +08:00
app.loadCoreTemplates fix #89
This commit is contained in:
12
app.coffee
12
app.coffee
@@ -35,8 +35,16 @@ exports.checkEnvironment = ->
|
||||
unless fs.existsSync session_key_path
|
||||
fs.writeFileSync session_key_path, crypto.randomBytes(48).toString('hex')
|
||||
|
||||
exports.loadCoreTemplates = ->
|
||||
app.template_data = {}
|
||||
|
||||
for filename in fs.readdirSync "#{__dirname}/core/template"
|
||||
template_name = path.basename filename, path.extname(filename)
|
||||
app.template_data[template_name] = fs.readFileSync "#{__dirname}/core/template/#{filename}"
|
||||
|
||||
exports.run = ->
|
||||
exports.checkEnvironment()
|
||||
exports.loadCoreTemplates()
|
||||
|
||||
{user, password, host, name} = config.mongodb
|
||||
|
||||
@@ -73,10 +81,6 @@ exports.run = ->
|
||||
app.notification = require './core/notification'
|
||||
app.authenticator = require './core/authenticator'
|
||||
|
||||
app.template_data =
|
||||
ticket_create_email: fs.readFileSync('./core/template/ticket_create_email.html').toString()
|
||||
ticket_reply_email: fs.readFileSync('./core/template/ticket_reply_email.html').toString()
|
||||
|
||||
app.use connect.json()
|
||||
app.use connect.urlencoded()
|
||||
app.use connect.logger()
|
||||
|
||||
Reference in New Issue
Block a user