This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/models/top-period.js.es6

31 lines
660 B
JavaScript

export default Ember.Object.extend({
title: null,
availablePeriods: function() {
var periods = this.get('periods');
if (!periods) { return; }
var self = this;
return periods.filter(function(p) {
return p !== self;
});
}.property('showMoreUrl'),
_createTitle: function() {
var id = this.get('id');
if (id) {
var title = "this_week";
if (id === "yearly") {
title = "this_year";
} else if (id === "monthly") {
title = "this_month";
} else if (id === "daily") {
title = "today";
}
this.set('title', I18n.t("filters.top." + title));
}
}.on('init')
});