chg: [UI] Nicer user edit for notifications

pull/8613/head
Jakub Onderka 2022-09-30 20:44:54 +02:00
parent 35e15a5220
commit ef3d0e33b7
3 changed files with 20 additions and 11 deletions

View File

@ -96,17 +96,19 @@
'disabled' => !$canChangePassword,
'data-disabled-reason' => !$canChangePassword ? __('User password change is disabled on this instance') : '',
]);
echo $this->Form->input('autoalert', array('label' => __('Receive email alerts when events are published'), 'type' => 'checkbox'));
echo $this->Form->input('contactalert', array('label' => __('Receive email alerts from "Contact reporter" requests'), 'type' => 'checkbox'));
echo $this->Form->input('disabled', array('type' => 'checkbox', 'label' => __('Immediately disable this user account')));
echo '</div>';
?>
<h5><?= __('Subscribe to the following notification periods:') ?></h5>
<h5><?= __('Subscribe to the following notification:') ?></h5>
<div class="user-edit-checkboxes">
<?php
echo $this->Form->input('autoalert', array('label' => __('Event published notification'), 'type' => 'checkbox'));
echo $this->Form->input('notification_daily', array('label' => __('Daily notifications'), 'type' => 'checkbox'));
echo $this->Form->input('notification_weekly', array('label' => __('Weekly notifications'), 'type' => 'checkbox'));
echo $this->Form->input('notification_monthly', array('label' => __('Monthly notifications'), 'type' => 'checkbox'));
?>
</div>
</fieldset>
<div style="border-bottom: 1px solid #e5e5e5;width:100%;">&nbsp;</div>
<div class="clear" style="margin-top:10px;">

View File

@ -38,13 +38,15 @@
echo $this->Form->input('contactalert', array('label' => __('Receive email alerts from "Contact reporter" requests'), 'type' => 'checkbox'));
echo '</div>';
?>
<h5><?= __('Subscribe to the following notification periods:') ?></h5>
<?php
<h5><?= __('Subscribe to the following notification:') ?></h5>
<div class="user-edit-checkboxes">
<?php
echo $this->Form->input('autoalert', array('label' => __('Event published notification'), 'type' => 'checkbox'));
echo $this->Form->input('notification_daily', array('label' => __('Daily notifications'), 'type' => 'checkbox'));
echo $this->Form->input('notification_weekly', array('label' => __('Weekly notifications'), 'type' => 'checkbox'));
echo $this->Form->input('notification_monthly', array('label' => __('Monthly notifications'), 'type' => 'checkbox'));
?>
</fieldset>
?>
</div>
<div style="border-bottom: 1px solid #e5e5e5;width:100%;">&nbsp;</div>
<div class="clear" style="margin-top:10px;">
<?php

View File

@ -102,12 +102,12 @@ $notificationsHtml .= '</table>';
$table_data[] = array('key' => __('Terms accepted'), 'boolean' => $user['User']['termsaccepted']);
$table_data[] = array('key' => __('Must change password'), 'boolean' => $user['User']['change_pw']);
}
$table_data[] = array(
'key' => __('PGP key'),
'element' => 'genericElements/key',
'element_params' => array('key' => $user['User']['gpgkey']),
);
if (!empty($user['User']['gpgkey'])) {
$table_data[] = array(
'key' => __('PGP key'),
'element' => 'genericElements/key',
'element_params' => array('key' => $user['User']['gpgkey']),
);
$table_data[] = array(
'key' => __('PGP key fingerprint'),
'value_class' => 'quickSelect',
@ -118,6 +118,11 @@ $notificationsHtml .= '</table>';
'value_class' => (empty($user['User']['pgp_status']) || $user['User']['pgp_status'] !== 'OK') ? 'red': '',
'value' => !empty($user['User']['pgp_status']) ? $user['User']['pgp_status'] : 'N/A'
);
} else {
$table_data[] = array(
'key' => __('PGP key'),
'boolean' => false,
);
}
if (Configure::read('SMIME.enabled')) {
$table_data[] = array(