Subscriber Portal working with Mock data
diff --git a/views/ngXosViews/subscriberPortal/src/app/view/bundle/bundle.js b/views/ngXosViews/subscriberPortal/src/app/view/bundle/bundle.js
index a5b59d0..60dea84 100644
--- a/views/ngXosViews/subscriberPortal/src/app/view/bundle/bundle.js
+++ b/views/ngXosViews/subscriberPortal/src/app/view/bundle/bundle.js
@@ -46,6 +46,7 @@
availId = (current === basic) ? family : basic;
resource.bundles.forEach(function (bundle) {
if (bundle.id === availId) {
+ // NOTE available should be an array
$scope.available = bundle;
}
});
diff --git a/views/ngXosViews/subscriberPortal/src/app/view/common/common.css b/views/ngXosViews/subscriberPortal/src/app/view/common/common.css
index c2bc96d..5ae154b 100644
--- a/views/ngXosViews/subscriberPortal/src/app/view/common/common.css
+++ b/views/ngXosViews/subscriberPortal/src/app/view/common/common.css
@@ -20,6 +20,7 @@
html, body, div#frame, div#view {
height: 100%;
+ overflow: scroll;
}
head, body, footer,
diff --git a/views/ngXosViews/subscriberPortal/src/app/view/home/home.html b/views/ngXosViews/subscriberPortal/src/app/view/home/home.html
index 27f0d96..a3d7fb2 100644
--- a/views/ngXosViews/subscriberPortal/src/app/view/home/home.html
+++ b/views/ngXosViews/subscriberPortal/src/app/view/home/home.html
@@ -26,6 +26,8 @@
</thead>
<tbody>
+ <!--<pre>{{users | json}}</pre>-->
+
<tr ng-repeat="user in users" class="fadein">
<td class="user-pic">
<img ng-src="{{'/imgs/' + user.icon_id + '.jpg'}}">
@@ -37,4 +39,4 @@
</table>
</div>
</div>
-</div>
+</div>
\ No newline at end of file
diff --git a/views/ngXosViews/subscriberPortal/src/app/view/user/user.js b/views/ngXosViews/subscriberPortal/src/app/view/user/user.js
index bb44fec..971838c 100644
--- a/views/ngXosViews/subscriberPortal/src/app/view/user/user.js
+++ b/views/ngXosViews/subscriberPortal/src/app/view/user/user.js
@@ -22,9 +22,15 @@
family = 'family',
url_filter = 'url_filter';
+ function randomDate(start, end) {
+ return new Date(
+ start.getTime() + Math.random() * (end.getTime() - start.getTime())
+ );
+ }
+
angular.module('cordUser', [])
- .controller('CordUserCtrl', ['$log', '$scope', '$resource', '$timeout',
- function ($log, $scope, $resource, $timeout) {
+ .controller('CordUserCtrl', ['$log', '$scope', '$resource', '$timeout', '$filter',
+ function ($log, $scope, $resource, $timeout, $filter) {
var BundleData, bundleResource;
$scope.page.curr = 'user';
$scope.isFamily = false;
@@ -63,6 +69,15 @@
// success
function () {
$scope.users = userResource.users;
+ if ($.isEmptyObject($scope.shared.userActivity)) {
+ $scope.users.forEach(function (user) {
+ var date = randomDate(new Date(2015, 0, 1),
+ new Date());
+
+ $scope.shared.userActivity[user.id] =
+ $filter('date')(date, 'mediumTime');
+ });
+ }
},
// error
function () {