Style group directory output

This commit is contained in:
Zach Copley 2011-04-13 15:08:12 -07:00
parent b6b9baa9a2
commit 42e945a42d
5 changed files with 24 additions and 46 deletions

View File

@ -185,7 +185,7 @@ class DirectoryPlugin extends Plugin
{ {
if (in_array( if (in_array(
$action->trimmed('action'), $action->trimmed('action'),
array('userdirectory')) array('userdirectory', 'groupdirectory'))
) { ) {
$action->cssLink($this->path('css/directory.css')); $action->cssLink($this->path('css/directory.css'));
} }

View File

@ -199,7 +199,7 @@ class GroupdirectoryAction extends Action
{ {
$this->showForm(); $this->showForm();
$this->elementStart('div', array('id' => 'group_directory')); $this->elementStart('div', array('id' => 'profile_directory'));
$alphaNav = new AlphaNav($this, false, false, array('0-9', 'All')); $alphaNav = new AlphaNav($this, false, false, array('0-9', 'All'));
$alphaNav->show(); $alphaNav->show();
@ -232,14 +232,13 @@ class GroupdirectoryAction extends Action
$this->pagination( $this->pagination(
$this->page > 1, $this->page > 1,
$cnt > GROUPS_PER_PAGE, $cnt > PROFILES_PER_PAGE,
$this->page, $this->page,
'groupdirectory', 'groupdirectory',
$args $args
); );
$this->elementEnd('div'); $this->elementEnd('div');
} }
function showForm($error=null) function showForm($error=null)
@ -281,7 +280,7 @@ class GroupdirectoryAction extends Action
$limit = GROUPS_PER_PAGE + 1; $limit = GROUPS_PER_PAGE + 1;
if (isset($this->q)) { if (isset($this->q)) {
$order = 'user_group.created ASC'; $order = 'user_group.created ASC';
if ($this->sort == 'nickname') { if ($this->sort == 'nickname') {

View File

@ -199,7 +199,7 @@ class UserdirectoryAction extends Action
{ {
$this->showForm(); $this->showForm();
$this->elementStart('div', array('id' => 'user_directory')); $this->elementStart('div', array('id' => 'profile_directory'));
$alphaNav = new AlphaNav($this, false, false, array('0-9', 'All')); $alphaNav = new AlphaNav($this, false, false, array('0-9', 'All'));
$alphaNav->show(); $alphaNav->show();

View File

@ -1,35 +1,35 @@
/* CSS file for the Directory plugin */ /* CSS file for the Directory plugin */
div#user_directory div.alpha_nav { div#profile_directory div.alpha_nav {
overflow: hidden; overflow: hidden;
width: 100%; width: 100%;
text-align: center; text-align: center;
} }
/* XXX: this needs serious CSS foo */ /* XXX: this needs serious CSS foo */
div#user_directory div.alpha_nav > a { div#profile_directory div.alpha_nav > a {
border-left: 1px solid #000; border-left: 1px solid #000;
padding-left: 2px; padding-left: 2px;
} }
div#user_directory div.alpha_nav > a.first { div#profile_directory div.alpha_nav > a.first {
border-left: none; border-left: none;
} }
div#user_directory div.alpha_nav a:link { div#profile_directory div.alpha_nav a:link {
text-decoration: none; text-decoration: none;
} }
div#user_directory div.alpha_nav a:visited { div#profile_directory div.alpha_nav a:visited {
text-decoration: none; text-decoration: none;
} }
div#user_directory div.alpha_nav a:active { div#profile_directory div.alpha_nav a:active {
text-decoration: none; text-decoration: none;
} }
div#user_directory div.alpha_nav a:hover { div#profile_directory div.alpha_nav a:hover {
text-decoration: underline; color: blue; text-decoration: underline; color: blue;
} }
div#user_directory div.alpha_nav a.current { div#profile_directory div.alpha_nav a.current {
background-color:#9BB43E; background-color:#9BB43E;
} }

View File

@ -58,7 +58,7 @@ class SortableGroupList extends SortableSubscriptionList
function startList() function startList()
{ {
$this->out->elementStart('table', array('class' => 'profile_list xoxo', 'border' => '1')); $this->out->elementStart('table', array('class' => 'profile_list xoxo'));
$this->out->elementStart('thead'); $this->out->elementStart('thead');
$this->out->elementStart('tr'); $this->out->elementStart('tr');
@ -120,25 +120,6 @@ class SortableGroupList extends SortableSubscriptionList
$this->out->elementStart('tbody'); $this->out->elementStart('tbody');
} }
function showProfiles()
{
$cnt = 0;
while ($this->profile->fetch()) {
$cnt++;
if($cnt > PROFILES_PER_PAGE) {
break;
}
$odd = ($cnt % 2 == 0); // for zebra striping
$pli = $this->newListItem($this->profile, $odd);
$pli->show();
}
return $cnt;
}
function newListItem($profile, $odd) function newListItem($profile, $odd)
{ {
return new SortableGroupListItem($profile, $this->owner, $this->action, $odd); return new SortableGroupListItem($profile, $this->owner, $this->action, $odd);
@ -188,13 +169,16 @@ class SortableGroupListItem extends SortableSubscriptionListItem
$avatar = $this->profile->stream_logo; $avatar = $this->profile->stream_logo;
$aAttrs = $this->linkAttributes(); $aAttrs = $this->linkAttributes();
$this->out->elementStart('a', $aAttrs); $this->out->elementStart('a', $aAttrs);
$this->out->element('img', array('src' => ($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_STREAM_SIZE), $this->out->element(
'class' => 'photo avatar', 'img',
'width' => AVATAR_STREAM_SIZE, array(
'height' => AVATAR_STREAM_SIZE, 'src' => ($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_STREAM_SIZE),
'alt' => 'class' => 'photo avatar',
($this->profile->fullname) ? $this->profile->fullname : 'width' => AVATAR_STREAM_SIZE,
$this->profile->nickname)); 'height' => AVATAR_STREAM_SIZE,
'alt' => ($this->profile->fullname) ? $this->profile->fullname : $this->profile->nickname
)
);
$this->out->text(' '); $this->out->text(' ');
$hasFN = (!empty($this->profile->fullname)) ? 'nickname' : 'fn nickname'; $hasFN = (!empty($this->profile->fullname)) ? 'nickname' : 'fn nickname';
$this->out->elementStart('span', $hasFN); $this->out->elementStart('span', $hasFN);
@ -203,7 +187,6 @@ class SortableGroupListItem extends SortableSubscriptionListItem
$this->out->elementEnd('a'); $this->out->elementEnd('a');
} }
function endItem() function endItem()
{ {
$this->out->elementEnd('tr'); $this->out->elementEnd('tr');
@ -266,8 +249,6 @@ class SortableGroupListItem extends SortableSubscriptionListItem
function showJoinButton() function showJoinButton()
{ {
$this->out->elementStart('td', 'entry_controls');
$user = $this->owner; $user = $this->owner;
if ($user) { if ($user) {
@ -282,8 +263,6 @@ class SortableGroupListItem extends SortableSubscriptionListItem
$jf->show(); $jf->show();
} }
} }
$this->out->elementEnd('td');
} }
function showMemberCount() function showMemberCount()