Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated faq styles #24

Open
wants to merge 43 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d2f4ecc
Social icons intial commit
jarek-t Sep 22, 2018
ffd98bc
Initial faq styles commit
jarek-t Nov 3, 2018
d764195
FAQ style progress
jarek-t Nov 3, 2018
47d82c1
Added delete button
HarrisonSanders Nov 26, 2018
b3621cf
Started Password reset
HarrisonSanders Nov 26, 2018
00dc73f
more password work
HarrisonSanders Nov 26, 2018
f368bec
more logos
jessicalam Dec 6, 2018
ddb7446
Merge pull request #26 from SpartaHack/improvement/more-logos
yash1337 Dec 6, 2018
f817445
combined other branch with this one
jessicalam Dec 7, 2018
123a443
Merge pull request #27 from SpartaHack/improvement/even-more-logos
HarrisonSanders Dec 7, 2018
2238534
Moved linode down to donation
HarrisonSanders Dec 7, 2018
3d242e0
Fixed sitckermule link and centered stuff
HarrisonSanders Dec 7, 2018
12252db
Added Intrepid systems
HarrisonSanders Dec 7, 2018
0bd8d13
Faqs filtered by display and placement
HarrisonSanders Dec 8, 2018
773c75a
sponsorship logos
jessicalam Dec 8, 2018
79c2c55
Update sponsors.component.html
jessicalam Dec 8, 2018
7618bd1
Merge pull request #31 from SpartaHack/improvement/change-logos
HarrisonSanders Dec 8, 2018
b4b8fd9
Upped warrior sponsor sizing
HarrisonSanders Dec 8, 2018
3fad5fa
Removed Prospectus and Tiers buttons
HarrisonSanders Dec 8, 2018
34661f3
removed stockx
HarrisonSanders Dec 9, 2018
838a5ec
Abstracted reset password logic into own component
HarrisonSanders Dec 9, 2018
5e3a371
Merge pull request #32 from SpartaHack/dev
HarrisonSanders Dec 9, 2018
c1ee16d
Change password and delete account options added to dashboard
HarrisonSanders Dec 16, 2018
9c52da9
Merge pull request #33 from SpartaHack/feature/dashboard_updates
HarrisonSanders Dec 16, 2018
888f6c8
User can edit application
HarrisonSanders Dec 17, 2018
88a8600
routing fix
HarrisonSanders Dec 17, 2018
0163ad4
Merge pull request #34 from SpartaHack/feature/dashboard_updates
HarrisonSanders Dec 17, 2018
6d5e6e1
Added page for actually resetting the password
HarrisonSanders Dec 18, 2018
765ea79
Reset password fix
HarrisonSanders Dec 19, 2018
60fe7b4
Merge branch 'dev' into feature/reset_password
HarrisonSanders Dec 19, 2018
92211c2
Merge pull request #35 from SpartaHack/feature/reset_password
HarrisonSanders Dec 19, 2018
8957da2
Sponsor logo updates
HarrisonSanders Dec 19, 2018
45a43cc
whoops hotfix
HarrisonSanders Dec 19, 2018
4f10cd5
Added admin page with ability to approve/deny applications
HarrisonSanders Dec 19, 2018
1918cfe
Merge pull request #36 from SpartaHack/feature/admin-page
HarrisonSanders Dec 19, 2018
87e43e1
Added decision messages to account dashboard
HarrisonSanders Dec 20, 2018
fd18461
-Dashboard formatting
HarrisonSanders Dec 20, 2018
b50c065
Added kellog and sendgrid, centered some things
HarrisonSanders Dec 20, 2018
9e9d948
Merge branch 'faq-styles' of github.com:SpartaHack/SpartaHack-Website…
jarek-t Dec 23, 2018
9355dbc
Mobile faq height adjustments
jarek-t Dec 23, 2018
440729e
Faq filtering base
jarek-t Dec 24, 2018
a8221ff
Faq filtering completed
jarek-t Dec 24, 2018
d842c89
Faq filtering style tweak
jarek-t Dec 24, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,951 changes: 1,591 additions & 1,360 deletions package-lock.json

Large diffs are not rendered by default.

10,862 changes: 10,862 additions & 0 deletions package-lock_BACKUP_10321.json

Large diffs are not rendered by default.

10,862 changes: 10,862 additions & 0 deletions package-lock_BACKUP_10407.json

Large diffs are not rendered by default.

