Skip to content

Commit e60ee75

Browse files
author
Tim Geyssens
committed
Pushed latest WIP, trying to get global date range picker
1 parent 5672dcc commit e60ee75

File tree

22 files changed

+4784
-3151
lines changed

22 files changed

+4784
-3151
lines changed

Analytics.Site/App_Data/Logs/UmbracoTraceLog.txt

Lines changed: 1 addition & 3128 deletions
Large diffs are not rendered by default.

Analytics.Site/App_Data/Logs/UmbracoTraceLog.txt.2014-01-03

Lines changed: 4166 additions & 0 deletions
Large diffs are not rendered by default.

Analytics.Site/App_Data/Logs/UmbracoTraceLog.txt.2014-01-04

Lines changed: 521 additions & 0 deletions
Large diffs are not rendered by default.

Analytics.Site/App_Data/Umbraco.sdf

0 Bytes
Binary file not shown.

Analytics.Site/App_Plugins/Analytics/account.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
{
22
"Id": "4113171",
33
"Name": "www.nibble.be",
44
"Created": "2008-04-13T14:26:12+02:00",

Analytics.Site/App_Plugins/Analytics/backOffice/AnalyticsTree/controllers/PageViews.Controller.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
angular.module("umbraco").controller("Analytics.PageViewsController",
2-
function ($scope, statsResource, settingsResource) {
2+
function ($scope, statsResource, settingsResource, dateRangeService) {
33

44
var profileID = "";
55

66
$scope.dateFilter = settingsResource.getDateFilter();
77

8+
//$scope.$on('DateFilterChanged', function (event, x) {
9+
// console.log("catch change");
10+
// $scope.dateFilter = x;
11+
//});
12+
813
$scope.$watch('dateFilter', function () {
914

10-
settingsResource.setDateFilter($scope.dateFilter.startDate, $scope.dateFilter.endDate);
15+
1116
//Get Profile
1217
settingsResource.getprofile().then(function (response) {
1318
$scope.profile = response.data;
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
angular.module("umbraco").controller("Analytics.ViewController",
2-
function ($scope, $routeParams, assetsService) {
2+
function ($scope, $routeParams, settingsResource) {
33

44
//Currently loading /umbraco/general.html
55
//Need it to look at /App_Plugins/
6-
6+
$scope.dateFilter = settingsResource.getDateFilter();
7+
$scope.$watch('dateFilter', function () {
8+
console.log("parent watch");
9+
});
10+
711
var viewName = $routeParams.id;
812
viewName = viewName.replace('%20', '-').replace(' ', '-');
913

1014
$scope.templatePartialURL = '../App_Plugins/Analytics/backoffice/analyticsTree/partials/' + viewName + '.html';
1115
$scope.sectionName = $routeParams.id;
1216

17+
1318

1419
});

Analytics.Site/App_Plugins/Analytics/backOffice/AnalyticsTree/directives/DateRangePicker.Directive.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
ngModel: '=',
77
},
88
template: '<i class="glyphicon glyphicon-calendar icon-calendar icon-large"></i> <span></span> <b class="caret"></b>',
9-
link: function (scope, element, attrs) {
9+
link: function (scope, element, attrs,ngModel) {
1010
$(function () {
1111

1212
element.daterangepicker(
@@ -53,7 +53,9 @@
5353
dateFilter.startDate = start.format('YYYY-MM-DD');
5454
dateFilter.endDate = end.format('YYYY-MM-DD');
5555
scope.ngModel = dateFilter;
56+
scope.ngModel = "test";
5657
scope.$apply();
58+
5759

5860
angular.element(element.children()[1]).html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
5961
}

Analytics.Site/App_Plugins/Analytics/backOffice/AnalyticsTree/partials/views.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div ng-controller="Analytics.PageViewsController">
22
<div class="umb-pane">
3-
<div ng-model="dateFilter" date-range-picker class="pull-right" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc">
4-
</div>
3+
<!-- <div ng-model="dateFilter" date-range-picker class="pull-right" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc">
4+
</div>-->
55

66
<h4>Views</h4>
77

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
angular.module("umbraco")
2+
.service('dateRangeService', function ($rootScope, settingsResource) {
3+
var filter = settingsResource.getDateFilter();
4+
return {
5+
getFilter: function() {
6+
return filter;
7+
},
8+
setFilter: function (filt) {
9+
settingsResource.setDateFilter(filt.startDate, filt.endDate);
10+
filter.startDate = filt.startDate;
11+
filter.endDate = filt.endDate;
12+
console.log("broad start");
13+
$rootScope.$broadcast('DateFilterChanged', filter);
14+
console.log("broad end");
15+
}
16+
};
17+
})

0 commit comments

Comments
 (0)