Skip to content

Commit

Permalink
Merge branch 'master' of github.com:maxbbn/rating-app
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbbn committed Nov 5, 2011
2 parents a3ea063 + 520bb0c commit 159b306
Show file tree
Hide file tree
Showing 17 changed files with 387 additions and 86 deletions.
2 changes: 0 additions & 2 deletions modules/auth.js
Expand Up @@ -5,8 +5,6 @@ var User = require('./index').User;

exports.everyauth = everyauth;

//everyauth.debug = true;
//
everyauth.everymodule.findUserById(function(userId, callback){
User.findById(userId, callback);
});
Expand Down
2 changes: 1 addition & 1 deletion public/bootstrap
Submodule bootstrap updated 1 files
+2 −2 lib/patterns.less
19 changes: 16 additions & 3 deletions public/css/boothack.less
@@ -1,9 +1,22 @@
// Focus states
a {
color:#3399CC;
&:hover {
color: #2e89b6;
}
}
a:focus {
outline: thin dotted;
}
// Hover & Active
a:hover,
a:active {
outline: 0;
}

.topbar div > ul, .nav {
.active > a {
background-color: #1d648e;
background-color: rgba(27,94,134,.5);
}
.menu-dropdown,.dropdown-menu {
background-color:#123e58;
}
}
129 changes: 112 additions & 17 deletions public/css/share.less
Expand Up @@ -3,48 +3,147 @@
#main{
padding-top:50px;
}
html,body {
background:#cdcdcd url(http://img04.taobaocdn.com/tps/i4/T1KWCyXo0pXXXXXXXX-164-164.png) 0 0;
}

.navback {
float:right;
padding:10px;
}

// 分享
.ratelist {
.clearfix();
margin:0;
list-style:none;
}
.rateitem {
@shareWidth : 195px;
@shareBorder : 10px;
@shareBorderRadius:3px;
.shareitem{
width:@shareWidth;
height:@shareWidth;
margin:0 50px 50px 0;
color:#666;
float:left;
width:260px;
height:260px;
border:1px solid #888;
margin-left:-1px;
margin-top:-1px;
padding:10px;
position:relative;
.cover {
.transition(all .2s ease-in);
width:@shareWidth;
height:@shareWidth;
position:absolute;
z-index:1;
.border-radius(@shareBorderRadius);
}
.wrap {
border:@shareBorder solid #fff;
height:@shareWidth - @shareBorder*2;
.border-radius(@shareBorderRadius);
}
.cnt {
.transition(all .2s ease-in);
width:@shareWidth;
height:@shareWidth;
position:absolute;
z-index:0;
.border-radius(@shareBorderRadius);
background-color:rgba(255,255,255,0);
}
&:hover {
.cnt {
z-index:2;
background-color:rgba(255,255,255,0.5);
}
.cover {
opacity:.3;
}

}
h3 {
font-size:14px;
line-height:1.5;
padding:5px;
}
.score {
display:none;
}
.desc {
padding:5px;
}
.author {
font-weight:bold;
}
.act {
padding:5px;
position:absolute;
bottom:@shareBorder;
left:@shareBorder;
width:@shareWidth - @shareBorder*2;
}
}

.slideshare {
width:580px;
background:#fff;
}
.desc {
color : @gray;
margin-bottom:20px;
}

// 标签
.tags {
.clearfix();
list-style:none;
margin:0;
li {
float:left;
margin: 5px 5px 0 0;
}
a {
display:inline-block;
padding:5px;
margin-right:10px;
background:#eee;
#gradient .vertical(#f2f2f2, #ddd);
}
a:hover {
text-decoration:none;
color:#fff;
#gradient .vertical(#666, #333);
}
}
.slideshare {
width:580px;
}


// 分享会
.setitem {
padding:10px 0;
margin:20px 0;
border-bottom:1px solid #b9b9b9;
border-right:1px solid #b9b9b9;
border-left:1px solid #b9b9b9;
margin-bottom:20px;
border-bottom:1px solid #ddd;
background:#fff;
.box-shadow();
.hd {
background:#d5d5d7;
height:24px;
border-bottom:1px solid #b7bac1;
}
.bd {
padding:10px;
}
.a {
color:#39c
}
dl {
.clearfix();
}
dt, dd {
float:left;
}
dd {
margin-right:20px;
}
}

//fix calendar
Expand All @@ -57,7 +156,3 @@
}
}

