Commit | Line | Data |
---|---|---|
0a6f84dc MW |
1 | <nav id="topMenu" class="userPanel{if $__wcf->user->userID} userPanelLoggedIn{/if}"> |
2 | {if $__wcf->user->userID} | |
3 | <span class="userPanelAvatar">{@$__wcf->getUserProfileHandler()->getAvatar()->getImageTag(32)}</span> | |
4 | {/if} | |
5 | ||
b8eab696 AE |
6 | <ul class="userPanelItems"> |
7 | {if $__wcf->user->userID} | |
8 | <!-- user menu --> | |
9 | <li id="userMenu"> | |
677bdb69 AE |
10 | <a |
11 | class="jsTooltip" | |
12 | href="{$__wcf->user->getLink()}" | |
13 | title="{lang}wcf.user.controlPanel{/lang}" | |
14 | role="button" | |
15 | tabindex="0" | |
16 | aria-haspopup="true" | |
17 | aria-expanded="false" | |
18 | > | |
19 | {@$__wcf->getUserProfileHandler()->getAvatar()->getImageTag(32)} <span>{lang}wcf.user.userNote{/lang}</span> | |
20 | </a> | |
21 | <div class="userMenu userMenuControlPanel" data-origin="userMenu" tabindex="-1" hidden> | |
22 | <div class="userMenuHeader"> | |
23 | <div class="userMenuTitle">{lang}wcf.user.controlPanel{/lang}</div> | |
b8eab696 | 24 | </div> |
677bdb69 AE |
25 | <div class="userMenuContent"> |
26 | <div class="userMenuItem"> | |
27 | <div class="userMenuItemImage"> | |
28 | {@$__wcf->getUserProfileHandler()->getUserProfile()->getAvatar()->getImageTag(48)} | |
29 | </div> | |
30 | <div class="userMenuItemContent"> | |
31 | {* This is the unformatted username, custom styles might not work nicely here and | |
32 | the consistent styling is used to provide visual anchors to identify links. *} | |
33 | <a href="{$__wcf->user->getLink()}" class="userMenuItemLink">{$__wcf->user->username}</a> | |
34 | ||
35 | {if MODULE_USER_RANK} | |
36 | {if $__wcf->getUserProfileHandler()->getUserTitle()} | |
37 | <span class="badge userTitleBadge{if $__wcf->getUserProfileHandler()->getRank() && $__wcf->getUserProfileHandler()->getRank()->cssClassName} {@$__wcf->getUserProfileHandler()->getRank()->cssClassName}{/if}">{$__wcf->getUserProfileHandler()->getUserTitle()}</span> | |
38 | {/if} | |
39 | {if $__wcf->getUserProfileHandler()->getRank() && $__wcf->getUserProfileHandler()->getRank()->rankImage} | |
40 | <span class="userRankImage">{@$__wcf->getUserProfileHandler()->getRank()->getImage()}</span> | |
41 | {/if} | |
42 | {/if} | |
43 | </div> | |
44 | <div class="userMenuItemMeta"> | |
45 | {lang}wcf.user.myProfile{/lang} | |
46 | </div> | |
47 | </div> | |
48 | </div> | |
49 | <div class="userMenuContentDivider"></div> | |
50 | {if $__wcf->session->getPermission('admin.general.canUseAcp')} | |
51 | <div class="userMenuContent"> | |
52 | <div class="userMenuItem userMenuItemNarrow userMenuItemSingleLine"> | |
53 | <div class="userMenuItemImage"> | |
54 | <span class="icon icon32 fa-wrench"></span> | |
55 | </div> | |
56 | <div class="userMenuItemContent"> | |
57 | <a href="{link isACP=true}{/link}" class="userMenuItemLink">{lang}wcf.global.acp{/lang}</a> | |
58 | </div> | |
59 | </div> | |
60 | </div> | |
61 | <div class="userMenuContentDivider"></div> | |
62 | {/if} | |
63 | <div class="userMenuContent"> | |
64 | {foreach from=$__wcf->getUserMenu()->getUserMenuItems() item=menuItem} | |
65 | <div class="userMenuItem userMenuItemNarrow" data-category="{$menuItem[category]->menuItem}"> | |
66 | <div class="userMenuItemImage"> | |
67 | <span class="icon icon32 {$menuItem[category]->getIconClassName()}"></span> | |
68 | </div> | |
69 | <div class="userMenuItemContent"> | |
70 | <a href="{$menuItem[link]}" class="userMenuItemLink"> | |
71 | {$menuItem[category]->getTitle()} | |
72 | </a> | |
73 | </div> | |
74 | <div class="userMenuItemMeta"> | |
75 | {implode from=$menuItem[items] item=title glue=' · '}{$title}{/implode} | |
76 | </div> | |
77 | </div> | |
78 | {/foreach} | |
79 | </div> | |
80 | <div class="userMenuFooter"> | |
81 | <a href="{link controller='Logout'}t={csrfToken type=url}{/link}" class="userMenuFooterLink">{lang}wcf.user.logout{/lang}</a> | |
b8eab696 | 82 | </div> |
b8eab696 | 83 | </div> |
51547f2c | 84 | <script data-relocate="true"> |
677bdb69 | 85 | require(["WoltLabSuite/Core/Ui/User/Menu/ControlPanel"], ({ setup }) => setup()); |
51547f2c | 86 | </script> |
b8eab696 AE |
87 | </li> |
88 | ||
b8eab696 AE |
89 | <!-- user notifications --> |
90 | {if !$__hideUserMenu|isset} | |
f030cb76 | 91 | <li id="userNotifications" data-count="{#$__wcf->getUserNotificationHandler()->getNotificationCount()}" data-title="Benachrichtigungen"> |
ea0c0ef6 AE |
92 | <a |
93 | class="jsTooltip" | |
94 | href="{link controller='NotificationList'}{/link}" | |
95 | title="{lang}wcf.user.notification.notifications{/lang}" | |
96 | role="button" | |
97 | tabindex="0" | |
98 | aria-haspopup="true" | |
99 | aria-expanded="false" | |
100 | > | |
101 | <span class="icon icon32 fa-bell-o"></span> <span>{lang}wcf.user.notification.notifications{/lang}</span>{if $__wcf->getUserNotificationHandler()->getNotificationCount()} <span class="badge badgeUpdate">{#$__wcf->getUserNotificationHandler()->getNotificationCount()}</span>{/if} | |
102 | </a> | |
b8eab696 AE |
103 | {if !OFFLINE || $__wcf->session->getPermission('admin.general.canViewPageDuringOfflineMode')} |
104 | <script data-relocate="true"> | |
8eaab6e0 AE |
105 | require(["WoltLabSuite/Core/Ui/User/Menu/Data/Notification"], ({ setup }) => { |
106 | setup({ | |
9f663473 | 107 | noItems: '{jslang}wcf.user.notification.noMoreNotifications{/jslang}', |
b8eab696 | 108 | settingsLink: '{link controller='NotificationSettings' encode=false}{/link}', |
8eaab6e0 | 109 | settingsTitle: '{jslang}wcf.user.notification.settings{/jslang}', |
b8eab696 | 110 | showAllLink: '{link controller='NotificationList' encode=false}{/link}', |
8eaab6e0 AE |
111 | showAllTitle: '{jslang}wcf.user.notification.showAll{/jslang}', |
112 | title: '{jslang}wcf.user.notification.notifications{/jslang}', | |
677bdb69 | 113 | }); |
b8eab696 | 114 | }); |
b8eab696 | 115 | </script> |
320f4a6d | 116 | {/if} |
b8eab696 AE |
117 | </li> |
118 | {/if} | |
119 | {else} | |
d4e8bc05 AE |
120 | {if $__wcf->getLanguage()->getLanguages()|count > 1} |
121 | <li id="pageLanguageContainer"> | |
122 | <script data-relocate="true"> | |
58d7e8f8 | 123 | require(['EventHandler', 'WoltLabSuite/Core/Language/Chooser'], function(EventHandler, LanguageChooser) { |
d4e8bc05 | 124 | var languages = { |
fb062f13 MS |
125 | {implode from=$__wcf->getLanguage()->getLanguages() item=_language} |
126 | '{@$_language->languageID}': { | |
127 | iconPath: '{@$_language->getIconPath()|encodeJS}', | |
128 | languageName: '{@$_language|encodeJS}', | |
129 | languageCode: '{@$_language->languageCode|encodeJS}' | |
d4e8bc05 AE |
130 | } |
131 | {/implode} | |
132 | }; | |
ff110591 | 133 | |
d4e8bc05 | 134 | var callback = function(listItem) { |
ff110591 MW |
135 | var location; |
136 | var languageCode = elData(listItem, 'language-code'); | |
137 | var link = elBySel('link[hreflang="' + languageCode + '"]'); | |
138 | if (link !== null) { | |
139 | location = link.href; | |
140 | } | |
141 | else { | |
142 | location = window.location.toString().replace(/#.*/, '').replace(/(\?|&)l=[0-9]+/g, ''); | |
143 | } | |
d4e8bc05 | 144 | |
ff110591 | 145 | var delimiter = (location.indexOf('?') == -1) ? '?' : '&'; |
d4e8bc05 AE |
146 | window.location = location + delimiter + 'l=' + elData(listItem, 'language-id') + window.location.hash; |
147 | }; | |
148 | ||
51ab1086 | 149 | LanguageChooser.init('pageLanguageContainer', 'pageLanguageID', {@$__wcf->getLanguage()->languageID}, languages, callback); |
d4e8bc05 AE |
150 | EventHandler.add('com.woltlab.wcf.UserMenuMobile', 'more', function(data) { |
151 | if (data.identifier === 'com.woltlab.wcf.language') { | |
152 | callback(data.parent); | |
153 | } | |
154 | }); | |
155 | }); | |
156 | </script> | |
157 | </li> | |
158 | {/if} | |
b8eab696 AE |
159 | {if !$__disableLoginLink|isset} |
160 | <!-- login box --> | |
161 | <li id="userLogin"> | |
162 | <a class="loginLink" href="{link controller='Login'}{/link}">{lang}wcf.user.loginOrRegister{/lang}</a> | |
5ea92119 | 163 | <div id="loginForm" class="loginForm" style="display: none"> |
b8eab696 | 164 | <form method="post" action="{link controller='Login'}{/link}"> |
5ea92119 AE |
165 | <section class="section loginFormLogin"> |
166 | <h2 class="sectionTitle">{lang}wcf.user.login.login{/lang}</h2> | |
b8eab696 AE |
167 | |
168 | <dl> | |
169 | <dt><label for="username">{lang}wcf.user.usernameOrEmail{/lang}</label></dt> | |
170 | <dd> | |
7845bedd | 171 | <input type="text" id="username" name="username" value="" required class="long" autocomplete="username"> |
b8eab696 AE |
172 | </dd> |
173 | </dl> | |
174 | ||
b8eab696 AE |
175 | <dl> |
176 | <dt><label for="password">{lang}wcf.user.password{/lang}</label></dt> | |
177 | <dd> | |
cf4fd97e | 178 | <input type="password" id="password" name="password" value="" class="long" autocomplete="current-password"> |
5ea92119 | 179 | <small><a href="{link controller='LostPassword'}{/link}">{lang}wcf.user.lostPassword{/lang}</a></small> |
b8eab696 AE |
180 | </dd> |
181 | </dl> | |
182 | ||
5ea92119 | 183 | {event name='fields'} |
b8eab696 | 184 | |
5ea92119 AE |
185 | <div class="userLoginButtons"> |
186 | <input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s"> | |
0ba63443 | 187 | <input type="hidden" name="url" value="{$__wcf->session->requestURI}"> |
bb3d4ee5 | 188 | {csrfToken} |
b8eab696 | 189 | </div> |
5ea92119 | 190 | </section> |
b8eab696 | 191 | |
5ea92119 AE |
192 | {if !REGISTER_DISABLED} |
193 | <section class="section loginFormRegister"> | |
194 | <h2 class="sectionTitle">{lang}wcf.user.login.register{/lang}</h2> | |
195 | ||
196 | <p>{lang}wcf.user.login.register.teaser{/lang}</p> | |
197 | ||
198 | <div class="userLoginButtons"> | |
199 | <a href="{link controller='Register'}{/link}" class="button loginFormRegisterButton">{lang}wcf.user.login.register.registerNow{/lang}</a> | |
200 | </div> | |
95961bdf | 201 | </section> |
b8eab696 | 202 | {/if} |
5ea92119 AE |
203 | |
204 | {hascontent} | |
205 | <section class="section loginFormThirdPartyLogin"> | |
206 | <h2 class="sectionTitle">{lang}wcf.user.login.3rdParty{/lang}</h2> | |
207 | ||
208 | <dl> | |
209 | <dt></dt> | |
210 | <dd> | |
f968ffe1 | 211 | <ul class="buttonList"> |
5ea92119 | 212 | {content} |
5ea92119 AE |
213 | {if FACEBOOK_PUBLIC_KEY !== '' && FACEBOOK_PRIVATE_KEY !== ''} |
214 | <li id="facebookAuth" class="thirdPartyLogin"> | |
f968ffe1 | 215 | <a href="{link controller='FacebookAuth'}{/link}" class="button thirdPartyLoginButton facebookLoginButton"><span class="icon icon24 fa-facebook-official"></span> <span>{lang}wcf.user.3rdparty.facebook.login{/lang}</span></a> |
5ea92119 AE |
216 | </li> |
217 | {/if} | |
218 | ||
219 | {if GOOGLE_PUBLIC_KEY !== '' && GOOGLE_PRIVATE_KEY !== ''} | |
220 | <li id="googleAuth" class="thirdPartyLogin"> | |
f968ffe1 | 221 | <a href="{link controller='GoogleAuth'}{/link}" class="button thirdPartyLoginButton googleLoginButton"><span class="icon icon24 fa-google"></span> <span>{lang}wcf.user.3rdparty.google.login{/lang}</span></a> |
5ea92119 AE |
222 | </li> |
223 | {/if} | |
a5c93ac0 MW |
224 | |
225 | {if TWITTER_PUBLIC_KEY !== '' && TWITTER_PRIVATE_KEY !== ''} | |
226 | <li id="twitterAuth" class="thirdPartyLogin"> | |
135ef37a | 227 | <a href="{link controller='TwitterAuth'}{/link}" class="button thirdPartyLoginButton twitterLoginButton"><span class="icon icon24 fa-twitter"></span> <span>{lang}wcf.user.3rdparty.twitter.login{/lang}</span></a> |
a5c93ac0 MW |
228 | </li> |
229 | {/if} | |
230 | ||
231 | {if GITHUB_PUBLIC_KEY !== '' && GITHUB_PRIVATE_KEY !== ''} | |
232 | <li id="githubAuth" class="thirdPartyLogin"> | |
135ef37a | 233 | <a href="{link controller='GithubAuth'}{/link}" class="button thirdPartyLoginButton githubLoginButton"><span class="icon icon24 fa-github"></span> <span>{lang}wcf.user.3rdparty.github.login{/lang}</span></a> |
a5c93ac0 MW |
234 | </li> |
235 | {/if} | |
5ea92119 AE |
236 | |
237 | {event name='3rdpartyButtons'} | |
238 | {/content} | |
239 | </ul> | |
240 | </dd> | |
241 | </dl> | |
242 | </section> | |
243 | {/hascontent} | |
b8eab696 AE |
244 | </form> |
245 | </div> | |
320f4a6d | 246 | |
b8eab696 | 247 | <script data-relocate="true"> |
b8eab696 AE |
248 | $(function() { |
249 | WCF.Language.addObject({ | |
e2e8c155 MW |
250 | 'wcf.user.button.login': '{jslang}wcf.user.button.login{/jslang}', |
251 | 'wcf.user.button.register': '{jslang}wcf.user.button.register{/jslang}', | |
252 | 'wcf.user.login': '{jslang}wcf.user.login{/jslang}' | |
b8eab696 | 253 | }); |
4004c095 | 254 | WCF.User.QuickLogin.init(); |
b2e0e0cd | 255 | }); |
b8eab696 AE |
256 | </script> |
257 | </li> | |
258 | {/if} | |
b8eab696 AE |
259 | {/if} |
260 | ||
261 | {if !$__hideUserMenu|isset} | |
262 | {if $__wcf->user->userID && $__wcf->session->getPermission('mod.general.canUseModeration')} | |
0882d872 | 263 | <li id="outstandingModeration" data-count="{#$__wcf->getModerationQueueManager()->getUnreadModerationCount()}"> |
ea0c0ef6 AE |
264 | <a |
265 | class="jsTooltip" | |
266 | href="{link controller='ModerationList'}{/link}" | |
267 | title="{lang}wcf.moderation.moderation{/lang}" | |
268 | role="button" | |
269 | tabindex="0" | |
270 | aria-haspopup="true" | |
271 | aria-expanded="false" | |
272 | > | |
e2368a74 | 273 | <span class="icon icon32 fa-exclamation-triangle"></span> |
b8eab696 | 274 | <span>{lang}wcf.moderation.moderation{/lang}</span> |
e2368a74 | 275 | {if $__wcf->getModerationQueueManager()->getUnreadModerationCount()}<span class="badge badgeUpdate">{#$__wcf->getModerationQueueManager()->getUnreadModerationCount()}</span>{/if} |
b8eab696 AE |
276 | </a> |
277 | {if !OFFLINE || $__wcf->session->getPermission('admin.general.canViewPageDuringOfflineMode')} | |
278 | <script data-relocate="true"> | |
cf9e11c3 AE |
279 | require(["WoltLabSuite/Core/Ui/User/Menu/Data/ModerationQueue"], ({ setup }) => { |
280 | setup({ | |
9f663473 | 281 | deletedContent: '{jslang}wcf.moderation.showDeletedContent{/jslang}', |
b8eab696 | 282 | deletedContentLink: '{link controller='DeletedContentList' encode=false}{/link}', |
9f663473 | 283 | noItems: '{jslang}wcf.moderation.noMoreItems{/jslang}', |
b8eab696 | 284 | showAllLink: '{link controller='ModerationList' encode=false}{/link}', |
cf9e11c3 | 285 | showAllTitle: '{jslang}wcf.moderation.showAll{/jslang}', |
9f663473 | 286 | title: '{jslang}wcf.moderation.moderation{/jslang}' |
677bdb69 | 287 | }); |
b8eab696 | 288 | }); |
b8eab696 AE |
289 | </script> |
290 | {/if} | |
291 | </li> | |
51547f2c | 292 | {/if} |
b8eab696 AE |
293 | |
294 | {event name='menuItems'} | |
295 | {/if} | |
74029e21 AE |
296 | |
297 | <!-- page search --> | |
d53b1144 MW |
298 | {if !SEARCH_USE_CAPTCHA || $__wcf->user->userID} |
299 | <li class="jsOnly"> | |
300 | <a href="#" id="userPanelSearchButton" class="jsTooltip" title="{lang}wcf.global.search{/lang}"><span class="icon icon32 fa-search"></span> <span>{lang}wcf.global.search{/lang}</span></a> | |
301 | </li> | |
302 | {else} | |
303 | <li> | |
304 | <a href="{link controller='Search'}{/link}" class="jsTooltip" title="{lang}wcf.global.search{/lang}"><span class="icon icon32 fa-search"></span> <span>{lang}wcf.global.search{/lang}</span></a> | |
258f69d4 | 305 | <span id="userPanelSearchButton" style="display: none"></span> |
d53b1144 MW |
306 | </li> |
307 | {/if} | |
b8eab696 | 308 | </ul> |
bf1461c2 | 309 | </nav> |