Support rebuilding activity points on user rank list page (#3684)
authorMatthias Schmidt <gravatronics@live.com>
Mon, 2 Nov 2020 16:23:49 +0000 (17:23 +0100)
committerGitHub <noreply@github.com>
Mon, 2 Nov 2020 16:23:49 +0000 (17:23 +0100)
Close  #3532

wcfsetup/install/files/acp/templates/userRankList.tpl

index b50e287632fa6a08ca5d62bc3be108bab6b8d44e..e4dab4c486e155603dafde6c87e0f357e0af335a 100644 (file)
@@ -4,6 +4,21 @@
        $(function() {
                new WCF.Action.Delete('wcf\\data\\user\\rank\\UserRankAction', '.jsUserRankRow');
        });
+       
+       require(['Language', 'Ui/Notification', 'WoltLabSuite/Core/Acp/Ui/Worker'], function (Language, UiNotification, AcpUiWorker) {
+               Language.add('wcf.acp.worker.abort.confirmMessage', '{lang}wcf.acp.worker.abort.confirmMessage{/lang}');
+               
+               document.getElementById('updateEvents').addEventListener('click', function (event) {
+                       event.preventDefault();
+                       
+                       new AcpUiWorker({
+                               dialogId: 'updateEvents',
+                               dialogTitle: '{jslang}wcf.acp.user.activityPoint.updateEvents{/jslang}',
+                               className: 'wcf\\system\\worker\\UserActivityPointUpdateEventsWorker',
+                               callbackSuccess: () => UiNotification.show()
+                       });
+               });
+       });
 </script>
 
 <header class="contentHeader">
@@ -13,6 +28,7 @@
        
        <nav class="contentHeaderNavigation">
                <ul>
+                       <li><a id="updateEvents" class="button"><span class="icon icon16 fa-repeat"></span> <span>{lang}wcf.acp.user.activityPoint.updateEvents{/lang}</span></a></li>
                        <li><a href="{link controller='UserRankAdd'}{/link}" class="button"><span class="icon icon16 fa-plus"></span> <span>{lang}wcf.acp.user.rank.add{/lang}</span></a></li>
                        
                        {event name='contentHeaderNavigation'}