Skip to content

Commit

Permalink
Brandon: Clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Goh committed Aug 25, 2013
1 parent 6943698 commit 281c3e0
Show file tree
Hide file tree
Showing 14 changed files with 149 additions and 74 deletions.
10 changes: 6 additions & 4 deletions app/groups.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,15 @@ <h3 id="myUploadItems">{{heading}}</h3>
<li class="dropdown" ui-if="User.u_login">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" title="{{notify}}">
<!-- <b class="caret"></b> -->
<i class="icon-list-alt icon-white"></i>
<i ng-class="notify_icon"></i>
</a>
<ul class="dropdown-menu">
<li>
<a ui-if="!smallnotifications.entities.length"><span>You have no new notifications.</span></a>
<table class="table table-striped" ui-if="!!smallnotifications.entities.length">
<tr ng-repeat="notification in smallnotifications.entities">
<a ui-if="!notifications.entities.length">
<span>You have no new notifications.</span>
</a>
<table class="table table-striped" ui-if="!!notifications.entities.length">
<tr ng-repeat="notification in notifications.entities | limitTo:3">
<td>
<span>{{notification.n_date}}</span>
</td>
Expand Down
10 changes: 6 additions & 4 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,16 @@ <h3 id="myUploadItems">{{heading}}</h3>
</li>
<li class="dropdown" ui-if="User.u_login">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" title="{{notify}}">
<i ng-class="notify_icon"></i>
<!-- <b class="caret"></b> -->
<i class="icon-list-alt icon-white"></i>
</a>
<ul class="dropdown-menu">
<li>
<a ui-if="!smallnotifications.entities.length"><span>You have no new notifications.</span></a>
<table class="table table-striped" ui-if="!!smallnotifications.entities.length">
<tr ng-repeat="notification in smallnotifications.entities">
<a ui-if="!notifications.entities.length">
<span>You have no new notifications.</span>
</a>
<table class="table table-striped" ui-if="!!notifications.entities.length">
<tr ng-repeat="notification in notifications.entities | limitTo:3">
<td>
<span>{{notification.n_date}}</span>
</td>
Expand Down
25 changes: 17 additions & 8 deletions app/js/angular/groups-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function GroupsController($scope,$resource,sharedProperties, sharedFunctions){
$scope.group_name = "-";
$scope.u_groups = [];
$scope.notify = "You have no new notification(s).";
$scope.notify_icon = "icon-list-alt";


//Search Query Filter
Expand Down Expand Up @@ -373,18 +374,26 @@ function GroupsController($scope,$resource,sharedProperties, sharedFunctions){
}

$scope.get_notification = function() {
$scope.NotificationResource = $resource('http://:remote_url/get/notification/:limit',
{"remote_url":$scope.remote_url,"limit":3},
$scope.AllNotificationResource = $resource('http://:remote_url/get/notification',
{"remote_url":$scope.remote_url},
{'get': {method: 'JSONP', isArray: false, params:{callback: 'JSON_CALLBACK'}}});
$scope.NotificationResource.get(function(response) {
$scope.smallnotifications = response;
if ($scope.smallnotifications.entities !== undefined) {
if ($scope.smallnotifications.entities.length > 0) {
$scope.notify = "You have pending notification(s).";
$scope.waiting = "Loading";
$scope.AllNotificationResource.get(function(response) {
$scope.notifications = response;
if ($scope.notifications.entities !== undefined) {
if ($scope.notifications.entities.length > 0) {
$scope.notify_icon = "icon-list-alt";
for (var i = 0; i < $scope.notifications.entities.length; i++) {
if ($scope.notifications.entities[i].n_type === 'GROUPINVITE') {
$scope.notify = "You have notification(s) that require your attention.";
$scope.notify_icon = "icon-list-alt icon-white";
break;
}
}
}
}
});
};
}



Expand Down
26 changes: 18 additions & 8 deletions app/js/angular/index-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function IndexController($scope,$resource,sharedProperties, sharedFunctions){

$scope.search = "";
$scope.notify = "You have no new notification(s).";
$scope.notify_icon = "icon-list-alt";

//Replace this url with your final URL from the SingPath API path.
//$scope.remote_url = "localhost:8080";
Expand Down Expand Up @@ -57,19 +58,28 @@ function IndexController($scope,$resource,sharedProperties, sharedFunctions){
$scope.setData = function(fileData) {
$scope.fileData = fileData;
}

$scope.get_notification = function() {
$scope.NotificationResource = $resource('http://:remote_url/get/notification/:limit',
{"remote_url":$scope.remote_url,"limit":3},
$scope.AllNotificationResource = $resource('http://:remote_url/get/notification',
{"remote_url":$scope.remote_url},
{'get': {method: 'JSONP', isArray: false, params:{callback: 'JSON_CALLBACK'}}});
$scope.NotificationResource.get(function(response) {
$scope.smallnotifications = response;
if ($scope.smallnotifications.entities !== undefined) {
if ($scope.smallnotifications.entities.length > 0) {
$scope.notify = "You have pending notification(s).";
$scope.waiting = "Loading";
$scope.AllNotificationResource.get(function(response) {
$scope.notifications = response;
if ($scope.notifications.entities !== undefined) {
if ($scope.notifications.entities.length > 0) {
$scope.notify_icon = "icon-list-alt";
for (var i = 0; i < $scope.notifications.entities.length; i++) {
if ($scope.notifications.entities[i].n_type === 'GROUPINVITE') {
$scope.notify = "You have notification(s) that require your attention.";
$scope.notify_icon = "icon-list-alt icon-white";
break;
}
}
}
}
});
};
}


$scope.accept = {};
Expand Down
10 changes: 9 additions & 1 deletion app/js/angular/notifications-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function NotificationsController($scope,$resource,sharedProperties, sharedFuncti

$scope.search = "";
$scope.notify = "You have no new notification(s).";
$scope.notify_icon = "icon-list-alt";

//Replace this url with your final URL from the SingPath API path.
//$scope.remote_url = "localhost:8080";
Expand Down Expand Up @@ -100,7 +101,14 @@ function NotificationsController($scope,$resource,sharedProperties, sharedFuncti
$scope.notifications = response;
if ($scope.notifications.entities !== undefined) {
if ($scope.notifications.entities.length > 0) {
$scope.notify = "You have pending notification(s).";
$scope.notify_icon = "icon-list-alt";
for (var i = 0; i < $scope.notifications.entities.length; i++) {
if ($scope.notifications.entities[i].n_type === 'GROUPINVITE') {
$scope.notify = "You have notification(s) that require your attention.";
$scope.notify_icon = "icon-list-alt icon-white";
break;
}
}
}
}
$scope.waiting = "Ready";
Expand Down
25 changes: 17 additions & 8 deletions app/js/angular/profile-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function ProfileController($scope,$resource,sharedProperties, sharedFunctions){
$scope.message = "";
$scope.submessage = "";
$scope.notify = "You have no new notification(s).";
$scope.notify_icon = "icon-list-alt";


//Search Query Filter
Expand Down Expand Up @@ -260,18 +261,26 @@ function ProfileController($scope,$resource,sharedProperties, sharedFunctions){
}

$scope.get_notification = function() {
$scope.NotificationResource = $resource('http://:remote_url/get/notification/:limit',
{"remote_url":$scope.remote_url,"limit":3},
$scope.AllNotificationResource = $resource('http://:remote_url/get/notification',
{"remote_url":$scope.remote_url},
{'get': {method: 'JSONP', isArray: false, params:{callback: 'JSON_CALLBACK'}}});
$scope.NotificationResource.get(function(response) {
$scope.smallnotifications = response;
if ($scope.smallnotifications.entities !== undefined) {
if ($scope.smallnotifications.entities.length > 0) {
$scope.notify = "You have pending notification(s).";
$scope.waiting = "Loading";
$scope.AllNotificationResource.get(function(response) {
$scope.notifications = response;
if ($scope.notifications.entities !== undefined) {
if ($scope.notifications.entities.length > 0) {
$scope.notify_icon = "icon-list-alt";
for (var i = 0; i < $scope.notifications.entities.length; i++) {
if ($scope.notifications.entities[i].n_type === 'GROUPINVITE') {
$scope.notify = "You have notification(s) that require your attention.";
$scope.notify_icon = "icon-list-alt icon-white";
break;
}
}
}
}
});
};
}

$scope.sketch_pagination = {"limit":5, "offset":0, "prev_offset":0, "next_offset":0};

Expand Down
25 changes: 17 additions & 8 deletions app/js/angular/search-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function SearchController($scope,$resource,sharedProperties, sharedFunctions){
$scope.waiting = "Ready";
$scope.test = "-";
$scope.notify = "You have no new notification(s).";
$scope.notify_icon = "icon-list-alt";

//resource calls are defined here

Expand Down Expand Up @@ -62,18 +63,26 @@ function SearchController($scope,$resource,sharedProperties, sharedFunctions){
}

$scope.get_notification = function() {
$scope.NotificationResource = $resource('http://:remote_url/get/notification/:limit',
{"remote_url":$scope.remote_url,"limit":3},
$scope.AllNotificationResource = $resource('http://:remote_url/get/notification',
{"remote_url":$scope.remote_url},
{'get': {method: 'JSONP', isArray: false, params:{callback: 'JSON_CALLBACK'}}});
$scope.NotificationResource.get(function(response) {
$scope.smallnotifications = response;
if ($scope.smallnotifications.entities !== undefined) {
if ($scope.smallnotifications.entities.length > 0) {
$scope.notify = "You have pending notification(s).";
$scope.waiting = "Loading";
$scope.AllNotificationResource.get(function(response) {
$scope.notifications = response;
if ($scope.notifications.entities !== undefined) {
if ($scope.notifications.entities.length > 0) {
$scope.notify_icon = "icon-list-alt";
for (var i = 0; i < $scope.notifications.entities.length; i++) {
if ($scope.notifications.entities[i].n_type === 'GROUPINVITE') {
$scope.notify = "You have notification(s) that require your attention.";
$scope.notify_icon = "icon-list-alt icon-white";
break;
}
}
}
}
});
};
}


$scope.accept = {};
Expand Down
25 changes: 17 additions & 8 deletions app/js/angular/sketch-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ function SketchController($scope,$resource,sharedProperties,sharedFunctions){
$scope.message = "";
$scope.submessage = "";
$scope.notify = "You have no new notification(s).";
$scope.notify_icon = "icon-list-alt";

//Search Query Filter
$scope.query = function(item) {
Expand Down Expand Up @@ -340,18 +341,26 @@ function SketchController($scope,$resource,sharedProperties,sharedFunctions){
}

$scope.get_notification = function() {
$scope.NotificationResource = $resource('http://:remote_url/get/notification/:limit',
{"remote_url":$scope.remote_url,"limit":3},
$scope.AllNotificationResource = $resource('http://:remote_url/get/notification',
{"remote_url":$scope.remote_url},
{'get': {method: 'JSONP', isArray: false, params:{callback: 'JSON_CALLBACK'}}});
$scope.NotificationResource.get(function(response) {
$scope.smallnotifications = response;
if ($scope.smallnotifications.entities !== undefined) {
if ($scope.smallnotifications.entities.length > 0) {
$scope.notify = "You have pending notification(s).";
$scope.waiting = "Loading";
$scope.AllNotificationResource.get(function(response) {
$scope.notifications = response;
if ($scope.notifications.entities !== undefined) {
if ($scope.notifications.entities.length > 0) {
$scope.notify_icon = "icon-list-alt";
for (var i = 0; i < $scope.notifications.entities.length; i++) {
if ($scope.notifications.entities[i].n_type === 'GROUPINVITE') {
$scope.notify = "You have notification(s) that require your attention.";
$scope.notify_icon = "icon-list-alt icon-white";
break;
}
}
}
}
});
};
}

$scope.accept = {};
$scope.accept.data = {'n_id': -1, 'u_g' : -1, 'status': ''};
Expand Down
25 changes: 17 additions & 8 deletions app/js/angular/view-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function ViewController($scope,$resource,sharedProperties,sharedFunctions){
$scope.message = "";
$scope.submessage = "";
$scope.notify = "You have no new notification(s).";
$scope.notify_icon = "icon-list-alt";

//Search Query Filter
$scope.query = function(item) {
Expand Down Expand Up @@ -162,18 +163,26 @@ function ViewController($scope,$resource,sharedProperties,sharedFunctions){
}

$scope.get_notification = function() {
$scope.NotificationResource = $resource('http://:remote_url/get/notification/:limit',
{"remote_url":$scope.remote_url,"limit":3},
$scope.AllNotificationResource = $resource('http://:remote_url/get/notification',
{"remote_url":$scope.remote_url},
{'get': {method: 'JSONP', isArray: false, params:{callback: 'JSON_CALLBACK'}}});
$scope.NotificationResource.get(function(response) {
$scope.smallnotifications = response;
if ($scope.smallnotifications.entities !== undefined) {
if ($scope.smallnotifications.entities.length > 0) {
$scope.notify = "You have pending notification(s).";
$scope.waiting = "Loading";
$scope.AllNotificationResource.get(function(response) {
$scope.notifications = response;
if ($scope.notifications.entities !== undefined) {
if ($scope.notifications.entities.length > 0) {
$scope.notify_icon = "icon-list-alt";
for (var i = 0; i < $scope.notifications.entities.length; i++) {
if ($scope.notifications.entities[i].n_type === 'GROUPINVITE') {
$scope.notify = "You have notification(s) that require your attention.";
$scope.notify_icon = "icon-list-alt icon-white";
break;
}
}
}
}
});
};
}



Expand Down
2 changes: 1 addition & 1 deletion app/notifications.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ <h3 id="myUploadItems">{{heading}}</h3>
<li class="dropdown" ui-if="User.u_login">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" title="{{notify}}">
<!-- <b class="caret"></b> -->
<i class="icon-list-alt icon-white"></i>
<i ng-class="notify_icon"></i>
</a>
<ul class="dropdown-menu" >
<li>
Expand Down
10 changes: 6 additions & 4 deletions app/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,15 @@ <h3 id="myUploadItems">{{heading}}</h3>
<li class="dropdown" ui-if="User.u_login">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" title="{{notify}}">
<!-- <b class="caret"></b> -->
<i class="icon-list-alt icon-white"></i>
<i ng-class="notify_icon"></i>
</a>
<ul class="dropdown-menu">
<li>
<a ui-if="!smallnotifications.entities.length"><span>You have no new notifications.</span></a>
<table class="table table-striped" ui-if="!!smallnotifications.entities.length">
<tr ng-repeat="notification in smallnotifications.entities">
<a ui-if="!notifications.entities.length">
<span>You have no new notifications.</span>
</a>
<table class="table table-striped" ui-if="!!notifications.entities.length">
<tr ng-repeat="notification in notifications.entities | limitTo:3">
<td>
<span>{{notification.n_date}}</span>
</td>
Expand Down
10 changes: 6 additions & 4 deletions app/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,15 @@ <h3 id="myUploadItems">{{heading}}</h3>
<li class="dropdown" ui-if="User.u_login">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" title="{{notify}}">
<!-- <b class="caret"></b> -->
<i class="icon-list-alt icon-white"></i>
<i ng-class="notify_icon"></i>
</a>
<ul class="dropdown-menu">
<li>
<a ui-if="!smallnotifications.entities.length"><span>You have no new notifications.</span></a>
<table class="table table-striped" ui-if="!!smallnotifications.entities.length">
<tr ng-repeat="notification in smallnotifications.entities">
<a ui-if="!notifications.entities.length">
<span>You have no new notifications.</span>
</a>
<table class="table table-striped" ui-if="!!notifications.entities.length">
<tr ng-repeat="notification in notifications.entities | limitTo:3">
<td>
<span>{{notification.n_date}}</span>
</td>
Expand Down
10 changes: 6 additions & 4 deletions app/sketch.html
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,15 @@ <h3 id="myUploadItems">{{heading}}</h3>
<li class="dropdown" ui-if="User.u_login">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" title="{{notify}}">
<!-- <b class="caret"></b> -->
<i class="icon-list-alt icon-white"></i>
<i ng-class="notify_icon"></i>
</a>
<ul class="dropdown-menu">
<li>
<a ui-if="!smallnotifications.entities.length"><span>You have no new notifications.</span></a>
<table class="table table-striped" ui-if="!!smallnotifications.entities.length">
<tr ng-repeat="notification in smallnotifications.entities">
<a ui-if="!notifications.entities.length">
<span>You have no new notifications.</span>
</a>
<table class="table table-striped" ui-if="!!notifications.entities.length">
<tr ng-repeat="notification in notifications.entities | limitTo:3">
<td>
<span>{{notification.n_date}}</span>
</td>
Expand Down
Loading

0 comments on commit 281c3e0

Please sign in to comment.