diff --git a/src/Controllers/PostController.php b/src/Controllers/PostController.php index 4d039508..da947ebb 100644 --- a/src/Controllers/PostController.php +++ b/src/Controllers/PostController.php @@ -483,7 +483,7 @@ class PostController $this->context->stylesheets []= 'post-view.css'; $this->context->stylesheets []= 'comment-small.css'; $this->context->scripts []= 'post-view.js'; - $this->context->subTitle = 'showing @' . $post->id . ' – ' . join(', ', array_map(function($x) { return $x['name']; }, $post->sharedTag)); + $this->context->subTitle = 'showing ' . TextHelper::reprPost($post) . ' – ' . TextHelper::reprTags($post->sharedTag); $this->context->favorite = $favorite; $this->context->score = $score; $this->context->flagged = $flagged; diff --git a/src/Helpers/TextHelper.php b/src/Helpers/TextHelper.php index 4e51235c..ac9d1606 100644 --- a/src/Helpers/TextHelper.php +++ b/src/Helpers/TextHelper.php @@ -197,6 +197,15 @@ class TextHelper return '#' . $tag->name; } + public static function reprTags($tags) + { + $x = []; + foreach ($tags as $tag) + $x []= self::reprTag($tag); + natcasesort($x); + return join(', ', $x); + } + public static function encrypt($text) { $salt = \Chibi\Registry::getConfig()->main->salt; diff --git a/src/Views/index-index.phtml b/src/Views/index-index.phtml index 6424533e..3d377885 100644 --- a/src/Views/index-index.phtml +++ b/src/Views/index-index.phtml @@ -16,13 +16,15 @@