<commit_before>/**
  A button for favoriting a topic

  @class NotificationsButton
  @extends Discourse.DropdownButtonView
  @namespace Discourse
  @module Discourse
**/
Discourse.NotificationsButton = Discourse.DropdownButtonView.extend({
  title: I18n.t('topic.notifications.title'),
  longDescriptionBinding: 'topic.details.notificationReasonText',
  topic: Em.computed.alias('controller.model'),
  hidden: Em.computed.alias('topic.deleted'),

  dropDownContent: [
    [Discourse.Topic.NotificationLevel.WATCHING, 'topic.notifications.watching'],
    [Discourse.Topic.NotificationLevel.TRACKING, 'topic.notifications.tracking'],
    [Discourse.Topic.NotificationLevel.REGULAR, 'topic.notifications.regular'],
    [Discourse.Topic.NotificationLevel.MUTE, 'topic.notifications.muted']
  ],

  text: function() {
    var key = (function() {
      switch (this.get('topic.details.notification_level') || 1) {
        case Discourse.Topic.NotificationLevel.WATCHING: return 'watching';
        case Discourse.Topic.NotificationLevel.TRACKING: return 'tracking';
        case Discourse.Topic.NotificationLevel.REGULAR: return 'regular';
        case Discourse.Topic.NotificationLevel.MUTE: return 'muted';
      }
    }).call(this);

    var icon = (function() {
      switch (key) {
        case 'watching': return '<i class="icon-circle heatmap-high"></i>&nbsp;';
        case 'tracking': return '<i class="icon-circle heatmap-low"></i>&nbsp;';
        case 'regular': return '';
        case 'muted': return '<i class="icon-remove-sign"></i>&nbsp;';
      }
    })();
    return icon + (I18n.t("topic.notifications." + key + ".title")) + "<span class='caret'></span>";
  }.property('topic.details.notification_level'),

  clicked: function(id) {
    return this.get('topic.details').updateNotifications(id);
  }

});

<commit_msg>Fix rendering of muted topic button<commit_after>/**
  A button for favoriting a topic

  @class NotificationsButton
  @extends Discourse.DropdownButtonView
  @namespace Discourse
  @module Discourse
**/
Discourse.NotificationsButton = Discourse.DropdownButtonView.extend({
  title: I18n.t('topic.notifications.title'),
  longDescriptionBinding: 'topic.details.notificationReasonText',
  topic: Em.computed.alias('controller.model'),
  hidden: Em.computed.alias('topic.deleted'),

  dropDownContent: [
    [Discourse.Topic.NotificationLevel.WATCHING, 'topic.notifications.watching'],
    [Discourse.Topic.NotificationLevel.TRACKING, 'topic.notifications.tracking'],
    [Discourse.Topic.NotificationLevel.REGULAR, 'topic.notifications.regular'],
    [Discourse.Topic.NotificationLevel.MUTE, 'topic.notifications.muted']
  ],

  text: function() {
    var key = (function() {
      switch (this.get('topic.details.notification_level')) {
        case Discourse.Topic.NotificationLevel.WATCHING: return 'watching';
        case Discourse.Topic.NotificationLevel.TRACKING: return 'tracking';
        case Discourse.Topic.NotificationLevel.MUTE: return 'muted';
        default: return 'regular';
      }
    }).call(this);

    var icon = (function() {
      switch (key) {
        case 'watching': return '<i class="icon-circle heatmap-high"></i>&nbsp;';
        case 'tracking': return '<i class="icon-circle heatmap-low"></i>&nbsp;';
        case 'muted': return '<i class="icon-remove-sign"></i>&nbsp;';
        default: return '';
      }
    })();
    return icon + (I18n.t("topic.notifications." + key + ".title")) + "<span class='caret'></span>";
  }.property('topic.details.notification_level'),

  clicked: function(id) {
    return this.get('topic.details').updateNotifications(id);
  }

});


{'fraction_non_alphanumeric': 0.1545028917653539, 'fraction_numerical': 0.0024786560176259984, 'mean_word_length': 4.093969144460028, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4671170', 'n_tokens_mistral': 1093, 'n_tokens_neox': 1074, 'n_words': 194}