Rework recently shared a bit

This commit is contained in:
Jonathan Cremin 2014-12-06 12:24:03 +00:00
parent a104d86eec
commit d8d88de74c
3 changed files with 4 additions and 4 deletions

2
app.js
View file

@ -65,7 +65,7 @@ app.get('/', function(req, res) {
];
// shitty sort until I add more metadata on cached items
req.db.matches.find().sort({$natural:-1}).limit(4).toArray().then(function(docs){
req.db.matches.find().sort({$natural:-1}).limit(6).toArray().then(function(docs){
res.render('index', { page: "home", samples: samples, recent: docs, error: req.flash('search-error') });
});
});

View file

@ -108,7 +108,7 @@ h3 {
margin-bottom: 50px;
}
.recent {
.recent img {
margin-bottom: 30px;
}

View file

@ -32,9 +32,9 @@
<% if (recent.length) { %><h2>Recently Shared</h2><% } %>
<div class="row recent">
<% for (var i=0;i < recent.length;i++) { var item = recent[i].items[0]; %>
<div class="col-md-6">
<div class="col-sm-4 col-xs-6">
<a href="/<%= item.service.replace("playmusic", "") %>/<%= item.type %>/<%= item.id %>"><img src="<%= item.artwork %>" width="100%"></a>
</div><% if((i+1)%2 == 0) { %></div><div class="row"><% } %>
</div>
<% } %>
</div>
</div>