mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-09-08 07:38:28 +02:00
40 lines
1.3 KiB
JavaScript
40 lines
1.3 KiB
JavaScript
(function () {
|
|
'use strict';
|
|
|
|
angular
|
|
.module('requests')
|
|
.controller('RequestsViewController', RequestsViewController);
|
|
|
|
RequestsViewController.$inject = ['$scope', '$rootScope', '$state', '$timeout', '$translate', 'Authentication', 'RequestsService', 'ScoreLevelService', 'MeanTorrentConfig', 'DebugConsoleService',
|
|
'NotifycationService', 'uibButtonConfig', 'marked'];
|
|
|
|
function RequestsViewController($scope, $rootScope, $state, $timeout, $translate, Authentication, RequestsService, ScoreLevelService, MeanTorrentConfig, mtDebug,
|
|
NotifycationService, uibButtonConfig, marked) {
|
|
var vm = this;
|
|
vm.user = Authentication.user;
|
|
vm.itemsPerPageConfig = MeanTorrentConfig.meanTorrentConfig.itemsPerPage;
|
|
vm.requestsConfig = MeanTorrentConfig.meanTorrentConfig.requests;
|
|
|
|
/**
|
|
* getRequestsDesc
|
|
* @returns {*}
|
|
*/
|
|
vm.getRequestsDesc = function () {
|
|
var ts = $translate.instant('REQUESTS.DESC_LIST', {
|
|
days: vm.requestsConfig.requestExpires / (60 * 60 * 1000 * 24)
|
|
});
|
|
|
|
return marked(ts, {sanitize: true});
|
|
};
|
|
|
|
/**
|
|
* getRequestItemDescContent
|
|
* @param q
|
|
* @returns {*}
|
|
*/
|
|
vm.getRequestItemDescContent = function (q) {
|
|
return q ? marked(q.desc, {sanitize: true}) : '';
|
|
};
|
|
}
|
|
}());
|