message when no readme is found
This commit is contained in:
parent
75dab1970c
commit
0f97b514c6
@ -384,7 +384,7 @@ class Package extends ActiveRecord
|
|||||||
*/
|
*/
|
||||||
public function getReadmeHtml()
|
public function getReadmeHtml()
|
||||||
{
|
{
|
||||||
if ($this->readme_format && $this->readme) {
|
if ($this->readme) {
|
||||||
if ($this->readme_format == 'markdown') {
|
if ($this->readme_format == 'markdown') {
|
||||||
$parser = new GithubMarkdown();
|
$parser = new GithubMarkdown();
|
||||||
return $parser->parse($this->readme);
|
return $parser->parse($this->readme);
|
||||||
|
@ -18,6 +18,15 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||||||
<div class="col-lg-8">
|
<div class="col-lg-8">
|
||||||
<?= $model->getReadmeHtml() ?>
|
<?= $model->getReadmeHtml() ?>
|
||||||
<?php
|
<?php
|
||||||
|
if (!$model->readme) {
|
||||||
|
echo Alert::widget([
|
||||||
|
'options' => [
|
||||||
|
'class' => 'alert-danger',
|
||||||
|
],
|
||||||
|
'closeButton' => false,
|
||||||
|
'body' => 'This mod has no readme. If you are the owner please consider adding one.',
|
||||||
|
]);
|
||||||
|
}
|
||||||
if ($model->readme_format == 'text') {
|
if ($model->readme_format == 'text') {
|
||||||
echo Alert::widget([
|
echo Alert::widget([
|
||||||
'options' => [
|
'options' => [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user