mirror of
https://github.com/cnodejs/nodeclub.git
synced 2025-12-08 19:55:55 +00:00
Add tag topic list page's background image css.
This commit is contained in:
parent
755fa98ff2
commit
17b2cc7bf2
@ -31,8 +31,23 @@ exports.list_topic = function(req,res,next){
|
||||
}
|
||||
}
|
||||
}
|
||||
res.render('tag/list_topic',{tag:tag,topics:topics,current_page:page,list_topic_count:limit,in_collection:collection,
|
||||
hot_topics:hot_topics,no_reply_topics:no_reply_topics,pages:pages});
|
||||
|
||||
if (tag.background=='') {
|
||||
var style = null;
|
||||
} else {
|
||||
var style = '#wrapper {background-image: url("'+tag.background+'")}';
|
||||
}
|
||||
|
||||
res.render('tag/list_topic',{
|
||||
tag:tag,topics:topics,
|
||||
current_page:page,
|
||||
list_topic_count:limit,
|
||||
in_collection:collection,
|
||||
hot_topics:hot_topics,
|
||||
no_reply_topics:no_reply_topics,
|
||||
pages:pages,
|
||||
extra_style:style
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -110,7 +125,7 @@ exports.add = function(req,res,next){
|
||||
var description = sanitize(req.body.description).trim();
|
||||
description = sanitize(description).xss();
|
||||
var background = sanitize(req.body.background).trim();
|
||||
background = sanitize(description).xss();
|
||||
background = sanitize(background).xss();
|
||||
var order = req.body.order;
|
||||
|
||||
if(name == ''){
|
||||
@ -162,6 +177,8 @@ exports.edit = function(req,res,next){
|
||||
var name = sanitize(req.body.name).trim();
|
||||
name = sanitize(name).xss();
|
||||
var order = req.body.order;
|
||||
var background = sanitize(req.body.background).trim();
|
||||
background = sanitize(background).xss();
|
||||
var description = sanitize(req.body.description).trim();
|
||||
description = sanitize(description).xss();
|
||||
if(name == ''){
|
||||
@ -170,6 +187,7 @@ exports.edit = function(req,res,next){
|
||||
}
|
||||
tag.name = name;
|
||||
tag.order = order;
|
||||
tag.background = background;
|
||||
tag.description = description;
|
||||
tag.save(function(err){
|
||||
if(err) return next(err);
|
||||
|
||||
@ -15,6 +15,11 @@
|
||||
<link rel="stylesheet" type="text/css" href="/libs/bootstrap/css/bootstrap.css" />
|
||||
<link rel="stylesheet" type="text/css" href="/stylesheets/style.css" />
|
||||
<link type='text/css' rel='stylesheet' href='/libs/code-prettify/prettify.css' />
|
||||
<% if (locals.extra_style) { %>
|
||||
<style type="text/css">
|
||||
<%- locals.extra_style %>
|
||||
</style>
|
||||
<% } %>
|
||||
<script src='/libs/code-prettify/prettify.js'></script>
|
||||
<!-- script -->
|
||||
<script src='/libs/jquery/jquery.js'></script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user