diff --git a/app/settings.py b/app/settings.py index 597ed59..4152658 100644 --- a/app/settings.py +++ b/app/settings.py @@ -28,9 +28,12 @@ SECRET_KEY = '=%%a@whz46w1#=8ffk^a+8vya5fg-kz0ztyz!_@hdg-(5a9q+s' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False -TEMPLATE_DEBUG = True +TEMPLATE_DEBUG = False -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = [ + '.zuykov.com', # Allow domain and subdomains + '.zuykov.com.', # Also allow FQDN and subdomains +] # Application definition @@ -107,7 +110,6 @@ PIPELINE_JS = { 'source_filenames': ( 'js/app.js', 'js/forms.js', - 'js/tabs.js', 'js/snippets.js', 'js/nice.js' ), @@ -186,11 +188,6 @@ CACHES = { } } -ALLOWED_HOSTS = [ - # '127.0.0.1' - '.zuykov.com', # Allow domain and subdomains - '.zuykov.com.', # Also allow FQDN and subdomains -] # TEMPLATES = [ # { diff --git a/zsite/static/js/app.js b/zsite/static/js/app.js index f83f2c3..9e805e2 100644 --- a/zsite/static/js/app.js +++ b/zsite/static/js/app.js @@ -33,4 +33,69 @@ angular.module('zuykov') .controller('TabsCtrl', ['$scope', function ($scope) { }]) + +.directive( 'ngTabs', function() { + return { + scope: true, + restrict: 'EAC', + controller: function( $scope ) { + $scope.tabs = { + index: 0, + count: 0 + }; + + this.headIndex = 0; + this.bodyIndex = 0; + + this.getTabHeadIndex = function() { + return $scope.tabs.count = ++this.headIndex; + }; + + this.getTabBodyIndex = function() { + return ++this.bodyIndex; + }; + } + }; +}) + + +.directive( 'ngTabHead', function() { + return { + scope: false, + restrict: 'EAC', + require: '^ngTabs', + link: function( scope, element, attributes, controller ) { + var index = controller.getTabHeadIndex(); + var value = attributes.ngTabHead; + var active = /[-*\/%^=!<>&|]/.test( value ) ? scope.$eval( value ) : !!value; + + scope.tabs.index = scope.tabs.index || ( active ? index : null ); + + element.bind( 'click', function() { + scope.tabs.index = index; + scope.$$phase || scope.$apply(); + }); + + scope.$watch( 'tabs.index', function() { + element.toggleClass( 'active', scope.tabs.index === index ); + }); + } + }; +}) + + +.directive( 'ngTabBody', function() { + return { + scope: false, + restrict: 'EAC', + require: '^ngTabs', + link: function( scope, element, attributes, controller ) { + var index = controller.getTabBodyIndex(); + + scope.$watch( 'tabs.index', function() { + element.toggleClass( attributes.ngTabBody + ' show', scope.tabs.index === index ); + }); + } + }; +}); ; \ No newline at end of file diff --git a/zsite/static/js/forms.js b/zsite/static/js/forms.js index ce4bfae..509b11c 100644 --- a/zsite/static/js/forms.js +++ b/zsite/static/js/forms.js @@ -24,7 +24,7 @@ angular.module('zuykov') modalInstance.result.then(function (selectedItem) { $scope.selected = selectedItem; }, function () { - $log.info('Modal dismissed at: ' + new Date()); + // $log.info('Modal dismissed at: ' + new Date()); }); }; diff --git a/zsite/static/js/tabs.js b/zsite/static/js/tabs.js deleted file mode 100644 index 6b5e819..0000000 --- a/zsite/static/js/tabs.js +++ /dev/null @@ -1,80 +0,0 @@ -/** - * The angular tabs module - * @author: nerv - * @version: 0.2.5, 2012-08-25 - */ - - -'use strict'; - - -angular - - - .module( 'tabs', []) - - - .directive( 'ngTabs', function() { - return { - scope: true, - restrict: 'EAC', - controller: function( $scope ) { - $scope.tabs = { - index: 0, - count: 0 - }; - - this.headIndex = 0; - this.bodyIndex = 0; - - this.getTabHeadIndex = function() { - return $scope.tabs.count = ++this.headIndex; - }; - - this.getTabBodyIndex = function() { - return ++this.bodyIndex; - }; - } - }; - }) - - - .directive( 'ngTabHead', function() { - return { - scope: false, - restrict: 'EAC', - require: '^ngTabs', - link: function( scope, element, attributes, controller ) { - var index = controller.getTabHeadIndex(); - var value = attributes.ngTabHead; - var active = /[-*\/%^=!<>&|]/.test( value ) ? scope.$eval( value ) : !!value; - - scope.tabs.index = scope.tabs.index || ( active ? index : null ); - - element.bind( 'click', function() { - scope.tabs.index = index; - scope.$$phase || scope.$apply(); - }); - - scope.$watch( 'tabs.index', function() { - element.toggleClass( 'active', scope.tabs.index === index ); - }); - } - }; - }) - - - .directive( 'ngTabBody', function() { - return { - scope: false, - restrict: 'EAC', - require: '^ngTabs', - link: function( scope, element, attributes, controller ) { - var index = controller.getTabBodyIndex(); - - scope.$watch( 'tabs.index', function() { - element.toggleClass( attributes.ngTabBody + ' show', scope.tabs.index === index ); - }); - } - }; - }); \ No newline at end of file