10,862 changes: 10,862 additions & 0 deletions package-lock_BACKUP_10564.json

Large diffs are not rendered by default.

10,862 changes: 10,862 additions & 0 deletions package-lock_BACKUP_10653.json

Large diffs are not rendered by default.

10,862 changes: 10,862 additions & 0 deletions package-lock_BACKUP_10819.json

Large diffs are not rendered by default.

10,584 changes: 10,584 additions & 0 deletions package-lock_BASE_10321.json

Large diffs are not rendered by default.

10,584 changes: 10,584 additions & 0 deletions package-lock_BASE_10407.json

Large diffs are not rendered by default.

10,584 changes: 10,584 additions & 0 deletions package-lock_BASE_10564.json

Large diffs are not rendered by default.

10,584 changes: 10,584 additions & 0 deletions package-lock_BASE_10653.json

Large diffs are not rendered by default.

10,584 changes: 10,584 additions & 0 deletions package-lock_BASE_10819.json

Large diffs are not rendered by default.

10,621 changes: 10,621 additions & 0 deletions package-lock_LOCAL_10321.json

Large diffs are not rendered by default.

10,621 changes: 10,621 additions & 0 deletions package-lock_LOCAL_10407.json

Large diffs are not rendered by default.

10,621 changes: 10,621 additions & 0 deletions package-lock_LOCAL_10564.json

Large diffs are not rendered by default.

10,621 changes: 10,621 additions & 0 deletions package-lock_LOCAL_10653.json

Large diffs are not rendered by default.

10,621 changes: 10,621 additions & 0 deletions package-lock_LOCAL_10819.json

Large diffs are not rendered by default.

10,823 changes: 10,823 additions & 0 deletions package-lock_REMOTE_10321.json

Large diffs are not rendered by default.

10,823 changes: 10,823 additions & 0 deletions package-lock_REMOTE_10407.json

Large diffs are not rendered by default.

10,823 changes: 10,823 additions & 0 deletions package-lock_REMOTE_10564.json

Large diffs are not rendered by default.

10,823 changes: 10,823 additions & 0 deletions package-lock_REMOTE_10653.json

Large diffs are not rendered by default.

10,823 changes: 10,823 additions & 0 deletions package-lock_REMOTE_10819.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,15 @@
"@angular/router": "^6.0.3",
"angular2-text-mask": "^9.0.0",
"core-js": "^2.5.4",
"ng-multiselect-dropdown": "^0.2.3",
"missing": "0.0.1",
"ngx-perfect-scrollbar": "^6.3.1",
"rxjs": "^6.0.0",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular/compiler-cli": "^6.0.3",
"@angular-devkit/build-angular": "~0.6.6",
"typescript": "~2.7.2",
"@angular/cli": "~6.0.7",
"@angular/cli": "^6.2.3",
"@angular/compiler-cli": "^6.0.3",
"@angular/language-service": "^6.0.3",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
Expand All @@ -46,8 +45,9 @@
"karma-coverage-istanbul-reporter": "~2.0.0",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.3.0",
"protractor": "^5.4.1",
"ts-node": "~5.0.1",
"tslint": "~5.9.1"
"tslint": "~5.9.1",
"typescript": "~2.7.2"
}
}
5 changes: 5 additions & 0 deletions src/app/account/account.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ export class UserInput {
export class Credentials {
email: string = "";
password: string = "";
}

export class PasswordReset {
password: string = "";
password_confirmation: string = "";
}
25 changes: 24 additions & 1 deletion src/app/account/account.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { User } from './../shared/user/user.model';
import { UserInput, Credentials } from './account.model';
import { UserInput, Credentials, PasswordReset } from './account.model';
import { environment } from './../../environments/environment';
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders, HttpErrorResponse } from '@angular/common/http';
Expand Down Expand Up @@ -34,11 +34,34 @@ export class AccountService {
)
}

resetPassword(email: string): Observable<User> {
let emailJSON = {"email": email}

return this.httpClient.post<User>(environment.baseUrl + "/users/request_password_token", emailJSON, httpOptions)
.pipe(
catchError(this.handleError)
)
}

setNewPassword(passwords: PasswordReset, resetToken: string): Observable<User> {
let newHttpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/json',
'X-WWW-RESET-PASSWORD-TOKEN': resetToken
})
};
return this.httpClient.post<User>(environment.baseUrl + "/users/reset_password", passwords, newHttpOptions)
.pipe(
catchError(this.handleError)
)
}

