- First implementation of filter for languages.
- Language is now an array in the document
- various corrections linked to the above change
- Simplify the IndexDocumet loop
import Ember from 'ember';
export function popularity([target, minimum, maximum]) {
var classname = ['not-popular', 'popular', 'very-popular'];
var interval = ( maximum - minimum ) / classname.length;
var i = 0;
while( target > minimum + ( interval * ( i + 1 ) ) ) {
i ++;
}
return classname[i];
}
export default Ember.Helper.helper(popularity);