Made use of content interaction dropdown in user profiles
authorMarcel Werk <burntime@woltlab.com>
Thu, 28 Apr 2022 13:28:22 +0000 (15:28 +0200)
committerMarcel Werk <burntime@woltlab.com>
Thu, 28 Apr 2022 13:28:22 +0000 (15:28 +0200)
com.woltlab.wcf/templates/user.tpl
ts/WoltLabSuite/Core/Ui/User/Profile/Menu/Item/Abstract.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/User/Profile/Menu/Item/Abstract.js
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index a05569881a5f1749acd94b53edb222bca89c3ed4..0f0c0416b77c8584cea93d66afbbc0ee99a35769 100644 (file)
                                        </li>
                                {/hascontent}
                                
-                               {hascontent}
-                                       <li class="dropdown">
-                                               <a class="jsTooltip button dropdownToggle" title="{lang}wcf.user.profile.user{/lang}"><span class="icon icon32 fa-user"></span> <span class="invisible">{lang}wcf.user.profile.user{/lang}</span></a>
-                                               <ul class="dropdownMenu userProfileButtonMenu" data-menu="interaction">
-                                                       {content}
-                                                               {event name='menuInteraction'}
-                                                               
-                                                               {if $user->userID != $__wcf->user->userID}
-                                                                       {if $user->isAccessible('canViewEmailAddress') || $__wcf->session->getPermission('admin.user.canEditMailAddress')}
-                                                                               <li><a href="mailto:{@$user->getEncodedEmail()}">{lang}wcf.user.button.mail{/lang}</a></li>
-                                                                       {/if}
-                                                               {/if}
-                                                               
-                                                               {if $user->userID != $__wcf->user->userID && $__wcf->session->getPermission('user.profile.canReportContent')}
-                                                                       <li class="jsReportUser" data-object-id="{@$user->userID}"><a href="#">{lang}wcf.user.profile.report{/lang}</a></li>
-                                                               {/if}
-                                                       {/content}
-                                               </ul>
-                                       </li>
-                               {/hascontent}
-                               
                                {hascontent}
                                        <li class="dropdown">
                                                <a class="jsTooltip button dropdownToggle" title="{lang}wcf.user.searchUserContent{/lang}"><span class="icon icon32 fa-search"></span> <span class="invisible">{lang}wcf.user.searchUserContent{/lang}</span></a>
                                {event name='contentHeaderNavigation'}
                        </ul>
                </nav>
-               
        </header>
 {/capture}
 
 {include file='userSidebar' assign='sidebarRight'}
 
+{capture assign='contentInteractionDropdownItems'}
+       {event name='menuInteraction'}
+                                                               
+       {if $user->userID != $__wcf->user->userID}
+               {if $user->isAccessible('canViewEmailAddress') || $__wcf->session->getPermission('admin.user.canEditMailAddress')}
+                       <li><a href="mailto:{@$user->getEncodedEmail()}">{lang}wcf.user.button.mail{/lang}</a></li>
+               {/if}
+       {/if}
+       
+       {if $user->userID != $__wcf->user->userID && $__wcf->session->getPermission('user.profile.canReportContent')}
+               <li class="jsReportUser" data-object-id="{@$user->userID}"><a href="#">{lang}wcf.user.profile.report{/lang}</a></li>
+       {/if}
+{/capture}
+
 {include file='header'}
 
 {if !$user->isProtected()}
index d25574af9118163ac2aaf068b449e6f3069b2b63..275750ccd20e32570196c2fe89639ef826efc6e2 100644 (file)
@@ -37,7 +37,7 @@ abstract class UiUserProfileMenuItemAbstract implements AjaxCallbackObject {
     this._button.addEventListener("click", (ev) => this._toggle(ev));
     this._listItem.appendChild(this._button);
 
-    const menu = document.querySelector(`.userProfileButtonMenu[data-menu="interaction"]`) as HTMLElement;
+    const menu = document.querySelector(".contentInteractionDropdownItems") as HTMLElement;
     menu.insertAdjacentElement("afterbegin", this._listItem);
   }
 
