message when no readme is found

This commit is contained in:
cornernote 2015-08-10 20:00:43 +09:30
parent 75dab1970c
commit 0f97b514c6
2 changed files with 10 additions and 1 deletions

View File

@ -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);

View File

@ -18,6 +18,15 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="col-lg-8">
<?= $model->getReadmeHtml() ?>
<?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') {
echo Alert::widget([
'options' => [