This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  94639946f763d91b6aff1611a3d13c677a64f14d (commit)
      from  bb4052b53df9c391d551b81588b564bea9844669 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=94639946f763d91b6aff1611a3d13c677a64f14d

commit 94639946f763d91b6aff1611a3d13c677a64f14d
Author: Franck Villaume <[email protected]>
Date:   Tue Oct 4 18:02:42 2016 +0200

    Project Members widget improvement: display only 10 admins & 10 members, 
add buttons to display full list. Save a lot of space for large project

diff --git a/src/common/widget/Widget_ProjectMembers.class.php 
b/src/common/widget/Widget_ProjectMembers.class.php
index 3536b87..38bb179 100644
--- a/src/common/widget/Widget_ProjectMembers.class.php
+++ b/src/common/widget/Widget_ProjectMembers.class.php
@@ -2,6 +2,7 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights 
reserved
  * Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
+ * Copyright 2016, Franck Villaume - TrivialDev
  *
  * This file is a part of Fusionforge.
  *
@@ -47,53 +48,97 @@ class Widget_ProjectMembers extends Widget {
 
                $iam_member = false ;
                if (count($admins) > 0) {
-                       $result .= '<span class="develtitle">'._('Project 
Admins').'</span><br />';
-                       foreach ($admins as $u) {
-                               $result .= '<div rel="doap:maintainer">'."\n";
+                       $result .= '<div class="extractadmin"><span 
class="develtitle">'._('Project Admins').'</span><br />';
+                       $resultcomplete = '<span class="completeadmin" 
style="display:none">';
+                       $resultmore = false;
+                       foreach ($admins as $key => $u) {
+                               $resultlocal = '<div 
rel="doap:maintainer">'."\n";
                                // A foaf:Person that holds an account on the 
forge
                                $developer_url = util_make_url_u 
($u->getUnixName(),$u->getID());
-                               $result .= '<div typeof="foaf:Person" about="'.
+                               $resultlocal .= '<div typeof="foaf:Person" 
about="'.
                                        $developer_url.'#person' .'" >'."\n";
-                               $result .= '<div rel="foaf:account">'."\n";
-                               $result .= '<div typeof="sioc:UserAccount" 
about="'.
+                               $resultlocal .= '<div rel="foaf:account">'."\n";
+                               $resultlocal .= '<div typeof="sioc:UserAccount" 
about="'.
                                        $developer_url.
                                        '">'."\n";
-                               $result .= 
util_display_user($u->getUnixName(),$u->getID(),$u->getRealName())."\n";
-                               $result .= "</div>\n"; // /sioc:UserAccount
-                               $result .= "</div>\n"; // /foaf:holdsAccount
-                               $result .= "</div>\n"; // /foaf:Person
-                               $result .= "</div>\n"; // 
/doap:maintainer|developer
+                               $resultlocal .= 
util_display_user($u->getUnixName(),$u->getID(),$u->getRealName())."\n";
+                               $resultlocal .= "</div>\n"; // /sioc:UserAccount
+                               $resultlocal .= "</div>\n"; // 
/foaf:holdsAccount
+                               $resultlocal .= "</div>\n"; // /foaf:Person
+                               $resultlocal .= "</div>\n"; // 
/doap:maintainer|developer
                                if ($u->getID() == user_getid()) {
                                        $iam_member = true ;
                                }
-                               $seen[] = $u->getID() ;
+                               $seen[] = $u->getID();
+                               if ($key < 10) {
+                                       $result .= $resultlocal;
+                               } else {
+                                       $resultcomplete .= $resultlocal;
+                                       $resultmore = true;
+                               }
+                       }
+                       $resultcomplete .= '</span>';
+                       $result .= $resultcomplete;
+                       if ($resultmore) {
+                               $result .= '<input type="button" 
class="seemoreadmin" value="'._('See more ...').'" />';
+                               $result .= '<script type="text/javascript">';
+                               $result .= 'toggleAdmin = function() { 
jQuery(".completeadmin").toggle(); };';
+                               $result .= 
'jQuery(document).ready(jQuery(".seemoreadmin").click(jQuery.proxy(this, 
"toggleAdmin")));';
+                               $result .= '</script>';
                        }
