Browse Source

added select buttons on teacher reg page, reg user operational

rjsmall90 6 years ago
parent
commit
c720cef37a

+ 2
- 0
src/app/app.component.ts View File

6
 import { HomePage } from '../pages/home/home';
6
 import { HomePage } from '../pages/home/home';
7
 import { ListPage } from '../pages/list/list';
7
 import { ListPage } from '../pages/list/list';
8
 import { NewProfilePage } from '../pages/registerUser/registerUser';
8
 import { NewProfilePage } from '../pages/registerUser/registerUser';
9
+import {TeacherRegistrationPage } from '../pages/registerTeacher/registerTeacher'
9
 
10
 
10
 
11
 
11
 @Component({
12
 @Component({
26
       { title: 'Home', component: HomePage },
27
       { title: 'Home', component: HomePage },
27
       { title: 'List', component: ListPage },
28
       { title: 'List', component: ListPage },
28
       { title: 'Register User', component: NewProfilePage },
29
       { title: 'Register User', component: NewProfilePage },
30
+      { title: 'Register Teacher', component: TeacherRegistrationPage }, 
29
     ];
31
     ];
30
 
32
 
31
   }
33
   }

+ 11
- 4
src/app/app.module.ts View File

1
 import { BrowserModule } from '@angular/platform-browser';
1
 import { BrowserModule } from '@angular/platform-browser';
2
 import { ErrorHandler, NgModule } from '@angular/core';
2
 import { ErrorHandler, NgModule } from '@angular/core';
3
 import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
3
 import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
4
+import { HttpClientModule } from '@angular/common/http';
4
 
5
 
5
 import { MyApp } from './app.component';
6
 import { MyApp } from './app.component';
6
 import { HomePage } from '../pages/home/home';
7
 import { HomePage } from '../pages/home/home';
7
 import { ListPage } from '../pages/list/list';
8
 import { ListPage } from '../pages/list/list';
8
 import { NewProfilePage } from '../pages/registerUser/registerUser';
9
 import { NewProfilePage } from '../pages/registerUser/registerUser';
10
+import {TeacherRegistrationPage } from '../pages/registerTeacher/registerTeacher'
11
+
9
 
12
 
10
 import { StatusBar } from '@ionic-native/status-bar';
13
 import { StatusBar } from '@ionic-native/status-bar';
11
 import { SplashScreen } from '@ionic-native/splash-screen';
14
 import { SplashScreen } from '@ionic-native/splash-screen';
16
     MyApp,
19
     MyApp,
17
     HomePage,
20
     HomePage,
18
     ListPage,
21
     ListPage,
19
-    NewProfilePage
22
+    NewProfilePage,
23
+    TeacherRegistrationPage
20
   ],
24
   ],
21
   imports: [
25
   imports: [
22
     BrowserModule,
26
     BrowserModule,
23
     IonicModule.forRoot(MyApp),
27
     IonicModule.forRoot(MyApp),
28
+    HttpClientModule
24
   ],
29
   ],
25
   bootstrap: [IonicApp],
30
   bootstrap: [IonicApp],
26
   entryComponents: [
31
   entryComponents: [
27
     MyApp,
32
     MyApp,
28
     HomePage,
33
     HomePage,
29
     ListPage, 
34
     ListPage, 
30
-    NewProfilePage
35
+    NewProfilePage,
36
+    TeacherRegistrationPage
31
   ],
37
   ],
32
   providers: [
38
   providers: [
33
     StatusBar,
39
     StatusBar,
34
     SplashScreen,
40
     SplashScreen,
35
-    {provide: ErrorHandler, useClass: IonicErrorHandler},
36
-    ConnectionProvider
41
+    ConnectionProvider,
42
+    {provide: ErrorHandler, useClass: IonicErrorHandler}
43
+    
37
   ]
44
   ]
38
 })
45
 })
39
 export class AppModule {}
46
 export class AppModule {}

