Last active
October 5, 2018 00:03
-
-
Save jameshahn2/8fa056c3d3a381084ad6bfffefe0b86f to your computer and use it in GitHub Desktop.
Glossary App
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function() { | |
this.namespace = '/api'; | |
let terms = [ | |
{ | |
url: "https://www.glossary.oilfield.slb.com/en/Terms/c/coal-seam_gas.aspx", | |
term: "coal-seam gas", | |
definitions: [ | |
{ | |
speech_type: "n.", | |
category: "Geology", | |
definition: "Natural gas, predominantly methane [CH4], generated during coal formation and adsorbed in coal.", | |
see: [ | |
{ | |
title: "unconventional resource", | |
link: "https://www.glossary.oilfield.slb.com/en/Terms/u/unconventional_resource.aspx" | |
} | |
], | |
more_details: [ | |
{ | |
title: "Learning to Produce Coalbed Methane", | |
link: "http://www.slb.com/resources/publications/industry_articles/oilfield_review/1991/or1991jan04_methane.aspx" | |
}, | |
{ | |
title: "Producing Natural Gas from Coal", | |
link: "http://www.slb.com/resources/publications/industry_articles/oilfield_review/2003/or2003aut02_gas_from_coal.aspx" | |
}, | |
{ | |
title: "Coalbed Methane: Clean Energy for the World", | |
link: "http://www.slb.com/resources/publications/industry_articles/oilfield_review/2009/or2009sum01_coalbed_methane.aspx" | |
} | |
], | |
synonyms: [ | |
{ | |
title: "coalbed methane", | |
link: "https://www.glossary.oilfield.slb.com/en/Terms/c/coalbed_methane.aspx" | |
}, | |
{ | |
title: "coal bed methane", | |
link: "https://www.glossary.oilfield.slb.com/en/Terms/c/coal_bed_methane.aspx" | |
}, | |
{ | |
title: "coal-bed methane", | |
link: "https://www.glossary.oilfield.slb.com/en/Terms/c/coal-bed_methane.aspx" | |
}, | |
{ | |
title: "CBM", | |
link: "https://www.glossary.oilfield.slb.com/en/Terms/c/cbm.aspx" | |
} | |
], | |
antonyms: [], | |
alternate_forms: "coal seam gas, CSG", | |
image: { | |
src: "https://www.glossary.oilfield.slb.com/en/Terms/c/en/~/media/PublicMedia/geology/coalbedMethane01.ashx", | |
caption: "Gas adsorption and desorption in coal. During coalification, the matrix shrinks, creating orthogonal fractures called cleats." | |
} | |
} | |
] | |
}, | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Controller from '@ember/controller'; | |
import { computed, get } from '@ember/object'; | |
import { alias } from '@ember/object/computed'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
term: Ember.computed('term', 'definitions', function() { | |
return `${this.get('term')} ${this.get('definitions')}`; | |
}) | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Model from 'ember-data/model'; | |
import attr from 'ember-data/attr'; | |
import { belongsTo, hasMany } from 'ember-data/relationships'; | |
export default DS.Model.extend({ | |
speechType: DS.attr('string'), | |
category: DS.attr('string'), | |
definition: DS.attr('string'), | |
see: DS.hasMany('termSee'), | |
moreDetails: DS.hasMany('termMoreDetails'), | |
synonyms: DS.hasMany('termSynonyms'), | |
antonyms: DS.hasMany('termAntonyms'), | |
alternateForms: DS.attr('string'), | |
image: DS.hasMany('termImage') | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Model from 'ember-data/model'; | |
import attr from 'ember-data/attr'; | |
import { belongsTo, hasMany } from 'ember-data/relationships'; | |
export default DS.Model.extend({ | |
title: DS.belongsTo('antonyms'), | |
link: DS.belongsTo('antonyms') | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Model from 'ember-data/model'; | |
import attr from 'ember-data/attr'; | |
import { belongsTo, hasMany } from 'ember-data/relationships'; | |
export default DS.Model.extend({ | |
src: DS.belongsTo('image'), | |
caption: DS.belongsTo('image') | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Model from 'ember-data/model'; | |
import attr from 'ember-data/attr'; | |
import { belongsTo, hasMany } from 'ember-data/relationships'; | |
export default DS.Model.extend({ | |
title: DS.belongsTo('moreDetails'), | |
link: DS.belongsTo('moreDetails') | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Model from 'ember-data/model'; | |
import attr from 'ember-data/attr'; | |
import { belongsTo, hasMany } from 'ember-data/relationships'; | |
export default DS.Model.extend({ | |
title: DS.belongsTo('see'), | |
link: DS.belongsTo('see') | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Model from 'ember-data/model'; | |
import attr from 'ember-data/attr'; | |
import { belongsTo, hasMany } from 'ember-data/relationships'; | |
export default DS.Model.extend({ | |
title: DS.belongsTo('synonyms'), | |
link: DS.belongsTo('synonyms') | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Model from 'ember-data/model'; | |
import attr from 'ember-data/attr'; | |
import { belongsTo, hasMany } from 'ember-data/relationships'; | |
export default DS.Model.extend({ | |
term: DS.hasMany('definitions') | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Route from '@ember/routing/route'; | |
export default Route.extend({ | |
model(params) { | |
return this.store.findRecord('term', params.term_id, { include: 'definitions,definitions.termSee,definitions.more_details,definitions.synonyms,definitions.antonyms,definitions.alternate_forms' }); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.15.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "3.4.3", | |
"ember-template-compiler": "3.4.3", | |
"ember-testing": "3.4.3" | |
}, | |
"addons": { | |
"ember-data": "3.4.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment