Pārlūkot izejas kodu

login page added, search updated ..will push

rjsmall90 6 gadus atpakaļ
vecāks
revīzija
dd386eed24

+ 3
- 1
src/app/app.component.ts Parādīt failu

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

+ 4
- 1
src/app/app.module.ts Parādīt failu

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

+ 1
- 1
src/app/component/school.ts Parādīt failu

1
 export class School {
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 Parādīt failu

5
     displayName: string; 
5
     displayName: string; 
6
     email: string;
6
     email: string;
7
     password: string; 
7
     password: string; 
8
+    verifyPassword: string;
8
 }
9
 }

+ 3
- 1
src/index.html Parādīt failu

45
   <!-- The main bundle js is generated during the build process -->
45
   <!-- The main bundle js is generated during the build process -->
46
   <script src="build/main.js"></script>
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
 </html>
51
 </html>

+ 49
- 0
src/pages/login/login.html Parādīt failu

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 Parādīt failu

1
+page-login {
2
+
3
+}

+ 18
- 0
src/pages/login/login.ts Parādīt failu

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 Parādīt failu

56
       <ion-label>
56
       <ion-label>
57
         Password
57
         Password
58
       </ion-label>
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
     </ion-item>
60
     </ion-item>
61
     <ion-item id="teacherRegistration-input14">
61
     <ion-item id="teacherRegistration-input14">
62
       <ion-label>
62
       <ion-label>
63
         Verify Password
63
         Verify Password
64
       </ion-label>
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
     </ion-item>
66
     </ion-item>
67
     <button id="teacherRegistration-button17" ion-button color="stable" block on-click="register()">
67
     <button id="teacherRegistration-button17" ion-button color="stable" block on-click="register()">
68
       Sign up
68
       Sign up

+ 4
- 4
src/pages/registerUser/registerUser.html Parādīt failu

45
         </ion-item>
45
         </ion-item>
46
         <ion-item id="newProfile-input6">
46
         <ion-item id="newProfile-input6">
47
           <ion-label>
47
           <ion-label>
48
-            Display Name (optional)
48
+            Display Name
49
           </ion-label>
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
         </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">
54
           <p style="color:#FF0303;font-size:-1px;">
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
           </p>
56
           </p>
57
         </div>
57
         </div>
58
       </form>
58
       </form>
67
       <ion-label>
67
       <ion-label>
68
         Verify Password
68
         Verify Password
69
       </ion-label>
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
     </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="register()">
73
     <button id="newProfile-button9" ion-button color="balanced" full on-click="register()">

+ 4
- 3
src/pages/schools/schools.html Parādīt failu

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

+ 2
- 0
src/pages/schools/schools.scss Parādīt failu

1
+page-schools {
2
+}

+ 23
- 3
src/pages/schools/schools.ts Parādīt failu

1
 import { Component } from '@angular/core';
1
 import { Component } from '@angular/core';
2
 import { NavController, NavParams } from 'ionic-angular';
2
 import { NavController, NavParams } from 'ionic-angular';
3
-//import { SearchPage } from '../../pages/search/search'
4
 
3
 
4
+// declare var google;
5
 
5
 
6
 @Component({
6
 @Component({
7
-  selector: 'page-school-page',
7
+  selector: 'page-schools',
8
   templateUrl: 'schools.html'
8
   templateUrl: 'schools.html'
9
 })
9
 })
10
 export class SchoolPage {
10
 export class SchoolPage {
11
     public school; 
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
       this.school = this.navParams.get("school");
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 Parādīt failu

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

+ 11
- 0
src/pages/search/search.ts Parādīt failu

14
 export class SearchPage {
14
 export class SearchPage {
15
     listOfSchools: any; 
15
     listOfSchools: any; 
16
     filterSchools: any;
16
     filterSchools: any;
17
+    school: School = new School(); 
17
 
18
 
18
   constructor(public navCtrl: NavController, public conn: ConnectionProvider, public dist: DistrictProvider) {
19
   constructor(public navCtrl: NavController, public conn: ConnectionProvider, public dist: DistrictProvider) {
19
   }
20
   }
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
     goToSchoolPage(school: School){
50
     goToSchoolPage(school: School){
51
+    
52
+        this.dist.post("schools/post", school).subscribe(
53
+            data => console.log(data)
54
+          )
44
     this.navCtrl.push(SchoolPage, {
55
     this.navCtrl.push(SchoolPage, {
45
         school: school
56
         school: school
46
     });
57
     });

+ 2
- 0
src/providers/connection/connection.ts Parādīt failu

26
 
26
 
27
 
27
 
28
 
28
 
29
+
30
+
29
 }
31
 }

+ 6
- 9
src/providers/connection/district.ts Parādīt failu

6
 export class DistrictProvider {
6
 export class DistrictProvider {
7
 
7
 
8
     public districtAPI = 'https://data.delaware.gov/api/views/wky5-77bt/rows.json?accessType=DOWNLOAD'
8
     public districtAPI = 'https://data.delaware.gov/api/views/wky5-77bt/rows.json?accessType=DOWNLOAD'
9
+    public apiUrl = 'http://localhost:8080/'; 
9
 
10
 
10
     constructor(public http: HttpClient) {
11
     constructor(public http: HttpClient) {
11
             console.log('Hello DistrictProvider Provider');
12
             console.log('Hello DistrictProvider Provider');
13
     }
14
     }
14
 
15
 
15
     getAllSchools() {
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
     parseData(data: any) {
20
     parseData(data: any) {
30
     onlyUnique(value, index, self) { 
24
     onlyUnique(value, index, self) { 
31
         return self.indexOf(value) === index;
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
 }