bootstrap3

This commit is contained in:
Athou
2013-11-27 12:13:18 +01:00
parent 4f8e2ab478
commit 7caa99f8f2
41 changed files with 787 additions and 1416 deletions

View File

@@ -30,36 +30,16 @@ module.run(['$rootScope', function($rootScope) {
});
}]);
module.controller('SubscribeCtrl', ['$scope', 'FeedService', 'CategoryService', 'MobileService',
function($scope, FeedService, CategoryService, MobileService) {
module.controller('SubscribeCtrl', ['$scope', '$location', 'FeedService', 'CategoryService', 'MobileService',
function($scope, $location, FeedService, CategoryService, MobileService) {
$scope.opts = {
backdropFade : true,
dialogFade : true
$scope.sub = {
categoryId : 'all'
};
$scope.isOpen = false;
$scope.isOpenImport = false;
$scope.sub = {};
$scope.CategoryService = CategoryService;
$scope.MobileService = MobileService;
$scope.search = function() {
$scope.$emit('emitFeedSearch');
};
$scope.open = function() {
$scope.sub = {
categoryId : $scope.sub.categoryId || 'all'
};
$scope.isOpen = true;
};
$scope.close = function() {
$scope.isOpen = false;
};
// 'ok', 'loading' or 'failed'
$scope.state = 'ok';
$scope.urlChanged = function() {
@@ -88,39 +68,45 @@ module.controller('SubscribeCtrl', ['$scope', 'FeedService', 'CategoryService',
}
FeedService.subscribe($scope.sub, function() {
CategoryService.init();
$scope.close();
$location.path('/');
}, function(data) {
$scope.state = 'failed';
$scope.sub.title = 'ERROR: ' + data.data;
});
};
$scope.openImport = function() {
$scope.isOpenImport = true;
$scope.back = function() {
$location.path('/');
};
}]);
$scope.closeImport = function() {
$scope.isOpenImport = false;
};
module.controller('NewCategoryCtrl', ['$scope', '$location', 'FeedService', 'CategoryService', 'MobileService',
function($scope, $location, FeedService, CategoryService, MobileService) {
$scope.cat = {};
$scope.CategoryService = CategoryService;
$scope.MobileService = MobileService;
$scope.openCategory = function() {
$scope.isOpenCategory = true;
$scope.cat = {
parentId : 'all'
};
};
$scope.closeCategory = function() {
$scope.isOpenCategory = false;
$scope.cat = {
parentId : 'all'
};
$scope.saveCategory = function() {
CategoryService.add($scope.cat, function() {
CategoryService.init();
});
$scope.closeCategory();
$location.path('/');
};
$scope.back = function() {
$location.path('/');
};
}]);
module.controller('ImportCtrl', ['$scope', '$location', 'FeedService', 'CategoryService', 'MobileService',
function($scope, $location, FeedService, CategoryService, MobileService) {
$scope.back = function() {
$location.path('/');
};
}]);

View File

@@ -39,6 +39,21 @@ app.config(['$routeProvider', '$stateProvider', '$urlRouterProvider', '$httpProv
templateUrl : 'templates/feeds.view.html',
controller : 'FeedListCtrl'
});
$stateProvider.state('feeds.subscribe', {
url : '/subscribe',
templateUrl : 'templates/feeds.subscribe.html',
controller : 'SubscribeCtrl'
});
$stateProvider.state('feeds.new_category', {
url : '/add_category',
templateUrl : 'templates/feeds.new_category.html',
controller : 'NewCategoryCtrl'
});
$stateProvider.state('feeds.import', {
url : '/import',
templateUrl : 'templates/feeds.import.html',
controller : 'ImportCtrl'
});
$stateProvider.state('feeds.search', {
url : '/search/:_keywords',
templateUrl : 'templates/feeds.view.html',