From 825b5b0d8916da9c0b17c7c9ddbd3fa4193a19f9 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Wed, 13 Sep 2017 06:20:34 -0700 Subject: [PATCH 1/4] WIP --- app/components/ccdb-pagination.js | 5 +++ app/components/ccdb-table.js | 2 ++ app/components/filter-collections.js | 5 +++ app/templates/components/ccdb-pagination.hbs | 36 +++++++++++++++++++ .../components/collections-container.hbs | 2 ++ .../components/filter-collections.hbs | 10 ++++++ .../components/ccdb-pagination-test.js | 25 +++++++++++++ .../components/filter-collections-test.js | 25 +++++++++++++ 8 files changed, 110 insertions(+) create mode 100644 app/components/ccdb-pagination.js create mode 100644 app/components/filter-collections.js create mode 100644 app/templates/components/ccdb-pagination.hbs create mode 100644 app/templates/components/filter-collections.hbs create mode 100644 tests/integration/components/ccdb-pagination-test.js create mode 100644 tests/integration/components/filter-collections-test.js diff --git a/app/components/ccdb-pagination.js b/app/components/ccdb-pagination.js new file mode 100644 index 0000000..1ef4a00 --- /dev/null +++ b/app/components/ccdb-pagination.js @@ -0,0 +1,5 @@ +import Ember from 'ember'; + +export default Ember.Component.extend({ + classNames: ['row'], +}); diff --git a/app/components/ccdb-table.js b/app/components/ccdb-table.js index 328b9d3..fce3474 100644 --- a/app/components/ccdb-table.js +++ b/app/components/ccdb-table.js @@ -8,6 +8,8 @@ export default Component.extend({ columns: null, table: null, + classNames: ['row'], + init() { this._super(...arguments); const table = new Table(this.get('columns'), this.get('model')); diff --git a/app/components/filter-collections.js b/app/components/filter-collections.js new file mode 100644 index 0000000..1ef4a00 --- /dev/null +++ b/app/components/filter-collections.js @@ -0,0 +1,5 @@ +import Ember from 'ember'; + +export default Ember.Component.extend({ + classNames: ['row'], +}); diff --git a/app/templates/components/ccdb-pagination.hbs b/app/templates/components/ccdb-pagination.hbs new file mode 100644 index 0000000..15bd26e --- /dev/null +++ b/app/templates/components/ccdb-pagination.hbs @@ -0,0 +1,36 @@ +
+
+ Showing 1-100 of 102 entries +
+
+ +
+
diff --git a/app/templates/components/collections-container.hbs b/app/templates/components/collections-container.hbs index b6a7d07..f342573 100644 --- a/app/templates/components/collections-container.hbs +++ b/app/templates/components/collections-container.hbs @@ -1 +1,3 @@ +{{filter-collections}} +{{ccdb-pagination}} {{ccdb-table model=model columns=columns}} diff --git a/app/templates/components/filter-collections.hbs b/app/templates/components/filter-collections.hbs new file mode 100644 index 0000000..a60011d --- /dev/null +++ b/app/templates/components/filter-collections.hbs @@ -0,0 +1,10 @@ +
+
+
+ +
+
+
diff --git a/tests/integration/components/ccdb-pagination-test.js b/tests/integration/components/ccdb-pagination-test.js new file mode 100644 index 0000000..2297928 --- /dev/null +++ b/tests/integration/components/ccdb-pagination-test.js @@ -0,0 +1,25 @@ +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('ccdb-pagination', 'Integration | Component | ccdb pagination', { + integration: true +}); + +test('it renders', function(assert) { + + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.on('myAction', function(val) { ... }); + + this.render(hbs`{{ccdb-pagination}}`); + + assert.equal(this.$().text().trim(), ''); + + // Template block usage: + this.render(hbs` + {{#ccdb-pagination}} + template block text + {{/ccdb-pagination}} + `); + + assert.equal(this.$().text().trim(), 'template block text'); +}); diff --git a/tests/integration/components/filter-collections-test.js b/tests/integration/components/filter-collections-test.js new file mode 100644 index 0000000..db25d68 --- /dev/null +++ b/tests/integration/components/filter-collections-test.js @@ -0,0 +1,25 @@ +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('filter-collections', 'Integration | Component | filter collections', { + integration: true +}); + +test('it renders', function(assert) { + + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.on('myAction', function(val) { ... }); + + this.render(hbs`{{filter-collections}}`); + + assert.equal(this.$().text().trim(), ''); + + // Template block usage: + this.render(hbs` + {{#filter-collections}} + template block text + {{/filter-collections}} + `); + + assert.equal(this.$().text().trim(), 'template block text'); +}); From f158d7a7f35a0ed49ba9d673a28e7413bef1fbe4 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Wed, 13 Sep 2017 14:07:41 -0700 Subject: [PATCH 2/4] WIP --- app/components/filter-collections.js | 2 +- app/router.js | 4 +- app/routes/collections/1.js | 4 ++ .../{collections.js => collections/index.js} | 0 app/styles/app.css | 11 +++ app/templates/collections/1.hbs | 9 +++ .../index.hbs} | 0 .../components/filter-collections.hbs | 69 ++++++++++++++++++- ember-cli-build.js | 1 - tests/unit/routes/collections/1-test.js | 11 +++ 10 files changed, 105 insertions(+), 6 deletions(-) create mode 100644 app/routes/collections/1.js rename app/routes/{collections.js => collections/index.js} (100%) create mode 100644 app/templates/collections/1.hbs rename app/templates/{collections.hbs => collections/index.hbs} (100%) create mode 100644 tests/unit/routes/collections/1-test.js diff --git a/app/components/filter-collections.js b/app/components/filter-collections.js index 1ef4a00..16e66b5 100644 --- a/app/components/filter-collections.js +++ b/app/components/filter-collections.js @@ -1,5 +1,5 @@ import Ember from 'ember'; export default Ember.Component.extend({ - classNames: ['row'], + tagName: 'form', }); diff --git a/app/router.js b/app/router.js index 3234f26..75adc76 100644 --- a/app/router.js +++ b/app/router.js @@ -9,7 +9,9 @@ const Router = Ember.Router.extend({ Router.map(function() { this.route('login'); this.route('logout'); - this.route('collections'); + this.route('collections', function() { + this.route('1'); + }); }); export default Router; diff --git a/app/routes/collections/1.js b/app/routes/collections/1.js new file mode 100644 index 0000000..26d9f31 --- /dev/null +++ b/app/routes/collections/1.js @@ -0,0 +1,4 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ +}); diff --git a/app/routes/collections.js b/app/routes/collections/index.js similarity index 100% rename from app/routes/collections.js rename to app/routes/collections/index.js diff --git a/app/styles/app.css b/app/styles/app.css index 1a8070d..b74ca4b 100644 --- a/app/styles/app.css +++ b/app/styles/app.css @@ -1,3 +1,14 @@ +.content { + padding-left: 40px; + padding-right: 40px; + padding-top: 20px; + padding-bottom: 20px; +} + +.top-buffer { + padding-top: 20px; +} + .form-signin { max-width: 330px; padding: 15px; diff --git a/app/templates/collections/1.hbs b/app/templates/collections/1.hbs new file mode 100644 index 0000000..95a0f6f --- /dev/null +++ b/app/templates/collections/1.hbs @@ -0,0 +1,9 @@ +

Collection Detail

+ +
+
+
+ asf +
+
+
diff --git a/app/templates/collections.hbs b/app/templates/collections/index.hbs similarity index 100% rename from app/templates/collections.hbs rename to app/templates/collections/index.hbs diff --git a/app/templates/components/filter-collections.hbs b/app/templates/components/filter-collections.hbs index a60011d..f1f9fb8 100644 --- a/app/templates/components/filter-collections.hbs +++ b/app/templates/components/filter-collections.hbs @@ -1,10 +1,73 @@ -
+
+
- - + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +
+
+
+ + + +
+
diff --git a/ember-cli-build.js b/ember-cli-build.js index 2e0af58..3fb70dd 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -11,7 +11,6 @@ module.exports = function(defaults) { }); app.import('bower_components/bootstrap/dist/css/bootstrap.min.css'); - app.import('bower_components/bootstrap/dist/css/bootstrap-theme.min.css'); return app.toTree(); }; diff --git a/tests/unit/routes/collections/1-test.js b/tests/unit/routes/collections/1-test.js new file mode 100644 index 0000000..713679d --- /dev/null +++ b/tests/unit/routes/collections/1-test.js @@ -0,0 +1,11 @@ +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:collections/1', 'Unit | Route | collections/1', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('it exists', function(assert) { + let route = this.subject(); + assert.ok(route); +}); From 408b1bb1d4338a2abaa626822785966c06d2a8ec Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Thu, 14 Sep 2017 07:14:57 -0700 Subject: [PATCH 3/4] WIP --- app/templates/collections/1.hbs | 132 +++++++++++++++++++++++++++++++- 1 file changed, 129 insertions(+), 3 deletions(-) diff --git a/app/templates/collections/1.hbs b/app/templates/collections/1.hbs index 95a0f6f..9e4b6f1 100644 --- a/app/templates/collections/1.hbs +++ b/app/templates/collections/1.hbs @@ -1,9 +1,135 @@

Collection Detail

-
-
- asf +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ProjectStudy LocationMethodType# of TrapsStartEndExperiments
PerchlorateRSMTEmbryos2010-06-072010-06-07Perchlorate diel; Perchlorate rescue
+
+
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+ + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ExperimentTypeSpeciesSexContainerReplicatesFlaw
Perchlorate diel10 ppm perchlorate, iodide supplementedThreespine sticklebackBoth SexesJar1; 2; 3
Perchlorate diel10 ppm perchlorate, iodide supplementedThreespine sticklebackBoth SexesJar1; 2; 3
Perchlorate diel10 ppm perchlorate, iodide supplementedThreespine sticklebackBoth SexesJar1; 2; 3
Perchlorate diel10 ppm perchlorate, iodide supplementedThreespine sticklebackBoth SexesJar1; 2; 3
Perchlorate diel10 ppm perchlorate, iodide supplementedThreespine sticklebackBoth SexesJar1; 2; 3
Perchlorate diel10 ppm perchlorate, iodide supplementedThreespine sticklebackBoth SexesJar1; 2; 3
+
+
...
From ffa302298fe212c9898557942b9aac0a59d3ef3c Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Thu, 14 Sep 2017 08:06:55 -0700 Subject: [PATCH 4/4] WIP --- app/router.js | 1 + app/routes/collections/new.js | 4 + app/templates/collections/1.hbs | 14 +- app/templates/collections/new.hbs | 130 ++++++++++++++++++ .../components/collections-container.hbs | 2 + tests/unit/routes/collections/new-test.js | 11 ++ 6 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 app/routes/collections/new.js create mode 100644 app/templates/collections/new.hbs create mode 100644 tests/unit/routes/collections/new-test.js diff --git a/app/router.js b/app/router.js index 75adc76..03cadfc 100644 --- a/app/router.js +++ b/app/router.js @@ -11,6 +11,7 @@ Router.map(function() { this.route('logout'); this.route('collections', function() { this.route('1'); + this.route('new'); }); }); diff --git a/app/routes/collections/new.js b/app/routes/collections/new.js new file mode 100644 index 0000000..26d9f31 --- /dev/null +++ b/app/routes/collections/new.js @@ -0,0 +1,4 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ +}); diff --git a/app/templates/collections/1.hbs b/app/templates/collections/1.hbs index 9e4b6f1..7b8bc2c 100644 --- a/app/templates/collections/1.hbs +++ b/app/templates/collections/1.hbs @@ -1,4 +1,4 @@ -

Collection Detail

+

Collection Detail

@@ -33,6 +33,18 @@
+ +
diff --git a/app/templates/collections/new.hbs b/app/templates/collections/new.hbs new file mode 100644 index 0000000..10dac87 --- /dev/null +++ b/app/templates/collections/new.hbs @@ -0,0 +1,130 @@ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+
diff --git a/app/templates/components/collections-container.hbs b/app/templates/components/collections-container.hbs index f342573..cef684c 100644 --- a/app/templates/components/collections-container.hbs +++ b/app/templates/components/collections-container.hbs @@ -1,3 +1,5 @@ +{{#link-to "collections.new" class="btn btn-default"}}New Collection{{/link-to}} +
{{filter-collections}} {{ccdb-pagination}} {{ccdb-table model=model columns=columns}} diff --git a/tests/unit/routes/collections/new-test.js b/tests/unit/routes/collections/new-test.js new file mode 100644 index 0000000..1784b29 --- /dev/null +++ b/tests/unit/routes/collections/new-test.js @@ -0,0 +1,11 @@ +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:collections/new', 'Unit | Route | collections/new', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('it exists', function(assert) { + let route = this.subject(); + assert.ok(route); +});