master
fefa4ka 10 years ago
parent acc697740c
commit 90e22039ec
  1. 13
      app/settings.py
  2. 65
      zsite/static/js/app.js
  3. 2
      zsite/static/js/forms.js
  4. 80
      zsite/static/js/tabs.js

@ -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 = [
# {

@ -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 );
});
}
};
});
;

@ -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());
});
};

@ -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 );
});
}
};
});
Loading…
Cancel
Save