Add web notifications

This commit is contained in:
Frederic Guillot
2015-10-03 12:09:27 -04:00
parent b5a2b8f9f7
commit d67d7c54e6
41 changed files with 1670 additions and 567 deletions

View File

@@ -1,33 +1,24 @@
<div class="page-header">
<h2><?= t('Email notifications') ?></h2>
<h2><?= t('Notifications') ?></h2>
</div>
<form method="post" action="<?= $this->url->href('user', 'notifications', array('user_id' => $user['id'])) ?>" autocomplete="off">
<?= $this->form->csrf() ?>
<?= $this->form->checkbox('notifications_enabled', t('Enable email notifications'), '1', $notifications['notifications_enabled'] == 1) ?><br>
<?= $this->form->checkbox('notifications_enabled', t('Enable notifications'), '1', $notifications['notifications_enabled'] == 1) ?><br>
<hr>
<?= t('I want to receive notifications for:') ?>
<?= $this->form->radios('notifications_filter', array(
\Model\Notification::FILTER_NONE => t('All tasks'),
\Model\Notification::FILTER_ASSIGNEE => t('Only for tasks assigned to me'),
\Model\Notification::FILTER_CREATOR => t('Only for tasks created by me'),
\Model\Notification::FILTER_BOTH => t('Only for tasks created by me and assigned to me'),
), $notifications) ?><br>
<h4><?= t('Notification methods:') ?></h4>
<?= $this->form->checkboxes('notification_types', $types, $notifications) ?>
<hr>
<h4><?= t('I want to receive notifications for:') ?></h4>
<?= $this->form->radios('notifications_filter', $filters, $notifications) ?>
<hr>
<?php if (! empty($projects)): ?>
<p><?= t('I want to receive notifications only for those projects:') ?><br/><br/></p>
<div class="form-checkbox-group">
<?php foreach ($projects as $project_id => $project_name): ?>
<?= $this->form->checkbox('projects['.$project_id.']', $project_name, '1', isset($notifications['project_'.$project_id])) ?><br>
<?php endforeach ?>
</div>
<h4><?= t('I want to receive notifications only for those projects:') ?></h4>
<?= $this->form->checkboxes('notification_projects', $projects, $notifications) ?>
<?php endif ?>
<div class="form-actions">