Improved avatar list visuals
authorAlexander Ebert <ebert@woltlab.com>
Tue, 12 Apr 2016 09:37:16 +0000 (11:37 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 12 Apr 2016 09:37:16 +0000 (11:37 +0200)
com.woltlab.wcf/templates/userSidebar.tpl
wcfsetup/install/files/lib/page/UserPage.class.php
wcfsetup/install/files/style/layout/layout.scss
wcfsetup/install/files/style/layout/sidebar.scss
wcfsetup/install/files/style/ui/userProfile.scss

index e14508eaab6ba1bb12622567e6e5e80a9280f831..1777068eb2f2ce6a2b9e0e2c2e2ef0621804f8ba 100644 (file)
@@ -10,7 +10,7 @@
                                        {/foreach}
                                </ul>
                                
-                               {if $followingCount > 8}
+                               {if $followingCount > 7}
                                        <a id="followingAll" class="button small more jsOnly">{lang}wcf.global.button.showAll{/lang}</a>
                                {/if}
                        </div>
@@ -28,7 +28,7 @@
                                        {/foreach}
                                </ul>
                                        
-                               {if $followerCount > 8}
+                               {if $followerCount > 7}
                                        <a id="followerAll" class="button small more jsOnly">{lang}wcf.global.button.showAll{/lang}</a>
                                {/if}
                        </div>
@@ -46,7 +46,7 @@
                                        {/foreach}
                                </ul>
                                        
-                               {if $visitorCount > 8}
+                               {if $visitorCount > 7}
                                        <a id="visitorAll" class="button small more jsOnly">{lang}wcf.global.button.showAll{/lang}</a>
                                {/if}
                        </div>
index 9eb871443e4642acba1c37dc4543985be7f39034..b2c870f5ca0667d1a815eb96dcb00e02715cafe6 100644 (file)
@@ -22,7 +22,7 @@ use wcf\system\WCF;
  * Shows the user profile page.
  * 
  * @author     Marcel Werk
- * @copyright  2001-2015 WoltLab GmbH
+ * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage page
@@ -44,7 +44,7 @@ class UserPage extends AbstractPage {
         * overview editable content object type
         * @var \wcf\data\object\type\ObjectType
         */
-       public $objectType = null;
+       public $objectType;
        
        /**
         * profile content for active menu item
@@ -62,25 +62,25 @@ class UserPage extends AbstractPage {
         * user object
         * @var UserProfile
         */
-       public $user = null;
+       public $user;
        
        /**
         * follower list
         * @var \wcf\data\user\follow\UserFollowerList
         */
-       public $followerList = null;
+       public $followerList;
        
        /**
         * following list
         * @var \wcf\data\user\follow\UserFollowingList
         */
-       public $followingList = null;
+       public $followingList;
        
        /**
         * visitor list
         * @var \wcf\data\user\profile\visitor\UserProfileVisitorList
         */
-       public $visitorList = null;
+       public $visitorList;
        
        /**
         * @see \wcf\page\IPage::readParameters()
@@ -100,7 +100,7 @@ class UserPage extends AbstractPage {
                
                if (isset($_REQUEST['editOnInit'])) $this->editOnInit = true;
                
-               $this->canonicalURL = LinkHandler::getInstance()->getLink('User', array('object' => $this->user));
+               $this->canonicalURL = LinkHandler::getInstance()->getLink('User', ['object' => $this->user]);
        }
        
        /**
@@ -125,25 +125,25 @@ class UserPage extends AbstractPage {
                
                // get followers
                $this->followerList = new UserFollowerList();
-               $this->followerList->getConditionBuilder()->add('user_follow.followUserID = ?', array($this->userID));
-               $this->followerList->sqlLimit = 12;
+               $this->followerList->getConditionBuilder()->add('user_follow.followUserID = ?', [$this->userID]);
+               $this->followerList->sqlLimit = 7;
                $this->followerList->readObjects();
                
                // get following
                $this->followingList = new UserFollowingList();
-               $this->followingList->getConditionBuilder()->add('user_follow.userID = ?', array($this->userID));
-               $this->followingList->sqlLimit = 12;
+               $this->followingList->getConditionBuilder()->add('user_follow.userID = ?', [$this->userID]);
+               $this->followingList->sqlLimit = 7;
                $this->followingList->readObjects();
                
                // get visitors
                if (PROFILE_ENABLE_VISITORS) {
                        $this->visitorList = new UserProfileVisitorList();
-                       $this->visitorList->getConditionBuilder()->add('user_profile_visitor.ownerID = ?', array($this->userID));
-                       $this->visitorList->sqlLimit = 12;
+                       $this->visitorList->getConditionBuilder()->add('user_profile_visitor.ownerID = ?', [$this->userID]);
+                       $this->visitorList->sqlLimit = 7;
                        $this->visitorList->readObjects();
                }
                
-               MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('User', array('object' => $this->user->getDecoratedObject(), 'appendSession' => false)), true);
+               MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('User', ['object' => $this->user->getDecoratedObject(), 'appendSession' => false]), true);
                MetaTagHandler::getInstance()->addTag('og:type', 'og:type', 'profile', true);
                MetaTagHandler::getInstance()->addTag('profile:username', 'profile:username', $this->user->username, true);
                MetaTagHandler::getInstance()->addTag('og:title', 'og:title', $this->user->username . ' - ' . WCF::getLanguage()->get('wcf.user.members') . ' - ' . WCF::getLanguage()->get(PAGE_TITLE), true);
@@ -156,7 +156,7 @@ class UserPage extends AbstractPage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'editOnInit' => $this->editOnInit,
                        'overviewObjectType' => $this->objectType,
                        'profileContent' => $this->profileContent,
@@ -166,11 +166,11 @@ class UserPage extends AbstractPage {
                        'followerCount' => $this->followerList->countObjects(),
                        'following' => $this->followingList->getObjects(),
                        'followingCount' => $this->followingList->countObjects(),
-                       'visitors' => ($this->visitorList !== null ? $this->visitorList->getObjects() : array()),
+                       'visitors' => ($this->visitorList !== null ? $this->visitorList->getObjects() : []),
                        'visitorCount' => ($this->visitorList !== null ? $this->visitorList->countObjects() : 0),
                        'allowSpidersToIndexThisPage' => true,
                        'isAccessible' => UserGroup::isAccessibleGroup($this->user->getGroupIDs())
-               ));
+               ]);
        }
        
        /**
@@ -180,22 +180,20 @@ class UserPage extends AbstractPage {
                // update profile hits
                if ($this->user->userID != WCF::getUser()->userID && !WCF::getSession()->spiderID && !$this->user->isProtected()) {
                        $editor = new UserEditor($this->user->getDecoratedObject());
-                       $editor->updateCounters(array('profileHits' => 1));
+                       $editor->updateCounters(['profileHits' => 1]);
                        
                        // save visitor
                        if (PROFILE_ENABLE_VISITORS && WCF::getUser()->userID && !WCF::getUser()->canViewOnlineStatus) {
                                if (($visitor = UserProfileVisitor::getObject($this->user->userID, WCF::getUser()->userID)) !== null) {
                                        $editor = new UserProfileVisitorEditor($visitor);
-                                       $editor->update(array(
-                                               'time' => TIME_NOW
-                                       ));
+                                       $editor->update(['time' => TIME_NOW]);
                                }
                                else {
-                                       UserProfileVisitorEditor::create(array(
+                                       UserProfileVisitorEditor::create([
                                                'ownerID' => $this->user->userID,
                                                'userID' => WCF::getUser()->userID,
                                                'time' => TIME_NOW
-                                       ));
+                                       ]);
                                }
                        }
                }
index 841d343a9008cd4d27c2e4ad3978c2bc09d99508..db6e312de5c8751cdef7fc4bf994851325ce066e 100644 (file)
@@ -1,7 +1,3 @@
-/* @TODO */
-.userAvatarImage { border-radius: 50%; }
-/* @TODO END */
-
 html, body {
        height: 100%;
        
index 421f8b566ad63db40f1b8193345e23cb1bf52928..40cf02d7d2cb4b09973f6adb3f41a1006dfaab51 100644 (file)
                > div,
                > fieldset,
                > section {
+                       .boxContent {
+                               @include clearfix;
+                       }
+                       
                        .button.more {
                                float: right;
                                margin-top: 15px;
index fd6da7c2ad81d6922b78b7e5e9931d03f99cbc22..fec2f719ea2e588849b734477db93b7d9e964151 100644 (file)
        }
 }
 
+.userAvatarImage {
+       background-color: rgba(255, 255, 255, 1);
+       border-radius: 50%;
+}
+
 .userAvatarList {
        display: flex;
        flex-wrap: wrap;
-       margin-bottom: -15px;
+       margin-bottom: -10px;
        
        > li {
-               flex: 0 0 25%;
-               margin-bottom: 15px;
+               flex: 0 0 48px;
+               margin-bottom: 10px;
                text-align: center;
                
+               &:not(:last-child) {
+                       margin-right: -12px;
+               }
+               
                > a {
                        display: block;
+                       
+                       > img {
+                               padding: 2px;
+                       }
                }
        }
 }