From 0f97b514c6c611704d1e4f068f11bff7285fa45e Mon Sep 17 00:00:00 2001 From: cornernote Date: Mon, 10 Aug 2015 20:00:43 +0930 Subject: [PATCH] message when no readme is found --- src/models/Package.php | 2 +- src/views/mod/view.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/models/Package.php b/src/models/Package.php index 2e838e5..f19244a 100644 --- a/src/models/Package.php +++ b/src/models/Package.php @@ -384,7 +384,7 @@ class Package extends ActiveRecord */ public function getReadmeHtml() { - if ($this->readme_format && $this->readme) { + if ($this->readme) { if ($this->readme_format == 'markdown') { $parser = new GithubMarkdown(); return $parser->parse($this->readme); diff --git a/src/views/mod/view.php b/src/views/mod/view.php index 6c22dc1..9327f89 100644 --- a/src/views/mod/view.php +++ b/src/views/mod/view.php @@ -18,6 +18,15 @@ $this->params['breadcrumbs'][] = $this->title;
getReadmeHtml() ?> 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') { echo Alert::widget([ 'options' => [