This repository has been archived on 2025-05-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
discourse/app/assets/javascripts/discourse/models/user_action_stat.js
2015-02-04 22:03:44 -08:00

25 lines
763 B
JavaScript

/**
A data model representing a statistic on a UserAction
@class UserActionStat
@extends Discourse.Model
@namespace Discourse
@module Discourse
**/
Discourse.UserActionStat = Discourse.Model.extend({
isPM: function() {
var actionType = this.get('action_type');
return actionType === Discourse.UserAction.TYPES.messages_sent ||
actionType === Discourse.UserAction.TYPES.messages_received;
}.property('action_type'),
description: Discourse.computed.i18n('action_type', 'user_action_groups.%@'),
isResponse: function() {
var actionType = this.get('action_type');
return actionType === Discourse.UserAction.TYPES.replies ||
actionType === Discourse.UserAction.TYPES.quotes;
}.property('action_type')
});