Various fixes for top/dashboard/themes/plugins notifications styling

This commit is contained in:
Andy Miller
2019-02-12 13:59:08 -07:00
parent 7e5fcd49a9
commit 07c1b449d8
11 changed files with 33 additions and 12 deletions

View File

@@ -1389,13 +1389,6 @@ class Admin
}
// // Process notifications dates
// $notifications = array_map(function ($notification) {
// $notification['nicetime'] = $this->adminNiceTime($notification['date']);
//
// return $notification;
// }, $cleaned_notifications);
// reset notifications
$notifications = [];

View File

@@ -843,7 +843,8 @@ class AdminController extends AdminBaseController
foreach ($notifications as $type => $type_notifications) {
if (empty($filter) || in_array($type, $filter_types)) {
$notification_data[$type] = $this->grav['twig']->processTemplate('partials/notification-block.html.twig', ['notifications' => $type_notifications]);
$twig_template = 'partials/notification-' . $type . '-block.html.twig';
$notification_data[$type] = $this->grav['twig']->processTemplate($twig_template, ['notifications' => $type_notifications]);
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -26,6 +26,7 @@ b, strong {
.alert {
font-size: 1rem;
padding: 0.5rem $padding-default;
position: relative;
@include breakpoint(mobile-only) {
padding: 0.5rem 1rem;

View File

@@ -28,7 +28,7 @@
.dashboard-notifications-container, .plugins-notifications-container, .themes-notifications-container {
margin: 2rem 0 2rem 0;
margin-bottom: 1rem;
.raw {
position: relative;
@@ -72,6 +72,8 @@
.top-notifications-container {
margin-bottom: 1rem;
.alert {
a {
cursor: pointer;

View File

@@ -0,0 +1,6 @@
{% for entry_id, entry in notifications %}
<div class="alert {{ entry.type }} position-dashboard">
<a href="#" data-notification-action="hide-notification" data-notification-id="{{ entry_id }}" class="close hide-notification"><i class="fa fa-close"></i></a>
{{ entry.message|raw }}
</div>
{% endfor %}

View File

@@ -1,3 +1,3 @@
{% for entry in notifications if 'feed' %}
{% for entry in notifications %}
<li class="single-notification {{ entry.type }}-notification"><span class="badge alert {{ entry.type }}">{{ entry.type|capitalize }}</span><a target="_blank" href="{{ entry.link }}" title="{{ entry.message|striptags|e('html_attr') }}">{{ entry.message|raw }}</a></li>
{% endfor %}

View File

@@ -0,0 +1,6 @@
{% for entry_id, entry in notifications %}
<div class="alert {{ entry.type }} position-plugins">
<a href="#" data-notification-action="hide-notification" data-notification-id="{{ entry_id }}" class="close hide-notification"><i class="fa fa-close"></i></a>
{{ entry.message|raw }}
</div>
{% endfor %}

View File

@@ -0,0 +1,6 @@
{% for entry_id, entry in notifications %}
<div class="alert {{ entry.type }} position-themes">
<a href="#" data-notification-action="hide-notification" data-notification-id="{{ entry_id }}" class="close hide-notification"><i class="fa fa-close"></i></a>
{{ entry.message|raw }}
</div>
{% endfor %}

View File

@@ -0,0 +1,6 @@
{% for entry_id, entry in notifications %}
<div class="alert {{ entry.type }} position-top">
<a href="#" data-notification-action="hide-notification" data-notification-id="{{ entry_id }}" class="close hide-notification"><i class="fa fa-close"></i></a>
{{ entry.message|raw }}
</div>
{% endfor %}