[demos/search][s]: minor refactoring of facets in sidebar and styling.

This commit is contained in:
Rufus Pollock
2012-10-04 07:26:57 +01:00
parent cc9389a689
commit 15b53b4703
2 changed files with 24 additions and 8 deletions

View File

@@ -18,9 +18,10 @@ var createSearch = function(dataset, state) {
{{#records}} \ {{#records}} \
<div class="record"> \ <div class="record"> \
<h3> \ <h3> \
{{title}} \ {{title}} <em>by {{Author}}</em> \
</h3> \ </h3> \
<p>{{description}} \ <p>{{description}}</p> \
<p><code>${{price}}</code></p> \
</div> \ </div> \
{{/records}} \ {{/records}} \
'; ';
@@ -36,7 +37,7 @@ var createSearch = function(dataset, state) {
}, },
{silent: true} {silent: true}
); );
dataset.queryState.addFacet('author'); dataset.queryState.addFacet('Author');
dataset.query(); dataset.query();
} }
@@ -97,15 +98,21 @@ var SearchView = Backbone.View.extend({
var simpleData = [ var simpleData = [
{ {
title: 'War and Peace', title: 'War and Peace',
description: 'The epic tale ...', description: 'The epic tale of love, war and history',
author: 'Tolstoy', Author: 'Tolstoy',
price: 7.99 price: 7.99
}, },
{ {
title: 'Anna Karenina', title: 'Anna Karenina',
description: 'How things go wrong in love and ultimately lead to suicide. This is why you should not have affairs, girls!', description: 'How things go wrong in love and ultimately lead to suicide. This is why you should not have affairs, girls!',
author: 'Tolstoy', Author: 'Tolstoy',
price: 8.50 price: 8.50
},
{
title: "Fathers and Sons",
description: "Another 19th century Russian novel",
Author: "Turgenev",
price: 11
} }
]; ];

View File

@@ -57,12 +57,21 @@ root: ../../
} }
.results { .results {
margin-right: 300px; margin-right: 290px;
border-right: #eee 1px solid;
padding-right: 20px;
} }
.sidebar { .sidebar {
width: 250px; height: 100%;
width: 270px;
float: right; float: right;
padding-left: 10px;
}
ul.facet-items {
list-style-type: none;
margin-left: 0;
} }
</style> </style>