mirror of
https://github.com/discourse/discourse.git
synced 2025-01-23 12:02:08 +08:00
29 lines
830 B
JavaScript
29 lines
830 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.mentions ||
|
|
actionType === Discourse.UserAction.TYPES.quotes;
|
|
}.property('action_type')
|
|
|
|
});
|
|
|
|
|