Skip to content

Commit

Permalink
[Update] Change structure and update stylesheets for catalog listing.
Browse files Browse the repository at this point in the history
  • Loading branch information
yfwz100 committed Feb 10, 2013
1 parent e9dfa00 commit 32f7978
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
1 change: 1 addition & 0 deletions my/model/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ postSchema.statics.list = function list(options, callback) {
self.find(options)
.populate('author')
.populate('catalog')
.sort({date:-1})
.exec(callback);
});
};
Expand Down
27 changes: 21 additions & 6 deletions public/stylesheets/catalog.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,35 @@
position: relative;
}

.author {
@dateboxbg: #049cdb;

.date-box {
width: 64px;
float: left;
margin: 10px;
margin: 8px 18px 8px 8px;
border: 2px solid @dateboxbg;
border-radius: 5px;
text-align: center;
overflow: hidden;

.date {
border-top: 1px solid #efefef;
margin-top: 0.5em;
background-color: @dateboxbg;
font-size: 30px;
color: #f3f3f3;
line-height: 50px;
}

.year {
float: left;
}

.month {
float: right;
}
}

.box {
width: 576px;
width: 566px;
float: left;

.title {
Expand All @@ -34,7 +49,7 @@
}

.description {
height: 3em;
height: 1.5em;
overflow: hidden;
margin: 0.5em;
}
Expand Down
2 changes: 1 addition & 1 deletion public/stylesheets/neuola.less
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ footer, #footer, .footer {
background-color: white;

.main-stage-inner {
padding: 10px;
padding: 20px 20px 0 20px;
}
}

8 changes: 3 additions & 5 deletions views/catalog.jade
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ block main-stage

.catalog-stage
mixin displayPost(post)
.author
.img
img(src=_(post.author.pic))
.text= post.author.name
.date= post.date.getFullYear()+'-'+(post.date.getMonth()+1)+'-'+post.date.getDate()
.date-box
.date= post.date.getDate()
.year-month= post.date.getFullYear()+' / '+(post.date.getMonth()+1)
.box
.title
a(href=_('/article/'+post.url))= post.title
Expand Down

0 comments on commit 32f7978

Please sign in to comment.