forked from NeuOL/neuola-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
160 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2022,4 +2022,4 @@ | |
}) | ||
|
||
|
||
}(window.jQuery); | ||
}(window.jQuery); |
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
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
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,66 @@ | ||
|
||
/** | ||
* The initialization module for Neuola. | ||
* | ||
*/ | ||
|
||
var model = require('../my/model') | ||
, async = require('async') | ||
; | ||
|
||
module.exports = function (req, res) { | ||
model.User.find({role:0}).count(function (err, count) { | ||
if (count == 0) { | ||
function catalog(meta) { | ||
var c = new model.Catalog(meta); | ||
return function (callback) { | ||
c.save(callback); | ||
}; | ||
} | ||
var tasks = { | ||
admin: function (callback) { | ||
var admin = new model.User({ | ||
name: 'admin', | ||
password: 'admin', | ||
role: 0, | ||
description: '高级管理员', | ||
verified: true | ||
}); | ||
admin.save(function (err) { | ||
if (err) { | ||
res.render('res'); | ||
} | ||
}); | ||
}, | ||
catalogExplore: catalog({ | ||
name: '精选', | ||
description: '发现这个世界的故事。', | ||
id: 'explore' | ||
}), | ||
catalogActivities: catalog({ | ||
name: '活动', | ||
description: '正在进行的活动。', | ||
id: 'news' | ||
}) | ||
}; | ||
async.parallel(tasks, function (err, result) { | ||
if (err) { | ||
res.render('error', { | ||
message: '初始化错误!', | ||
link: '/' | ||
}); | ||
} else { | ||
res.render('info', { | ||
message: '初始化成功!', | ||
link: '/' | ||
}); | ||
} | ||
}); | ||
} else { | ||
res.render('error', { | ||
message: 'Nothing', | ||
link: '/' | ||
}); | ||
} | ||
}); | ||
}; |
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
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,6 @@ | ||
if posts.length > 0 | ||
.date #{posts[0].date.getMonth()}月#{posts[0].date.getDate()}日 | ||
.text 「文章」 | ||
a(href=_('/article/'+posts[0].url)) #{posts[0].title} | ||
else | ||
.no-result 还没有文章哦~ |
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 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