Re: [xwiki-devs] [xwiki-notifications] r35662 - platform/xwiki-applications/trunk/administration/src/main/resources/XWiki
Hi Sergiu, Isn't it wrong for the Admin app to depend on the XE application? IMO the attachmentselector app should be in another app on which the Admin depend on, and the XE app should depend on the Admin app, not the other way around Thanks -Vincent On Mar 17, 2011, at 2:31 AM, sdumitriu (SVN) wrote:
Author: sdumitriu Date: 2011-03-17 02:31:42 +0100 (Thu, 17 Mar 2011) New Revision: 35662
Modified: platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/XWikiUserSheet.xml Log: XAADMINISTRATION-257: Improve the UI for changing the user's avatar Done. Patch from Marta Girdea applied without changes.
Modified: platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/XWikiUserSheet.xml =================================================================== --- platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/XWikiUserSheet.xml 2011-03-17 00:54:43 UTC (rev 35661) +++ platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/XWikiUserSheet.xml 2011-03-17 01:31:42 UTC (rev 35662) @@ -3,7 +3,7 @@ <web>XWiki</web> <name>XWikiUserSheet</name> <language></language> -<defaultLanguage>en</defaultLanguage> +<defaultLanguage></defaultLanguage> <translation>0</translation> <parent>Main.XWikiUsers</parent> <creator>xwiki:XWiki.Admin</creator> @@ -167,11 +167,6 @@ userprofile : {
init : function() { - if ($('avatar')) { - Event.observe($('avatar'), 'mouseover', function() { XWiki.userprofile.displayChangePhoto('true') }); - Event.observe($('avatar'), 'mouseout', function() { XWiki.userprofile.displayChangePhoto('false') }); - XWiki.userprofile.adjustTabsContainerHeight(); - } this.tabsContainer = $('vertical-tabs'); this.tabsContainer.select('.vertical-tab').each(function (tabElement) { if (!tabElement.__name) { @@ -185,6 +180,7 @@ this.tabsContainer.select('.vertical-tab.active').each(function (activeTab) { document.fire('xwiki:profile:switchedCategory', {'category' : activeTab.__name}); }); + XWiki.userprofile.adjustTabsContainerHeight(); },
/* @@ -207,15 +203,6 @@ } },
- displayChangePhoto : function(display) { - var changePhoto = $('avatarUpload'); - if (display == true) { - changePhoto.removeClassName('hidden'); - } else { - changePhoto.addClassName('hidden'); - } - }, - switchTab : function(tab) { $("vertical-panes").select("div.vertical-pane").each(function(pane){ pane.addClassName('hidden'); @@ -537,6 +524,38 @@ float: right; margin-right: -16px; padding: 0; +} +## -------------------------------------- +## Picker style +.attachment-picker { + position: relative; +} +.attachment-picker p { + padding: 0; + margin: 0; +} + +.attachment-picker .picture { + z-index: -1; +} +.attachment-picker .buttonwrapper { + margin: 0; +} + +.attachment-picker-start { + background: url("$xwiki.getSkinFile('icons/silk/picture_edit.gif')") no-repeat center center $theme.pageContentBackgroundColor !important; + border: 0 none !important; + border-radius-bottomleft: 8px; + -moz-border-radius-bottomleft: 8px; + -webkit-border-radius-bottomleft: 8px; + height: 18px; + position: absolute; + right: 0; + text-align: left; + text-indent: -9999px; + top: 0; + width: 18px !important; + z-index: 1; }</code> </property> <property> @@ -569,20 +588,6 @@ #if($isMyProfile && $hasWatch) #set($discard = $categories.add(['watchlist', $msg.get('platform.core.profile.category.watchlist'), 'XWiki.XWikiUserWatchListSheet', 'icons/silk/star.gif'])) #end -## -## Avatar -## -#set($avatarURL = '') -#if($obj.getProperty("avatar") && $obj.getProperty("avatar").getValue() != '') - #foreach ($attach in $doc.attachmentList) - #if($attach.filename == $obj.getProperty("avatar").getValue()) - #set($avatarURL = "$doc.getAttachmentURL($attach.filename, 'download', 'width=120')") - #end - #end -#end -#if("$!avatarURL" == '') - #set($avatarURL = $xwiki.getDocument("XWiki.XWikiUserSheet").getAttachmentURL('noavatar.png', 'download', 'width=120')) -#end #if ($isMyProfile) #set ($discard = $categories.add(['network', $msg.get('platform.core.profile.category.network'), 'XWiki.XWikiUserNetworkSheet', 'icons/silk/group.gif'])) #end @@ -603,9 +608,12 @@ ## <div id="vertical-tabs"> <div id="avatar"> - <span id="avatarUpload" class="hidden">$msg.get('platform.core.profile.changePhoto')</span> - <a href="$doc.getURL('edit', 'xpage=changemyavatar')" ><img class="photo" id="xwikiuseravatar" alt="$doc.display('first_name', 'view', $obj)" src="$avatarURL"/></a> - </div> +{{/html}} + +{{attachmentSelector classname="XWiki.XWikiUsers" object="$obj.number" property="avatar" #if ($isMyProfile) savemode="direct" #end defaultValue="[email protected]" width="120" alternateText="$xwiki.getUserName($doc.fullName, false)" buttontext="$msg.get('platform.core.profile.changePhoto')" displayImage="true" filter="png,jpg,gif"/}} + +{{html clean="false"}} + </div>## avatar <div> <ul> #foreach($tab in $categories)
On Thu, Mar 17, 2011 at 07:11, Vincent Massol <[email protected]> wrote:
Hi Sergiu,
Isn't it wrong for the Admin app to depend on the XE application?
IMO the attachmentselector app should be in another app on which the Admin depend on, and the XE app should depend on the Admin app, not the other way around
+1 It should be possible to use admin app without XE
Thanks -Vincent
On Mar 17, 2011, at 2:31 AM, sdumitriu (SVN) wrote:
Author: sdumitriu Date: 2011-03-17 02:31:42 +0100 (Thu, 17 Mar 2011) New Revision: 35662
Modified: platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/XWikiUserSheet.xml Log: XAADMINISTRATION-257: Improve the UI for changing the user's avatar Done. Patch from Marta Girdea applied without changes.
Modified: platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/XWikiUserSheet.xml =================================================================== --- platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/XWikiUserSheet.xml 2011-03-17 00:54:43 UTC (rev 35661) +++ platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/XWikiUserSheet.xml 2011-03-17 01:31:42 UTC (rev 35662) @@ -3,7 +3,7 @@ <web>XWiki</web> <name>XWikiUserSheet</name> <language></language> -<defaultLanguage>en</defaultLanguage> +<defaultLanguage></defaultLanguage> <translation>0</translation> <parent>Main.XWikiUsers</parent> <creator>xwiki:XWiki.Admin</creator> @@ -167,11 +167,6 @@ userprofile : {
init : function() { - if ($('avatar')) { - Event.observe($('avatar'), 'mouseover', function() { XWiki.userprofile.displayChangePhoto('true') }); - Event.observe($('avatar'), 'mouseout', function() { XWiki.userprofile.displayChangePhoto('false') }); - XWiki.userprofile.adjustTabsContainerHeight(); - } this.tabsContainer = $('vertical-tabs'); this.tabsContainer.select('.vertical-tab').each(function (tabElement) { if (!tabElement.__name) { @@ -185,6 +180,7 @@ this.tabsContainer.select('.vertical-tab.active').each(function (activeTab) { document.fire('xwiki:profile:switchedCategory', {'category' : activeTab.__name}); }); + XWiki.userprofile.adjustTabsContainerHeight(); },
/* @@ -207,15 +203,6 @@ } },
- displayChangePhoto : function(display) { - var changePhoto = $('avatarUpload'); - if (display == true) { - changePhoto.removeClassName('hidden'); - } else { - changePhoto.addClassName('hidden'); - } - }, - switchTab : function(tab) { $("vertical-panes").select("div.vertical-pane").each(function(pane){ pane.addClassName('hidden'); @@ -537,6 +524,38 @@ float: right; margin-right: -16px; padding: 0; +} +## -------------------------------------- +## Picker style +.attachment-picker { + position: relative; +} +.attachment-picker p { + padding: 0; + margin: 0; +} + +.attachment-picker .picture { + z-index: -1; +} +.attachment-picker .buttonwrapper { + margin: 0; +} + +.attachment-picker-start { + background: url("$xwiki.getSkinFile('icons/silk/picture_edit.gif')") no-repeat center center $theme.pageContentBackgroundColor !important; + border: 0 none !important; + border-radius-bottomleft: 8px; + -moz-border-radius-bottomleft: 8px; + -webkit-border-radius-bottomleft: 8px; + height: 18px; + position: absolute; + right: 0; + text-align: left; + text-indent: -9999px; + top: 0; + width: 18px !important; + z-index: 1; }</code> </property> <property> @@ -569,20 +588,6 @@ #if($isMyProfile && $hasWatch) #set($discard = $categories.add(['watchlist', $msg.get('platform.core.profile.category.watchlist'), 'XWiki.XWikiUserWatchListSheet', 'icons/silk/star.gif'])) #end -## -## Avatar -## -#set($avatarURL = '') -#if($obj.getProperty("avatar") && $obj.getProperty("avatar").getValue() != '') - #foreach ($attach in $doc.attachmentList) - #if($attach.filename == $obj.getProperty("avatar").getValue()) - #set($avatarURL = "$doc.getAttachmentURL($attach.filename, 'download', 'width=120')") - #end - #end -#end -#if("$!avatarURL" == '') - #set($avatarURL = $xwiki.getDocument("XWiki.XWikiUserSheet").getAttachmentURL('noavatar.png', 'download', 'width=120')) -#end #if ($isMyProfile) #set ($discard = $categories.add(['network', $msg.get('platform.core.profile.category.network'), 'XWiki.XWikiUserNetworkSheet', 'icons/silk/group.gif'])) #end @@ -603,9 +608,12 @@ ## <div id="vertical-tabs"> <div id="avatar"> - <span id="avatarUpload" class="hidden">$msg.get('platform.core.profile.changePhoto')</span> - <a href="$doc.getURL('edit', 'xpage=changemyavatar')" ><img class="photo" id="xwikiuseravatar" alt="$doc.display('first_name', 'view', $obj)" src="$avatarURL"/></a> - </div> +{{/html}} + +{{attachmentSelector classname="XWiki.XWikiUsers" object="$obj.number" property="avatar" #if ($isMyProfile) savemode="direct" #end defaultValue="[email protected]" width="120" alternateText="$xwiki.getUserName($doc.fullName, false)" buttontext="$msg.get('platform.core.profile.changePhoto')" displayImage="true" filter="png,jpg,gif"/}} + +{{html clean="false"}} + </div>## avatar <div> <ul> #foreach($tab in $categories)
devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
On 03/17/2011 07:11 AM, Vincent Massol wrote:
Hi Sergiu,
Isn't it wrong for the Admin app to depend on the XE application?
IMO the attachmentselector app should be in another app on which the Admin depend on, and the XE app should depend on the Admin app, not the other way around
I agree, and I tried to think of a way to not introduce this dependency, while at the same time not creating a horde of new small modules/jiras. Administration already depends on XE, and has been for a long time (the {{activity}} in the user profile for once). Since it uses color themes, there's another soft dependency. Groups? Livetable => XWiki.LiveTableResults => Bam! Another implicit dependency. In the future we should move all documents from enterprise/wiki into other applications, but let's not oppose improvements because they merely tighten a wrong dependency.
On Mar 17, 2011, at 2:31 AM, sdumitriu (SVN) wrote:
Author: sdumitriu Date: 2011-03-17 02:31:42 +0100 (Thu, 17 Mar 2011) New Revision: 35662
Modified: platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/XWikiUserSheet.xml Log: XAADMINISTRATION-257: Improve the UI for changing the user's avatar Done.
-- Sergiu Dumitriu http://purl.org/net/sergiu/
participants (3)
-
Sergiu Dumitriu -
Thomas Mortagne -
Vincent Massol