.desc {
color : @gray;
margin-bottom:20px;
}
Binary file added public/img/default-cover.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions public/js/rate/tags.js
@@ -0,0 +1,15 @@
KISSY.add('rate/tags',function(S){
var $ = S.all;

var temp = S.one('#temp-tags')[0].innerHTML;
var tagsTmpl = new S.Template(temp);

S.io({
url : '/json/tags',
dataType : 'json',
type : 'get',
success : function(data){
$('#tags .bd').html(tagsTmpl.render(data));
}
});
});
8 changes: 5 additions & 3 deletions routers/shareset.js
Expand Up @@ -59,10 +59,12 @@ exports.create = function(req,res){
exports.show = function(req,res, next){
var ss = req.shareset;
Share.find({shareset : ss._id, deleted : {$ne : true}}, function(err, docs){
var isOwner = req.loggedIn && req.user._id.toString() == ss.owner.toString();
if(err) return next(err);
res.render('shareset/show',{
title : ss.subject
,shareset : ss
,isOwner : isOwner
,shares : docs
});
});
Expand All @@ -87,13 +89,13 @@ exports.update = function(req,res){
shareset.save(function(error,saved){
if(error && error.errors){
res.send({
success : false
,errors : error.errors
errors : error.errors
});
return;
}
res.send({
success : true,
errors : null,
action : 'redirect',
redirect : '/shareset/' + saved._id
});
});
Expand Down
1 change: 1 addition & 0 deletions views/404.jade
@@ -0,0 +1 @@
h1 page not found!
1 change: 1 addition & 0 deletions views/500.jade
@@ -0,0 +1 @@
div= error
29 changes: 29 additions & 0 deletions views/index.jade
@@ -0,0 +1,29 @@
script
KISSY.use('rate/app',function(S,App){
App.nav('home');
});

script#temp-tags(type='kissy/template')
|<ul class='tags'>
| {{#each tags as tag}}
| <li><a href='/list?tags={{tag}}'>{{tag}}</a></li>
| {{/each}}
|</ul>

div.box
.hd
h3 分享会
.bd!= partial('partial/links')
.box
.hd
h3 常用链接
.bd
ul.links
li
a(href='https://is.taobao.org/meeting/') 会议室预定
div#tags.box
.hd
h3 标签
.bd
script
KISSY.use('rate/home');
57 changes: 57 additions & 0 deletions views/layout.jade
@@ -0,0 +1,57 @@
!!! 5
html
head
title= title
link(rel='stylesheet/less', href='/css/share.less')
script(src='/lib/less/1.1.3/less.min.js')
meta(name='viewport',content='width=device-width, initial-scale = 1.0, user-scalable = no')
-if(typeof css !== "undefined" )
-if(css=="rate")
link(rel='stylesheet', href='/stylesheets/rate2.css')
script(src='http://a.tbcdn.cn/s/kissy/1.2.0/kissy-min.js')
script(src='');
script(src='/js/template-pkg-min.js')
script
KISSY.config({
packages : [{
name : 'rate',
path : '/js'
}]
});
KISSY.Config.debug = true;
script
KISSY.use('rate/app');
body
div.topbar(data-dropdown='dropdown')
div.topbar-inner
.container
h3
a.brand(href='/') 分享平台
ul.nav
li(id='nav-home')
a(href="/") 首页
li(id='nav-setlist')
a(href="/shareset/") 分享会
li(id='nav-list')
a(href="/share") 分享
li#nav-create
a(href='/shareset/new') 组织分享
ul.nav.secondary-nav
- if(!everyauth.loggedIn)
li.dropdown
a.dropdown-toggle(href='/login') 未登录
ul.dropdown-menu
li
a(href='/login') 登录
li
a(href='/register') 注册
- else
li.dropdown
a.dropdown-toggle(href='#')= user.login
ul.dropdown-menu
li
a(href='/logout') 退出
div#main.container!= body
div.footer
script(src="/lib/jquery/1.6.4/jquery.min.js")
script(src="/bootstrap/js/bootstrap-dropdown.js")
5 changes: 5 additions & 0 deletions views/partial/links.jade
@@ -0,0 +1,5 @@
ul.links
li
a(href="/list/?tag=firebird") 火鸟分享
li
a(href="/list/?tag=firebird") STS分享分享会

0 comments on commit 159b306

Please sign in to comment.