Изменения документа Профиль пользователя XWikiUserSheet

Редактировал(а) Dmitriy Rybakov 20.06.2025, 16:38

От версии 1.1
отредактировано Admin xWiKi
на 15.10.2019, 13:20
Изменить комментарий: Install extension [org.xwiki.platform:xwiki-platform-user-profile-ui/11.8.1]
К версии 2.1
отредактировано Dmitriy Rybakov
на 04.10.2024, 00:12
Изменить комментарий: Install extension [org.xwiki.platform:xwiki-platform-user-profile-ui/15.10.12]

Сводка

Подробности

Свойства страницы
Автор документа
... ... @@ -1,1 +1,1 @@
1 -XWiki.admin
1 +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: add APIs to be able to display users watchlists to admins
18 -#if($isMyProfile && $hasWatch)
19 - #set($discard = $categories.add({'id':'watchlist', 'sheet':'XWiki.XWikiUserWatchListSheet', 'glyphicon': 'eye'}))
20 -#end
21 -#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,6 +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).
68 + #set($isMyProfile = ($services.model.resolveDocument($xcontext.user) == $doc.documentReference))
85 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"/}}
86 86   #end
87 87   )))
... ... @@ -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}" /}}
90 + {{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]
Код
... ... @@ -12,7 +12,7 @@
12 12  
13 13  #avatar img {
14 14   border: 1px solid $theme.borderColor;
15 - border-radius: 5px 5px 5px 5px;
15 + border-radius: 8px 8px 8px 8px;
16 16   box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
17 17   margin: 0 auto;
18 18   padding: 0.3em;
... ... @@ -72,13 +72,13 @@
72 72   margin-left: 14em;
73 73  }
74 74  
75 -.column h1 {
76 - font-weight:bold;
77 - font-size:115%;
78 - margin:10px 0;
75 +.column h1, .column h2 {
76 + font-weight: bold;
77 + font-size: 115%;
78 + margin: 10px 0;
79 79  }
80 80  
81 -.column h2 {
81 +.column h3 {
82 82   font-size: 110%;
83 83  }
84 84  
... ... @@ -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,7 +126,13 @@
126 126  .userInfo img {
127 127   max-width: 100%;
128 128  }
129 -
125 +
126 +.userInfo h2 {
127 + font-size: larger;
128 + font-weight: bolder;
129 + margin-top: 10px;
130 +}
131 +
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  }
... ... @@ -135,13 +135,22 @@
135 135   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;
140 +div.editProfileCategory {
141 + float:right;
142 + a.btn-xs {
143 + background-color: @xwiki-page-content-bg;
144 + border: 1px solid @xwiki-border-color;
145 + .action-icon {
146 + font-size: larger;
147 + color: @btn-default-color;
148 + }
149 + &:hover, &:active, &:focus {
150 + border-color: darken(@dropdown-divider-bg, 10%);
151 + }
152 + }
143 143  }
144 144  
155 +
145 145  /* Watchlist */
146 146  
147 147  #watchlistRssLink {
Content Type
... ... @@ -1,0 +1,1 @@
1 +LESS