Changes for page Profile of XWikiUserSheet
Last modified by Ludovic Dubost on 2024/07/22 15:51
From version 5.1
edited by Ludovic Dubost
on 2017/02/07 23:57
on 2017/02/07 23:57
Change comment:
Install extension [org.xwiki.platform:xwiki-platform-user-profile-ui-8.4.4]
Summary
-
Page properties (2 modified, 0 added, 0 removed)
-
Objects (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - #set($userName="$!doc.getValue('first_name') $!doc.getValue('last_name')")#if($userName==' ')#set($userName=$doc.name)#{end}$services.localization.render('platform.core.profile.title', [$userName])1 +$services.localization.render('platform.core.profile.title', ["$!doc.getValue('first_name') $!doc.getValue('last_name')"]) - Content
-
... ... @@ -8,29 +8,28 @@ 8 8 ## Setting categories 9 9 ######################### 10 10 #set($categories = []) 11 -#set($discard = $categories.add({'id':'profile', 'sheet':'XWiki.XWikiUserProfileSheet' , 'glyphicon': 'user'}))11 +#set($discard = $categories.add({'id':'profile', 'sheet':'XWiki.XWikiUserProfileSheet'})) 12 12 #set($isMyProfile = ($services.model.resolveDocument($xcontext.user) == $doc.documentReference)) 13 13 #if($isMyProfile || $hasAdmin) 14 - #set($discard = $categories.add({'id':'preferences', 'sheet':'XWiki.XWikiUserPreferencesSheet' , 'glyphicon': 'wrench'}))14 + #set($discard = $categories.add({'id':'preferences', 'sheet':'XWiki.XWikiUserPreferencesSheet'})) 15 15 #end 16 16 ## TODO: add APIs to be able to display users watchlists to admins 17 -#if($isMyProfile && $hasWatch) 18 - #set($discard = $categories.add({'id':'watchlist', 'sheet':'XWiki.XWikiUserWatchListSheet' , 'glyphicon': 'eye-open'}))17 +#if($isMyProfile && $hasWatch) 18 + #set($discard = $categories.add({'id':'watchlist', 'sheet':'XWiki.XWikiUserWatchListSheet'})) 19 19 #end 20 20 #if($isMyProfile) 21 - #set($discard = $categories.add({'id':'network', 'sheet':'XWiki.XWikiUserNetworkSheet' , 'glyphicon': 'globe'}))21 + #set($discard = $categories.add({'id':'network', 'sheet':'XWiki.XWikiUserNetworkSheet'})) 22 22 #end 23 -#set($userW ikiSheet = 'WikiManager.UserWikiSheet')24 -#if($xcontext.isMainWiki() && $xwiki.exists($userW ikiSheet))23 +#set($userWorkspaceSheet = 'WorkspaceManager.UserWorkspaceSheet') 24 +#if($xcontext.isMainWiki() && $xwiki.exists($userWorkspaceSheet)) 25 25 #set($discard = $categories.add({ 26 - 'id': 'wikis', 27 - 'name': $services.localization.render('platform.wiki.menu.userwikis'), 28 - 'sheet': $userWikiSheet, 29 - 'glyphicon': 'list' 26 + 'id': 'workspaces', 27 + 'name': $services.localization.render('workspacemanager.profile.category.workspaces'), 28 + 'sheet': $userWorkspaceSheet 30 30 })) 31 31 #end 32 32 #if($isMyProfile && $hasDashboard) 33 - #set($discard = $categories.add({'id':'dashboard', 'sheet':'Dashboard.XWikiUserDashboardSheet' , 'glyphicon': 'th'}))32 + #set($discard = $categories.add({'id':'dashboard', 'sheet':'Dashboard.XWikiUserDashboardSheet'})) 34 34 #end 35 35 ######################### 36 36 ## Current category ... ... @@ -37,7 +37,7 @@ 37 37 ######################### 38 38 #set($currentCategory = "$!request.category") 39 39 #if($currentCategory == "") 40 - #set($currentCategory = $categories [0].get('id'))39 + #set($currentCategory = $listtool.get($categories, 0).get('id')) 41 41 #end 42 42 ######################### 43 43 ## Creating vertical menu ... ... @@ -68,13 +68,10 @@ 68 68 ((( 69 69 #if($request.xpage == 'edituser') 70 70 {{html clean="false"}} 71 - #resizedUserAvatar($doc.fullName 1 80)70 + #resizedUserAvatar($doc.fullName 170) 72 72 {{/html}} 73 73 #else 74 - ## By specifying the image width we enable server side resizing. The width value we use is greater than the 75 - ## available space because we don't want to loose too much of the image quality (we rely on the browser to fit the 76 - ## image in the available space). 77 - {{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,gif"/}} 73 + {{attachmentSelector classname="XWiki.XWikiUsers" object="$obj.number" property="avatar" #if ($isMyProfile) savemode="direct" #end defaultValue="XWiki.XWikiUserSheet@noavatar.png" width="120" alternateText="$xwiki.getUserName($doc.fullName, false)" buttontext="$services.localization.render('platform.core.profile.changePhoto')" displayImage="true" filter="png,jpg,gif"/}} 78 78 #end 79 79 ))) 80 80 ########## ... ... @@ -106,7 +106,7 @@ 106 106 ######################### 107 107 {{html clean="false"}} 108 108 #if($xcontext.action == 'edit' || $xcontext.action == 'inline') 109 - <input type='hidden' name='category' value="$!{ escapetool.xml($currentCategory)}" />105 + <input type='hidden' name='category' value="$!{currentCategory}" /> 110 110 #end 111 111 <div class="clearfloats"> </div> 112 112 #if($request.get('xpage'))
- XWiki.JavaScriptExtension[0]
-
- Code
-
... ... @@ -11,7 +11,7 @@ 11 11 this.tabsContainer.select('.category-tab').each(function (tabElement) { 12 12 tabElement.observe('click', function(event) { 13 13 Event.stop(event); 14 - this.switchTab(tabElement.id , true);14 + this.switchTab(tabElement.id); 15 15 }.bindAsEventListener(this)); 16 16 }.bind(this)); 17 17 this.tabsContainer.select('.category-tab.current').each(function (activeTab) { ... ... @@ -19,20 +19,9 @@ 19 19 document.fire('xwiki:profile:switchedCategory', {'category' : activeTab.id}); 20 20 }.bind(this)); 21 21 this.handleCancelAction(); 22 - 23 - // History navigation through our pushed states. 24 - window.addEventListener('popstate', function(event) { 25 - if (event.state && event.state.category) { 26 - this.switchTab('vertical-menu-' + event.state.category); 27 - } 28 - }.bindAsEventListener(this)); 29 - // Store the initial history state so we can go back. 30 - history.replaceState({ 31 - category: window.location.search.toQueryParams().category || 'profile' 32 - }, document.title, document.location.href); 33 33 }, 34 34 35 - switchTab : function(tab , pushHistory) {24 + switchTab : function(tab) { 36 36 var tabName = tab.substring(14); // 14 = len('vertical-menu-') 37 37 $("user-page-content").select("div.user-page-pane").each(function(pane){ 38 38 pane.addClassName('hidden'); ... ... @@ -43,9 +43,6 @@ 43 43 }); 44 44 $(tab).addClassName('current'); 45 45 this.updateCategoryFields(tab); 46 - if (pushHistory) { 47 - this.updateURL(tabName); 48 - } 49 49 document.fire('xwiki:profile:switchedCategory', {'category' : tab}); 50 50 }, 51 51 ... ... @@ -57,17 +57,6 @@ 57 57 this.updateField('category', category); 58 58 }, 59 59 60 - updateURL : function (category) { 61 - if (history.pushState) { 62 - var params = window.location.search.toQueryParams(); 63 - params.category = category; 64 - newQueryString = Object.toQueryString(params); 65 - 66 - var newURL = window.location.protocol + '//' + window.location.host + window.location.pathname + '?' + newQueryString; 67 - window.history.pushState({category : category}, '', newURL); 68 - } 69 - }, 70 - 71 71 updateField : function (fieldName, value) { 72 72 var element = $$('input[name=' + fieldName + ']'); 73 73 if (element && element.size() > 0) {
- XWiki.StyleSheetExtension[0]
-
- Code
-
... ... @@ -6,10 +6,6 @@ 6 6 width: 13em; 7 7 } 8 8 9 -#avatar p { 10 - text-align: center; 11 -} 12 - 13 13 #avatar img { 14 14 border: 1px solid $theme.borderColor; 15 15 border-radius: 5px 5px 5px 5px; ... ... @@ -44,11 +44,11 @@ 44 44 content: url("$xwiki.getSkinFile('icons/silk/application_view_tile.png')"); 45 45 } 46 46 47 -.profile-menu .user-menu-w ikis:before{43 +.profile-menu .user-menu-workspaces:before{ 48 48 content: url("$xwiki.getSkinFile('icons/silk/chart_organisation.png')"); 49 49 } 50 50 51 -. skin-colibri .profile-menu .group.user-menu-title{47 +.profile-menu .group.user-menu-title{ 52 52 #set ($menuIcon = "url(${escapetool.S}$xwiki.getSkinFile('icons/silk/user.png')${escapetool.S})") 53 53 #css3_backgroundIconAndLinearGradient($menuIcon, { 54 54 'to': 'bottom', ... ... @@ -72,6 +72,11 @@ 72 72 margin-left: 14em; 73 73 } 74 74 71 +#user-page-content h1{ 72 + margin: 0 0 20px 0; 73 +} 74 + 75 + 75 75 .column h1 { 76 76 font-weight:bold; 77 77 font-size:115%; ... ... @@ -115,14 +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 -.userInfo a { 123 - word-wrap: break-word; 124 -} 125 - 126 126 .userInfo img { 127 127 max-width: 100%; 128 128 } ... ... @@ -150,6 +150,24 @@ 150 150 font-weight: bold; 151 151 } 152 152 146 +span.wikiWatchlistType, span.spaceWatchlistType, span.pageWatchlistType { 147 + width: 16px; 148 + height: 16px; 149 + display: block; 150 +} 151 + 152 +span.wikiWatchlistType { 153 + background: url("$xwiki.getSkinFile('icons/silk/world.png')") no-repeat; 154 +} 155 + 156 +span.spaceWatchlistType { 157 + background: url("$xwiki.getSkinFile('icons/silk/folder.png')") no-repeat; 158 +} 159 + 160 +span.pageWatchlistType { 161 + background: url("$xwiki.getSkinFile('icons/silk/page_white_text.png')") no-repeat; 162 +} 163 + 153 153 span#avatarUpload { 154 154 display:block; 155 155 width:$tabswidth; ... ... @@ -213,6 +213,8 @@ 213 213 background: url("$xwiki.getSkinFile('icons/silk/picture_edit.png')") no-repeat center center $theme.pageContentBackgroundColor !important; 214 214 border: 0 none !important; 215 215 border-bottom-left-radius: 8px; 227 + -moz-border-radius-bottomleft: 8px; 228 + -webkit-border-bottom-left-radius: 8px; 216 216 height: 18px; 217 217 position: absolute; 218 218 right: 0; ... ... @@ -226,7 +226,6 @@ 226 226 ## -------------------------------------- 227 227 ## Dashboard 228 228 /* prevent the clearfloats between buttons & dashboard gadgets from clearing the tabs as well, only the buttons float */ 229 -.dashboard .clearfloats, 230 -.dashboard .clearfloats:after, .dashboard .clearfloats:before { 242 +.dashboard .clearfloats { 231 231 clear: right; 232 232 }