Add tag Dashboard

This commit is contained in:
Diego Najar 2021-09-12 20:57:18 +02:00
parent cf4e0cc755
commit 2eac988843
4 changed files with 39 additions and 39 deletions

View file

@ -1,7 +1,7 @@
{ {
"plugin-data": "plugin-data":
{ {
"name": "Latest pages", "name": "Last pages",
"description": "Shows the latest published pages." "description": "Shows the last pages in the dashboard."
} }
} }

View file

@ -1,11 +1,11 @@
{ {
"author": "Bludit", "author": "Bludit",
"email": "", "email": "",
"website": "https://plugins.bludit.com", "website": "https://plugins.bludit.com",
"version": "4.0.0", "version": "4.0.0",
"releaseDate": "2021-03-02", "releaseDate": "2021-03-02",
"license": "MIT", "license": "MIT",
"compatible": "4.0", "compatible": "4.0",
"type": "dashboard", "type": "dashboard",
"notes": "" "notes": ""
} }

View file

@ -2,31 +2,31 @@
class pluginLatestPages extends Plugin { class pluginLatestPages extends Plugin {
public function dashboard() public function dashboard()
{ {
global $L; global $L;
global $pages; global $pages;
$html = '<div class="pluginLatestPages mt-4 mb-4 pb-4 border-bottom">'; $html = '<div class="pluginLatestPages mt-4 mb-4 pb-4 border-bottom">';
$html .= '<h3 class="m-0 p-0 pb-3"><i class="bi bi-pencil-square"></i>Latest pages</h3>'; $html .= '<h3 class="m-0 p-0 pb-3"><i class="bi bi-pencil-square"></i>Latest pages</h3>';
$html .= '<div class="list-group">'; $html .= '<div class="list-group">';
$tmp = $pages->getList(1, 5); $tmp = $pages->getList(1, 5);
foreach ($tmp as $key) { foreach ($tmp as $key) {
$page = buildPage($key); $page = buildPage($key);
$html .= '<a target="_blank" href="'.$page->permalink().'" class="list-group-item list-group-item-action d-flex gap-3 py-3" aria-current="true">'; $html .= '<a target="_blank" href="'.$page->permalink().'" class="list-group-item list-group-item-action d-flex gap-3 py-3" aria-current="true">';
$html .= '<div class="d-flex gap-2 w-100 justify-content-between">'; $html .= '<div class="d-flex gap-2 w-100 justify-content-between">';
$html .= '<div>'; $html .= '<div>';
$html .= '<h6 class="mb-0">'.($page->title() ? $page->title() : '<span class="text-muted">' . $L->g('Empty title') . '</span> ').'</h6>'; $html .= '<h6 class="mb-0">'.($page->title() ? $page->title() : '<span class="text-muted">' . $L->g('Empty title') . '</span> ').'</h6>';
$html .= '<p class="mb-0 opacity-75">Category: '.($page->category() ? $page->category() : $L->get('uncategorized')).'</p>'; $html .= '<p class="mb-0 opacity-75">Category: '.($page->category() ? $page->category() : $L->get('uncategorized')).'</p>';
$html .= '</div>'; $html .= '</div>';
$html .= '<small class="opacity-50 text-nowrap">'.$page->relativeTime().'</small>'; $html .= '<small class="opacity-50 text-nowrap">'.$page->relativeTime().'</small>';
$html .= '</div>'; $html .= '</div>';
$html .= '</a>'; $html .= '</a>';
} }
$html .= '</div>'; $html .= '</div>';
$html .= '</div>'; $html .= '</div>';
return $html; return $html;
} }
} }

View file

@ -2,7 +2,7 @@
"plugin-data": "plugin-data":
{ {
"name": "Visits Stats", "name": "Visits Stats",
"description": "Shows the number of visits and unique visitors." "description": "Shows the number of visits and unique visitors in the dashboard."
}, },
"visits": "Visits", "visits": "Visits",
"visitors": "Visitors", "visitors": "Visitors",