<commit_before>define([
    'jquery',
    'underscore',
    'moment',
    'knockout',
    'arches',
    'views/list',
    'bindings/datepicker',
    'bindings/chosen',
    'views/components/simple-switch'
], function($, _, moment, ko, arches, ListView) {
    var NotificationsList = ListView.extend({
        /**
        * A backbone view to manage a list of notification records
        * @augments ListView
        * @constructor
        * @name NotificationsList
        */

        singleSelect: true,

        initialize: function(options) {
            var self = this;
            ListView.prototype.initialize.apply(this, arguments);

            this.updateList = function() {
                self.helploading(true);
                $.ajax({
                    type: 'GET',
                    url: arches.urls.get_notifications,
                    data: {"unread_only": true}
                }).done(function(data) {
                    self.items(_.filter(data.notifications, function(notif) {
                        notif.displaytime = moment(notif.created).format('DD-MM-YYYY hh:mm a');
                        if (notif.link) {
                            notif.downloadBtn = ("<a download href="+notif.link+"><button class='btn btn-notifs-download btn-labeled btn-sm fa fa-download'>Download File</button></a>");
                        }
                        return notif.isread === false;
                    }));
                    self.helploading(false);
                });
            };

            this.dismiss = function(notifId) {
                var notifs, item;
                if (!notifId) { // i.e. dismissAll
                    notifs = self.items().map(function(notif) { return notif.id; });
                    self.items.removeAll();
                } else { 
                    notifs = [notifId];
                    item = self.items().find(function(it) { return it.id === notifId; });
                    self.items.remove(item);
                }
                $.ajax({<commit_msg>changes time formatting for notification timestamp, re #5695<commit_after>define([
    'jquery',
    'underscore',
    'moment',
    'knockout',
    'arches',
    'views/list',
    'bindings/datepicker',
    'bindings/chosen',
    'views/components/simple-switch'
], function($, _, moment, ko, arches, ListView) {
    var NotificationsList = ListView.extend({
        /**
        * A backbone view to manage a list of notification records
        * @augments ListView
        * @constructor
        * @name NotificationsList
        */

        singleSelect: true,

        initialize: function(options) {
            var self = this;
            ListView.prototype.initialize.apply(this, arguments);

            this.updateList = function() {
                self.helploading(true);
                $.ajax({
                    type: 'GET',
                    url: arches.urls.get_notifications,
                    data: {"unread_only": true}
                }).done(function(data) {
                    self.items(_.filter(data.notifications, function(notif) {
                        notif.displaytime = moment(notif.created).format('dddd, DD MMMM YYYY | hh:mm A');
                        if (notif.link) {
                            notif.downloadBtn = ("<a download href="+notif.link+"><button class='btn btn-notifs-download btn-labeled btn-sm fa fa-download'>Download File</button></a>");
                        }
                        return notif.isread === false;
                    }));
                    self.helploading(false);
                });
            };

            this.dismiss = function(notifId) {
                var notifs, item;
                if (!notifId) { // i.e. dismissAll
                    notifs = self.items().map(function(notif) { return notif.id; });
                    self.items.removeAll();
                } else { 
                    notifs = [notifId];
                    item = self.items().find(function(it) { return it.id === notifId; });
                    self.items.remove(item);
                }
                $.ajax({
{'fraction_non_alphanumeric': 0.12509090909090909, 'fraction_numerical': 0.0009696969696969697, 'mean_word_length': 1.4128654970760235, 'pattern_counts': {'":': 2, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2266098', 'n_tokens_mistral': 1126, 'n_tokens_neox': 1053, 'n_words': 211}