This repository has been archived by the owner on Apr 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into 194_maximum-amount-validation
- Loading branch information
Showing
95 changed files
with
4,281 additions
and
985 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,5 @@ | |
"version": "0.2.0", | ||
"description": "Lisk Nano", | ||
"main": "main.js", | ||
"author":{ | ||
"name": "Ricardo Ferro", | ||
"email": "[email protected]" | ||
} | ||
"author": "Lisk Foundation <[email protected]>, lightcurve GmbH <[email protected]>" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
export default angular.module('app', [ | ||
const app = angular.module('app', [ | ||
'ui.router', | ||
'angular-svg-round-progressbar', | ||
'ngMessages', | ||
'ngMaterial', | ||
'ngAnimate', | ||
'ngCookies', | ||
'infinite-scroll', | ||
'md.data.table', | ||
]); | ||
|
||
export default app; |
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
64 changes: 64 additions & 0 deletions
64
src/app/components/delegate-registration/delegateRegistration.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import './delegateRegistration.less'; | ||
|
||
app.directive('delegateRegistration', ($mdDialog, delegateService, Account, dialog) => { | ||
const DelegateRegistrationLink = function ($scope, $element) { | ||
$scope.form = { | ||
name: '', | ||
fee: 25, | ||
error: '', | ||
onSubmit: (form) => { | ||
if (form.$valid) { | ||
delegateService.registerDelegate($scope.form.name.toLowerCase(), Account.get().passphrase) | ||
.then(() => { | ||
dialog.successAlert({ | ||
title: 'Congratulations!', | ||
text: 'Account was successfully registered as delegate.', | ||
}) | ||
.then(() => { | ||
Account.set({ | ||
isDelegate: true, | ||
username: $scope.form.name.toLowerCase(), | ||
}); | ||
$scope.reset(form); | ||
$mdDialog.hide(); | ||
}); | ||
}) | ||
.catch((error) => { | ||
$scope.form.error = error.message ? error.message : ''; | ||
}); | ||
} | ||
}, | ||
}; | ||
|
||
$scope.reset = (form) => { | ||
$scope.form.name = ''; | ||
$scope.form.error = ''; | ||
|
||
form.$setPristine(); | ||
form.$setUntouched(); | ||
}; | ||
|
||
$scope.cancel = (form) => { | ||
$scope.reset(form); | ||
$mdDialog.hide(); | ||
}; | ||
|
||
$element.bind('click', () => { | ||
$mdDialog.show({ | ||
template: require('./delegateRegistration.pug')(), | ||
bindToController: true, | ||
locals: { | ||
form: $scope.form, | ||
cancel: $scope.cancel, | ||
}, | ||
controller: () => {}, | ||
controllerAs: '$ctrl', | ||
}); | ||
}); | ||
}; | ||
|
||
return { | ||
restrict: 'A', | ||
link: DelegateRegistrationLink, | ||
}; | ||
}); |
41 changes: 41 additions & 0 deletions
41
src/app/components/delegate-registration/delegateRegistration.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.dialog-delegate-registration { | ||
background: transparent; | ||
box-shadow: none; | ||
|
||
& > md-card { | ||
box-shadow: | ||
0px 4px 6px -4px rgba(0, 0, 0, 0.2), | ||
0px 8px 10px 2px rgba(0, 0, 0, 0.14), | ||
0px 3px 12px 4px rgba(0, 0, 0, 0.12); | ||
} | ||
|
||
.fee { | ||
position: absolute; | ||
left: auto; | ||
right: 6px; | ||
bottom: 7px; | ||
font-size: 12px; | ||
line-height: 14px; | ||
transition: all 0.3s cubic-bezier(0.55, 0, 0.55, 0.2); | ||
color: grey; | ||
} | ||
|
||
input { | ||
text-transform: lowercase; | ||
} | ||
|
||
p.error { | ||
font-size:.8em; | ||
width: 100%; | ||
text-align: center; | ||
color: rgb(221,44,0); | ||
} | ||
|
||
md-dialog-actions .md-button { | ||
margin-left: -8px; | ||
} | ||
|
||
.info-icon-wrapper { | ||
margin: 24px 24px 0 0; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/app/components/delegate-registration/delegateRegistration.pug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
div.dialog-delegate-registration(aria-label='Vote for delegates') | ||
form(name='delegateRegistrationForm', ng-submit='$ctrl.form.onSubmit(delegateRegistrationForm)') | ||
md-toolbar | ||
.md-toolbar-tools | ||
h2 Delegate Registration | ||
md-dialog-content | ||
.md-dialog-content | ||
div | ||
md-input-container.md-block | ||
label Delegate name | ||
input(type='text', name='delegateName', ng-model='$ctrl.form.name', required, ng-disabled='$ctrl.loading') | ||
div(ng-messages='delegateRegistrationForm.name.$error') | ||
div(ng-message='required') Required | ||
md-input-container.md-block | ||
div.fee Fee: {{$ctrl.form.fee}} LSK | ||
md-divider | ||
div(layout='row') | ||
p.info-icon-wrapper | ||
i.material-icons info | ||
p | ||
span Becoming a delegate requires registration. You may choose your own delegate name, which can be used to promote your delegate. Only the top 101 delegates are eligible to forge. All fees are shared equally between the top 101 delegates. | ||
md-divider | ||
p.error(ng-bind='$ctrl.form.error', ng-if='$ctrl.form.error') | ||
md-dialog-actions(layout='row') | ||
md-button.md-raised.md-secondary(ng-disabled='$ctrl.loading', ng-click='$ctrl.cancel(delegateRegistrationForm)') {{ 'Cancel' }} | ||
span(flex) | ||
md-button.md-raised.md-primary(ng-disabled='!delegateRegistrationForm.$valid || $ctrl.loading', type='submit') {{ $ctrl.loading ? 'Registering...' : 'Register' }} |
Oops, something went wrong.