@@ -21,7 +21,7 @@
diff --git a/src/app/pages/login/login.scss b/src/app/pages/login/login.scss
index acf1045b..cb03e3ee 100644
--- a/src/app/pages/login/login.scss
+++ b/src/app/pages/login/login.scss
@@ -1,141 +1 @@
-@import '../../theme/sass/conf/conf';
-
-main {
- min-height: 520px;
- height: 100%;
-}
-
-$text-color: #ffffff;
-
-.form-control, .form-control:focus {
- @include placeholderStyle($text-color, 0.9);
- background-color: rgba(0, 0, 0, .4);
- border-radius: 5px;
- color: $text-color;
-}
-.form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control {
- @include placeholderStyle($text-color, 0.6);
-}
-
-.auth-main {
- display: flex;
- align-items: center;
- height: 100%;
- width: 100%;
- position: relative;
-}
-
-.auth-block {
- width: 540px;
- margin: 0 auto;
- border-radius: 5px;
- @include bg-translucent-dark(0.55);
- color: #fff;
- padding: 32px;
- h1 {
- font-weight: $font-light;
- margin-bottom: 28px;
- text-align: center;
- }
- p {
- font-size: 16px;
- }
- a {
- text-decoration: none;
- outline: none;
- transition: all 0.2s ease;
- color: $primary;
- &:hover {
- color: $primary-dark;
- }
- }
-
- .control-label {
- padding-top: 11px;
- color: $text-color;
- }
-
- .form-group {
- margin-bottom: 12px;
- }
-}
-
-.auth-input {
- width: 300px;
- margin-bottom: 24px;
- input {
- display: block;
- width: 100%;
- border: none;
- font-size: 16px;
- padding: 4px 10px;
- outline: none;
- }
-}
-
-a.forgot-pass {
- display: block;
- text-align: right;
- margin-bottom: -20px;
- float: right;
- z-index: 2;
- position: relative;
-}
-
-.auth-link {
- display: block;
- font-size: 16px;
- text-align: center;
- margin-bottom: 33px;
-}
-
-.auth-sep {
- margin-top: 36px;
- margin-bottom: 24px;
- line-height: 20px;
- font-size: 16px;
- text-align: center;
- display: block;
- position: relative;
- & > span {
- display: table-cell;
- width: 30%;
- white-space: nowrap;
- padding: 0 24px;
- color: $text-color;
- & > span {
- margin-top: -12px;
- display: block;
- }
- }
- &:before, &:after {
- border-top: solid 1px $text-color;
- content: "";
- height: 1px;
- width: 35%;
- display: table-cell;
- }
-}
-
-.al-share-auth {
- text-align: center;
- .al-share {
- float: none;
- margin: 0;
- padding: 0;
- display: inline-block;
- li {
- margin-left: 24px;
- &:first-child {
- margin-left: 0;
- }
- i {
- font-size: 24px;
- }
- }
- }
-}
-
-.btn-auth {
- color: #ffffff!important;
-}
+@import '../../theme/sass/auth';
diff --git a/src/app/pages/register/index.ts b/src/app/pages/register/index.ts
new file mode 100644
index 00000000..55388b6e
--- /dev/null
+++ b/src/app/pages/register/index.ts
@@ -0,0 +1 @@
+export * from './register.component';
diff --git a/src/app/pages/register/register.component.ts b/src/app/pages/register/register.component.ts
new file mode 100644
index 00000000..eff29e6f
--- /dev/null
+++ b/src/app/pages/register/register.component.ts
@@ -0,0 +1,18 @@
+import {Component, ViewEncapsulation} from '@angular/core';
+
+
+@Component({
+ selector: 'login',
+ encapsulation: ViewEncapsulation.None,
+ directives: [],
+ styles: [require('./register.scss')],
+ template: require('./register.html'),
+})
+export class Register {
+
+ constructor() {
+ }
+
+ ngOnInit() {
+ }
+}
diff --git a/src/app/pages/register/register.html b/src/app/pages/register/register.html
new file mode 100644
index 00000000..7224e171
--- /dev/null
+++ b/src/app/pages/register/register.html
@@ -0,0 +1,45 @@
+
diff --git a/src/app/pages/register/register.scss b/src/app/pages/register/register.scss
new file mode 100644
index 00000000..cb03e3ee
--- /dev/null
+++ b/src/app/pages/register/register.scss
@@ -0,0 +1 @@
+@import '../../theme/sass/auth';
diff --git a/src/app/theme/sass/_auth.scss b/src/app/theme/sass/_auth.scss
new file mode 100644
index 00000000..b848a417
--- /dev/null
+++ b/src/app/theme/sass/_auth.scss
@@ -0,0 +1,141 @@
+@import 'conf/conf';
+
+main {
+ min-height: 520px;
+ height: 100%;
+}
+
+$text-color: #ffffff;
+
+.form-control, .form-control:focus {
+ @include placeholderStyle($text-color, 0.9);
+ background-color: rgba(0, 0, 0, .4);
+ border-radius: 5px;
+ color: $text-color;
+}
+.form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control {
+ @include placeholderStyle($text-color, 0.6);
+}
+
+.auth-main {
+ display: flex;
+ align-items: center;
+ height: 100%;
+ width: 100%;
+ position: relative;
+}
+
+.auth-block {
+ width: 540px;
+ margin: 0 auto;
+ border-radius: 5px;
+ @include bg-translucent-dark(0.55);
+ color: #fff;
+ padding: 32px;
+ h1 {
+ font-weight: $font-light;
+ margin-bottom: 28px;
+ text-align: center;
+ }
+ p {
+ font-size: 16px;
+ }
+ a {
+ text-decoration: none;
+ outline: none;
+ transition: all 0.2s ease;
+ color: $primary;
+ &:hover {
+ color: $primary-dark;
+ }
+ }
+
+ .control-label {
+ padding-top: 11px;
+ color: $text-color;
+ }
+
+ .form-group {
+ margin-bottom: 12px;
+ }
+}
+
+.auth-input {
+ width: 300px;
+ margin-bottom: 24px;
+ input {
+ display: block;
+ width: 100%;
+ border: none;
+ font-size: 16px;
+ padding: 4px 10px;
+ outline: none;
+ }
+}
+
+a.forgot-pass {
+ display: block;
+ text-align: right;
+ margin-bottom: -20px;
+ float: right;
+ z-index: 2;
+ position: relative;
+}
+
+.auth-link {
+ display: block;
+ font-size: 16px;
+ text-align: center;
+ margin-bottom: 33px;
+}
+
+.auth-sep {
+ margin-top: 36px;
+ margin-bottom: 24px;
+ line-height: 20px;
+ font-size: 16px;
+ text-align: center;
+ display: block;
+ position: relative;
+ & > span {
+ display: table-cell;
+ width: 30%;
+ white-space: nowrap;
+ padding: 0 24px;
+ color: $text-color;
+ & > span {
+ margin-top: -12px;
+ display: block;
+ }
+ }
+ &:before, &:after {
+ border-top: solid 1px $text-color;
+ content: "";
+ height: 1px;
+ width: 35%;
+ display: table-cell;
+ }
+}
+
+.al-share-auth {
+ text-align: center;
+ .al-share {
+ float: none;
+ margin: 0;
+ padding: 0;
+ display: inline-block;
+ li {
+ margin-left: 24px;
+ &:first-child {
+ margin-left: 0;
+ }
+ i {
+ font-size: 24px;
+ }
+ }
+ }
+}
+
+.btn-auth {
+ color: #ffffff!important;
+}
From 2ba18109cdd98a9d523326b057fdf0968441f203 Mon Sep 17 00:00:00 2001
From: nixa <4dmitr@gmail.com>
Date: Thu, 16 Jun 2016 12:11:28 +0300
Subject: [PATCH 3/5] feat(login): add angular 2 form logic
---
src/app/pages/login/login.component.ts | 24 +++++++++++++++++++++---
src/app/pages/login/login.html | 14 +++++++-------
2 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/src/app/pages/login/login.component.ts b/src/app/pages/login/login.component.ts
index a47c295f..69c2ed07 100644
--- a/src/app/pages/login/login.component.ts
+++ b/src/app/pages/login/login.component.ts
@@ -1,5 +1,5 @@
import {Component, ViewEncapsulation} from '@angular/core';
-
+import {FORM_DIRECTIVES, FormBuilder, ControlGroup, Validators, AbstractControl} from '@angular/common';
@Component({
selector: 'login',
@@ -10,9 +10,27 @@ import {Component, ViewEncapsulation} from '@angular/core';
})
export class Login {
- constructor() {
+ public form:ControlGroup;
+ public email:AbstractControl;
+ public password:AbstractControl;
+ public submitted:boolean = false;
+
+ constructor(fb:FormBuilder) {
+ this.form = fb.group({
+ 'email': ['', Validators.compose([Validators.required, Validators.minLength(4)])],
+ 'password': ['', Validators.compose([Validators.required, Validators.minLength(4)])]
+ });
+
+ this.email = this.form.controls['email'];
+ this.password = this.form.controls['password'];
}
- ngOnInit() {
+
+ public onSubmit(values:Object):void {
+ this.submitted = true;
+ if (this.form.valid) {
+ // your code goes here
+ // console.log(values);
+ }
}
}
diff --git a/src/app/pages/login/login.html b/src/app/pages/login/login.html
index 9d2bf283..9bedac1a 100644
--- a/src/app/pages/login/login.html
+++ b/src/app/pages/login/login.html
@@ -1,26 +1,26 @@