+ 8
- 0
src/app/component/user.ts View File

1
+export class User {
2
+
3
+    firstName: string;
4
+    lastName: string;
5
+    displayName: string; 
6
+    email: string;
7
+    password: string; 
8
+}

+ 4
- 0
src/pages/home/home.ts View File

1
 import { Component } from '@angular/core';
1
 import { Component } from '@angular/core';
2
 import { NavController } from 'ionic-angular';
2
 import { NavController } from 'ionic-angular';
3
 
3
 
4
+//import { ConnectionProvider } from '../../providers/connection/connection;
5
+//import { User } from './../../app/users/user';
6
+
4
 @Component({
7
 @Component({
5
   selector: 'page-home',
8
   selector: 'page-home',
6
   templateUrl: 'home.html'
9
   templateUrl: 'home.html'
11
 
14
 
12
   }
15
   }
13
 
16
 
17
+
14
 }
18
 }

+ 71
- 0
src/pages/registerTeacher/registerTeacher.html View File

1
+<ion-header>
2
+  <ion-navbar>
3
+    <button ion-button menuToggle>
4
+      <ion-icon name="menu"></ion-icon>
5
+    </button>
6
+    <ion-title>
7
+      Teacher Registration
8
+    </ion-title>
9
+  </ion-navbar>
10
+</ion-header>
11
+<ion-content padding id="page13" style="background:url(assets/imgs/final_spitball.jpg) no-repeat center;background-size:cover;">
12
+  <form id="teacherRegistration-form10">
13
+    <ion-list id="teacherRegistration-list25">
14
+      <ion-item id="teacherRegistration-input8">
15
+        <ion-label>
16
+          First Name
17
+        </ion-label>
18
+        <ion-input type="text" placeholder=""></ion-input>
19
+      </ion-item>
20
+      <ion-item id="teacherRegistration-input11">
21
+        <ion-label>
22
+          Last Name
23
+        </ion-label>
24
+        <ion-input type="text" placeholder=""></ion-input>
25
+      </ion-item>
26
+      <ion-item id="teacherRegistration-input9">
27
+        <ion-label>
28
+          Email
29
+        </ion-label>
30
+        <ion-input type="email" placeholder=""></ion-input>
31
+      </ion-item>
32
+       <ion-item id="teacherRegistration-item-select1">
33
+        <ion-label>
34
+          State
35
+        </ion-label>
36
+        <ion-select> 
37
+             <ion-option>DE</ion-option>
38
+          <ion-option>PA</ion-option>
39
+          <ion-option>MD</ion-option>
40
+        </ion-select>
41
+        </ion-item>
42
+      <ion-item id="teacherRegistration-item-select2">
43
+      <ion-label>
44
+          School/School District
45
+      </ion-label>
46
+        <ion-select> 
47
+            <ion-option>Red Clay</ion-option>
48
+            <ion-option>Colonial</ion-option>
49
+            <ion-option>Christiana</ion-option>
50
+        </ion-select>
51
+        <!-- <ion-input type="text" placeholder=""></ion-input> -->
52
+      </ion-item>
53
+    </ion-list>
54
+    <div class="spacer" style="height:100px;" id="teacherRegistration-spacer9"></div>
55
+    <ion-item id="teacherRegistration-input10">
56
+      <ion-label>
57
+        Password
58
+      </ion-label>
59
+      <ion-input type="text" placeholder=""></ion-input>
60
+    </ion-item>
61
+    <ion-item id="teacherRegistration-input14">
62
+      <ion-label>
63
+        Verify Password
64
+      </ion-label>
65
+      <ion-input type="text" placeholder=""></ion-input>
66
+    </ion-item>
67
+    <button id="teacherRegistration-button17" ion-button color="stable" block on-click="goToTeacherProfile()">
68
+      Sign up
69
+    </button>
70
+  </form>
71
+</ion-content>

