Skip to content

Commit 39bd47b

Browse files
committed
Merge branch 'release/0.5.0'
2 parents 989b5a9 + 43bfa14 commit 39bd47b

File tree

335 files changed

+53862
-2232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

335 files changed

+53862
-2232
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ https://openscience.atlassian.net/browse/EOSF-
33

44
# Purpose
55

6-
# Notes for Reviewers
76

8-
## Routes Added/Updated
7+
# Summary of changes
98

109

10+
# Testing notes
11+

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,22 @@ to fetch all nodes (or at least the first page of results). If you need to fetch
134134
information about how to handle pagination. Ember-osf also provides support for
135135
[paginated relationship requests](https://github.com/mdehoog/ember-data-has-many-query) via a third-party addon.
136136

137+
### MathJax
138+
139+
We use [MathJax](https://www.mathjax.org/) to make math look pretty in all browsers. If you want this in your application, copy this section into the `<head>` element of your `index.html` file:
140+
141+
```
142+
<script type="text/javascript"
143+
src="//cdnjs.cloudflare.com/ajax/libs/mathjax/2.6.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
144+
</script>
145+
<script type="text/x-mathjax-config">
146+
MathJax.Hub.Config({
147+
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']], processEscapes: true},
148+
skipStartupTypeset: true
149+
});
150+
</script>
151+
```
152+
137153
### Advanced: using components and styles
138154
Some of the ember-osf components require additional configuration to take advantage of premade widgets or styles.
139155

addon/assets/img/share-logo-icon.png

6.4 KB
Loading
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import Ember from 'ember';
2+
import layout from './template';
3+
4+
/**
5+
* @module ember-osf
6+
* @submodule components
7+
*/
8+
9+
/**
10+
* Adapted from Ember Preprints.
11+
* Creates a link to a contributor name if link exists, otherwise just displays contributor name.
12+
*
13+
* Sample usage:
14+
* ```handlebars
15+
* {{author-link
16+
* contributor=contributor
17+
*}}
18+
* ```
19+
* @class author-link
20+
*/
21+
export default Ember.Component.extend({
22+
layout,
23+
tagName: 'li',
24+
/**
25+
* @property contributor
26+
* type Object - SHARE contributor
27+
*/
28+
contributor: null,
29+
profileLink: Ember.computed('contributor', function() {
30+
// Builds profile link for contributor - handles nesting under contributor or users
31+
const contributor = this.get('contributor');
32+
let ids = contributor.users ? contributor.users.identifiers || [] : contributor.identifiers || [];
33+
34+
for (let i = 0; i < ids.length; i++)
35+
if (ids[i].match(/^https?:\/\/(?:.*\.)osf\.io/))
36+
return ids[i];
37+
38+
return false;
39+
}),
40+
contributorName: Ember.computed('contributor', function() {
41+
// Extracts contributor name - handles nesting under contributor or users
42+
const contributor = this.get('contributor');
43+
return contributor.users ? contributor.users.name : contributor.name;
44+
})
45+
});
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{~#if profileLink~}}
2+
<a href={{profileLink}}>
3+
{{~contributorName~}}
4+
</a>
5+
{{~else~}}
6+
{{~contributorName~}}
7+
{{~/if}}

0 commit comments

Comments
 (0)