show all links on list page
This commit is contained in:
parent
b48af47faa
commit
c2219ce059
@ -374,20 +374,22 @@ class Package extends ActiveRecord
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param bool $inline
|
||||||
* @return string
|
* @return string
|
||||||
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function getLinksHtml()
|
public function getLinksHtml($inline = true)
|
||||||
{
|
{
|
||||||
$items = [];
|
$items = [];
|
||||||
if ($this->homepage && $this->homepage != Git::getUrl($this->url)) {
|
if ($this->homepage && $this->homepage != Git::getUrl($this->url) && $this->homepage != $this->forum) {
|
||||||
$items[] = ['label' => 'Homepage', 'url' => $this->homepage];
|
$items[] = ['label' => 'Homepage', 'url' => $this->homepage];
|
||||||
}
|
}
|
||||||
$items[] = ['label' => 'Project', 'url' => Git::getUrl($this->url)];
|
|
||||||
if ($this->forum) {
|
if ($this->forum) {
|
||||||
$items[] = ['label' => 'Forum', 'url' => $this->forum];
|
$items[] = ['label' => 'Forum', 'url' => $this->forum];
|
||||||
}
|
}
|
||||||
|
$items[] = ['label' => 'Project', 'url' => Git::getUrl($this->url)];
|
||||||
return Menu::widget([
|
return Menu::widget([
|
||||||
'options' => ['class' => 'list-unstyled', 'style' => 'margin-bottom:0;'],
|
'options' => ['class' => 'list-unstyled' . ($inline ? ' list-inline' : ''), 'style' => 'margin-bottom:0;'],
|
||||||
'items' => $items,
|
'items' => $items,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ use yii\widgets\DetailView;
|
|||||||
'attributes' => [
|
'attributes' => [
|
||||||
'description',
|
'description',
|
||||||
'keywords',
|
'keywords',
|
||||||
'homepage:url',
|
'linksHtml:raw',
|
||||||
],
|
],
|
||||||
]) ?>
|
]) ?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -38,7 +38,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||||||
'keywords',
|
'keywords',
|
||||||
[
|
[
|
||||||
'label' => 'Links',
|
'label' => 'Links',
|
||||||
'value' => $model->getLinksHtml(),
|
'value' => $model->getLinksHtml(false),
|
||||||
'format' => 'raw',
|
'format' => 'raw',
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
Loading…
x
Reference in New Issue
Block a user