Last active
October 27, 2017 16:30
-
-
Save golampo/899d5fdcadbe2272abc721dc4e3142a6 to your computer and use it in GitHub Desktop.
Entity Card - v2
This file contains 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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
tagName: 'li', | |
classNames: ['actions-menu__item'], | |
actions: { | |
bookmark() { | |
Ember.tryInvoke(this, 'onAction', ['bookmark']); | |
} | |
} | |
}); |
This file contains 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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
tagName: 'li', | |
classNames: ['actions-menu__item'], | |
actions: { | |
bookmark() { | |
Ember.tryInvoke(this, 'onAction', ['markAsDone']); | |
} | |
} | |
}); |
This file contains 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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
}); |
This file contains 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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
}); |
This file contains 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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
entityLabels: { | |
course: 'COURSE', | |
video: 'VIDEO', | |
learningPath: 'LEARNING PATH' | |
} | |
}); |
This file contains 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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
}); |
This file contains 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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
classNames: ['feed-card'], | |
entity: undefined, | |
}); |
This file contains 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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
}); |
This file contains 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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
tagName: '', | |
entity: undefined, | |
init() { | |
this._super(...arguments); | |
}, | |
}); |
This file contains 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 Ember from 'ember'; | |
import { actionTypes } from '../cards/actions-menu'; | |
export default Ember.Component.extend({ | |
actionsOrder: [ | |
actionTypes.bookmark, | |
actionTypes.share, | |
[ | |
actionTypes.markAsDone | |
] | |
], | |
actions: { | |
didBookmark() { | |
// console.log('result-card bookmark', ...arguments); | |
}, | |
didShare() { | |
//console.log('result-card share', ...arguments); | |
} | |
} | |
}); |
This file contains 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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
entities: [ | |
{ | |
title: 'Decision-Making Strategies', | |
contentType: 'course', | |
actions: ['BOOKMARK', 'SHARE'], | |
authors: [{ name: 'Todd Rodgers' }] | |
}, | |
{ | |
title: 'HTML resources', | |
contentType: 'video', | |
actions: ['BOOKMARK', 'MARK_AS_DONE'], | |
authors: [{ name: 'Todd Rodgers' }], | |
parent: { | |
title: 'How to do the things you want' | |
} | |
}, | |
{ | |
title: 'Become a Customer Service Specialist', | |
contentType: 'learningPath', | |
actions: ['SHARE'], | |
}, | |
] | |
}); |
This file contains 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 Ember from 'ember'; | |
import config from './config/environment'; | |
const Router = Ember.Router.extend({ | |
location: 'none', | |
rootURL: config.rootURL | |
}); | |
Router.map(function() { | |
this.route('entity'); | |
}); | |
export default Router; |
This file contains 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 Ember from 'ember'; | |
export default Ember.Route.extend({ | |
}); |
This file contains 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
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
.feed-card { | |
display: flex; | |
margin-bottom: 16px; | |
max-width: 400px; | |
} | |
.feed-card__title { | |
margin: 0; | |
font-size: 1rem; | |
} | |
.feed-card__media { | |
flex: 0 0 auto; | |
width: 100px; | |
height: 64px; | |
background-color: #ccc; | |
margin-right: 16px; | |
} | |
.feed-card__body { | |
flex: 1 1 auto; | |
display: flex; | |
flex-direction: column; | |
justify-content: space-between; | |
} | |
.feed-card__body-footer { | |
display: flex; | |
justify-content: space-between; | |
} | |
.feed-card__label, | |
.feed-card__content, | |
.feed-card__meta { | |
font-size: .85rem; | |
} | |
.feed-card__actions, | |
.actions__more-menu { | |
list-style-type: none; | |
margin: 0; | |
} | |
.actions-menu__item { | |
margin: 0; | |
display: inline-block; | |
position: relative; | |
white-space: nowrap; | |
} | |
.actions-menu__more-menu { | |
position: absolute; | |
right: 0; | |
} | |
This file contains 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.12.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.12.0", | |
"ember-template-compiler": "2.12.0", | |
"ember-testing": "2.12.0" | |
}, | |
"addons": { | |
"ember-data": "2.10.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment