unsakini 0.0.3.1 → 0.0.4.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +37 -6
- data/angular/angular-cli.json +5 -3
- data/angular/npm-debug.log +54 -0
- data/angular/package.json +4 -1
- data/angular/src/app/app.component.html +1 -4
- data/angular/src/app/app.module.ts +8 -7
- data/angular/src/app/app.routes.module.ts +12 -2
- data/angular/src/app/confirm-account/confirm-account.component.ts +27 -0
- data/angular/src/app/confirm-account/confirm-account.html +41 -0
- data/angular/src/app/confirm-account/confirm-account.module.ts +24 -0
- data/angular/src/app/confirm-account/confirm-account.scss +3 -0
- data/angular/src/app/confirm-account/confirm-account.service.ts +27 -0
- data/angular/src/app/confirm-account/index.ts +3 -0
- data/angular/src/app/index.ts +2 -0
- data/angular/src/app/login/index.ts +3 -0
- data/angular/src/app/login/login.component.ts +40 -0
- data/angular/src/app/login/login.html +43 -0
- data/angular/src/app/login/login.module.ts +27 -0
- data/angular/src/app/login/login.service.ts +48 -0
- data/angular/src/app/registration/index.ts +3 -0
- data/angular/src/app/registration/registration.component.html +70 -12
- data/angular/src/app/registration/registration.component.spec.ts +8 -11
- data/angular/src/app/registration/registration.component.ts +10 -8
- data/angular/src/app/registration/registration.module.ts +23 -0
- data/angular/src/app/registration/registration.service.ts +46 -0
- data/angular/src/app/registration/registration.services.spec.ts +71 -0
- data/angular/src/app/services/auth-http/auth.http.service.ts +35 -0
- data/angular/src/app/services/auth-http/index.ts +1 -0
- data/angular/src/app/services/http/http.service.spec.ts +205 -0
- data/angular/src/app/services/http/http.service.ts +40 -0
- data/angular/src/app/services/http/index.ts +1 -0
- data/angular/src/app/services/index.ts +3 -0
- data/angular/src/app/services/services.module.ts +33 -0
- data/angular/src/assets/global.scss +3 -0
- data/angular/src/environments/custom.ts +4 -0
- data/angular/src/environments/environment.prod.ts +2 -1
- data/angular/src/environments/environment.ts +2 -1
- data/angular/src/index.html +1 -1
- data/app/controllers/application_controller.rb +2 -2
- data/app/controllers/concerns/unsakini/board_owner_controller_concern.rb +42 -0
- data/app/controllers/concerns/unsakini/comment_owner_controller_concern.rb +36 -0
- data/app/controllers/concerns/unsakini/logged_in_controller_concern.rb +23 -0
- data/app/controllers/concerns/unsakini/post_owner_controller_concern.rb +38 -0
- data/app/controllers/concerns/unsakini/serializer_controller_concern.rb +13 -0
- data/app/controllers/unsakini/base_controller.rb +6 -0
- data/app/controllers/unsakini/boards_controller.rb +76 -0
- data/app/controllers/unsakini/comments_controller.rb +54 -0
- data/app/controllers/unsakini/posts_controller.rb +61 -0
- data/app/controllers/unsakini/share_board_controller.rb +122 -0
- data/app/controllers/unsakini/user_token_controller.rb +17 -0
- data/app/controllers/unsakini/users_controller.rb +69 -0
- data/app/controllers/unsakini/web_controller.rb +27 -0
- data/app/mailers/unsakini/user_mailer.rb +13 -0
- data/app/models/concerns/unsakini/encryptable_model_concern.rb +97 -0
- data/app/models/unsakini/application_record.rb +7 -0
- data/app/models/unsakini/board.rb +16 -0
- data/app/models/unsakini/comment.rb +12 -0
- data/app/models/unsakini/post.rb +15 -0
- data/app/models/unsakini/user.rb +43 -0
- data/app/models/unsakini/user_board.rb +84 -0
- data/app/models/unsakini.rb +5 -0
- data/app/serializers/unsakini/board_serializer.rb +7 -0
- data/app/serializers/{comment_serializer.rb → unsakini/comment_serializer.rb} +6 -3
- data/app/serializers/unsakini/post_serializer.rb +26 -0
- data/app/serializers/unsakini/user_board_serializer.rb +14 -0
- data/app/serializers/{user_serializer.rb → unsakini/user_serializer.rb} +5 -2
- data/app/views/unsakini/user_mailer/confirm_account.html.erb +3 -0
- data/app/views/unsakini/web/index.html.erb +343 -0
- data/config/routes.rb +10 -10
- data/db/migrate/20161116114222_create_unsakini_boards.rb +10 -0
- data/db/migrate/{20161116200034_create_user_boards.rb → 20161116200034_create_unsakini_user_boards.rb} +3 -2
- data/db/migrate/{20161118031023_create_posts.rb → 20161118031023_create_unsakini_posts.rb} +2 -2
- data/db/migrate/{20161118100454_create_comments.rb → 20161118100454_create_unsakini_comments.rb} +2 -2
- data/db/migrate/20161126145352_create_unsakini_users.rb +15 -0
- data/lib/generators/unsakini/config/config_generator.rb +3 -1
- data/lib/generators/unsakini/dependencies/USAGE +5 -0
- data/lib/generators/unsakini/dependencies/dependencies_generator.rb +19 -0
- data/lib/tasks/unsakini_tasks.rake +6 -37
- data/lib/unsakini/engine.rb +6 -0
- data/lib/unsakini/version.rb +1 -1
- data/public/css/all.css +1204 -0
- data/public/css/all.css.map +7 -0
- data/public/css/bootstrap.css +5622 -0
- data/public/css/bootstrap.css.map +7 -0
- data/public/css/custom.css +15 -0
- data/public/favicons/android-chrome-144x144.png +0 -0
- data/public/favicons/android-chrome-192x192.png +0 -0
- data/public/favicons/android-chrome-36x36.png +0 -0
- data/public/favicons/android-chrome-48x48.png +0 -0
- data/public/favicons/android-chrome-72x72.png +0 -0
- data/public/favicons/android-chrome-96x96.png +0 -0
- data/public/favicons/apple-touch-icon-114x114.png +0 -0
- data/public/favicons/apple-touch-icon-120x120.png +0 -0
- data/public/favicons/apple-touch-icon-144x144.png +0 -0
- data/public/favicons/apple-touch-icon-152x152.png +0 -0
- data/public/favicons/apple-touch-icon-180x180.png +0 -0
- data/public/favicons/apple-touch-icon-57x57.png +0 -0
- data/public/favicons/apple-touch-icon-60x60.png +0 -0
- data/public/favicons/apple-touch-icon-72x72.png +0 -0
- data/public/favicons/apple-touch-icon-76x76.png +0 -0
- data/public/favicons/apple-touch-icon-precomposed.png +0 -0
- data/public/favicons/apple-touch-icon.png +0 -0
- data/public/favicons/favicon-16x16.png +0 -0
- data/public/favicons/favicon-194x194.png +0 -0
- data/public/favicons/favicon-32x32.png +0 -0
- data/public/favicons/favicon-96x96.png +0 -0
- data/public/favicons/favicon.ico +0 -0
- data/public/favicons/mstile-144x144.png +0 -0
- data/public/favicons/mstile-150x150.png +0 -0
- data/public/favicons/mstile-310x150.png +0 -0
- data/public/favicons/mstile-310x310.png +0 -0
- data/public/favicons/mstile-70x70.png +0 -0
- data/public/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
- data/public/fonts/bootstrap/glyphicons-halflings-regular.svg +288 -0
- data/public/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
- data/public/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
- data/public/fonts/bootstrap/glyphicons-halflings-regular.woff2 +0 -0
- data/public/fonts/font-awesome-4.3.0/css/font-awesome.css +1801 -0
- data/public/fonts/font-awesome-4.3.0/css/font-awesome.min.css +4 -0
- data/public/fonts/font-awesome-4.3.0/fonts/FontAwesome.otf +0 -0
- data/public/fonts/font-awesome-4.3.0/fonts/fontawesome-webfont.eot +0 -0
- data/public/fonts/font-awesome-4.3.0/fonts/fontawesome-webfont.svg +565 -0
- data/public/fonts/font-awesome-4.3.0/fonts/fontawesome-webfont.ttf +0 -0
- data/public/fonts/font-awesome-4.3.0/fonts/fontawesome-webfont.woff +0 -0
- data/public/fonts/font-awesome-4.3.0/fonts/fontawesome-webfont.woff2 +0 -0
- data/public/images/graph-01.svg +425 -0
- data/public/images/graph-02.svg +435 -0
- data/public/images/graph-03.svg +576 -0
- data/public/images/graph-04.svg +70 -0
- data/public/images/img-01.png +0 -0
- data/public/images/img-decor-01.jpg +0 -0
- data/public/images/img-decor-02.jpg +0 -0
- data/public/images/img-decor-03.jpg +0 -0
- data/public/images/img-social-placeholder-01.png +0 -0
- data/public/images/logo-cb.png +0 -0
- data/public/images/logo-codrops.png +0 -0
- data/public/images/logo-pixel.png +0 -0
- data/public/images/logo-smashing.png +0 -0
- data/public/images/logo-tnw.png +0 -0
- data/public/images/logo-w.png +0 -0
- data/public/images/unsakini.svg +56 -0
- data/public/images/user-01.jpg +0 -0
- data/public/images/user-02.jpg +0 -0
- data/public/images/user-03.jpg +0 -0
- data/public/js/bootstrap.js +2306 -0
- data/public/js/jquery-1.11.2.min.js +4 -0
- data/public/js/jquery.main.js +603 -0
- data/public/manifest.json +41 -0
- data/public/unsakini/app/448c34a56d699c29117adc64c43affeb.woff2 +0 -0
- data/public/unsakini/app/89889688147bd7575d6327160d64e760.svg +288 -0
- data/public/unsakini/app/assets/global.scss +3 -0
- data/public/unsakini/app/e18bbf611f2a2e43afc071aa2f4e1512.ttf +0 -0
- data/public/unsakini/app/f4769f9bdb7466be65088239c12046d1.eot +0 -0
- data/public/unsakini/app/fa2772327f55d8198301fdb8bcfc8158.woff +0 -0
- data/{angular/dist → public/unsakini/app}/favicon.ico +0 -0
- data/public/unsakini/app/index.html +14 -0
- data/public/unsakini/app/inline.d41d8cd98f00b204e980.bundle.js +2 -0
- data/public/unsakini/app/inline.d41d8cd98f00b204e980.bundle.map +1 -0
- data/public/unsakini/app/main.54f49c65d3d20650a5d5.bundle.js +2152 -0
- data/public/unsakini/app/main.54f49c65d3d20650a5d5.bundle.js.gz +0 -0
- data/public/unsakini/app/main.54f49c65d3d20650a5d5.bundle.map +1 -0
- data/public/unsakini/app/styles.58e065928ed8ebd0b582.bundle.js +2 -0
- data/public/unsakini/app/styles.58e065928ed8ebd0b582.bundle.map +1 -0
- data/public/unsakini/app/styles.5dac0e986fce6f8738b300cb558b56a0.bundle.css +8 -0
- data/spec/concerns/models/encryptable_concern.rb +3 -2
- data/spec/controllers/{web_base_controller_spec.rb → web_controller_spec.rb} +5 -4
- data/spec/dummy/config/application.rb +3 -1
- data/spec/dummy/config/environments/development.rb +2 -0
- data/spec/dummy/config/initializers/knock.rb +59 -0
- data/spec/dummy/db/schema.rb +16 -14
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/factories/boards.rb +1 -1
- data/spec/factories/comments.rb +1 -1
- data/spec/factories/posts.rb +1 -1
- data/spec/factories/user_boards.rb +1 -1
- data/spec/factories/users.rb +1 -1
- data/spec/models/board_spec.rb +2 -2
- data/spec/models/comment_spec.rb +2 -2
- data/spec/models/post_spec.rb +2 -2
- data/spec/models/user_board_spec.rb +19 -19
- data/spec/models/user_spec.rb +1 -1
- data/spec/requests/{api/boards/api_boards_crud_spec.rb → boards/boards_crud_spec.rb} +26 -26
- data/spec/requests/{api/boards/api_boards_pagination_spec.rb → boards/boards_pagination_spec.rb} +7 -7
- data/spec/requests/{api/boards/api_private_board_spec.rb → boards/private_board_spec.rb} +26 -26
- data/spec/requests/{api/boards/api_shared_board_spec.rb → boards/shared_board_spec.rb} +9 -9
- data/spec/requests/{api/boards/api_sharing_board_spec.rb → boards/sharing_board_spec.rb} +13 -13
- data/spec/requests/{api/comments/api_comments_pagination_spec.rb → comments/comments_pagination_spec.rb} +3 -3
- data/spec/requests/{api/comments/api_comments_private_board_spec.rb → comments/comments_private_board_spec.rb} +20 -20
- data/spec/requests/{api/comments/api_comments_shared_board_spec.rb → comments/comments_shared_board_spec.rb} +17 -17
- data/spec/requests/{api/posts/api_posts_pagination_spec.rb → posts/posts_pagination_spec.rb} +3 -3
- data/spec/requests/{api/posts/api_posts_private_board_spec.rb → posts/posts_private_board_spec.rb} +22 -22
- data/spec/requests/{api/posts/api_posts_shared_board_spec.rb → posts/posts_shared_board_spec.rb} +24 -24
- data/spec/requests/user/user_create_spec.rb +104 -0
- data/spec/requests/{api/api_users_spec.rb → user/user_search_spec.rb} +9 -9
- data/spec/schema/jwt.json +9 -0
- data/spec/schema/validation_message.json +4 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/support/auth_helper.rb +0 -2
- metadata +204 -199
- data/angular/dist/index.html +0 -14
- data/angular/dist/inline.bundle.js +0 -139
- data/angular/dist/inline.map +0 -1
- data/angular/dist/main.bundle.js +0 -64689
- data/angular/dist/main.map +0 -1
- data/angular/dist/styles.bundle.js +0 -364
- data/angular/dist/styles.map +0 -1
- data/angular/src/styles.css +0 -1
- data/app/controllers/api/boards_controller.rb +0 -73
- data/app/controllers/api/comments_controller.rb +0 -51
- data/app/controllers/api/posts_controller.rb +0 -58
- data/app/controllers/api/share_board_controller.rb +0 -118
- data/app/controllers/api/users_controller.rb +0 -27
- data/app/controllers/concerns/board_owner_controller_concern.rb +0 -38
- data/app/controllers/concerns/comment_owner_controller_concern.rb +0 -33
- data/app/controllers/concerns/logged_in_controller_concern.rb +0 -21
- data/app/controllers/concerns/post_owner_controller_concern.rb +0 -36
- data/app/controllers/concerns/serializer_controller_concern.rb +0 -11
- data/app/controllers/user_token_controller.rb +0 -2
- data/app/controllers/web_base_controller.rb +0 -15
- data/app/models/application_record.rb +0 -5
- data/app/models/board.rb +0 -14
- data/app/models/comment.rb +0 -9
- data/app/models/concerns/encryptable_model_concern.rb +0 -96
- data/app/models/post.rb +0 -12
- data/app/models/user.rb +0 -6
- data/app/models/user_board.rb +0 -82
- data/app/serializers/board_serializer.rb +0 -5
- data/app/serializers/post_serializer.rb +0 -23
- data/app/serializers/user_board_serializer.rb +0 -11
- data/app/views/web_base/index.html +0 -16
- data/db/migrate/20161116114222_create_boards.rb +0 -9
- data/db/migrate/20161118221508_add_encrypted_password_to_user_board.rb +0 -5
- data/db/migrate/20161122211105_create_users.rb +0 -12
- data/db/migrate/20161124102633_add_is_shared_to_boards.rb +0 -5
- data/lib/generators/unsakini/angular/USAGE +0 -8
- data/lib/generators/unsakini/angular/angular_generator.rb +0 -7
- data/spec/dummy/config/initializers/assets.rb +0 -11
- data/spec/dummy/config/initializers/cookies_serializer.rb +0 -5
- data/spec/dummy/config/initializers/session_store.rb +0 -3
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20161124210219_create_boards.unsakini_engine.rb +0 -10
- data/spec/dummy/db/migrate/20161124210220_create_user_boards.unsakini_engine.rb +0 -12
- data/spec/dummy/db/migrate/20161124210221_create_posts.unsakini_engine.rb +0 -13
- data/spec/dummy/db/migrate/20161124210222_create_comments.unsakini_engine.rb +0 -12
- data/spec/dummy/db/migrate/20161124210223_add_encrypted_password_to_user_board.unsakini_engine.rb +0 -6
- data/spec/dummy/db/migrate/20161124210224_create_users.unsakini_engine.rb +0 -13
- data/spec/dummy/db/migrate/20161124210225_add_is_shared_to_boards.unsakini_engine.rb +0 -6
- data/spec/dummy/public/app/favicon.ico +0 -0
- data/spec/dummy/public/app/index.html +0 -14
- data/spec/dummy/public/app/inline.bundle.js +0 -139
- data/spec/dummy/public/app/inline.map +0 -1
- data/spec/dummy/public/app/main.bundle.js +0 -64689
- data/spec/dummy/public/app/main.map +0 -1
- data/spec/dummy/public/app/styles.bundle.js +0 -364
- data/spec/dummy/public/app/styles.map +0 -1
- data/spec/dummy/tmp/unsakini-ng2/LICENSE +0 -21
- data/spec/dummy/tmp/unsakini-ng2/README.md +0 -1
- data/spec/dummy/tmp/unsakini-ng2/angular-cli.json +0 -59
- data/spec/dummy/tmp/unsakini-ng2/e2e/app.e2e-spec.ts +0 -14
- data/spec/dummy/tmp/unsakini-ng2/e2e/app.po.ts +0 -11
- data/spec/dummy/tmp/unsakini-ng2/e2e/signup.e2e-spec.ts +0 -28
- data/spec/dummy/tmp/unsakini-ng2/e2e/signup.po.ts +0 -31
- data/spec/dummy/tmp/unsakini-ng2/e2e/tsconfig.json +0 -16
- data/spec/dummy/tmp/unsakini-ng2/karma.conf.js +0 -45
- data/spec/dummy/tmp/unsakini-ng2/package.json +0 -49
- data/spec/dummy/tmp/unsakini-ng2/protractor.conf.js +0 -32
- data/spec/dummy/tmp/unsakini-ng2/src/app/app.component.css +0 -0
- data/spec/dummy/tmp/unsakini-ng2/src/app/app.component.html +0 -4
- data/spec/dummy/tmp/unsakini-ng2/src/app/app.component.spec.ts +0 -47
- data/spec/dummy/tmp/unsakini-ng2/src/app/app.component.ts +0 -10
- data/spec/dummy/tmp/unsakini-ng2/src/app/app.module.ts +0 -29
- data/spec/dummy/tmp/unsakini-ng2/src/app/app.routes.module.ts +0 -29
- data/spec/dummy/tmp/unsakini-ng2/src/app/index.ts +0 -2
- data/spec/dummy/tmp/unsakini-ng2/src/app/registration/registration.component.css +0 -0
- data/spec/dummy/tmp/unsakini-ng2/src/app/registration/registration.component.html +0 -14
- data/spec/dummy/tmp/unsakini-ng2/src/app/registration/registration.component.spec.ts +0 -157
- data/spec/dummy/tmp/unsakini-ng2/src/app/registration/registration.component.ts +0 -42
- data/spec/dummy/tmp/unsakini-ng2/src/environments/environment.prod.ts +0 -3
- data/spec/dummy/tmp/unsakini-ng2/src/environments/environment.ts +0 -8
- data/spec/dummy/tmp/unsakini-ng2/src/favicon.ico +0 -0
- data/spec/dummy/tmp/unsakini-ng2/src/index.html +0 -14
- data/spec/dummy/tmp/unsakini-ng2/src/main.ts +0 -12
- data/spec/dummy/tmp/unsakini-ng2/src/polyfills.ts +0 -19
- data/spec/dummy/tmp/unsakini-ng2/src/styles.css +0 -1
- data/spec/dummy/tmp/unsakini-ng2/src/test.ts +0 -31
- data/spec/dummy/tmp/unsakini-ng2/src/tsconfig.json +0 -18
- data/spec/dummy/tmp/unsakini-ng2/src/typings.d.ts +0 -2
- data/spec/dummy/tmp/unsakini-ng2/tslint.json +0 -114
- data/spec/dummy/tmp/unsakini-ng2/typings.json +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ff0d0fddfd943d5422fd5bf76802fd0bb6dbb9d
|
4
|
+
data.tar.gz: a607dd0b131acbc0d5c01f2fb383f27d38a6e767
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73fd502e576b9faf274ef8807edbd30149a8a05c71c007eee926aee4dd354e1487c9c12f907d4a163025c0101306d2ac613c6f01f1f8063365dd72140972355f
|
7
|
+
data.tar.gz: 8fb675dc1b991bc9689a495b7d5fb6d0c9dfc2df7ab48033fc7be5463322eb8115b7cc1c6227f9875a37e47fdbf540e56d1f0f841b048125aeead93f8c7ddb82
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
[![Build Status](https://travis-ci.org/
|
1
|
+
[![Build Status](https://travis-ci.org/adonespitogo/unsakini.svg?branch=master)](https://travis-ci.org/adonespitogo/unsakini)
|
2
|
+
|
2
3
|
|
3
4
|
UNSAKINI
|
4
5
|
-----------
|
@@ -15,9 +16,9 @@ Features:
|
|
15
16
|
-------------------------
|
16
17
|
|
17
18
|
### How it Works
|
18
|
-
Upon using the system, you'll be asked to provide your private key. This key is used to encrypt your data before
|
19
|
+
Upon using the system, you'll be asked to provide your private key. This key is used to encrypt your data before they are sent to the server. The key is stored in your computer and is never sent to the server.
|
19
20
|
|
20
|
-
Hackers, surveillance and spy softwares and even the server host cannot read your data, unless they are able to obtain your private key. Your private key is deleted from your computer everytime you logout.
|
21
|
+
Hackers, surveillance and spy softwares and even the server host cannot read your data, unless they are able to obtain your private key. Your private key is deleted from your computer everytime you logout to ensure no one can obtain it while you're away.
|
21
22
|
|
22
23
|
To increase the security, your data is re-encrypted in the backend before being saved to the database, which adds a second layer of protection.
|
23
24
|
|
@@ -28,9 +29,9 @@ The data is ecnrypted using [Advanced Encryption System (AES)](https://en.wikipe
|
|
28
29
|
------
|
29
30
|
|
30
31
|
### System Requirements
|
31
|
-
- Node.js
|
32
32
|
- Ruby >= 2.2.2
|
33
|
-
-
|
33
|
+
- Rails >= 5.0
|
34
|
+
- Bunlder gem
|
34
35
|
|
35
36
|
### Installation
|
36
37
|
Create a new rails application named `my-app` or anything you like.
|
@@ -38,11 +39,41 @@ Create a new rails application named `my-app` or anything you like.
|
|
38
39
|
$ rails new my-app
|
39
40
|
$ cd my-app
|
40
41
|
```
|
41
|
-
Add
|
42
|
+
Add the gem to your `Gemfile`.
|
43
|
+
```
|
44
|
+
gem 'unsakini'
|
45
|
+
```
|
46
|
+
Bundle install and initialize the application
|
42
47
|
```
|
43
48
|
$ bundle install
|
44
49
|
$ rake unsakini:install
|
45
50
|
```
|
51
|
+
The `rake unsakini:install` command is just a super set of the following commands:
|
52
|
+
```
|
53
|
+
$ rails generate unsakini:config # generates config/initializers/unsakini.rb
|
54
|
+
$ rails generate unsakini:dependencies # add dependencies to Gemfile
|
55
|
+
$ rake unsakini_engine:install:migrations # copy the engine migrations to db/migrations directory
|
56
|
+
$ rake db:migrate # runs the migration files
|
57
|
+
```
|
58
|
+
|
59
|
+
These dependencies will be added to your Gemfile
|
60
|
+
```bash
|
61
|
+
gem "active_model_serializers"
|
62
|
+
gem "rack-cors"
|
63
|
+
gem "kaminari"
|
64
|
+
gem "api-pagination"
|
65
|
+
# As of Nov 28, 2016: waiting for my PR to be merged
|
66
|
+
# https://github.com/nsarno/knock/pull/126
|
67
|
+
gem 'knock', git: 'https://github.com/adonespitogo/knock'
|
68
|
+
|
69
|
+
```
|
70
|
+
|
71
|
+
Install the newly added dependencies
|
72
|
+
|
73
|
+
**Note:** You might want to review your Gemfile first
|
74
|
+
```
|
75
|
+
$ bundle install
|
76
|
+
```
|
46
77
|
|
47
78
|
Run local rails server
|
48
79
|
```
|
data/angular/angular-cli.json
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
"apps": [
|
7
7
|
{
|
8
8
|
"root": "src",
|
9
|
-
"outDir": "
|
9
|
+
"outDir": "../public/unsakini/app/",
|
10
10
|
"assets": [
|
11
11
|
"assets",
|
12
12
|
"favicon.ico"
|
@@ -18,13 +18,15 @@
|
|
18
18
|
"prefix": "app",
|
19
19
|
"mobile": false,
|
20
20
|
"styles": [
|
21
|
-
"
|
21
|
+
"../node_modules/bootstrap/dist/css/bootstrap.css",
|
22
|
+
"assets/global.scss"
|
22
23
|
],
|
23
24
|
"scripts": [],
|
24
25
|
"environments": {
|
25
26
|
"source": "environments/environment.ts",
|
26
27
|
"dev": "environments/environment.ts",
|
27
|
-
"prod": "environments/environment.prod.ts"
|
28
|
+
"prod": "environments/environment.prod.ts",
|
29
|
+
"custom": "environments/custom.ts"
|
28
30
|
}
|
29
31
|
}
|
30
32
|
],
|
@@ -0,0 +1,54 @@
|
|
1
|
+
0 info it worked if it ends with ok
|
2
|
+
1 verbose cli [ '/usr/bin/node',
|
3
|
+
1 verbose cli '/usr/bin/npm',
|
4
|
+
1 verbose cli 'run',
|
5
|
+
1 verbose cli 'e2e',
|
6
|
+
1 verbose cli '--',
|
7
|
+
1 verbose cli './protractor.conf.js' ]
|
8
|
+
2 info using npm@4.0.2
|
9
|
+
3 info using node@v6.9.1
|
10
|
+
4 verbose run-script [ 'pree2e', 'e2e', 'poste2e' ]
|
11
|
+
5 info lifecycle angular@0.0.0~pree2e: angular@0.0.0
|
12
|
+
6 verbose lifecycle angular@0.0.0~pree2e: unsafe-perm in lifecycle true
|
13
|
+
7 verbose lifecycle angular@0.0.0~pree2e: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/home/adones/Projects/UNSAKINI/unsakini/angular/node_modules/.bin:/home/adones/.rbenv/shims:/usr/local/bin:/usr/local/sbin:/usr/bin:/home/adones/.config/composer/vendor/bin
|
14
|
+
8 verbose lifecycle angular@0.0.0~pree2e: CWD: /home/adones/Projects/UNSAKINI/unsakini/angular
|
15
|
+
9 silly lifecycle angular@0.0.0~pree2e: Args: [ '-c', 'webdriver-manager update' ]
|
16
|
+
10 silly lifecycle angular@0.0.0~pree2e: Returned: code: 0 signal: null
|
17
|
+
11 info lifecycle angular@0.0.0~e2e: angular@0.0.0
|
18
|
+
12 verbose lifecycle angular@0.0.0~e2e: unsafe-perm in lifecycle true
|
19
|
+
13 verbose lifecycle angular@0.0.0~e2e: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/home/adones/Projects/UNSAKINI/unsakini/angular/node_modules/.bin:/home/adones/.rbenv/shims:/usr/local/bin:/usr/local/sbin:/usr/bin:/home/adones/.config/composer/vendor/bin
|
20
|
+
14 verbose lifecycle angular@0.0.0~e2e: CWD: /home/adones/Projects/UNSAKINI/unsakini/angular
|
21
|
+
15 silly lifecycle angular@0.0.0~e2e: Args: [ '-c', 'protractor "./protractor.conf.js"' ]
|
22
|
+
16 silly lifecycle angular@0.0.0~e2e: Returned: code: 1 signal: null
|
23
|
+
17 info lifecycle angular@0.0.0~e2e: Failed to exec e2e script
|
24
|
+
18 verbose stack Error: angular@0.0.0 e2e: `protractor "./protractor.conf.js"`
|
25
|
+
18 verbose stack Exit status 1
|
26
|
+
18 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
|
27
|
+
18 verbose stack at emitTwo (events.js:106:13)
|
28
|
+
18 verbose stack at EventEmitter.emit (events.js:191:7)
|
29
|
+
18 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:40:14)
|
30
|
+
18 verbose stack at emitTwo (events.js:106:13)
|
31
|
+
18 verbose stack at ChildProcess.emit (events.js:191:7)
|
32
|
+
18 verbose stack at maybeClose (internal/child_process.js:877:16)
|
33
|
+
18 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
|
34
|
+
19 verbose pkgid angular@0.0.0
|
35
|
+
20 verbose cwd /home/adones/Projects/UNSAKINI/unsakini/angular
|
36
|
+
21 error Linux 4.8.8-2-ARCH
|
37
|
+
22 error argv "/usr/bin/node" "/usr/bin/npm" "run" "e2e" "--" "./protractor.conf.js"
|
38
|
+
23 error node v6.9.1
|
39
|
+
24 error npm v4.0.2
|
40
|
+
25 error code ELIFECYCLE
|
41
|
+
26 error angular@0.0.0 e2e: `protractor "./protractor.conf.js"`
|
42
|
+
26 error Exit status 1
|
43
|
+
27 error Failed at the angular@0.0.0 e2e script 'protractor "./protractor.conf.js"'.
|
44
|
+
27 error Make sure you have the latest version of node.js and npm installed.
|
45
|
+
27 error If you do, this is most likely a problem with the angular package,
|
46
|
+
27 error not with npm itself.
|
47
|
+
27 error Tell the author that this fails on your system:
|
48
|
+
27 error protractor "./protractor.conf.js"
|
49
|
+
27 error You can get information on how to open an issue for this project with:
|
50
|
+
27 error npm bugs angular
|
51
|
+
27 error Or if that isn't available, you can get their info via:
|
52
|
+
27 error npm owner ls angular
|
53
|
+
27 error There is likely additional logging output above.
|
54
|
+
28 verbose exit [ 1, true ]
|
data/angular/package.json
CHANGED
@@ -21,8 +21,11 @@
|
|
21
21
|
"@angular/platform-browser": "^2.1.0",
|
22
22
|
"@angular/platform-browser-dynamic": "^2.1.0",
|
23
23
|
"@angular/router": "^3.1.0",
|
24
|
-
"angular2-
|
24
|
+
"angular2-jwt": "^0.1.25",
|
25
|
+
"bootstrap": "^3.3.7",
|
26
|
+
"bootstrap-sass": "^3.3.7",
|
25
27
|
"core-js": "^2.4.1",
|
28
|
+
"ng2-bootstrap": "^1.1.16",
|
26
29
|
"rxjs": "5.0.0-beta.12",
|
27
30
|
"ts-helpers": "^1.1.1",
|
28
31
|
"zone.js": "^0.6.23"
|
@@ -2,27 +2,28 @@ import { BrowserModule } from '@angular/platform-browser';
|
|
2
2
|
import { NgModule } from '@angular/core';
|
3
3
|
import { FormsModule } from '@angular/forms';
|
4
4
|
import { HttpModule } from '@angular/http';
|
5
|
-
import { Angular2TokenService, A2tUiModule } from 'angular2-token';
|
6
5
|
|
7
6
|
import { AppRoutesModule } from './app.routes.module';
|
8
|
-
|
9
7
|
import { AppComponent } from './app.component';
|
10
|
-
import {
|
8
|
+
import { RegistrationModule } from './registration/'
|
9
|
+
import { LoginModule } from './login'
|
10
|
+
import { ConfirmAccountModule } from './confirm-account'
|
11
11
|
|
12
12
|
@NgModule({
|
13
13
|
imports: [
|
14
14
|
BrowserModule,
|
15
15
|
FormsModule,
|
16
16
|
HttpModule,
|
17
|
+
|
17
18
|
AppRoutesModule,
|
18
|
-
|
19
|
+
RegistrationModule,
|
20
|
+
ConfirmAccountModule,
|
21
|
+
LoginModule,
|
19
22
|
],
|
20
23
|
declarations: [
|
21
|
-
AppComponent
|
22
|
-
RegistrationComponent
|
24
|
+
AppComponent
|
23
25
|
],
|
24
26
|
providers: [
|
25
|
-
Angular2TokenService,
|
26
27
|
],
|
27
28
|
bootstrap: [AppComponent]
|
28
29
|
})
|
@@ -2,17 +2,27 @@ import { NgModule } from '@angular/core';
|
|
2
2
|
import { RouterModule } from '@angular/router';
|
3
3
|
|
4
4
|
import { RegistrationComponent } from './registration/registration.component'
|
5
|
+
import { LoginComponent } from './login/login.component'
|
6
|
+
import { ConfirmAccountComponent } from './confirm-account/confirm-account.component'
|
5
7
|
|
6
8
|
|
7
9
|
const routes = [
|
8
10
|
{
|
9
11
|
path: '',
|
10
|
-
redirectTo: '
|
12
|
+
redirectTo: 'login',
|
11
13
|
pathMatch: 'full'
|
12
14
|
},
|
13
15
|
{
|
14
|
-
path: '
|
16
|
+
path: 'signup',
|
15
17
|
component: RegistrationComponent
|
18
|
+
},
|
19
|
+
{
|
20
|
+
path: 'login',
|
21
|
+
component: LoginComponent
|
22
|
+
},
|
23
|
+
{
|
24
|
+
path: 'account/confirm/:token',
|
25
|
+
component: ConfirmAccountComponent
|
16
26
|
}
|
17
27
|
];
|
18
28
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import {Component} from '@angular/core';
|
2
|
+
import {Router, Params, ActivatedRoute} from '@angular/router';
|
3
|
+
import {ConfirmAccountService} from './confirm-account.service';
|
4
|
+
import 'rxjs/add/operator/catch';
|
5
|
+
|
6
|
+
@Component({
|
7
|
+
templateUrl: './confirm-account.html',
|
8
|
+
styleUrls: ['./confirm-account.scss']
|
9
|
+
})
|
10
|
+
|
11
|
+
export class ConfirmAccountComponent {
|
12
|
+
confirming = true;
|
13
|
+
confirmed: boolean;
|
14
|
+
constructor(
|
15
|
+
private confirmAccountService: ConfirmAccountService,
|
16
|
+
private router: Router,
|
17
|
+
private route: ActivatedRoute
|
18
|
+
) {
|
19
|
+
this.route.params.forEach((params: Params) => {
|
20
|
+
let token = params['token'];
|
21
|
+
confirmAccountService.confirm(token).subscribe((json) => {
|
22
|
+
this.confirming = false;
|
23
|
+
this.confirmed = json.confirmed;
|
24
|
+
});
|
25
|
+
});
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<div class="container">
|
2
|
+
<div class="row">
|
3
|
+
<div class="col-md-4 col-md-offset-4">
|
4
|
+
<h1 class="text-center">
|
5
|
+
<a href="/">
|
6
|
+
<img src="/images/unsakini.svg" width="300px" height="130px">
|
7
|
+
</a>
|
8
|
+
</h1>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
<div class="jumbotron" *ngIf="confirming">
|
12
|
+
<h1>
|
13
|
+
Confirming your account. Please wait...
|
14
|
+
</h1>
|
15
|
+
</div>
|
16
|
+
<div class="jumbotron" *ngIf="confirmed && !confirming">
|
17
|
+
<div>
|
18
|
+
<h1>Success!</h1>
|
19
|
+
<hr>
|
20
|
+
<h3>Account activation succedded.</h3>
|
21
|
+
<p>
|
22
|
+
You can now sign in to the <a [routerLink]="['/login']">dashboard</a>.
|
23
|
+
</p>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
<div class="jumbotron" *ngIf="!confirmed && !confirming">
|
27
|
+
<div>
|
28
|
+
<h1>Ouch!</h1>
|
29
|
+
<hr>
|
30
|
+
<h3>
|
31
|
+
Account confirmation failed.
|
32
|
+
</h3>
|
33
|
+
<p>
|
34
|
+
That token is already expired or non-existent.
|
35
|
+
</p>
|
36
|
+
<p>
|
37
|
+
No account yet? <a [routerLink]="['/signup']"><b>Sign up</b></a>.
|
38
|
+
</p>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
</div>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import {NgModule} from '@angular/core';
|
2
|
+
import {RouterModule} from '@angular/router';
|
3
|
+
import {HttpModule} from '@angular/http';
|
4
|
+
import {CommonModule} from '@angular/common';
|
5
|
+
import {ServicesModule} from '../services';
|
6
|
+
import {ConfirmAccountComponent} from './confirm-account.component';
|
7
|
+
import {ConfirmAccountService} from './confirm-account.service';
|
8
|
+
|
9
|
+
@NgModule({
|
10
|
+
imports: [
|
11
|
+
HttpModule,
|
12
|
+
RouterModule,
|
13
|
+
CommonModule,
|
14
|
+
ServicesModule,
|
15
|
+
],
|
16
|
+
declarations: [
|
17
|
+
ConfirmAccountComponent
|
18
|
+
],
|
19
|
+
providers: [
|
20
|
+
ConfirmAccountService
|
21
|
+
]
|
22
|
+
})
|
23
|
+
|
24
|
+
export class ConfirmAccountModule {}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import {Injectable} from '@angular/core';
|
2
|
+
import {Observable} from 'rxjs/Observable';
|
3
|
+
import 'rxjs/add/operator/map';
|
4
|
+
import 'rxjs/add/operator/catch';
|
5
|
+
import {HttpService} from '../services';
|
6
|
+
|
7
|
+
@Injectable()
|
8
|
+
|
9
|
+
export class ConfirmAccountService {
|
10
|
+
constructor(private http: HttpService) { }
|
11
|
+
|
12
|
+
confirm (token: string): Observable<any> {
|
13
|
+
return this.http.get(`/user/confirm/${token}`).map((res) => {
|
14
|
+
console.log(res)
|
15
|
+
if (res.ok) {
|
16
|
+
return {confirmed: true}
|
17
|
+
} else {
|
18
|
+
return {confirmed: false}
|
19
|
+
}
|
20
|
+
}).catch(this.catchError);
|
21
|
+
}
|
22
|
+
|
23
|
+
private catchError(res) {
|
24
|
+
return Observable.of({confirmed: false});
|
25
|
+
}
|
26
|
+
|
27
|
+
}
|
data/angular/src/app/index.ts
CHANGED
@@ -0,0 +1,40 @@
|
|
1
|
+
|
2
|
+
import {Component} from '@angular/core';
|
3
|
+
import {Router} from '@angular/router';
|
4
|
+
import {ICredentials, LoginService} from './login.service';
|
5
|
+
|
6
|
+
|
7
|
+
@Component({
|
8
|
+
templateUrl: './login.html'
|
9
|
+
})
|
10
|
+
export class LoginComponent {
|
11
|
+
|
12
|
+
creds: ICredentials;
|
13
|
+
error: string;
|
14
|
+
success: string;
|
15
|
+
|
16
|
+
constructor(
|
17
|
+
private loginService: LoginService,
|
18
|
+
private router: Router
|
19
|
+
) {
|
20
|
+
this.creds = {email: '', password: ''};
|
21
|
+
}
|
22
|
+
|
23
|
+
doLogin (e) {
|
24
|
+
e.stopPropagation();
|
25
|
+
this.error = null;
|
26
|
+
this.loginService.login(this.creds)
|
27
|
+
.subscribe(
|
28
|
+
(json) => {
|
29
|
+
this.success = 'Login successful. Redirecting...';
|
30
|
+
window.localStorage.setItem('auth_token', json.token);
|
31
|
+
// this.router.navigate(['/dashboard']);
|
32
|
+
// window.location.assign('/dashboard');
|
33
|
+
},
|
34
|
+
(e) => {
|
35
|
+
this.error = e;
|
36
|
+
}
|
37
|
+
);
|
38
|
+
return false;
|
39
|
+
}
|
40
|
+
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<div class="container home-forms">
|
2
|
+
<div class="row">
|
3
|
+
<div class="col-md-4 col-md-offset-4">
|
4
|
+
<h1 class="text-center">
|
5
|
+
<a href="/">
|
6
|
+
<img src="/images/unsakini.svg" width="300px" height="130px">
|
7
|
+
</a>
|
8
|
+
</h1>
|
9
|
+
<hr>
|
10
|
+
<p class="lead text-center">
|
11
|
+
Sign In
|
12
|
+
</p>
|
13
|
+
<form #loginForm="ngForm">
|
14
|
+
<div *ngIf="error" class="alert alert-danger">
|
15
|
+
{{error}}
|
16
|
+
</div>
|
17
|
+
<div class="form-group">
|
18
|
+
<label for="email">Email</label>
|
19
|
+
<input type="email" class="form-control" id="email" placeholder="Email" required [(ngModel)]="creds.email" name="email" #email="ngModel">
|
20
|
+
</div>
|
21
|
+
<div [hidden]="email.valid || email.pristine" class="alert alert-danger">
|
22
|
+
Email is required
|
23
|
+
</div>
|
24
|
+
<label for="password">Password</label>
|
25
|
+
<input type="password" class="form-control" id="password" placeholder="Password" required [(ngModel)]="creds.password" name="password" #password="ngModel">
|
26
|
+
<div [hidden]="password.valid || password.pristine" class="alert alert-danger">
|
27
|
+
Password is required
|
28
|
+
</div>
|
29
|
+
<div class="form-group" style="margin-top: 20px;">
|
30
|
+
<button (click)="doLogin($event)" type="submit" class="btn btn-primary" [disabled]="!loginForm.form.valid || submitting">
|
31
|
+
<span *ngIf="!submitting">Sign In</span>
|
32
|
+
<span *ngIf="submitting">Signing in...</span>
|
33
|
+
</button>
|
34
|
+
</div>
|
35
|
+
</form>
|
36
|
+
<hr>
|
37
|
+
<p>
|
38
|
+
Don't have an account? <a [routerLink]="['/signup']">Create Account</a>
|
39
|
+
</p>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
</div>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { NgModule } from '@angular/core';
|
2
|
+
import { RouterModule } from '@angular/router';
|
3
|
+
import { BrowserModule } from '@angular/platform-browser';
|
4
|
+
import { HttpModule } from '@angular/http';
|
5
|
+
import { FormsModule } from '@angular/forms';
|
6
|
+
import { ServicesModule } from '../services'
|
7
|
+
|
8
|
+
import {LoginComponent} from './login.component';
|
9
|
+
import {LoginService} from './login.service';
|
10
|
+
|
11
|
+
@NgModule({
|
12
|
+
imports: [
|
13
|
+
BrowserModule,
|
14
|
+
HttpModule,
|
15
|
+
FormsModule,
|
16
|
+
RouterModule,
|
17
|
+
ServicesModule,
|
18
|
+
],
|
19
|
+
declarations: [
|
20
|
+
LoginComponent,
|
21
|
+
],
|
22
|
+
providers: [
|
23
|
+
LoginService
|
24
|
+
]
|
25
|
+
})
|
26
|
+
|
27
|
+
export class LoginModule {}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import {Injectable} from '@angular/core';
|
2
|
+
import {Response} from '@angular/http';
|
3
|
+
import { HttpService } from '../services/http';
|
4
|
+
import {Observable} from 'rxjs/Observable';
|
5
|
+
import 'rxjs/add/operator/map';
|
6
|
+
import 'rxjs/add/operator/catch';
|
7
|
+
|
8
|
+
export interface ICredentials {
|
9
|
+
email: string;
|
10
|
+
password: string;
|
11
|
+
}
|
12
|
+
|
13
|
+
export interface IAuthUser {
|
14
|
+
id: number;
|
15
|
+
name: string;
|
16
|
+
email: string;
|
17
|
+
}
|
18
|
+
|
19
|
+
@Injectable()
|
20
|
+
export class LoginService {
|
21
|
+
|
22
|
+
constructor (
|
23
|
+
private http: HttpService
|
24
|
+
) {}
|
25
|
+
|
26
|
+
login (creds: ICredentials) {
|
27
|
+
return this.http.post('/user_token', {auth: creds}).map(
|
28
|
+
(res) => {
|
29
|
+
return res.json();
|
30
|
+
}
|
31
|
+
)
|
32
|
+
.catch(this.loginFailedHandler(this));
|
33
|
+
}
|
34
|
+
|
35
|
+
private loginFailedHandler (self: LoginService) {
|
36
|
+
return (res: Response) => {
|
37
|
+
let error_message = res.toString();
|
38
|
+
|
39
|
+
if (res.status === 404 && res.text.length === 0)
|
40
|
+
error_message = `Invalid email and password combination.`
|
41
|
+
if (res.status === 401)
|
42
|
+
error_message = res.json().message;
|
43
|
+
|
44
|
+
return Observable.throw(error_message);
|
45
|
+
|
46
|
+
};
|
47
|
+
}
|
48
|
+
}
|
@@ -1,14 +1,72 @@
|
|
1
|
-
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
<div class="container home-forms">
|
2
|
+
<div class="row">
|
3
|
+
<div class="col-md-4 col-md-offset-4">
|
4
|
+
<h1 class="text-center">
|
5
|
+
<a href="/">
|
6
|
+
<img src="/images/unsakini.svg" width="300px" height="130px">
|
7
|
+
</a>
|
8
|
+
</h1>
|
9
|
+
<hr>
|
10
|
+
<p class="lead text-center">
|
11
|
+
Create Account
|
12
|
+
</p>
|
13
|
+
<form #regForm="ngForm" (ngSubmit)="doSubmit($event); false">
|
14
|
+
<div *ngIf="success" class="alert alert-success">
|
15
|
+
<p>Success! A confirmation link has been sent to {{user.email}}.</p>
|
16
|
+
</div>
|
17
|
+
<div class="form-group" [ngClass]="(email.invalid && !email.pristine) || errors.email.length > 0 ? 'has-error' : ''">
|
18
|
+
<label for="email">Email</label>
|
19
|
+
<input type="email" class="form-control" id="email" placeholder="Email" required [(ngModel)]="user.email" name="email" #email="ngModel">
|
20
|
+
<span class="help-block" *ngFor="let e of errors.email">
|
21
|
+
Email {{e}}
|
22
|
+
</span>
|
23
|
+
<span [hidden]="email.valid || email.pristine" class=" help-block">
|
24
|
+
Email is required
|
25
|
+
</span>
|
26
|
+
</div>
|
27
|
+
<div class="form-group" [ngClass]="(name.invalid && !name.pristine) || errors.name.length > 0 ? 'has-error' : ''">
|
28
|
+
<label for="name">name</label>
|
29
|
+
<input type="text" class="form-control" id="name" placeholder="name" required [(ngModel)]="user.name" name="name" #name="ngModel">
|
30
|
+
<span [hidden]="name.valid || name.pristine" class=" help-block">
|
31
|
+
<span class="text-danger">Name is required</span>
|
32
|
+
</span>
|
33
|
+
<span class="help-block" *ngFor="let e of errors.name">
|
34
|
+
Password {{e}}
|
35
|
+
</span>
|
36
|
+
</div>
|
37
|
+
<div class="form-group" [ngClass]="(password.invalid && !password.pristine) || errors.password.length > 0 ? 'has-error' : ''">
|
38
|
+
<label for="password">Password</label>
|
39
|
+
<input type="password" class="form-control" id="password" placeholder="Password" required [(ngModel)]="user.password" name="password" #password="ngModel">
|
40
|
+
<span [hidden]="password.valid || password.pristine" class="help-block">
|
41
|
+
Password is required
|
42
|
+
</span>
|
43
|
+
<span class="help-block" *ngFor="let e of errors.password">
|
44
|
+
Password {{e}}
|
45
|
+
</span>
|
46
|
+
</div>
|
47
|
+
<div class="form-group" [ngClass]="(password_confirmation.invalid && !password_confirmation.pristine) || errors.password_confirmation.length > 0 ? 'has-error' : ''">
|
48
|
+
<label for="password">Confirm Password</label>
|
49
|
+
<input type="password" class="form-control" id="password_confirmation" placeholder="Confirm Password" required [(ngModel)]="user.password_confirmation" name="password_confirmation" #password_confirmation="ngModel">
|
50
|
+
<span [hidden]="password_confirmation.valid || password_confirmation.pristine" class="help-block">
|
51
|
+
Password confirmation is required
|
52
|
+
</span>
|
53
|
+
<span class="help-block" *ngFor="let e of errors.password_confirmation">
|
54
|
+
Password Confirmation {{e}}
|
55
|
+
</span>
|
56
|
+
</div>
|
57
|
+
<div class="form-group" style="margin-top: 20px;">
|
58
|
+
<button type="submit" class="btn btn-primary" [disabled]="!regForm.form.valid || submitting">
|
59
|
+
<span *ngIf="!submitting">Create Account</span>
|
60
|
+
<span *ngIf="submitting">Submitting...</span>
|
61
|
+
</button>
|
62
|
+
</div>
|
63
|
+
</form>
|
64
|
+
<hr>
|
65
|
+
<p>
|
66
|
+
Already have an account? <a [routerLink]="['/login']">Login</a>
|
67
|
+
</p>
|
68
|
+
</div>
|
6
69
|
</div>
|
7
|
-
|
8
|
-
|
9
|
-
<input type="password" name="password">
|
10
|
-
<input type="password" name="password_confirmation">
|
11
|
-
<button type="submit">Sign Up</button>
|
12
|
-
</form>
|
70
|
+
</div>
|
71
|
+
|
13
72
|
|
14
|
-
<div (click)="doSubmit()">CLICK ME</div>
|