Skip to content

Commit

Permalink
Display collection header.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Aufreiter committed Oct 3, 2013
1 parent b0b2cf4 commit 7716eee
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 16 deletions.
50 changes: 37 additions & 13 deletions library.css
Expand Up @@ -24,12 +24,10 @@
display: block; display: block;
padding: 20px; padding: 20px;
margin-left: 30px; margin-left: 30px;

margin-right: 20px; margin-right: 20px;
margin-bottom: 20px; margin-bottom: 20px;
} }



.library-view .collection .teaser { .library-view .collection .teaser {
position: absolute; position: absolute;
top: 40px; top: 40px;
Expand Down Expand Up @@ -58,17 +56,6 @@
} }




.library-view .collection.active {
background: #fff;
}

.library-view .navigation .label {
margin-top: 30px;
padding-bottom: 20px;
font-family: 'Avenir LT W01 85 Heavy', 'Montserrat', 'Source Sans Pro';
font-size: 16px;
}

/* Collection View /* Collection View
======================================= */ ======================================= */


Expand All @@ -83,6 +70,43 @@
padding-top: 30px; padding-top: 30px;
} }




/* Collection metadata */

.collection-view .collection {
position: relative;
display: block;
padding: 40px;
padding-top: 20px;
margin-left: 30px;
margin-right: 20px;
margin-bottom: 20px;
border-bottom: 2px solid #ccc;
}

.collection-view .collection .teaser {
position: absolute;
top: 40px;
right: 20px;
width: 100px;
border-radius: 50px;
}

.collection-view .collection .name {
font-family: 'Avenir LT W01 85 Heavy', 'Montserrat', 'Source Sans Pro';
font-size: 26px;
}

.collection-view .collection .description {
color: rgba(0,0,0, 0.7);
padding: 10px 0;
margin-right: 100px;
font-size: 18px;
}

/* Records stuff */

.collection-view .record { .collection-view .record {
display: block; display: block;
background: white; background: white;
Expand Down
22 changes: 19 additions & 3 deletions src/collection_view.js
Expand Up @@ -6,6 +6,7 @@ var html = util.html;
var View = require("substance-application").View; var View = require("substance-application").View;
var $$ = require("substance-application").$$; var $$ = require("substance-application").$$;



// Substance.Collection.View // Substance.Collection.View
// ========================================================================== // ==========================================================================
// //
Expand All @@ -23,15 +24,32 @@ CollectionView.Prototype = function() {
// Rendering // Rendering
// -------- // --------
// //
// .collection // .collection-view
// .records // .records
// .title // .title
// .authors // .authors


this.render = function() { this.render = function() {

// Render the collection // Render the collection
var collection = this.collectionCtrl.collection; var collection = this.collectionCtrl.collection;
var records = collection.records; var records = collection.records;

// Collection metadata
// ----------

this.el.appendChild($$('.collection', {
children: [
$$('.name', {text: collection.name}),
$$('.description', {text: collection.description}),
$$('img.teaser', {src: collection.image})
]
}));


// Collection records
// ----------

var recordsEl = $$('.records'); var recordsEl = $$('.records');


// Sort by published_on date // Sort by published_on date
Expand Down Expand Up @@ -74,8 +92,6 @@ CollectionView.Prototype = function() {
children: children children: children
})); }));




}, this); }, this);


this.el.appendChild(recordsEl); this.el.appendChild(recordsEl);
Expand Down

0 comments on commit 7716eee

Please sign in to comment.