index 44c47f6ac52280648556666a50cfbb30487f7a05..7bcf26c1e13f7ea6d4305a6eba0199c04c77905f 100644 (file)
@@ -30,7 +30,7 @@ define(["require", "exports", "tslib", "../../../../../Ajax", "../../../../../Co
             this._button.href = "#";
             this._button.addEventListener("click", (ev) => this._toggle(ev));
             this._listItem.appendChild(this._button);
-            const menu = document.querySelector(`.userProfileButtonMenu[data-menu="interaction"]`);
+            const menu = document.querySelector(".contentInteractionDropdownItems");
             menu.insertAdjacentElement("afterbegin", this._listItem);
         }
         /**
index a9c99744dbc6d9a73c8d5c9226d41fea7236e78d..c1d00475076b743e664996a08c4f42ffbda870dc 100644 (file)
@@ -5474,7 +5474,6 @@ Benachrichtigungen auf <a href="{link isHtmlEmail=true}{/link}">{PAGE_TITLE|phra
                <item name="wcf.user.profile.recentActivity.profileCommentResponse"><![CDATA[Hat auf einen Kommentar von <a href="{link controller='User' object=$commentAuthor}{/link}">{$commentAuthor->username}</a> an der <a href="{link controller='User' object=$user}{/link}#wall/comment{@$commentID}/response{@$responseID}">Pinnwand von {$user->username}</a> geantwortet.]]></item>
                <item name="wcf.user.profile.report"><![CDATA[Benutzerprofil melden]]></item>
                <item name="wcf.user.profile.protected"><![CDATA[Der Benutzer hat den Zugriff auf sein vollständiges Profil eingeschränkt.]]></item>
-               <item name="wcf.user.profile.user"><![CDATA[Benutzer]]></item>
                <item name="wcf.user.profile.management"><![CDATA[Verwaltung]]></item>
                <item name="wcf.user.profile.customization"><![CDATA[Anpassung]]></item>
                <item name="wcf.user.profile.title"><![CDATA[Benutzerprofil von {$user->username}]]></item>
@@ -5608,5 +5607,6 @@ Benachrichtigungen auf <a href="{link isHtmlEmail=true}{/link}">{PAGE_TITLE|phra
        <item name="wcf.user.notification.markAsConfirmed" />
        <item name="wcf.user.panel.markAllAsRead" />
        <item name="wcf.user.panel.markAsRead" />
+       <item name="wcf.user.profile.user" />
 </delete>
 </language>
index ee52c36ebf81f4272739d276b4907e1901886a76..61abe81ae7fff5be66e443deaf8762a34f1ffae7 100644 (file)
@@ -5476,7 +5476,6 @@ your notifications on <a href="{link isHtmlEmail=true}{/link}">{PAGE_TITLE|phras
                <item name="wcf.user.profile.recentActivity.profileCommentResponse"><![CDATA[Replied to a comment by <a href="{link controller='User' object=$commentAuthor}{/link}">{$commentAuthor->username}</a> on <a href="{link controller='User' object=$user}{/link}#wall/comment{@$commentID}/response{@$responseID}">{$user->username}’s wall</a>.]]></item>
                <item name="wcf.user.profile.report"><![CDATA[Report User Profile]]></item>
                <item name="wcf.user.profile.protected"><![CDATA[This member limits who may view their full profile.]]></item>
-               <item name="wcf.user.profile.user"><![CDATA[User]]></item>
                <item name="wcf.user.profile.management"><![CDATA[Management]]></item>
                <item name="wcf.user.profile.customization"><![CDATA[Customization]]></item>
                <item name="wcf.user.profile.title"><![CDATA[User profile of {$user->username}]]></item>
@@ -5610,5 +5609,6 @@ your notifications on <a href="{link isHtmlEmail=true}{/link}">{PAGE_TITLE|phras
        <item name="wcf.user.notification.markAsConfirmed" />
        <item name="wcf.user.panel.markAllAsRead" />
        <item name="wcf.user.panel.markAsRead" />
+       <item name="wcf.user.profile.user" />
 </delete>
 </language>