diff --git a/index.html b/index.html
index 0300f7588..3a670a9ae 100644
--- a/index.html
+++ b/index.html
@@ -96,6 +96,37 @@
+
+
+
diff --git a/js/app.js b/js/app.js
index 21859c3ff..f1fff46a0 100644
--- a/js/app.js
+++ b/js/app.js
@@ -11,6 +11,7 @@ angular.module('copay',[
'copay.backup',
'copay.walletFactory',
'copay.signin',
+ 'copay.setup',
'copay.peer'
]);
@@ -21,5 +22,6 @@ angular.module('copay.send', []);
angular.module('copay.backup', []);
angular.module('copay.walletFactory', []);
angular.module('copay.signin', []);
+angular.module('copay.setup', []);
angular.module('copay.peer', []);
diff --git a/js/config.js b/js/config.js
index cbc46bab8..d73f23cdb 100644
--- a/js/config.js
+++ b/js/config.js
@@ -7,6 +7,10 @@ var config = {
maxPeers: 3,
debug: 3,
},
+ limits: {
+ totalCopayers: 10,
+ mPlusN: 15
+ },
wallet: {
requiredCopayers: 2,
totalCopayers: 3,
diff --git a/js/controllers/setup.js b/js/controllers/setup.js
new file mode 100644
index 000000000..30828843e
--- /dev/null
+++ b/js/controllers/setup.js
@@ -0,0 +1,34 @@
+'use strict';
+
+angular.module('copay.setup').controller('SetupController',
+ function($scope, $rootScope, $location, Network) {
+
+ $scope.loading = false;
+
+ $scope.selectedWalletId = false;
+ $scope.totalCopayers = config.wallet.totalCopayers;
+ $scope.TCValues = [];
+ for (var n = 1; n <= config.limits.totalCopayers; n++)
+ $scope.TCValues.push(n);
+
+ var updateRCSelect = function(n) {
+ $scope.requiredCopayers = parseInt(Math.min(n / 2 + 1, config.limits.mPlusN-n));
+ $scope.RCValues = [];
+ for (var m = 1; m <= n; m++) {
+ if (n + m <= config.limits.mPlusN) {
+ $scope.RCValues.push(m);
+ }
+ }
+ };
+ updateRCSelect($scope.totalCopayers);
+
+ $scope.$watch('totalCopayers', function(tc) {
+ updateRCSelect(tc);
+ })
+
+ $scope.create = function(totalCopayers, requiredCopayers) {
+ alert(totalCopayers);
+ alert(requiredCopayers);
+ };
+
+ });
diff --git a/js/routes.js b/js/routes.js
index 3793d88bd..5c655b208 100644
--- a/js/routes.js
+++ b/js/routes.js
@@ -12,6 +12,9 @@ angular
.when('/signin', {
templateUrl: 'signin.html'
})
+ .when('/setup', {
+ templateUrl: 'setup.html'
+ })
.when('/home', {
templateUrl: 'home.html'
})