+ 1
- 0
src/pages/registerTeacher/registerTeacher.scss View File

1
+page-registerTeacher{}

+ 17
- 0
src/pages/registerTeacher/registerTeacher.ts View File

1
+import { Component } from '@angular/core';
2
+import { NavController } from 'ionic-angular';
3
+//import { TeacherProfilePage } from '../teacher-profile/teacher-profile';
4
+
5
+@Component({
6
+  selector: 'page-registerTeacher',
7
+  templateUrl: 'registerTeacher.html'
8
+})
9
+export class TeacherRegistrationPage {
10
+
11
+  constructor(public navCtrl: NavController) {
12
+  }
13
+//   goToTeacherProfile(params){
14
+//     if (!params) params = {};
15
+//     this.navCtrl.push(TeacherProfilePage);
16
+//   }
17
+}

+ 9
- 9
src/pages/registerUser/registerUser.html View File

9
   </ion-navbar>
9
   </ion-navbar>
10
 </ion-header>
10
 </ion-header>
11
 
11
 
12
-<ion-content padding style="background:url(assets/img/tMs0PFvR0QQs5HRllDbw_final_spitball.jpg) no-repeat center;background-size:cover;" id="page11">
12
+<ion-content padding style="background:url(assets/imgs/final_spitball.jpg) no-repeat center;background-size:cover;" id="page11">
13
   <form id="newProfile-form4">
13
   <form id="newProfile-form4">
14
     <ion-list id="newProfile-list17">
14
     <ion-list id="newProfile-list17">
15
       <ion-item id="newProfile-input3">
15
       <ion-item id="newProfile-input3">
16
         <ion-label>
16
         <ion-label>
17
           First Name
17
           First Name
18
         </ion-label>
18
         </ion-label>
19
-        <ion-input type="text" placeholder=""></ion-input>
19
+        <ion-input type="text" placeholder="" [(ngModel)]="user.firstName" name="firstName"></ion-input>
20
       </ion-item>
20
       </ion-item>
21
       <ion-item id="newProfile-input4">
21
       <ion-item id="newProfile-input4">
22
         <ion-label>
22
         <ion-label>
23
           Last Name
23
           Last Name
24
         </ion-label>
24
         </ion-label>
25
-        <ion-input type="text" placeholder=""></ion-input>
25
+        <ion-input type="text" placeholder="" [(ngModel)]="user.lastName" name="lastName"></ion-input>
26
       </ion-item>
26
       </ion-item>
27
       <ion-item id="newProfile-input12">
27
       <ion-item id="newProfile-input12">
28
         <ion-label>
28
         <ion-label>
29
           E-mail
29
           E-mail
30
         </ion-label>
30
         </ion-label>
31
-        <ion-input type="email" placeholder=""></ion-input>
31
+        <ion-input type="email" placeholder=""[(ngModel)]="user.email" name="email"></ion-input>
32
       </ion-item>
32
       </ion-item>
33
       <form id="newProfile-form6">
33
       <form id="newProfile-form6">
34
         <ion-item id="newProfile-toggle4">
34
         <ion-item id="newProfile-toggle4">
43
           </ion-label>
43
           </ion-label>
44
           <ion-toggle color="positive" checked="false"></ion-toggle>
44
           <ion-toggle color="positive" checked="false"></ion-toggle>
45
         </ion-item>
45
         </ion-item>
46
-        <ion-item id="newProfile-radio2">
46
+        <ion-item id="newProfile-input6">
47
           <ion-label>
47
           <ion-label>
48
             Display Name (optional)
48
             Display Name (optional)
49
           </ion-label>
49
           </ion-label>
50
-          <ion-radio></ion-radio>
50
+          <ion-input type="text" placeholder="" [(ngModel)]="user.displayName" name="displayName"></ion-input>
51
         </ion-item>
51
         </ion-item>
52
         <div class="spacer" style="width:299.531px;height:12.9688px;" id="newProfile-spacer5"></div>
