Skip to content
This repository has been archived by the owner on Jul 9, 2019. It is now read-only.

Commit

Permalink
Change to 0 points
Browse files Browse the repository at this point in the history
  • Loading branch information
issyrocks12 committed Apr 25, 2017
1 parent 0b3d79b commit d019793
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion js/forum/dist/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ System.register('Reflar/gamification/components/AddAttributes', ['flarum/helpers

extend(UserCard.prototype, 'infoItems', function (items, user) {
var rank = this.props.user.data.attributes.Rank.split(': ');
var points = this.props.user.data.attributes.Points;

if (points == 0) {
points = '0';
}
if (rank[0] == '') {
rank[0] = app.forum.attribute('DefaultRank');
}
items.add('points', app.translator.trans('reflar-gamification.forum.user.points', { points: this.props.user.data.attributes.Points }));
items.add('points', app.translator.trans('reflar-gamification.forum.user.points', { points: points }));

items.add('rank', app.translator.trans('reflar-gamification.forum.user.rank', { rank: rank[0] }));
});
Expand Down
7 changes: 6 additions & 1 deletion js/forum/src/components/AddAttributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,16 @@ export default function () {

extend(UserCard.prototype, 'infoItems', function (items, user) {
let rank = this.props.user.data.attributes.Rank.split(': ');
let points = this.props.user.data.attributes.Points;

if (points == 0) {
points = '0';
}
if (rank[0] == '') {
rank[0] = app.forum.attribute('DefaultRank');
}
items.add('points',
app.translator.trans('reflar-gamification.forum.user.points', {points: this.props.user.data.attributes.Points})
app.translator.trans('reflar-gamification.forum.user.points', {points})
);

items.add('rank',
Expand Down

0 comments on commit d019793

Please sign in to comment.