Commit e581c638 authored by Bertrand PINEL's avatar Bertrand PINEL

Add Bootstrp and model table to make things look better

parent 5aad4d27
import Ember from 'ember';
export default Ember.Controller.extend({
rackTableColumns: Ember.computed(function() {
var col = Ember.A([
Ember.Object.create({
propertyName: "name",
title: "Name"
}),
Ember.Object.create({
propertyName: 'nbColumns',
title: 'Nombre de colonnes',
}),
Ember.Object.create({
propertyName: 'nbRows',
title: 'Nombre de lignes',
}),
Ember.Object.create({
"template": "customcell/imagecell",
title: 'Image',
})
]);
return col;
}),
rackTableContent: Ember.computed(function() {
return this.get("model");
})
});
<h1>Ember Cellar</h1>
{{outlet}}
<div class="container">
<div class="page-header">
<h1>Ember Cellar</h1>
<p class="lead">Basic layout using Bootstrap for a simple wine application</p>
</div>
{{outlet}}
</div>
{{!`record` - row from model, current column is available as `column`}}
<img src='{{record.image}}' height="128" width="128"/>
<h2>List of Racks</h2>
<div class="detail">
{{#each model as |rack|}}
<article class="listing">
<h3>{{rack.name}}</h3>
<div class="detail">
<span>Nb Colums:</span> {{rack.nbColumns}}
<span>Nb Rows:</span> {{rack.nbRows}}
</div>
<div class="detail">
<img src={{rack.image}} width='235px' height='235px'/>
</div>
</article>
{{/each}}
{{models-table
data=rackTableContent
columns=rackTableColumns}}
{{outlet}}
</div>
......@@ -3,7 +3,11 @@ const EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function(defaults) {
var app = new EmberApp(defaults, {
// Add options here
'ember-bootstrap': {
'bootstrapVersion': 3,
'importBootstrapFont': true,
'importBootstrapCSS': true
}
});
// Use `app.import` to add additional libraries to the generated
......
import { moduleFor, test } from 'ember-qunit';
moduleFor('controller:racks', 'Unit | Controller | racks', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
// Replace this with your real tests.
test('it exists', function(assert) {
let controller = this.subject();
assert.ok(controller);
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment