Skip to content

Commit

Permalink
User account reg moved to one dialog box #14
Browse files Browse the repository at this point in the history
  • Loading branch information
lpsandaruwan committed Feb 2, 2017
1 parent 7bccfb8 commit ea282f2
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 176 deletions.
22 changes: 11 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@ before_install:
- electron-packager app/ --platform=win32 --arch=x64
- electron-packager app/ --platform=win32 --arch=ia32
- ls
- tar -zcvf fontman-gui-linux-x64.tar.gz fontman-gui-linux-x64
- tar -zcvf fontman-gui-linux-ia32.tar.gz fontman-gui-linux-ia32
- tar -zcvf fontman-gui-darwin-x64.tar.gz fontman-gui-darwin-x64
- zip -r fontman-gui-win32-ia32.zip fontman-gui-win32-ia32
- zip -r fontman-gui-win32-x64.zip fontman-gui-win32-x64
- tar -zcvf fontman-desktop-linux-x64.tar.gz fontman-desktop-linux-x64
- tar -zcvf fontman-desktop-linux-ia32.tar.gz fontman-desktop-linux-ia32
- tar -zcvf fontman-desktop-darwin-x64.tar.gz fontman-desktop-darwin-x64
- zip -r fontman-desktop-win32-ia32.zip fontman-desktop-win32-ia32
- zip -r fontman-desktop-win32-x64.zip fontman-desktop-win32-x64
- ls
script: echo "done"
deploy:
overwrite: true
provider: releases
skip_cleanup: true
file:
- fontman-gui-darwin-x64.tar.gz
- fontman-gui-linux-x64.tar.gz
- fontman-gui-linux-ia32.tar.gz
- fontman-gui-win32-ia32.zip
- fontman-gui-win32-x64.zip
- fontman-desktop-darwin-x64.tar.gz
- fontman-desktop-linux-x64.tar.gz
- fontman-desktop-linux-ia32.tar.gz
- fontman-desktop-win32-ia32.zip
- fontman-desktop-win32-x64.zip
on:
tags: true
all_branches: true
repo: fontman/fontman-gui
repo: fontman/fontman-desktop
api-key:
secure: N9IU2xYJQBMuf9Ay828WCGs/zZJgRwcd+MeDjFt0AySqv5FTo4JxEL8DgG0URxj9Gd+GRttNHVEL7ajPdPq9Hnm7+lkr5wP8A8DDtu5Ir3JPtN2TWkBX27QDJsU74ZyuTslgTsu7sI4dRI47p0r/TLWdpRuFEnkKIwaXuTawpSDWF1wxr4BlzXZrP6GdUEK6cFMESbcMeA+d6CjZt824XHLQT8HCBfMrz8fK+LfQerm0pxdQF8sFFhqzRS2r5yzDSg0YMdmwCE5d10F/TG/tutbSkD37MZaghDTPYzlpe+rwkf5A6Tvr1ETR0TXicqQzNet2xg4Ilm38QvAn3vHQwmUd+LlfZ4B/lNkbEf1amnp6IPzisWzEP4DrvAY2AOYxxD/3Np4sV372JOzK+TiKwLAnOMUb9AECJzS2AR2ezIH6RwPjyihmVdR7EyyUP/Xz2HzaH3thKLdlkVLxvqUifK/ElFycFUnAOCbOu3mn834bgkdgL28tnzOuUCXCTCJITbwqBjcjkKUZvRUqZGtfkMJo6DEfeOGwyOAREXwDX9bHdjQyYih9JhgX5g5fZyq44GVlAvD9KFqX3VdOeVNAT9qqb1lFQVwHlwCjQVgUv3mCN+pFEG3BNmb757sAI0Rfc1ohYsqWLqa8t0raG9Tk3evFuljmE7orlFlMGlHkHuI=
env:
Expand Down
5 changes: 5 additions & 0 deletions app/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,11 @@ span.offcurve { color: orangered; }
padding-top: 150px;
}

.sign-up {
background-color: white;
padding: 10px 10px 10px 10px;
}

.slider-label {
font-size: 12px;
}
Expand Down
67 changes: 20 additions & 47 deletions app/fontman.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,6 @@ fontmanApp
$scope.inProgress = false;
$scope.selectedNavIndex = 0;

// profile creation dialog
$scope.createProfileDialog = function (ev) {
$mdDialog.show({
controller: profileCreationController,
templateUrl: "ng-modules/ng-templates/create_profile.html",
parent: angular.element(document.body),
targetEvent: ev,
clickOutsideToClose: true
})
.then(function () {
setAuthStatus(); // refresh auth status
})
};

// login dialog
$scope.loginDialog = function (ev) {
$mdDialog.show({
Expand Down Expand Up @@ -118,74 +104,61 @@ fontmanApp
password: undefined
};

$scope.profileData = {
email: undefined,
name: undefined,
password: undefined
};
$scope.confirmPassword = undefined;

$scope.cancel = function() {
$mdDialog.cancel();
};

$scope.clearFields = function () {
$scope.loginData.email = undefined;
$scope.loginData.password = undefined;
$scope.profileData.email = undefined;
$scope.profileData.name = undefined;
$scope.profileData.password = undefined;
$scope.confirmPassword = undefined;
};

$scope.loginProfile = function () {
$scope.createProfile = function () {
$scope.inProgress = true;

$http.post("http://127.0.0.1:5000/auth/login", $scope.loginData)
$http.post("http://127.0.0.1:5000/auth/new/profile", $scope.profileData)
.then(function onSuccess(response) {
if(response.data === true) {
$scope.inProgress = false;
$mdDialog.hide();
} else {
$scope.errorResponse = response.data;
$scope.inProgress = false;
alert(response.data.error);
}
})
.catch(function onError() {
$scope.inProgress = false;
alert("FMS connection failed!");
alert("FMS connection failed!")
});

$scope.inProgress = false;
};
};

// profile creation dialog controller
var profileCreationController = function ($http, $mdDialog, $mdToast, $scope) {
$scope.inProgress = false;
$scope.profileData = {
email: undefined,
name: undefined,
password: undefined
};
$scope.confirmPassword = undefined;

$scope.cancel = function() {
$mdDialog.cancel();
};

$scope.clearFields = function () {
$scope.profileData.email = undefined;
$scope.profileData.name = undefined;
$scope.profileData.password = undefined;
$scope.confirmPassword = undefined;
};

$scope.createProfile = function () {
$scope.loginProfile = function () {
$scope.inProgress = true;

$http.post("http://127.0.0.1:5000/auth/new/profile", $scope.profileData)
$http.post("http://127.0.0.1:5000/auth/login", $scope.loginData)
.then(function onSuccess(response) {
if(response.data === true) {
$scope.inProgress = false;
$mdDialog.hide();
} else {
$scope.errorResponse = response.data;
$scope.inProgress = false;
alert(response.data.error);
}
})
.catch(function onError() {
$scope.inProgress = false;
alert("FMS connection failed!")
alert("FMS connection failed!");
});

$scope.inProgress = false;
Expand All @@ -209,7 +182,7 @@ fontmanApp
if($scope.authStatus===true) {
$http.get("http://127.0.0.1:5000/auth/profile")
.then(function onSuccess(response) {
$scope.fontmanUser = (response.data.name).toUpperCase();
$scope.fontmanUser = (response.data.name);
$scope.fontmanUserId = response.data.user_id;
})
.catch(function onError(response) {
Expand Down
70 changes: 0 additions & 70 deletions app/ng-modules/ng-templates/create_profile.html

This file was deleted.

Loading

0 comments on commit ea282f2

Please sign in to comment.