ソースを参照

login page added, search updated ..will push

rjsmall90 6 年 前
コミット
dd386eed24

+ 3
- 1
src/app/app.component.ts ファイルの表示

@@ -9,6 +9,7 @@ import { ListPage } from '../pages/list/list';
9 9
 import { NewProfilePage } from '../pages/registerUser/registerUser';
10 10
 import { TeacherRegistrationPage } from '../pages/registerTeacher/registerTeacher';
11 11
 import { SearchPage } from '../pages/search/search';
12
+import { LoginPage } from '../pages/login/login';
12 13
 
13 14
 
14 15
 
@@ -27,7 +28,8 @@ export class MyApp {
27 28
 
28 29
     // used for an example of ngFor and navigation
29 30
     this.pages = [
30
-      { title: 'Home', component: HomePage },
31
+      { title: 'Login', component: LoginPage },
32
+      { title: 'Profile', component: HomePage },
31 33
       { title: 'List', component: ListPage },
32 34
       { title: 'Register User', component: NewProfilePage },
33 35
       { title: 'Register Teacher', component: TeacherRegistrationPage }, 

+ 4
- 1
src/app/app.module.ts ファイルの表示

@@ -10,6 +10,7 @@ import { NewProfilePage } from '../pages/registerUser/registerUser';
10 10
 import { TeacherRegistrationPage } from '../pages/registerTeacher/registerTeacher';
11 11
 import { SearchPage } from '../pages/search/search';
12 12
 import { SchoolPage } from '../pages/schools/schools';
13
+import { LoginPage } from '../pages/login/login';
13 14
 
14 15
 
15 16
 import { StatusBar } from '@ionic-native/status-bar';
@@ -26,6 +27,7 @@ import { DistrictProvider } from '../providers/connection/district';
26 27
     TeacherRegistrationPage,
27 28
     SearchPage,
28 29
     SchoolPage,
30
+    LoginPage,
29 31
   ],
30 32
   imports: [
31 33
     BrowserModule,
@@ -40,7 +42,8 @@ import { DistrictProvider } from '../providers/connection/district';
40 42
     NewProfilePage,
41 43
     TeacherRegistrationPage,
42 44
     SearchPage,
43
-    SchoolPage, 
45
+    SchoolPage,
46
+    LoginPage, 
44 47
   ],
45 48
   providers: [
46 49
     StatusBar,

+ 1
- 1
src/app/component/school.ts ファイルの表示

@@ -1,7 +1,7 @@
1 1
 export class School {
2 2
 
3 3
 
4
-    constructor(public name: string) {
4
+    constructor(public name?: string) {
5 5
 
6 6
     }
7 7
 }

+ 1
- 0
src/app/component/user.ts ファイルの表示

@@ -5,4 +5,5 @@ export class User {
5 5
     displayName: string; 
6 6
     email: string;
7 7
     password: string; 
8
+    verifyPassword: string;
8 9
 }

+ 3
- 1
src/index.html ファイルの表示

@@ -45,5 +45,7 @@
45 45
   <!-- The main bundle js is generated during the build process -->
46 46
   <script src="build/main.js"></script>
47 47
 
48
-</body>
48
+  <script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBjUqkq3Y327lB9evByUsXROPj03Y2JDbg"></script>
49
+  
50
+  </body>
49 51
 </html>

+ 49
- 0
src/pages/login/login.html ファイルの表示

@@ -0,0 +1,49 @@
1
+<ion-header>
2
+  <ion-navbar>
3
+    <button ion-button menuToggle>
4
+      <ion-icon name="menu"></ion-icon>
5
+    </button>
6
+    <ion-title>
7
+      Login
8
+    </ion-title>
9
+  </ion-navbar>
10
+</ion-header>
11
+<ion-content padding style="background:url(assets/imgs/final_spitball.jpg) no-repeat center;background-size:cover;" id="page7">
12
+  <form id="login-form1">
13
+    <ion-list id="login-list1">
14
+      <ion-item id="login-input1">
15
+        <ion-label>
16
+          Email or Display Name
17
+        </ion-label>
18
+        <ion-input type="email" placeholder=""></ion-input>
19
+      </ion-item>
20
+      <ion-item id="login-input2">
21
+        <ion-label>
22
+          Password
23
+        </ion-label>
24
+        <ion-input type="password" placeholder=""></ion-input>
25
+      </ion-item>
26
+    </ion-list>
27
+    <div class="spacer" style="height:20px;" id="login-spacer1"></div>
28
+    <button id="login-button1" ion-button color="calm" block on-click="goToUserProfile()">
29
+      Log in
30
+    </button>
31
+  </form>
32
+  <button id="login-button11" ion-button color="positive" small icon-left>
33
+    <ion-icon name="linkedin"></ion-icon>
34
+    LinkedIn Login
35
+  </button>
36
+  <button id="login-button14" ion-button clear color="light" small style="color:#FFFFFF;">
37
+               
38
+  </button>
39
+  <button id="login-button12" ion-button color="energized" small>
40
+    <ion-icon name="googleplus"></ion-icon>
41
+    Google + Login
42
+  </button>
43
+  <button id="login-button2" ion-button color="assertive" full small on-click="goToNewProfile()">
44
+    Create A New Profile!
45
+  </button>
46
+  <button id="login-button5" ion-button color="balanced" full small on-click="goToTeacherRegistration()">
47
+    Register As An Educator!
48
+  </button>
49
+</ion-content>

+ 3
- 0
src/pages/login/login.scss ファイルの表示

@@ -0,0 +1,3 @@
1
+page-login {
2
+
3
+}

+ 18
- 0
src/pages/login/login.ts ファイルの表示

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

+ 2
- 2
src/pages/registerTeacher/registerTeacher.html ファイルの表示

@@ -56,13 +56,13 @@
56 56
       <ion-label>
57 57
         Password
58 58
       </ion-label>
59
-      <ion-input type="text" placeholder="" [(ngModel)]="user.password" name="password"></ion-input>
59
+      <ion-input type="password" placeholder="" [(ngModel)]="user.password" name="password"></ion-input>
60 60
     </ion-item>
61 61
     <ion-item id="teacherRegistration-input14">
62 62
       <ion-label>
63 63
         Verify Password
64 64
       </ion-label>
65
-      <ion-input type="text" placeholder=""></ion-input>
65
+      <ion-input type="password" placeholder="" [(ngModel)]="user.verifyPassword" name="verify password"></ion-input>
66 66
     </ion-item>
67 67
     <button id="teacherRegistration-button17" ion-button color="stable" block on-click="register()">
68 68
       Sign up

+ 4
- 4
src/pages/registerUser/registerUser.html ファイルの表示

@@ -45,14 +45,14 @@
45 45
         </ion-item>
46 46
         <ion-item id="newProfile-input6">
47 47
           <ion-label>
48
-            Display Name (optional)
48
+            Display Name
49 49
           </ion-label>
50
-          <ion-input type="text" placeholder="" [(ngModel)]="user.displayName" name="displayName"></ion-input>
50
+          <ion-input type="text" placeholder="optional" [(ngModel)]="user.displayName" name="displayName" required minlength="5" maxlength="8"></ion-input>
51 51
         </ion-item>
52 52
         <div class="spacer" style="width:299.531px;height:12.9688px;" id="newProfile-spacer5"></div>
53 53
         <div id="newProfile-markdown17" class="show-list-numbers-and-dots">
54 54
           <p style="color:#FF0303;font-size:-1px;">
55
-            If under the age of 13, tell yo momma, or your daddy ...if he&#39;s still there ...mines wasn&#39;t T^T
55
+            If under the age of 13, tell yo momma, or yo daddy ...if he&#39;s still there ...mines wasn&#39;t T^T
56 56
           </p>
57 57
         </div>
58 58
       </form>
@@ -67,7 +67,7 @@
67 67
       <ion-label>
68 68
         Verify Password
69 69
       </ion-label>
70
-      <ion-input type="password" placeholder="" [(ngModel)]="user.password" name="password">></ion-input>
70
+      <ion-input type="password" placeholder="" [(ngModel)]="user.verifyPassword" name="verify password"></ion-input>
71 71
     </ion-item>
72 72
     <div class="spacer" style="width:299.514px;height:55.9757px;" id="newProfile-spacer4"></div>
73 73
     <button id="newProfile-button9" ion-button color="balanced" full on-click="register()">

+ 4
- 3
src/pages/schools/schools.html ファイルの表示

@@ -13,11 +13,12 @@
13 13
   {{school.name}}
14 14
   </h1>
15 15
       <ion-item color="none" id="teacherSelectPage-list-item52">
16
-      <ion-thumbnail item-left>
17
-  
18
-      </ion-thumbnail>
19 16
       <h2>
20 17
         School Aggregate Score
21 18
       </h2>
22 19
     </ion-item>
20
+    <div #mapsId id="mapsId">
21
+ASASAS
22
+    </div>
23
+
23 24
 </ion-content>

+ 2
- 0
src/pages/schools/schools.scss ファイルの表示

@@ -0,0 +1,2 @@
1
+page-schools {
2
+}

+ 23
- 3
src/pages/schools/schools.ts ファイルの表示

@@ -1,18 +1,38 @@
1 1
 import { Component } from '@angular/core';
2 2
 import { NavController, NavParams } from 'ionic-angular';
3
-//import { SearchPage } from '../../pages/search/search'
4 3
 
4
+// declare var google;
5 5
 
6 6
 @Component({
7
-  selector: 'page-school-page',
7
+  selector: 'page-schools',
8 8
   templateUrl: 'schools.html'
9 9
 })
10 10
 export class SchoolPage {
11 11
     public school; 
12
+    public gMap;
12 13
 
13
-  constructor(public navCtrl: NavController, public navParams: NavParams) {
14
+    // @ViewChild('mapsId') mapElement: ElementRef;
15
+    // map: any;
14 16
 
17
+  constructor(public navCtrl: NavController, public navParams: NavParams) {
15 18
       this.school = this.navParams.get("school");
16 19
   }
17 20
 
21
+  // ionViewDidLoad () {
22
+  //   this.loadMap();
23
+  // }
24
+
25
+  // loadMap () {
26
+  //     const latLng = new google.maps.LatLng(40.758895,-73.985) 
27
+  //     const mapOptions = {
28
+  //       zoom: 13,
29
+	// 	    center: latLng,
30
+	// 	    mapTypeId: google.maps.MapTypeId.ROADMAP
31
+  //     }
32
+
33
+  //     this.gMap = new google.maps.Map(this.mapElement.nativeElement, mapOptions);
34
+  // }
35
+
36
+
37
+
18 38
 }

+ 2
- 2
src/pages/search/search.html ファイルの表示

@@ -1,8 +1,8 @@
1 1
 <ion-header>
2 2
   <ion-navbar>
3
-    <!-- <button ion-button menuToggle>
3
+    <button ion-button menuToggle>
4 4
       <ion-icon name="menu"></ion-icon>
5
-    </button> -->
5
+    </button>
6 6
     <ion-title>
7 7
       Search Page
8 8
     </ion-title>

+ 11
- 0
src/pages/search/search.ts ファイルの表示

@@ -14,6 +14,7 @@ import { School } from './../../app/component/school'
14 14
 export class SearchPage {
15 15
     listOfSchools: any; 
16 16
     filterSchools: any;
17
+    school: School = new School(); 
17 18
 
18 19
   constructor(public navCtrl: NavController, public conn: ConnectionProvider, public dist: DistrictProvider) {
19 20
   }
@@ -40,7 +41,17 @@ export class SearchPage {
40 41
 
41 42
     }
42 43
     
44
+    postSchool(event: any) {
45
+        this.dist.post("schools/post", this.school).subscribe(
46
+            data => console.log(data)
47
+          );
48
+    }
49
+    
43 50
     goToSchoolPage(school: School){
51
+    
52
+        this.dist.post("schools/post", school).subscribe(
53
+            data => console.log(data)
54
+          )
44 55
     this.navCtrl.push(SchoolPage, {
45 56
         school: school
46 57
     });

+ 2
- 0
src/providers/connection/connection.ts ファイルの表示

@@ -26,4 +26,6 @@ get(partialPath: string, data: any) {
26 26
 
27 27
 
28 28
 
29
+
30
+
29 31
 }

+ 6
- 9
src/providers/connection/district.ts ファイルの表示

@@ -6,6 +6,7 @@ import { School } from './../../app/component/school'
6 6
 export class DistrictProvider {
7 7
 
8 8
     public districtAPI = 'https://data.delaware.gov/api/views/wky5-77bt/rows.json?accessType=DOWNLOAD'
9
+    public apiUrl = 'http://localhost:8080/'; 
9 10
 
10 11
     constructor(public http: HttpClient) {
11 12
             console.log('Hello DistrictProvider Provider');
@@ -13,14 +14,7 @@ export class DistrictProvider {
13 14
     }
14 15
 
15 16
     getAllSchools() {
16
-
17
-        return this.http.get(this.districtAPI) //.map((response: any) => {
18
-            // if (response.data.length > 0) {
19
-            //     return response.data[0].images.original.url;
20
-            // } else {
21
-            //     return console.log('error');
22
-        //     }
23
-        // });
17
+        return this.http.get(this.districtAPI)
24 18
     }
25 19
 
26 20
     parseData(data: any) {
@@ -30,6 +24,9 @@ export class DistrictProvider {
30 24
     onlyUnique(value, index, self) { 
31 25
         return self.indexOf(value) === index;
32 26
     }
33
-
27
+    
28
+    post(partialPath: string, data: any) {
29
+        return this.http.post(this.apiUrl + partialPath, data);
30
+      }
34 31
 
35 32
 }