52
         <div class="spacer" style="width:299.531px;height:12.9688px;" id="newProfile-spacer5"></div>
53
         <div id="newProfile-markdown17" class="show-list-numbers-and-dots">
53
         <div id="newProfile-markdown17" class="show-list-numbers-and-dots">
60
         <ion-label>
60
         <ion-label>
61
           Password
61
           Password
62
         </ion-label>
62
         </ion-label>
63
-        <ion-input type="text" placeholder=""></ion-input>
63
+        <ion-input type="text" placeholder="" [(ngModel)]="user.password" name="password"></ion-input>
64
       </ion-item>
64
       </ion-item>
65
     </ion-list>
65
     </ion-list>
66
     <ion-item id="newProfile-input13">
66
     <ion-item id="newProfile-input13">
67
       <ion-label>
67
       <ion-label>
68
         Verify Password
68
         Verify Password
69
       </ion-label>
69
       </ion-label>
70
-      <ion-input type="text" placeholder=""></ion-input>
70
+      <ion-input type="text" placeholder="" [(ngModel)]="user.password" name="password">></ion-input>
71
     </ion-item>
71
     </ion-item>
72
     <div class="spacer" style="width:299.514px;height:55.9757px;" id="newProfile-spacer4"></div>
72
     <div class="spacer" style="width:299.514px;height:55.9757px;" id="newProfile-spacer4"></div>
73
-    <button id="newProfile-button9" ion-button color="balanced" full on-click="goToUserProfile()">
73
+    <button id="newProfile-button9" ion-button color="balanced" full on-click="register()">
74
       Get Started!
74
       Get Started!
75
     </button>
75
     </button>
76
   </form>
76
   </form>

+ 13
- 3
src/pages/registerUser/registerUser.ts View File

1
 import { Component } from '@angular/core';
1
 import { Component } from '@angular/core';
2
 import { NavController } from 'ionic-angular';
2
 import { NavController } from 'ionic-angular';
3
-//import { Home } from '../home/home';
4
-//import { UpdateProfilePage } from '../update-profile/update-profile';
3
+import { User } from './../../app/component/user';
4
+import { ConnectionProvider } from './../../providers/connection/connection';
5
 
5
 
6
 @Component({
6
 @Component({
7
   selector: 'page-registerUser',
7
   selector: 'page-registerUser',
9
 })
9
 })
10
 export class NewProfilePage {
10
 export class NewProfilePage {
11
 
11
 
12
-  constructor(public navCtrl: NavController) {
12
+user: User = new User();
13
+
14
+  constructor(public navCtrl: NavController, public conn: ConnectionProvider) {
15
+  }
16
+
17
+  register(){
18
+    this.conn.post('user_profile/register_user', this.user).subscribe(
19
+      data => console.log(data)
20
+    );
13
   }
21
   }
22
+
23
+
14
   // goToUserProfile(params){
24
   // goToUserProfile(params){
15
   //   if (!params) params = {};
25
   //   if (!params) params = {};
16
   //   this.navCtrl.push(Home);
26
   //   this.navCtrl.push(Home);

+ 8
- 0
src/providers/connection/connection.ts View File

9
 */
9
 */
10
 @Injectable()
10
 @Injectable()
11
 export class ConnectionProvider {
11
 export class ConnectionProvider {
12
+public apiUrl = 'http://localhost:8080/';
13
+public user = this.apiUrl + '/user_profile';
12
 
14
 
13
   constructor(public http: HttpClient) {
15
   constructor(public http: HttpClient) {
14
     console.log('Hello ConnectionProvider Provider');
16
     console.log('Hello ConnectionProvider Provider');
15
   }
17
   }
16
 
18
 
19
+post(partialPath: string, data: any) {
20
+  return this.http.post(this.apiUrl + partialPath, data);
21
+}
22
+
23
+
24
+
17
 }
25
 }