From 14600caaff960c8ff43676bd467c3b26287ea667 Mon Sep 17 00:00:00 2001 From: cornernote Date: Wed, 12 Aug 2015 16:24:48 +0930 Subject: [PATCH] fix more readme issues --- src/models/Package.php | 3 ++- src/views/mod/view.php | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/models/Package.php b/src/models/Package.php index 5807fbe..048d6e2 100644 --- a/src/models/Package.php +++ b/src/models/Package.php @@ -328,6 +328,7 @@ class Package extends ActiveRecord if ($text) { $this->readme = Git::getFile($this->url, $file); if ($this->readme) { + $this->readme_format = 'text'; break; } } @@ -462,7 +463,7 @@ class Package extends ActiveRecord } if ($this->readme_format == 'text') { $readme = preg_replace('@(https?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-]*(\?\S+)?[^\.\s])?)?)@', '$1', $this->readme); - return '
' . $readme . '
'; + return '

' . $this->name . '

' . $readme . '
'; } } return ''; diff --git a/src/views/mod/view.php b/src/views/mod/view.php index 1f39844..113a9f5 100644 --- a/src/views/mod/view.php +++ b/src/views/mod/view.php @@ -19,12 +19,13 @@ $this->params['breadcrumbs'][] = $this->title; getReadmeHtml() ?> readme) { + echo '

' . Html::encode($this->title) . '

'; echo Alert::widget([ 'options' => [ 'class' => 'alert-danger', ], 'closeButton' => false, - 'body' => 'This mod has no readme. If you are the owner please consider adding one to the repository.', + 'body' => 'This mod has no README.md or README.txt file. If you are the owner please consider adding one to the repository.', ]); } ?> @@ -78,7 +79,7 @@ $this->params['breadcrumbs'][] = $this->title; 'class' => 'alert-info', ], 'closeButton' => false, - 'body' => 'This mod has no valid bower.json file. If you are the owner please consider adding one to the repository, then click Update.', + 'body' => 'This mod has no valid bower.json file. If you are the owner please consider adding one to the repository, then click Update.', ]); ?>