Refactor layout of verse template and add some new components

This commit is contained in:
Leonard Smith 2020-10-06 17:23:38 -05:00
parent d0b1591d00
commit b95c6510d4
9 changed files with 114 additions and 6 deletions

View File

@ -0,0 +1 @@
<h4>Commentary</h4>

View File

@ -0,0 +1,5 @@
<tr ...attributes>
<td>{{@model.greek}}</td>
<td>{{@model.ulb}}</td>
<td>{{@model.morph}}</td>
</tr>

View File

@ -0,0 +1,11 @@
<h4>Word Details</h4>
<table class="word-details" ...attributes>
<thead>
<th>Greek</th>
<th>ULB</th>
<th>Morphology</th>
</thead>
{{#each @model as |word|}}
<Words::WordRow @model={{word}} />
{{/each}}
</table>

View File

@ -2,3 +2,5 @@
@import "ember-bootstrap/bootstrap";
@import "components/scrollmenu";
@import "components/words";

View File

@ -0,0 +1,10 @@
table.word-details {
border: 1px solid grey;
}
table.word-details th,
table.word-details td {
border: 1px solid grey;
padding: 10px;
}

View File

@ -1,18 +1,19 @@
<div class="container">
<div class="row">
<div class="col-6">
<div class="col-12">
<h1>{{model.reference}}</h1>
<h4>Greek</h4>
<p>{{model.greek_text}}</p>
<h4>ULB</h4>
<p>{{model.ulb_text}}</p>
</div>
</div>
<div class="row">
<div class="col-6">
<ul>
{{#each @model.words as |word|}}
<li>{{word.greek}} : {{word.ulb}} : {{word.morph}}</li>
{{/each}}
</ul>
<Words::WordTable @model={{model.words}} />
</div>
<div class="col-6">
<Commentary::Entry />
</div>
</div>
</div>

View File

@ -0,0 +1,26 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
module('Integration | Component | commentary/entry', function(hooks) {
setupRenderingTest(hooks);
test('it renders', async function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs`<Commentary::Entry />`);
assert.equal(this.element.textContent.trim(), '');
// Template block usage:
await render(hbs`
<Commentary::Entry>
template block text
</Commentary::Entry>
`);
assert.equal(this.element.textContent.trim(), 'template block text');
});
});

View File

@ -0,0 +1,26 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
module('Integration | Component | words/word-row', function(hooks) {
setupRenderingTest(hooks);
test('it renders', async function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs`<Words::WordRow />`);
assert.equal(this.element.textContent.trim(), '');
// Template block usage:
await render(hbs`
<Words::WordRow>
template block text
</Words::WordRow>
`);
assert.equal(this.element.textContent.trim(), 'template block text');
});
});

View File

@ -0,0 +1,26 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
module('Integration | Component | words/word-table', function(hooks) {
setupRenderingTest(hooks);
test('it renders', async function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs`<Words::WordTable />`);
assert.equal(this.element.textContent.trim(), '');
// Template block usage:
await render(hbs`
<Words::WordTable>
template block text
</Words::WordTable>
`);
assert.equal(this.element.textContent.trim(), 'template block text');
});
});