<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <title>Cowhide example</title>
+ <title>Calf: a Cowhide example</title>
<meta name="description" content="An example showcasing ivi-webui's capabilities.">
<meta name="viewport" content="width=device-width">
<button class="btn btn-primary" data-toggle="ch-button">Driving mode</button>
</div>
- <h2>Example application: music player.</h2>
+ <h2>Calf Music Player<small>A Cowhide example application.</small></h2>
<div id="application"></div>
</div> <!-- container -->
<!-- initial template of our application; it just installs the outlet. -->
<script type="text/x-handlebars" data-template-name="application">
- {{outlet}}
+ <div class="navbar navbar-inverse">
+ <div class="navbar-inner">
+ <a class="brand" href="#">Calf</a>
+ <ul class="nav">
+ <li><a href="/">Artists</a></li>
+ <li><a href="/">Albums</a></li>
+ <li><a href="/">Songs</a></li>
+ </ul>
+ </div>
+ </div>
+ <div class="content">
+ {{outlet}}
+ </div>
</script>
<script type="text/x-handlebars" data-template-name="artists">
- <h3>Artists</h3>
{{#each artist in controller}}
- <p>{{artist.lastName}}, {{artist.firstName}}
+ <li>
+ <strong>{{artist.lastName}}</strong>, {{artist.firstName}}
+ </li>
{{/each}}
</script>
(function(win) {
'use strict';
- win.CowhideMusic = window.Ember.Application.create({
+ win.Calf = window.Ember.Application.create({
VERSION: '0.1',
rootElement: '#application',
ready: function() {
var ApplicationController = Ember.Controller.extend({});
app.ApplicationController = ApplicationController;
-})(window.CowhideMusic, window.Ember);
\ No newline at end of file
+})(window.Calf, window.Ember);
\ No newline at end of file
});
app.ArtistsController = ArtistsController;
-})(window.CowhideMusic, window.Ember);
\ No newline at end of file
+})(window.Calf, window.Ember);
\ No newline at end of file
});
app.Router = Router;
-})(window.CowhideMusic, window.Ember);
+})(window.Calf, window.Ember);
});
app.ApplicationView = ApplicationView;
-})(window.CowhideMusic, window.Ember);
\ No newline at end of file
+})(window.Calf, window.Ember);
\ No newline at end of file
'use strict';
var ArtistsView = Ember.View.extend({
- templateName: 'artists'
+ templateName: 'artists',
+ tagName: 'ul',
+ classNames: ['item-list', 'striped']
});
app.ArtistsView = ArtistsView;
-})(window.CowhideMusic, window.Ember);
\ No newline at end of file
+})(window.Calf, window.Ember);
\ No newline at end of file
#application {
- border: 1px solid #ccc;
height: 540px;
overflow: hidden;
margin-bottom: 30px;
-}
\ No newline at end of file
+}
watch: {
files: [
'grunt.js',
+
'src/bootstrap/**/*.{js,less}',
'src/*.{js,less}',
'src/themes/*.less',
+ 'src/cowhide-less/*.less',
+
'example/javascripts/*.js',
'example/javascripts/app/*.js',
'example/javascripts/app/**/*.js',
+
'tests/**/*.js'
],
tasks: 'default'
@import "variables.less"; // Modify this for custom colors, font-sizes, etc
@import "mixins.less";
+// Cowhide additions
+@import "cowhide-item-lists.less";
+
// Grid system and page structure
@import "scaffolding.less";
@import "grid.less";
--- /dev/null
+ul.item-list {
+ margin-left: 0;
+
+ li {
+ list-style: none;
+ padding: 16px 8px;
+ background-color: darken(@bodyBackground, 5%);
+ border-left: 1px solid;
+ border-right: 1px solid;
+ border-bottom: 1px solid;
+ border-color: darken(@bodyBackground, 10%);
+
+ &:first-of-type, &:first-child {
+ .border-top-radius(4px);
+ border-top: 1px solid;
+ border-top-color: darken(@bodyBackground, 2.5%);
+ }
+ &:last-of-type, &:first-child {
+ .border-bottom-radius(4px);
+ border-bottom: 1px solid;
+ border-bottom-color: darken(@bodyBackground, 15%);
+ }
+
+ &:hover {
+ background-color: darken(@bodyBackground, 1%);
+ }
+ }
+}
+
+ul.item-list.striped {
+ li {
+ &:nth-child(even), &:nth-of-type(even) {
+ background-color: darken(@bodyBackground, 3%);
+ &:hover {
+ background-color: darken(@bodyBackground, 2%);
+ }
+ }
+ }
+}
\ No newline at end of file
@import "bootstrap/less/bootstrap.less";
+
@import "themes/cyborg-variables.less";
@import "themes/cyborg-bootswatch.less";
+
+// TODO: this doesn't seem to work.
+@import "themes/cyborg-item-lists.less";
-@import "bootstrap/less/bootstrap.less";
\ No newline at end of file
+@import "bootstrap/less/bootstrap.less";
--- /dev/null
+ul.item-list {
+ li {
+ background-color: lighten(@bodyBackground, 5%);
+ border-color: lighten(@bodyBackground, 10%);
+
+ &:first-of-type, &:first-child {
+ border-top-color: lighten(@bodyBackground, 2.5%);
+ }
+ &:last-of-type, &:first-child {
+ border-bottom-color: lighten(@bodyBackground, 15%);
+ }
+ }
+}
+
+ul.item-list.striped {
+ li {
+ &:nth-child(even), &:nth-of-type(even) {
+ background-color: lighten(@bodyBackground, 3%);
+ }
+ }
+}
\ No newline at end of file