1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-08 09:46:46 +02:00

[ticket/17333] Add push subscribe toggle to notification dropdown

PHPBB-17333

Signed-off-by: Matt Friedman <maf675@gmail.com>
This commit is contained in:
Matt Friedman
2024-06-04 09:34:02 -07:00
parent e35a6f7aa5
commit d55ec608ec
12 changed files with 51 additions and 8 deletions

View File

@@ -44,6 +44,13 @@
<div class="footer">
<a href="{U_VIEW_ALL_NOTIFICATIONS}"><span>{L_SEE_ALL}</span></a>
</div>
{% if NOTIFICATIONS_WEBPUSH_ENABLE and notification_types is not defined %}
<div class="notification-dropdown-footer">
<span class="ellipsis-text">{{ lang('NOTIFY_WEB_PUSH_ENABLE') ~ lang('COLON') }}</span>
<button id="subscribe_webpush" name="subscribe_webpush" class="notification-subscribe_toggle">{{ Icon('font', 'toggle-off', lang('NOTIFY_WEB_PUSH_SUBSCRIBE'), false, 'icon-lightgray') }}</button>
<button id="unsubscribe_webpush" name="unsubscribe_webpush" class="notification-subscribe_toggle hidden">{{ Icon('font', 'toggle-on', lang('NOTIFY_WEB_PUSH_SUBSCRIBED'), false, 'icon-blue') }}</button>
</div>
{% endif %}
{% EVENT notification_dropdown_footer_after %}
</div>
</div>

View File

@@ -63,6 +63,10 @@
<!-- EVENT overall_header_stylesheets_after -->
{% if NOTIFICATIONS_WEBPUSH_ENABLE %}
{% include('ucp_notifications_webpush.html') %}
{% endif %}
</head>
<body id="phpbb" class="nojs notouch section-{SCRIPT_NAME} {S_CONTENT_DIRECTION} {BODY_CLASS}">

View File

@@ -1,9 +1,5 @@
{% include('ucp_header.html') %}
{% if NOTIFICATIONS_WEBPUSH_ENABLE %}
{% include('ucp_notifications_webpush.html') %}
{% endif %}
<form id="ucp" method="post" action="{{ S_UCP_ACTION }}"{{ S_FORM_ENCTYPE }}>
<h2 class="cp-title">{{ TITLE }}</h2>

View File

@@ -220,3 +220,9 @@ button::-moz-focus-inner {
.avatar-cropper-buttons > .button-group {
margin: 4px;
}
/* Notification buttons
--------------------------------------------- */
.notification-subscribe_toggle:disabled {
opacity: 0.7;
}

View File

@@ -1340,6 +1340,15 @@ ul.linklist:after,
display: block;
}
.dropdown-extended .notification-dropdown-footer {
white-space: nowrap;
border-top: solid 1px #b9b9b9;
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
padding: 5px 10px;
}
.notification-avatar,
.notification-menu .notification-list .notification-item .avatar,
.notification-menu .notification-list .notification-item .gravatar {