Show lang in admin

This commit is contained in:
Flavio Copes 2015-10-07 16:40:26 +02:00
parent e0e1782067
commit adec98c198
2 changed files with 3 additions and 2 deletions

View File

@ -56,7 +56,7 @@
<span data-toggle="children" data-hint="Something" class="hint--bottom js__comments-list-toggle"> <span data-toggle="children" data-hint="Something" class="hint--bottom js__comments-list-toggle">
<i class="page-icon fa fa-fw fa-circle-o children-closed"></i> <i class="page-icon fa fa-fw fa-circle-o children-closed"></i>
</span> </span>
<a href="#" class="page-edit">{{ file.data.title ?: file.fileName }}</a> <a href="#" class="page-edit">{{ file.data.title ?: file.fileName }}</a> <span class="badge lang info">{{file.data.lang}}</span>
<!-- <span class="page-home"><i class="fa fa-home"></i></span> --> <!-- <span class="page-home"><i class="fa fa-home"></i></span> -->
<p class="page-route">{% if file.data.hasUnread %}<span class="gpm-version">Has {{file.data.unreadCount}} unread comments</span>{% else %}<span class="gpm-version">{{file.data.comments|length}} comments</span>{% endif %}</p> <p class="page-route">{% if file.data.hasUnread %}<span class="gpm-version">Has {{file.data.unreadCount}} unread comments</span>{% else %}<span class="gpm-version">{{file.data.comments|length}} comments</span>{% endif %}</p>

View File

@ -68,7 +68,6 @@ class CommentsPlugin extends Plugin
$email = filter_var(urldecode($post['email']), FILTER_SANITIZE_STRING); $email = filter_var(urldecode($post['email']), FILTER_SANITIZE_STRING);
$title = filter_var(urldecode($post['title']), FILTER_SANITIZE_STRING); $title = filter_var(urldecode($post['title']), FILTER_SANITIZE_STRING);
$filename = DATA_DIR . 'comments'; $filename = DATA_DIR . 'comments';
$filename .= ($lang ? '/' . $lang : ''); $filename .= ($lang ? '/' . $lang : '');
$filename .= $path . '.yaml'; $filename .= $path . '.yaml';
@ -86,6 +85,7 @@ class CommentsPlugin extends Plugin
} else { } else {
$data = array( $data = array(
'title' => $title, 'title' => $title,
'lang' => $lang,
'comments' => array([ 'comments' => array([
'text' => $text, 'text' => $text,
'date' => gmdate('D, d M Y H:i:s', time()), 'date' => gmdate('D, d M Y H:i:s', time()),
@ -102,6 +102,7 @@ class CommentsPlugin extends Plugin
private function getFilesOrderedByModifiedDate($path = '') { private function getFilesOrderedByModifiedDate($path = '') {
$files = []; $files = [];
$dirItr = new \RecursiveDirectoryIterator(DATA_DIR . 'comments' . $path, \RecursiveDirectoryIterator::SKIP_DOTS); $dirItr = new \RecursiveDirectoryIterator(DATA_DIR . 'comments' . $path, \RecursiveDirectoryIterator::SKIP_DOTS);
$filterItr = new RecursiveFolderFilterIterator($dirItr); $filterItr = new RecursiveFolderFilterIterator($dirItr);
$itr = new \RecursiveIteratorIterator($filterItr, \RecursiveIteratorIterator::SELF_FIRST); $itr = new \RecursiveIteratorIterator($filterItr, \RecursiveIteratorIterator::SELF_FIRST);