Изменения документа Профиль пользователя XWikiUserSheet
Редактировал(а) Dmitriy Rybakov 20.06.2025
От версии 1.1
отредактировано Полина Герасимова
на 20.09.2024
на 20.09.2024
Изменить комментарий:
Install extension [org.xwiki.platform:xwiki-platform-user-profile-ui/11.8.1]
К версии 3.1
отредактировано Dmitriy Rybakov
на 20.06.2025
на 20.06.2025
Изменить комментарий:
Install extension [org.xwiki.platform:xwiki-platform-user-profile-ui/16.10.8]
Сводка
-
Свойства страницы (2 изменено, 0 добавлено, 0 удалено)
-
Объекты (2 изменено, 0 добавлено, 0 удалено)
Подробности
- Свойства страницы
-
- Автор документа
-
... ... @@ -1,1 +1,1 @@ 1 -xwiki:XWiki. gerasimovapd1 +xwiki:XWiki.rybakovds - Содержимое
-
... ... @@ -8,38 +8,21 @@ 8 8 ## Setting categories 9 9 ######################### 10 10 #set($categories = []) 11 - #set($discard = $categories.add({'id':'profile', 'sheet':'XWiki.XWikiUserProfileSheet', 'glyphicon': 'user'}))12 -# set($isMyProfile= ($services.model.resolveDocument($xcontext.user) == $doc.documentReference))13 -# if($isMyProfile|| $hasAdmin)14 - # set($discard = $categories.add({'id':'preferences', 'sheet':'XWiki.XWikiUserPreferencesSheet', 'glyphicon':'wrench'}))15 -#end 16 -# set($discard= $categories.add({'id':'groups','sheet':'XWiki.XWikiUserMembershipSheet','glyphicon':'group'}))17 - ##TODO:addAPIstobeabletodisplayusers watchlists to admins18 - #if($isMyProfile&&$hasWatch)19 - # set($discard = $categories.add({'id':'watchlist', 'sheet':'XWiki.XWikiUserWatchListSheet', 'glyphicon': 'eye'}))20 -#e nd21 -# if($isMyProfile)22 - # if("$!services.notification.watch" !=''||$hasWatch)23 - #set($discard = $categories.add( {'id':'network', 'sheet':'XWiki.XWikiUserNetworkSheet', 'glyphicon': 'world'}))11 + 12 +## load the user menu from the 'org.xwiki.plaftorm.user.profile.menu' UIXP. 13 +#foreach ($uix in $services.uix.getExtensions('org.xwiki.plaftorm.user.profile.menu', {'sortByParameter': 'priority'})) 14 + #if(!$uix.parameters.containsKey('isActive') || $uix.parameters.get('isActive') != 'false') 15 + #if (!$uix.parameters.containsKey('id')) 16 + ## when no id is explicitly provided, we use the id of the UIX. 17 + #set ($discard = $uix.parameters.put('id', $uix.id)) 18 + #end 19 + #if ($uix.parameters.containsKey('icon')) 20 + #set ($discard = $uix.parameters.put('glyphicon', $uix.parameters.get('icon'))) 21 + #end 22 + #set ($discard = $uix.parameters.put('uix', $uix)) 23 + #set($discard = $categories.add($uix.parameters)) 24 24 #end 25 - ## TODO: add an enhancement system instead 26 - #set($notificationsSheet = $services.model.createDocumentReference('', ['XWiki', 'Notifications', 'Code'], 'XWikiUserNotificationsSheet')) 27 - #if ($xwiki.exists($notificationsSheet)) 28 - #set($discard = $categories.add({'id':'notifications', 'sheet':'XWiki.Notifications.Code.XWikiUserNotificationsSheet', 'glyphicon': 'bell'})) 29 - #end 30 30 #end 31 -#set($userWikiSheet = 'WikiManager.UserWikiSheet') 32 -#if($xcontext.isMainWiki() && $xwiki.exists($userWikiSheet)) 33 - #set($discard = $categories.add({ 34 - 'id': 'wikis', 35 - 'name': $services.localization.render('platform.wiki.menu.userwikis'), 36 - 'sheet': $userWikiSheet, 37 - 'glyphicon': 'list' 38 - })) 39 -#end 40 -#if($isMyProfile && $hasDashboard) 41 - #set($discard = $categories.add({'id':'dashboard', 'sheet':'Dashboard.XWikiUserDashboardSheet', 'glyphicon': 'th'})) 42 -#end 43 43 ######################### 44 44 ## Current category 45 45 ######################### ... ... @@ -82,7 +82,7 @@ 82 82 ## By specifying the image width we enable server side resizing. The width value we use is greater than the 83 83 ## available space because we don't want to loose too much of the image quality (we rely on the browser to fit the 84 84 ## image in the available space). 85 - {{attachmentSelector classname="XWiki.XWikiUsers" object="$obj.number" property="avatar" #if ($ isMyProfile) savemode="direct" #end defaultValue="XWiki.XWikiUserSheet@noavatar.png" width="180" alternateText="$xwiki.getUserName($doc.fullName, false)" buttontext="$services.localization.render('platform.core.profile.changePhoto')" displayImage="true" filter="png,jpg,jpeg,gif"/}}68 + {{attachmentSelector classname="XWiki.XWikiUsers" object="$obj.number" property="avatar" #if ($hasEdit) savemode="direct" #end defaultValue="XWiki.XWikiUserSheet@noavatar.png" width="180" alternateText="$xwiki.getUserName($doc.fullName, false)" buttontext="$services.localization.render('platform.core.profile.changePhoto')" displayImage="true" filter="png,jpg,jpeg,gif"/}} 86 86 #end 87 87 ))) 88 88 ########## ... ... @@ -103,8 +103,7 @@ 103 103 #set($tabKey = $subcategory.get('id')) 104 104 (% id="${tabKey}Pane" class="user-page-pane#if($tabKey != $currentCategory) hidden#end" %) 105 105 ((( 106 - #set($tabInclude = $subcategory.get('sheet')) 107 - {{include reference="${tabInclude}" /}} 89 + {{html}}$services.rendering.render($subcategory.uix.execute(), 'html/5.0'){{/html}} 108 108 ))) 109 109 #end 110 110 #end
- XWiki.JavaScriptExtension[0]
-
- Код
-
... ... @@ -63,7 +63,7 @@ 63 63 if (history.pushState) { 64 64 var params = window.location.search.toQueryParams(); 65 65 params.category = category; 66 - newQueryString = Object.toQueryString(params); 66 + var newQueryString = Object.toQueryString(params); 67 67 68 68 var newURL = window.location.protocol + '//' + window.location.host + window.location.pathname + '?' + newQueryString; 69 69 window.history.pushState({category : category}, '', newURL); ... ... @@ -72,7 +72,7 @@ 72 72 73 73 updateField : function (fieldName, value) { 74 74 var element = $$('input[name=' + fieldName + ']'); 75 - if (element && element. size()> 0){75 + if (element && element.length) { 76 76 element[0].value = value; 77 77 } 78 78 }, ... ... @@ -79,7 +79,7 @@ 79 79 80 80 handleCancelAction : function() { 81 81 var elements = $$('form .buttons input[type=submit][name=action_cancel]'); 82 - if (elements && elements. size()> 0){82 + if (elements && elements.length) { 83 83 var button = elements[0]; 84 84 Event.stopObserving(button, 'click'); 85 85 button.observe('click', function(event){
- XWiki.StyleSheetExtension[0]
-
- Код
-
... ... @@ -1,50 +1,58 @@ 1 1 #template("colorThemeInit.vm") 2 2 #set($tabswidth = "130px") 3 3 /* ----- User menu ----- */ 4 -#user-menu-col{ 4 +#user-menu-col { 5 5 float: left; 6 6 width: 13em; 7 7 } 8 8 9 -#avatar p { 10 - text-align: center; 11 -} 9 +#avatar { 12 12 13 -#avatar img { 14 - border: 1px solid $theme.borderColor; 15 - border-radius: 5px 5px 5px 5px; 16 - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); 17 - margin: 0 auto; 18 - padding: 0.3em; 19 - width: 95%; 11 + p { 12 + text-align: center; 13 + } 14 + 15 + img { 16 + border-top: @border-width solid @list-group-border; 17 + border-left: @border-width solid @list-group-border; 18 + border-right: @border-width solid @list-group-border; 19 + border-bottom: 0; 20 + border-radius: @border-radius-base @border-radius-base 0 0; 21 + margin: 0 auto; 22 + } 23 + 24 + .attachment-picker { 25 + border-radius: @border-radius-base; 26 + padding: @border-width; 27 + } 20 20 } 21 21 22 -.profile-menu .category-tab:before{ 30 +.profile-menu .category-tab:before { 23 23 float: left; 24 24 margin: 5px 0 0 5px; 25 25 } 26 26 27 -.profile-menu .user-menu-profile:before{ 35 +.profile-menu .user-menu-profile:before { 28 28 content: url("$xwiki.getSkinFile('icons/silk/vcard.png')"); 29 29 } 30 30 31 -.profile-menu .user-menu-preferences:before{ 39 +.profile-menu .user-menu-preferences:before { 32 32 content: url("$xwiki.getSkinFile('icons/silk/wrench.png')"); 33 33 } 34 34 35 -.profile-menu .user-menu-watchlist:before{ 43 +.profile-menu .user-menu-watchlist:before { 36 36 content: url("$xwiki.getSkinFile('icons/silk/star.png')"); 37 37 } 38 38 39 -.profile-menu .user-menu-network:before{ 47 +.profile-menu .user-menu-network:before { 40 40 content: url("$xwiki.getSkinFile('icons/silk/group.png')"); 41 41 } 42 42 43 -.profile-menu .user-menu-dashboard:before{ 51 +.profile-menu .user-menu-dashboard:before { 44 44 content: url("$xwiki.getSkinFile('icons/silk/application_view_tile.png')"); 45 45 } 46 46 47 -.profile-menu .user-menu-wikis:before{ 55 +.profile-menu .user-menu-wikis:before { 48 48 content: url("$xwiki.getSkinFile('icons/silk/chart_organisation.png')"); 49 49 } 50 50 ... ... @@ -63,22 +63,22 @@ 63 63 background-position: 7px 50%,top center; 64 64 } 65 65 66 -.user-menu-title a:hover{ 74 +.user-menu-title a:hover { 67 67 color: $theme.panelHeaderTextColor !important; 68 68 } 69 69 70 70 /* ----- Page content ---- */ 71 -#user-page-content{ 79 +#user-page-content { 72 72 margin-left: 14em; 73 73 } 74 74 75 -.column h1 { 76 - font-weight:bold; 77 - font-size:115%; 78 - margin:10px 0; 83 +.column h1, .column h2 { 84 + font-weight: bold; 85 + font-size: 115%; 86 + margin: 10px 0; 79 79 } 80 80 81 -.column h 2{89 +.column h3 { 82 82 font-size: 110%; 83 83 } 84 84 ... ... @@ -96,7 +96,7 @@ 96 96 97 97 /* ----- Profile ----- */ 98 98 td.recentChangesLeft, .recentChangesMoreActions { 99 - display:none; 107 + display: none; 100 100 } 101 101 102 102 td.recentChangesRight { ... ... @@ -115,10 +115,6 @@ 115 115 background-color: $theme.backgroundSecondaryColor; 116 116 } 117 117 118 -.userInfo { 119 - -ms-word-break: break-all; /* IE8, IE9 */ 120 -} 121 - 122 122 .userInfo a { 123 123 word-wrap: break-word; 124 124 } ... ... @@ -126,21 +126,21 @@ 126 126 .userInfo img { 127 127 max-width: 100%; 128 128 } 129 - 133 + 134 +.userInfo h2 { 135 + font-size: larger; 136 + font-weight: bolder; 137 + margin-top: 10px; 138 +} 139 + 130 130 div.userInfo input[type="text"], div.userInfo input[type="password"], div.userInfo textarea, div.userInfo select, div.userPreferences select { 131 131 width: 100%; 132 132 } 133 133 134 134 div.editProfileCategory { 135 - float:right; 145 + float: right; 136 136 } 137 137 138 -div.editProfileCategory a { 139 - display:block; 140 - width: 16px; 141 - height: 16px; 142 - background: url("$xwiki.getSkinFile('icons/silk/pencil.png')") no-repeat; 143 -} 144 144 145 145 /* Watchlist */ 146 146 ... ... @@ -151,9 +151,9 @@ 151 151 } 152 152 153 153 span#avatarUpload { 154 - display:block; 155 - width:$tabswidth; 156 - position:absolute; 158 + display: block; 159 + width: $tabswidth; 160 + position: absolute; 157 157 font-size: 10px; 158 158 font-weight: bold; 159 159 background-color: white; ... ... @@ -168,59 +168,72 @@ 168 168 margin: 0; 169 169 padding: 0; 170 170 } 175 + 171 171 #networkPane .following li { 172 172 padding: 2px 20px 2px 2px; 173 173 } 179 + 174 174 #networkPane .following li:hover { 175 175 background-color: $theme.highlightColor; 176 176 } 183 + 177 177 #networkPane .following img { 178 178 float: left; 179 179 margin-right: 5px; 180 180 } 188 + 181 181 #networkPane .following .user-info { 182 182 float: left; 183 183 } 192 + 184 184 #networkPane .following .user-id { 185 185 font-size: .8em; 186 186 font-weight: 900; 187 187 } 197 + 188 188 #networkPane .following .unfollow { 189 189 float: right; 190 190 margin-right: -16px; 191 191 padding: 0; 192 192 } 203 + 193 193 ## -------------------------------------- 194 194 ## Picker style 195 -.attachment-picker { 206 + 207 +#user-menu-col .attachment-picker { 196 196 position: relative; 197 197 margin: auto; 198 198 width: 100%; 199 199 } 200 -.attachment-picker p { 212 + 213 +#user-menu-col .attachment-picker p { 201 201 padding: 0; 202 202 margin: 0; 203 203 } 204 204 205 -.attachment-picker .picture { 218 +#user-menu-col .attachment-picker .picture { 206 206 z-index: -1; 207 207 } 208 -.attachment-picker .buttonwrapper { 221 + 222 +#user-menu-col .attachment-picker .buttonwrapper { 209 209 margin: 0; 210 210 } 211 211 212 -.attachment-picker-start { 213 - background: url("$xwiki.getSkinFile('icons/silk/picture_edit.png')") no-repeat center center $theme.pageContentBackgroundColor !important; 214 - border: 0 none !important; 215 - border-bottom-left-radius: 8px; 216 - height: 18px; 217 - position: absolute; 218 - right: 0; 219 - text-align: left; 220 - text-indent: -9999px; 221 - top: 1px; 222 - width: 18px !important; 223 - z-index: 1; 226 +#user-menu-col .attachment-picker { 227 + .buttonwrapper { 228 + .wikilink { 229 + display: flex; 230 + flex-flow: column; 231 + } 232 + 233 + a.button { 234 + .btn; 235 + .btn-default; 236 + border-radius: 0 0 @border-radius-base @border-radius-base; 237 + flex-grow: 1; 238 + margin: 0; 239 + } 240 + } 224 224 } 225 225 226 226 ## -------------------------------------- - Content Type
-
... ... @@ -1,0 +1,1 @@ 1 +LESS