Merge remote-tracking branch 'gitorious/1.0.x' into 1.0.x

This commit is contained in:
Evan Prodromou 2011-05-06 17:19:05 -07:00
commit 7b0ab409c9
2 changed files with 52 additions and 0 deletions

View File

@ -149,6 +149,24 @@ class SortableGroupListItem extends SortableSubscriptionListItem
}
}
function showDescription()
{
if (!empty($this->profile->description)) {
$cutoff = 140; // XXX Should this be configurable?
$description = htmlspecialchars($this->profile->description);
if (mb_strlen($description) > $cutoff) {
$description = mb_substr($description, 0, $cutoff - 1)
.'<a href="' . $this->profile->homeUrl() .'">…</a>';
}
$this->out->elementStart('p', 'note');
$this->out->raw($description);
$this->out->elementEnd('p');
}
}
function showAvatar()
{
$logo = ($this->profile->stream_logo) ?
@ -205,6 +223,19 @@ class SortableGroupListItem extends SortableSubscriptionListItem
}
}
function showProfile()
{
$this->startProfile();
$this->showAvatar();
$this->showFullName();
$this->showLocation();
$this->showHomepage();
$this->showDescription(); // groups have this instead of bios
// Relevant portion!
$this->showTags();
$this->endProfile();
}
function showActions()
{
$this->startActions();

View File

@ -249,6 +249,27 @@ class SortableSubscriptionListItem extends SubscriptionListItem
$this->out->elementEnd('td');
}
/**
* Overrided to truncate the bio if it's real long, because it
* looks better that way in the SortableSubscriptionList's table
*/
function showBio()
{
if (!empty($this->profile->bio)) {
$cutoff = 140; // XXX Should this be configurable?
$bio = htmlspecialchars($this->profile->bio);
if (mb_strlen($bio) > $cutoff) {
$bio = mb_substr($bio, 0, $cutoff - 1)
.'<a href="' . $this->profile->profileurl .'">…</a>';
}
$this->out->elementStart('p', 'note');
$this->out->raw($bio);
$this->out->elementEnd('p');
}
}
/**
* Only show the tags if we're logged in
*/