Skip to content

Commit

Permalink
Merge branch 'release/0.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
brianjgeiger committed May 16, 2017
2 parents 989b5a9 + 43bfa14 commit 39bd47b
Show file tree
Hide file tree
Showing 335 changed files with 53,862 additions and 2,232 deletions.
5 changes: 3 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ https://openscience.atlassian.net/browse/EOSF-

# Purpose

# Notes for Reviewers

## Routes Added/Updated
# Summary of changes


# Testing notes

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

### MathJax

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:

```
<script type="text/javascript"
src="//cdnjs.cloudflare.com/ajax/libs/mathjax/2.6.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']], processEscapes: true},
skipStartupTypeset: true
});
</script>
```

### Advanced: using components and styles
Some of the ember-osf components require additional configuration to take advantage of premade widgets or styles.

Expand Down
Binary file added addon/assets/img/share-logo-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions addon/components/author-link/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import Ember from 'ember';
import layout from './template';

/**
* @module ember-osf
* @submodule components
*/

/**
* Adapted from Ember Preprints.
* Creates a link to a contributor name if link exists, otherwise just displays contributor name.
*
* Sample usage:
* ```handlebars
* {{author-link
* contributor=contributor
*}}
* ```
* @class author-link
*/
export default Ember.Component.extend({
layout,
tagName: 'li',
/**
* @property contributor
* type Object - SHARE contributor
*/
contributor: null,
profileLink: Ember.computed('contributor', function() {
// Builds profile link for contributor - handles nesting under contributor or users
const contributor = this.get('contributor');
let ids = contributor.users ? contributor.users.identifiers || [] : contributor.identifiers || [];

for (let i = 0; i < ids.length; i++)
if (ids[i].match(/^https?:\/\/(?:.*\.)osf\.io/))
return ids[i];

return false;
}),
contributorName: Ember.computed('contributor', function() {
// Extracts contributor name - handles nesting under contributor or users
const contributor = this.get('contributor');
return contributor.users ? contributor.users.name : contributor.name;
})
});
7 changes: 7 additions & 0 deletions addon/components/author-link/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{~#if profileLink~}}
<a href={{profileLink}}>
{{~contributorName~}}
</a>
{{~else~}}
{{~contributorName~}}
{{~/if}}
Loading

0 comments on commit 39bd47b

Please sign in to comment.