logout() {
//Unset session variables and return to home
window.sessionStorage.removeItem('application id');
window.sessionStorage.removeItem('user id');
window.sessionStorage.removeItem('auth token');
window.sessionStorage.removeItem('admin');

this.router.navigate(['']);
}
Expand Down
1 change: 1 addition & 0 deletions src/app/account/login/login.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ <h3 style="text-align: center;">Login to Spartahack</h3>
</form>
<p class="text-danger mt-3" *ngIf="error != ''" [innerHTML]='error'></p>
<p class="new mt-3">New? Create an account <a (click)="onCreate()">here</a></p>
<p class="new">Forgot your password? Reset it <a (click)="onResetPassword()">here</a></p>
</div>
</div>
</div>
Expand Down
14 changes: 13 additions & 1 deletion src/app/account/login/login.component.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { UserService } from './../../shared/user/user.service';
import { Router } from '@angular/router';
import { AccountService } from './../account.service';
import { Component, OnInit } from '@angular/core';
Expand All @@ -18,6 +19,7 @@ export class LoginComponent implements OnInit {

constructor(
private accountService: AccountService,
private userService: UserService,
private router: Router
) { }

Expand All @@ -27,6 +29,11 @@ export class LoginComponent implements OnInit {
this.router.navigate(['create']);
}

onResetPassword() {
//navigate to reset page
this.router.navigate(['send-reset']);
}

onSubmit() {
this.error = "";

Expand All @@ -39,11 +46,16 @@ export class LoginComponent implements OnInit {
//Required to be passed in every header for restricted access pages
window.sessionStorage.setItem('auth token', String(response.auth_token))

//Set admin status. If they are not an admin on login, they never will be.
if(response.role == "organizer" || response.role == "director") {
window.sessionStorage.setItem('admin', "True");
}

//Navigate Based on application status
if(response.application_id == null)
{
//If not applied, go to apply
this.router.navigate(['apply'])
this.router.navigate(['application'])
}
else
{
Expand Down
33 changes: 33 additions & 0 deletions src/app/account/reset/reset.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<local-header [title]="'Reset'"></local-header>

<div class="row justify-content-center">
<div class="col-sm col-md-8 mt-4">
<h3 style="text-align: center;">Reset Password</h3>
</div>
</div>
<div class="row justify-content-center">
<div class="col-sm col-md-6">
<div class="card">
<div class="card-body">
<h5 *ngIf="!submitted" class="card-title" style="color: black;">Reset your password</h5>
<form #resetForm="ngForm" *ngIf="!submitted">
<div class="form-group">
<label for="password">New Password</label>
<input type="password" class="form-control" id="password" placeholder="strong but memorable" maxlength="30"
required [(ngModel)]="passwords.password" name="password" #password="ngModel">
<small *ngIf="!(password.valid || password.pristine)" class="form-text text-danger">Password is Required</small>
</div>
<div class="form-group">
<label for="password_confirmation">Confirm Password</label>
<input type="password" class="form-control" id="password_confirmation" placeholder="same as above" maxlength="30"
required [(ngModel)]="passwords.password_confirmation" name="password_confirmation" #passwordc="ngModel">
<small *ngIf="!(passwordc.valid || passwordc.pristine)" class="form-text text-danger">Confirmation is Required</small>
</div>
<button [disabled]="!resetForm.valid" (click)="onSubmit()" class="btn btn-primary mr-2">Submit!</button>
</form>
<p class="text-danger mt-3" *ngIf="error != ''" [innerHTML]='error'></p>
<p class="login text-dark mt-3" *ngIf="submitted">Your password has been reset. <a style="color: blue;text-decoration: underline;cursor: pointer;" (click)="onLogin()">Login Now!</a></p>
</div>
</div>
</div>
</div>
68 changes: 68 additions & 0 deletions src/app/account/reset/reset.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { PasswordReset } from './../account.model';
import { Component, OnInit } from '@angular/core';
import { AccountService } from '../account.service';
import { Router, ActivatedRoute } from '@angular/router';

@Component({
selector: 'reset',
templateUrl: 'reset.component.html'
})

export class ResetComponent implements OnInit {

submitted = false;
passwords: PasswordReset = new PasswordReset();
resetToken: string = "";

error: string = "";

constructor(
private accountService: AccountService,
private activatedRoute: ActivatedRoute,
private router: Router
) { }

ngOnInit() {
this.resetToken = this.activatedRoute.snapshot.params['token'];
}

onLogin() {
this.router.navigate(['login']);
}

onSubmit() {

this.error = "";

//actually make the password reset call
this.accountService.setNewPassword(this.passwords, this.resetToken).subscribe(
data => { this.submitted = true; },
error => {
if(!this.isEmpty(error.error_list))
{
console.log('here');
for (var key in error.error_list) {
if (error.error_list.hasOwnProperty(key)) {
this.error = error.error_list[key];
}
}
}
else
{
this.error = "Something is not right! Ensure your passwords match and try again."
}
}
);


}

isEmpty(obj) {
for(var key in obj) {
if(obj.hasOwnProperty(key))
return false;
}
return true;
}

}
30 changes: 30 additions & 0 deletions src/app/account/reset/send-reset.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<local-header [title]="'Reset'"></local-header>

<div class="row justify-content-center">
<div class="col-sm col-md-8 mt-4">
<h3 style="text-align: center;">Reset Password</h3>
</div>
</div>
<div class="row justify-content-center">
<div class="col-sm col-md-6">
<div class="card">
<div class="card-body">
<div *ngIf="!passwordReset">
<p style="color: black">Enter your email, and we'll send you a link to reset your password!</p>
<form #sendResetForm="ngForm">
<div class="form-group">
<label for="resetEmail">Email</label>
<input type="text" class="form-control" id="resetEmail" maxlength="50"
required [(ngModel)]="resetEmail" name="resetEmail" #resetEmailText="ngModel">
<small *ngIf="!(resetEmailText.valid || resetEmailText.pristine)" class="form-text text-danger">Email is Required</small>
</div>
<button type="button" [disabled]="!sendResetForm.valid" (click)="onResetConfirm()" class="btn btn-primary mr-2">Submit</button>
<button type="button" (click)="onResetCancel()" class="btn btn-primary mr-2">Cancel</button>
</form>
<p class="text-danger mt-3" *ngIf="error != ''" [innerHTML]='error'></p>
</div>
<p *ngIf="passwordReset" style="color: black" class="mt-3">Your password has been reset. If you have an account, you should recieve an email shortly.</p>
</div>
</div>
</div>
</div>
42 changes: 42 additions & 0 deletions src/app/account/reset/send-reset.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { Component, OnInit } from '@angular/core';
import { AccountService } from '../account.service';
import { Router } from '@angular/router';

@Component({
selector: 'send-reset',
templateUrl: 'send-reset.component.html'
})

export class SendResetComponent implements OnInit {

passwordReset = false;
resetEmail: string = "";

error: string = "";

constructor(
private accountService: AccountService,
private router: Router
) { }

ngOnInit() { }

onResetCancel() {
//Navigate back to login page
this.router.navigate(['login']);
}

onResetConfirm() {
//actually make the password reset call
this.accountService.resetPassword(this.resetEmail).subscribe(
data => { this.passwordReset = true; },
error => {
this.error = error.error_list.email
}
);


}


}
7 changes: 7 additions & 0 deletions src/app/admin/admin.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<local-header [title]="'Admin Dashboard'"></local-header>

<div class="row mb-2">
<div class="col-12 col-md-6 mb-2 tall-column">
<button class="btn btn-primary btn-block" (click)="onReview()">Review Applications</button>
</div>
</div>
15 changes: 15 additions & 0 deletions src/app/admin/admin.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.btn {
background-color: #20044f;
border-color: #ff0062;
font-size: 1rem;
}
.btn-warning {
background-color: #ff0062;
color: #20044f;
}
.tall-column {
height: 200%;
}
.btn-block {
font-size: 2rem;
}
35 changes: 35 additions & 0 deletions src/app/admin/admin.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { User } from '../shared/user/user.model';
import { UserService } from '../shared/user/user.service';

@Component({
selector: 'admin',
templateUrl: 'admin.component.html',
styleUrls: ['admin.component.scss']
})

export class AdminComponent implements OnInit {

user: User;

constructor(
private userService: UserService,
private router: Router
) { }

ngOnInit() {
//Is Logged in?
if(!this.userService.isUserLoggedIn()) {
//redirect to login
this.router.navigate(['login']);
}
else if(!this.userService.isAdmin()) {
this.router.navigate(['']);
}
}

onReview() {
this.router.navigate(['admin/review']);
}
}
Loading