Skip to content

Commit

Permalink
Dev: First draft for all notifications view
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Aug 2, 2016
1 parent 2e939a0 commit e2b2ae4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
15 changes: 7 additions & 8 deletions application/controllers/admin/NotificationController.php
Expand Up @@ -7,17 +7,16 @@ class NotificationController extends Survey_Common_Action
{

/**
*
* List all notifications for a user
*/
public function actionIndex()
public function index()
{
$aData = array();

//$this->_renderWrappedTemplate(null, 'super/dummy', $aData);
$this->checkPermission();

//$SCA = Yii::app()->createController('admin.Survey_Common_Action');
//$SCA->_renderWrappedTemplate();
$data = array();
$data['model'] = Notification::model();

$this->_renderWrappedTemplate(null, array('notification/index'), $data);
}

/**
Expand Down Expand Up @@ -103,7 +102,7 @@ public static function getMenuWidget($surveyId = null) {
$data['notifications'] = Notification::getNotifications($surveyId);
$data['zeroNotifications'] = count($data['notifications']) === 0;
$data['surveyId'] = $surveyId;
$data['allNotificationsUrl'] = Yii::app()->createUrl('notification', array());
$data['allNotificationsUrl'] = Yii::app()->createUrl('admin/notification', array());

return Yii::app()->getController()->renderPartial(
'/admin/super/admin_notifications',
Expand Down
3 changes: 1 addition & 2 deletions application/models/Notification.php
Expand Up @@ -164,8 +164,7 @@ public static function model($className=__CLASS__)
}

/**
* Get latest notifications
*
* Get latest notifications to show in the menu
* @param int|null $surveyId
* @return Notification[]
*/
Expand Down
3 changes: 2 additions & 1 deletion application/views/admin/super/admin_notifications.php
@@ -1,7 +1,8 @@
<!-- Admin notification system -->
<?php if ($zeroNotifications): ?>
<li id='notification-li' class='dropdown'>
<a class='dropdown-toggle' data-toggle='dropdown' role='button' aria-expanded='false' href='#'>
<a aria-expanded='false'
href='<?php echo $allNotificationsUrl; ?>'>
<span class='fa fa-bell text-muted'></span>
</a>
</li>
Expand Down

0 comments on commit e2b2ae4

Please sign in to comment.