+                       $result .= '</div>';
                }
 
                if (count($members) > 0) {
-                       $result .= '<span class="develtitle">'. 
_('Members')._(':').'</span><br />';
-                       foreach ($members as $u) {
+                       $headerresult = true;
+                       $resultcomplete = '<span class="completemember" 
style="display: none">';
+                       $resultmore = false;
+                       foreach ($members as $key => $u) {
                                if (in_array ($u->getID(), $seen)) {
-                                       continue ;
+                                       continue;
                                }
-
-                               $result .= '<div rel="doap:developer">'."\n";
+                               if ($headerresult) {
+                                       if (count($admins) > 0) {
+                                               $result .= '<hr/>';
+                                       }
+                                       $result .= '<div 
class="extractmember"><span class="develtitle">'. 
_('Members')._(':').'</span><br />';
+                                       $headerresult = false;
+                               }
+                               $resultlocal = '<div 
rel="doap:developer">'."\n";
                                // A foaf:Person that holds an account on the 
forge
                                $developer_url = util_make_url_u 
($u->getUnixName(),$u->getID());
-                               $result .= '<div typeof="foaf:Person" about="'.
+                               $resultlocal .= '<div typeof="foaf:Person" 
about="'.
                                        $developer_url.'#person' .'" >'."\n";
-                               $result .= '<div rel="foaf:account">'."\n";
-                               $result .= '<div typeof="sioc:UserAccount" 
about="'.
+                               $resultlocal .= '<div rel="foaf:account">'."\n";
+                               $resultlocal .= '<div typeof="sioc:UserAccount" 
about="'.
                                        $developer_url.
                                        '">'."\n";
-                               $result .= 
util_display_user($u->getUnixName(),$u->getID(),$u->getRealName())."\n";
-                               $result .= "</div>\n"; // /sioc:UserAccount
-                               $result .= "</div>\n"; // /foaf:holdsAccount
-                               $result .= "</div>\n"; // /foaf:Person
-                               $result .= "</div>\n"; // 
/doap:maintainer|developer
+                               $resultlocal .= 
util_display_user($u->getUnixName(),$u->getID(),$u->getRealName())."\n";
+                               $resultlocal .= "</div>\n"; // /sioc:UserAccount
+                               $resultlocal .= "</div>\n"; // 
/foaf:holdsAccount
+                               $resultlocal .= "</div>\n"; // /foaf:Person
+                               $resultlocal .= "</div>\n"; // 
/doap:maintainer|developer
                                if ($u->getID() == user_getid()) {
                                        $iam_member = true ;
                                }
+                               if ($key < 10) {
+                                       $result .= $resultlocal;
+                               } else {
+                                       $resultcomplete .= $resultlocal;
+                                       $resultmore = true;
+                               }
+                       }
+                       $resultcomplete .= '</span>';
+                       $result .= $resultcomplete;
+                       if ($resultmore && !$headerresult) {
+                               $result .= '<input type="button" 
class="seemoremember" value="'._('See more ...').'" />';
+                               $result .= '<script type="text/javascript">';
+                               $result .= 'toggleMember = function() { 
jQuery(".completemember").toggle(); };';
+                               $result .= 
'jQuery(document).ready(jQuery(".seemoremember").click(jQuery.proxy(this, 
"toggleMember")));';
+                               $result .= '</script>';
+                       }
+                       if (!$headerresult) {
+                               $result .= '</div>';
                        }
                }
 

-----------------------------------------------------------------------

Summary of changes:
 src/common/widget/Widget_ProjectMembers.class.php | 95 +++++++++++++++++------
 1 file changed, 70 insertions(+), 25 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to