Skip to content

Commit 9cd1bf7

Browse files
committed
something chnaged
2 parents efeb53b + c4e2535 commit 9cd1bf7

78 files changed

Lines changed: 924 additions & 528 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

codecamp-front/.angular-cli.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
"../node_modules/bootstrap/dist/js/bootstrap.min.js",
3030
"../node_modules/ace-builds/src-min/ace.js",
3131
"../node_modules/ace-builds/src-min/theme-sqlserver.js",
32-
"../node_modules/ace-builds/src-min/mode-c.js",
33-
"../node_modules/ace-builds/src-min/mode-cpp.js",
3432
"../node_modules/ace-builds/src-min/mode-python.js",
3533
"../node_modules/ace-builds/src-min/mode-java.js"
3634
],

codecamp-front/package-lock.json

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codecamp-front/package.json

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
},
1313
"private": true,
1414
"dependencies": {
15+
<<<<<<< HEAD
1516
"@angular/animations": "^5.2.7",
1617
"@angular/common": "^5.2.7",
1718
"@angular/compiler": "^5.2.7",
@@ -36,6 +37,32 @@
3637
"popper.js": "^1.12.9",
3738
"rxjs": "^5.5.6",
3839
"zone.js": "^0.8.19"
40+
=======
41+
"@angular/animations": "5.2.7",
42+
"@angular/common": "5.2.7",
43+
"@angular/compiler": "5.2.7",
44+
"@angular/core": "5.2.7",
45+
"@angular/forms": "5.2.7",
46+
"@angular/http": "5.2.7",
47+
"@angular/platform-browser": "5.2.7",
48+
"@angular/platform-browser-dynamic": "5.2.7",
49+
"@angular/platform-server": "5.2.7",
50+
"@angular/router": "5.2.7",
51+
"@types/jquery": "3.3.0",
52+
"angular2-flash-messages": "2.0.5",
53+
"angular2-jwt": "0.2.3",
54+
"bootstrap": "4.0.0-beta.2",
55+
"core-js": "2.4.1",
56+
"font-awesome": "4.7.0",
57+
"jquery": "3.3.1",
58+
"jquery-slimscroll": "1.3.8",
59+
"ng2-ace-editor": "0.3.4",
60+
"ng2-file-upload": "1.3.0",
61+
"ngx-progressbar": "2.1.1",
62+
"popper.js": "1.12.9",
63+
"rxjs": "5.5.6",
64+
"zone.js": "0.8.19"
65+
>>>>>>> c4e2535092f743e8105bd39eb4418534f142cf6f
3966
},
4067
"devDependencies": {
4168
"@angular/cli": "1.6.5",
@@ -57,6 +84,6 @@
5784
"protractor": "~5.1.2",
5885
"ts-node": "~4.1.0",
5986
"tslint": "~5.9.1",
60-
"typescript": "~2.5.3"
87+
"typescript": "^2.7.2"
6188
}
6289
}

codecamp-front/src/app/app-routing.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ const appRoutes: Routes = [
7070
},
7171
{
7272
path: 'submit/complete',
73-
component: SolutionComponent
73+
component: SolutionComponent,
74+
canActivate: [AuthGuard]
7475
},
7576
{
7677
path: 'contest/add-contest',

codecamp-front/src/app/app.module.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import { SidebarComponent } from './components/sidebar/sidebar.component';
3838
import { NgProgressModule, NgProgressBrowserXhr } from 'ngx-progressbar';
3939
import { BrowserXhr } from '@angular/http';
4040
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
41+
4142
@NgModule({
4243
declarations: [
4344
AppComponent,

codecamp-front/src/app/components/contest/contest.component.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
margin: 0;
1919
}
2020
.nav-link {
21-
padding: 0.5% 2%;
21+
padding: 0.5%;
22+
}
23+
24+
.main {
25+
background: white;
26+
padding: 2%;
2227
}
2328
.col-md-2 {
2429
text-align: center;

codecamp-front/src/app/components/contest/contest.component.html

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,39 @@
88

99
<br>
1010

11-
<div class="container">
12-
<div class="row">
11+
<div class="container main">
12+
13+
<h5>Present Contest</h5>
14+
<div class="row">
1315
<div class="col-md-6 head">
14-
Contest
15-
</div>
16-
<div class="col-md-2 head">
17-
Contest Code
18-
</div>
19-
<div class="col-md-2 head">
20-
Start Time
21-
</div>
22-
<div class="col-md-2 head">
23-
End Time
24-
</div>
25-
</div>
26-
<a
27-
class="nav-link contest"
28-
*ngFor="let i of contest"
29-
(click)="onSelectContest(i)">
30-
<div class="row">
31-
<div class="col-md-6">
32-
{{i.name}}
33-
</div>
34-
<div class="col-md-2">
35-
{{i.id}}
36-
</div>
37-
<div class="col-md-2" [innerHTML]="replaceTZ(i.startTime)">
38-
</div>
39-
<div class="col-md-2" [innerHTML]="replaceTZ(i.endTime)">
40-
</div>
41-
</div>
42-
</a>
16+
Contest
17+
</div>
18+
<div class="col-md-2 head">
19+
Contest Code
20+
</div>
21+
<div class="col-md-2 head">
22+
Start Time
23+
</div>
24+
<div class="col-md-2 head">
25+
End Time
26+
</div>
27+
</div>
28+
<a
29+
class="nav-link contest"
30+
*ngFor="let i of contest"
31+
(click)="onSelectContest(i)">
32+
<div class="row">
33+
<div class="col-md-6">
34+
{{i.name}}
35+
</div>
36+
<div class="col-md-2">
37+
{{i.id}}
38+
</div>
39+
<div class="col-md-2" [innerHTML]="replaceTZ(i.startTime)">
40+
</div>
41+
<div class="col-md-2" [innerHTML]="replaceTZ(i.endTime)">
42+
</div>
43+
</div>
44+
</a>
4345
</div>
46+

codecamp-front/src/app/components/home/home.component.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
.page-header {
22
height: 90vh;
33
overflow: hidden;
4+
45
}
56
.header-filter {
67
position: relative;
78
}
89

910
.page-header {
10-
height: 100vh;
11+
height: 60vh;
1112
background-position: 50%;
1213
background-size: cover;
1314
margin: 0;

codecamp-front/src/app/components/login/login.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h2 class="card-title">SIGN IN</h2>
4040
</div>
4141
</div>
4242
</div>
43-
43+
<p>{{message}}</p>
4444
<div class="row">
4545
<div class="col-md-9 offset-md-3">
4646
<div class="row">

codecamp-front/src/app/components/login/login.component.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ import { Router } from '@angular/router';
1010
})
1111
export class LoginComponent implements OnInit {
1212
form: FormGroup;
13-
message;
13+
message = false;
1414
messageClass;
15+
1516
constructor(
1617
private authService: AuthService,
1718
private router: Router,
@@ -39,9 +40,14 @@ export class LoginComponent implements OnInit {
3940
password: this.form.get('password').value // Password input field
4041
};
4142
this.authService.loginUser(user).subscribe(data => {
42-
this.authService.storeUserData(data.token, data.user);
43-
this.router.navigate(['/']);
44-
// Navigate to dashboard view
43+
if(!data.success){
44+
this.message = data.msg;
45+
}
46+
else{
47+
this.authService.storeUserData(data.token, data.user);
48+
this.router.navigate(['/']);
49+
this.message = false;
50+
} // Navigate to dashboard view
4551
});
4652
}
4753
}

0 commit comments

Comments
 (0)