Added user buttons in user profile preview
authorMarcel Werk <burntime@woltlab.com>
Sat, 27 Aug 2016 21:12:45 +0000 (23:12 +0200)
committerMarcel Werk <burntime@woltlab.com>
Sat, 27 Aug 2016 21:12:45 +0000 (23:12 +0200)
com.woltlab.wcf/templates/userProfilePreview.tpl
wcfsetup/install/files/js/WCF.User.js
wcfsetup/install/files/js/WoltLabSuite/Core/Dom/Util.js
wcfsetup/install/files/style/ui/userProfile.scss

index bb1a306a2cded8757775564df4d57bd17e1b8504..fd261a91bede8cef6eb0f6c5adfe797026a249fa 100644 (file)
@@ -5,7 +5,7 @@
                <a href="{link controller='User' object=$user}{/link}" title="{$user->username}">{@$user->getAvatar()->getImageTag(128)}</a>
                
                <div class="userInformation">
-                       {include file='userInformation' disableUserInformationButtons=true}
+                       {include file='userInformation'}
                        
                        {if $user->canViewOnlineStatus() && $user->getLastActivityTime()}
                                <dl class="plain inlineDataList">
                                </dl>
                        {/hascontent}
                </div>
+               
+               {if $__wcf->getUser()->userID && $__wcf->getUser()->userID != $user->userID}
+                       <script data-relocate="true">
+                               //<![CDATA[
+                               $(function() {
+                                       WCF.Language.addObject({
+                                               'wcf.user.button.follow': '{lang}wcf.user.button.follow{/lang}',
+                                               'wcf.user.button.ignore': '{lang}wcf.user.button.ignore{/lang}',
+                                               'wcf.user.button.unfollow': '{lang}wcf.user.button.unfollow{/lang}',
+                                               'wcf.user.button.unignore': '{lang}wcf.user.button.unignore{/lang}'
+                                       });
+                                       
+                                       new WCF.User.Action.Follow($('.userInformation'));
+                                       
+                                       {if !$user->getPermission('user.profile.cannotBeIgnored')}
+                                               new WCF.User.Action.Ignore($('.userInformation'));
+                                       {/if}
+                               });
+                               //]]>
+                       </script>
+               {/if}
        </div>
 {/if}
index 1fa2eb234d30444f98001ee02c582b2b73731d2b..57180163c6583f7286d889b1aade5b8733d9b5c3 100644 (file)
@@ -2128,12 +2128,6 @@ WCF.User.Action.Follow = Class.extend({
                
                var $notification = new WCF.System.Notification();
                $notification.show();
-               
-               // force rebuilding of popover cache
-               var self = this;
-               WCF.System.ObjectStore.invoke('WCF.User.ProfilePreview', function(profilePreview) {
-                       profilePreview.purge(self._userID);
-               });
        }
 });
 
index b7885765e449779545d5ba01f5e04fb496c35e29..da590cb25b606dc15064f0e58bdad70cc14f9c87 100644 (file)
@@ -50,7 +50,7 @@ define(['Environment', 'StringUtil'], function(Environment, StringUtil) {
                 */
                createFragmentFromHtml: function(html) {
                        var tmp = elCreate('div');
-                       tmp.innerHTML = html;
+                       this.setInnerHtml(tmp, html);
                        
                        var fragment = document.createDocumentFragment();
                        while (tmp.childNodes.length) {
index 3dfce24ac5500676b5e63e06396d20a929843b81..8773d54c17d4ece967a41942f118c481e31d9324 100644 (file)
        }
 }
 
+.userProfilePreview {
+       position: relative;
+       
+       .userInformation {
+               padding-bottom: 16px;
+       }
+       
+       .buttonGroupNavigation {
+               position: absolute;
+               bottom: 0;
+               right: 0;
+       }
+}
+
 /* using `dl` + `.inlineDataList` to prevent styles applied to the
    data list provided by the `userInformation` template */
 .userProfilePreview dl.inlineDataList {