Skip to content

Commit a91a5ac

Browse files
sandershihackerDerekTBrown
authored andcommitted
.
course dashboard get courseid from url delete userlist UserList and TaskView changes (#155) * Updated Schemas * Load Screen * Loading Screen * publish subscribe and dynamic explore page * deleted swap file * publish subscribe * template fixes * added start for reactive publication * template issue * . * . * course_records publish * course_records reactively publish * revert meteor update * publish subscribe and lineheight for searchpage icons * fixed indentation and removed test file * indentation * indentation * Accounts page and fixed random erro * toolbar for mobile devices * toolbar * account.html fixes * Toolbar made responsive * Responsive toolbar fixes * created userlist component * course_records course_id validation * indentation * markdown * import changes * validation addition * Forms Module Deprecated Warning. Issue #110 * indentation * Use routerLink * api changes (#126) * issue 32 fixed * removed swp * fixed nconf issues * issue 82, 84 fixes * fixed #82 * isse #77 * fixed tests * fixed files * fixed tests master * fixed comment * moved validator * removed duplicate file * fixed tests, removed duplicate underscore, publish * changes * fixed methods.ts import * fixed issues w methods * fixes * minor fixes * A * api changes * fixed api * comments * minor changes * minor fixes * method implementations (#127) * issue 32 fixed * removed swp * fixed nconf issues * issue 82, 84 fixes * fixed #82 * isse #77 * fixed tests * fixed files * fixed tests master * fixed comment * moved validator * removed duplicate file * fixed tests, removed duplicate underscore, publish * changes * fixed methods.ts import * fixed issues w methods * fixes * minor fixes * A * api changes * fixed api * comments * minor changes * minor fixes * method implementations * course pages now uses Child Routing * deleted LabData class * school name * search function * icon size and #136 * dashboard pull data from database * fix inappropriate file naming for gradelist and lablist * more templating issues * . * . * markdown default * lablist and gradelist * template changes * explore page changes * delete instructor page * user schema * indentation * indentation * explore publish and taskview sidenav * explore view links to course/courseId * taskview sidenav * taskview * taskview sidenav changes * Extend terminal on small width * . * . * Added UserList Component in Courses * Edit Course * . * course dashboard get courseid from url * delete userlist * input
1 parent 0781ce0 commit a91a5ac

File tree

10 files changed

+29
-154
lines changed

10 files changed

+29
-154
lines changed

client/imports/ui/components/userlist/userlist.html

Lines changed: 0 additions & 7 deletions
This file was deleted.

client/imports/ui/components/userlist/userlist.ts

Lines changed: 0 additions & 53 deletions
This file was deleted.

client/imports/ui/pages/course/course.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
<div class="wrapper">
66
<!-- Navigation -->
77
<div class="course-toolbar-nav">
8-
<a md-button [routerLink]="['/course/' + courseId]" class="home-button" id="toolbar-course">Home</a>
9-
<a md-button [routerLink]="['/course/' + courseId + '/labs']" id="toolbar-labs">Labs</a>
10-
<a md-button [routerLink]="['/course/' + courseId + '/grades']" id="toolbar-grades">Grades</a>
8+
<a md-button [routerLink]="['/course/' + courseId]" class="home-button">Home</a>
9+
<a md-button [routerLink]="['/course/' + courseId + '/labs']">Labs</a>
10+
<a md-button [routerLink]="['/course/' + courseId + '/grades']">Grades</a>
11+
<a md-button [routerLink]="['/course/' + courseId]">Settings</a>
1112
</div>
1213
</div>
1314
</md-toolbar>
1415
<md-toolbar class="small" *showItBootstrap="['xs']">
1516
<div>
16-
<a md-button [routerLink]="['/course/' + courseId]" id="toolbar-course">Home</a>
17-
<a md-button [routerLink]="['/course/' + courseId + '/labs']" id="toolbar-labs">Labs</a>
18-
<a md-button [routerLink]="['/course/' + courseId + '/grades']" id="toolbar-grades">Grades</a>
19-
<a md-button [routerLink]="['/course/' + courseId]">More</a>
20-
<a md-button [routerLink]="['/course/' + courseId]">More</a>
17+
<a md-button [routerLink]="['/course/' + courseId]">Home</a>
18+
<a md-button [routerLink]="['/course/' + courseId + '/labs']">Labs</a>
19+
<a md-button [routerLink]="['/course/' + courseId + '/grades']">Grades</a>
20+
<a md-button [routerLink]="['/course/' + courseId]">Settings</a>
2121
</div>
2222
<md-icon fontIcon="tuxicon-right"></md-icon>
2323
</md-toolbar>
@@ -26,4 +26,4 @@
2626
<div class="course-content" id="course-content">
2727
<router-outlet></router-outlet>
2828
</div>
29-
</div>
29+
</div>

client/imports/ui/pages/course/course.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
import 'zone.js/dist/zone';
66

77
// Angular Imports
8-
import { Component, ViewEncapsulation, provide } from '@angular/core';
8+
import { Component, ViewEncapsulation, provide, OnInit } from '@angular/core';
99
import { bootstrap } from 'angular2-meteor-auto-bootstrap';
1010
import { APP_BASE_HREF } from '@angular/common';
1111
import { HTTP_PROVIDERS } from '@angular/http';
1212
import { InjectUser } from 'angular2-meteor-accounts-ui';
13-
import { ROUTER_DIRECTIVES } from '@angular/router';
14-
import { ActivatedRoute } from '@angular/router';
13+
import { ROUTER_DIRECTIVES, ActivatedRoute } from '@angular/router';
1514

1615
// Angular Material Imports
1716
import { MATERIAL_PROVIDERS, MATERIAL_DIRECTIVES } from 'ng2-material';
@@ -21,10 +20,6 @@
2120
// Icon
2221
import { MD_ICON_DIRECTIVES, MdIconRegistry } from '@angular2-material/icon';
2322

24-
// Courses and Course Record Imports
25-
import { courses } from "../../../../../collections/courses.ts";
26-
import { course_records } from "../../../../../collections/course_records.ts";
27-
2823
declare var Collections: any;
2924

3025
// Define CourseView Component
@@ -45,15 +40,14 @@
4540
// Export CourseView Class
4641
export default class CourseView extends MeteorComponent {
4742
courseId: string;
43+
user: Meteor.User;
4844
constructor(mdIconRegistry: MdIconRegistry, private route: ActivatedRoute) {
4945
super();
5046
// Create Icon Font
5147
mdIconRegistry.registerFontClassAlias('tux', 'tuxicon');
5248
mdIconRegistry.setDefaultFontSetClass('tuxicon');
5349
}
54-
5550
ngOnInit() {
56-
this.courseId = this.route.snapshot.params['courseid'];
51+
this.courseId = <string>((<any>(this.route.snapshot.params)).courseid);
5752
}
58-
5953
}

client/imports/ui/pages/course/course_dashboard.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171
<md-card-content>
7272
<form>
7373
<input [(ngModel)]="courseName" name="course-name"/>
74+
<br>
7475
<textarea [(ngModel)]="courseDescription" name="course-description"></textarea>
75-
7676
</form>
7777
</md-card-content>
7878
</md-card>

client/imports/ui/pages/course/course_dashboard.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,27 @@
55
import 'zone.js/dist/zone';
66

77
// Angular Imports
8-
import { Component, ViewEncapsulation, provide } from '@angular/core';
8+
import { Component, ViewEncapsulation, provide, OnInit } from '@angular/core';
99
import { bootstrap } from 'angular2-meteor-auto-bootstrap';
1010
import { APP_BASE_HREF, FORM_DIRECTIVES } from '@angular/common';
1111
import { HTTP_PROVIDERS } from '@angular/http';
1212
import { InjectUser } from 'angular2-meteor-accounts-ui';
13-
import { ROUTER_DIRECTIVES } from '@angular/router';
13+
import { ROUTER_DIRECTIVES, ActivatedRoute } from '@angular/router';
1414

1515
// Angular Material Imports
1616
import { MATERIAL_PROVIDERS, MATERIAL_DIRECTIVES } from 'ng2-material';
1717
import { MeteorComponent } from 'angular2-meteor';
1818
import { OVERLAY_PROVIDERS } from '@angular2-material/core/overlay/overlay';
1919
import { MD_INPUT_DIRECTIVES } from '@angular2-material/input';
2020

21-
2221
// Icon
2322
import { MD_ICON_DIRECTIVES, MdIconRegistry } from '@angular2-material/icon';
2423

2524
// LabList and Grades import
2625
import { GradeList } from './gradelist.ts';
2726
import { LabList } from './lablist.ts';
2827

29-
// Courses and Course Record Imports
30-
import { courses } from "../../../../../collections/courses.ts";
31-
import { course_records } from "../../../../../collections/course_records.ts";
28+
declare var Collections: any;
3229

3330
// Define CourseDashboard Component
3431
@Component({
@@ -51,22 +48,25 @@
5148
// Export CourseDashboard Class
5249
export class CourseDashboard extends MeteorComponent {
5350
course;
54-
courseNumber: String = '15-131'; // TODO: Get from URL
55-
courseDescription: String = "Course Description Not Found";
56-
courseName: String = "Course Name Not Found";
51+
courseId: string;
52+
courseDescription: String = "";
53+
courseName: String = "";
5754

58-
constructor(mdIconRegistry: MdIconRegistry) {
55+
constructor(mdIconRegistry: MdIconRegistry, private route: ActivatedRoute) {
5956
super();
6057
// Create Icon Font
6158
mdIconRegistry.registerFontClassAlias('tux', 'tuxicon');
6259
mdIconRegistry.setDefaultFontSetClass('tuxicon');
6360
// Subscribe to courses database and set current course
64-
this.subscribe('user-courses', this.courseNumber, () => {
65-
this.course = courses.findOne({ course_number: this.courseNumber });
61+
this.subscribe('user-courses', this.courseId, () => {
62+
this.course = Collections.courses.findOne({ _id: this.courseId });
6663
if (typeof this.course !== "undefined") {
6764
this.courseName = this.course.course_name;
6865
this.courseDescription = this.course.course_description.content;
6966
}
7067
}, true);
7168
}
69+
ngOnInit() {
70+
this.courseId = <string>((<any>(this.route.snapshot.params)).courseid);
71+
}
7272
}

client/imports/ui/pages/course/userlist.html

Lines changed: 0 additions & 28 deletions
This file was deleted.

client/imports/ui/pages/course/userlist.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

client/imports/ui/pages/lab/taskview.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,7 @@
3636

3737
<tuxlab-markdown [mdData]="labMarkdown">Task markdown loading...</tuxlab-markdown>
3838
<div class="markdown-check-button">
39-
<md-dialog #alert>
40-
<md-dialog-title>Just a Second</md-dialog-title>
41-
<p>Checking Task...</p>
42-
<md-dialog-actions ok="Fine"></md-dialog-actions>
43-
</md-dialog>
44-
<button md-raised-button (click)="nextTask()">
39+
<button md-raised-button (click)="nextTask()" *ngIf="!currentCompleted">
4540
Check
4641
<md-icon fontIcon="tuxicon-tick"></md-icon>
4742
</button>

client/imports/ui/pages/lab/taskview.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export default class TaskView extends MeteorComponent {
5757
labProgress: string = "3 / 10";
5858
tasks: Array<any>;
5959
currentTask: number;
60+
currentCompleted: boolean;
6061
courseId: string;
6162
@ViewChild(Terminal) term : Terminal;
6263

@@ -107,6 +108,7 @@ export default class TaskView extends MeteorComponent {
107108
toTask(task) {
108109
this.labMarkdown = task.md;
109110
this.currentTask = task.id;
111+
this.currentCompleted = task.completed;
110112
}
111113

112114
}

0 commit comments

Comments
 (0)