forked from WycliffeAssociates/en_btr_frontend
Add route and template for words
This commit is contained in:
parent
a16861302e
commit
5ed6cee1ec
|
@ -1,3 +1,3 @@
|
|||
<h4>Lexicon Entry</h4>
|
||||
<h5>{{this.selectedWord.lexicalEntry.id}}: {{this.selectedWord.lexicalEntry.lemma}}</h5>
|
||||
<p>{{markdown-to-html this.selectedWord.lexicalEntry.commentary}}</p>
|
||||
<h5>{{@model.id}}: {{@model.lemma}}</h5>
|
||||
<p>{{markdown-to-html @model.commentary}}</p>
|
|
@ -1 +1 @@
|
|||
<span class="{{this.selected}}" {{on "click" (fn this.select @model)}} data-strongs={{@model.strongs_number}} ...attributes>{{@model.greek}}</span>
|
||||
<span class="{{this.selected}}" {{on "click" (fn this.select @model)}} ...attributes>{{@model.greek}}</span>
|
|
@ -4,10 +4,12 @@ import { action } from '@ember/object';
|
|||
|
||||
export default class WordsGreekWordComponent extends Component {
|
||||
@service('word-select') selectWord;
|
||||
@service router;
|
||||
|
||||
@action
|
||||
select(word) {
|
||||
this.selectWord.select(word);
|
||||
this.router.transitionTo('verse.word', word.strongsNumber);
|
||||
}
|
||||
|
||||
get
|
||||
|
|
|
@ -7,5 +7,7 @@ export default class Router extends EmberRouter {
|
|||
}
|
||||
|
||||
Router.map(function() {
|
||||
this.route('verse', { path: '/verse/:verse_id' });
|
||||
this.route('verse', { path: '/verse/:verse_id' }, function() {
|
||||
this.route('word', { path: '/word/:word_id' });
|
||||
});
|
||||
});
|
||||
|
|
|
@ -2,7 +2,6 @@ import Route from '@ember/routing/route';
|
|||
|
||||
export default class VerseRoute extends Route {
|
||||
model(params) {
|
||||
console.log('Looking for ' + params.verse_id);
|
||||
return this.store.findRecord('verse', params.verse_id, {
|
||||
include: 'words'
|
||||
});
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class VerseWordRoute extends Route {
|
||||
model(params) {
|
||||
return this.store.findRecord('lexical-entry', params.word_id);
|
||||
}
|
||||
}
|
|
@ -12,7 +12,7 @@ export default class WordSelectService extends Service {
|
|||
select(word) {
|
||||
this.currentWord = word;
|
||||
this.strongsNumber = word.strongsNumber;
|
||||
this.getLexicalEntry();
|
||||
// this.getLexicalEntry();
|
||||
}
|
||||
|
||||
async getLexicalEntry() {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<Words::WordTable @model={{model.words}} />
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<Lexicon::Entry />
|
||||
{{outlet}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<Lexicon::Entry @model={{model}}/>
|
|
@ -0,0 +1,11 @@
|
|||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Route | verse/word', function(hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it exists', function(assert) {
|
||||
let route = this.owner.lookup('route:verse/word');
|
||||
assert.ok(route);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue