moderators.5287fdac697f8eb8b785.js
4.56 KB
(window.webpackJsonp=window.webpackJsonp||[]).push([["0bd3"],{"34XA":function(n,t){angular.module("footyroom").component("banWizard",{template:'\n <div fr-litelay="$ctrl.isSaving || $ctrl.isLoading">\n <div class="modal-body">\n <div ng-if="!$ctrl.isLoading">\n <div ng-if="!$ctrl.isRequestingPermaban">\n <div ng-if="$ctrl.warning" ng-bind-html="$ctrl.warning"></div>\n \n <span>Ban this user from commenting for </span>\n <select class="ban-duration" ng-model="$ctrl.duration" ng-change="onDurationChange()">\n <option value="600">10 minutes</option>\n <option value="3600">1 hour</option>\n <option value="36000">10 hours</option>\n <option value="86400">1 day</option>\n <option value="172800">2 days</option>\n <option value="604800">1 week</option>\n <option value="2592000">1 month</option>\n </select>\n </div>\n\n <div ng-if="$ctrl.isRequestingPermaban">\n <textarea ng-model="$ctrl.explanation" class="form-control" rows="10" placeholder="Please give some explanation why you think this user deserves a permanent ban"></textarea>\n </div>\n </div>\n </div>\n <div class="modal-footer">\n <div class="pull-left">\n <button ng-click="$ctrl.isRequestingPermaban = true" ng-if="!$ctrl.isRequestingPermaban" class="btn btn-default">Request Permaban</button>\n <button ng-click="$ctrl.isRequestingPermaban = false" ng-if="$ctrl.isRequestingPermaban" class="btn btn-default">Ban Temporarily</button>\n </div>\n <div class="pull-right">\n <button class="btn btn-default" ng-click="$ctrl.dismiss()">Cancel</button>\n <button class="btn btn-primary" ng-click="$ctrl.ban()" ng-if="!$ctrl.isRequestingPermaban">Ban</button>\n <button class="btn btn-primary" ng-click="$ctrl.permaban()" ng-if="$ctrl.isRequestingPermaban">Send Request</button>\n </div>\n </div>\n </div>\n ',bindings:{userId:"<",dismiss:"&"},controller:["$http","$sce",function(n,t){var o=this;function e(t,e){return o.isSaving=!0,n.post(t,e).then(function(){return o.dismiss()}).catch(function(n){alert(n.data.errors)}).finally(function(){o.isSaving=!1})}o.ban=function(){e("/bans",{entity:"user_id",value:o.userId,type:"comment",duration:o.duration})},o.permaban=function(){e("/bans/request-permaban",{userId:o.userId,explanation:o.explanation})},o.duration="600",o.isLoading=!0,n.get("/bans/active-pagelet",{params:{userId:o.userId,type:"comment"}}).then(function(n){o.warning=t.trustAsHtml(n.data)}).finally(function(){o.isLoading=!1})}]})},LY9d:function(n,t){angular.module("footyroom").controller("PuppetsController",["$http",function(n){var t=this,o=0;function e(){n.get("/puppets.json",{params:{offset:o,username:t.username}}).success(function(n){t.accounts=o>0?t.accounts.concat(n):n})}t.loadMore=function(){o+=20,e()},t.searchAccounts=function(){o=0,e()},t.getAccounts=e,e()}])},bMx2:function(n,t){angular.module("footyroom").controller("BansOverviewController",["$http","$uibModal",function(n,t){var o=this,e=0;function a(){n.get("/bans/summaries.json",{params:{sortBy:o.sortBy,offset:e,username:o.username}}).success(function(n){o.summaries=e>0?o.summaries.concat(n.data):n.data})}o.sortBy="latestBan",o.setSort=function(n){if(o.sortBy===n)return;e=0,o.sortBy=n,a()},o.loadMore=function(){e+=20,a()},o.getBans=function(o){t.open({templateUrl:"/views/ng/modal/userBanList.html",controllerAs:"ctrl",bindToController:!0,controller:function(){var t=this;n.get("/bans.json",{params:{userId:o}}).success(function(n){t.bans=n.data})}})},o.searchUser=function(){e=0,a()},o.getSummaries=a,a()}])},zfoX:function(n,t,o){"use strict";o.r(t);o("bMx2"),o("LY9d");var e=o("hh57");angular.module("footyroom").controller("FlagsReportController",["$scope","$element","$http","$window",function(n,t,o,a){var i=this;i.clear=function(){t.find(".comment-action-errors").html("").hide(),o.post("/flags/clear",{commentId:i.commentId}).then(function(n){t.remove(),a.location.reload()}).catch(function(n){Object(e.a)(n.data.errors,".comment-action-errors","#comment"+i.commentId)})},i.$onInit=void(i.commentId=t.data("commentId"))}]);o("34XA")}},[["zfoX","d41d","91fe"]]]);