File tree Expand file tree Collapse file tree 18 files changed +111
-42
lines changed Expand file tree Collapse file tree 18 files changed +111
-42
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ <h2>{{ course.course_number }} | {{ course.course_name }}</h2>
15
15
{{ course.course_description.content }}
16
16
</ p >
17
17
< div class ="course-link ">
18
- < a md-button [routerLink] ="['/course/' + course._id] "> Enroll</ a >
18
+ < a md-button [routerLink] ="['/course/' + course._id] " *ngIf ="course.permissions.content == 'auth' "> Enroll</ a >
19
+ < a md-button [routerLink] ="['/course/' + course._id] " *ngIf ="course.permissions.content == 'any' " > View</ a >
19
20
</ div >
20
21
</ md-content >
21
22
</ template >
Original file line number Diff line number Diff line change @@ -32,7 +32,8 @@ <h2 id="search-string">Search Results for '{{ searchQuery }}'</h2>
32
32
</ div >
33
33
</ td >
34
34
< td >
35
- < a md-button [routerLink] ="['/course/' + course._id] "> Enroll</ a >
35
+ < a md-button [routerLink] ="['/course/' + course._id] " *ngIf ="course.permissions.content == 'auth' " > Enroll</ a >
36
+ < a md-button [routerLink] ="['/course/' + course._id] " *ngIf ="course.permissions.content == 'any' " > View</ a >
36
37
</ td >
37
38
</ tr >
38
39
</ tbody >
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ < div class ="tuxlab-courselist ">
2
+ < md-card >
3
+ < md-card-title >
4
+ < span class ="md-headline "> Course List</ span >
5
+ </ md-card-title >
6
+ < md-card-content >
7
+ < md-data-table layout-fill >
8
+ < thead >
9
+ < tr >
10
+ < th class ="md-text-cell "> Course Number</ th >
11
+ < th class ="md-text-cell "> Course Name</ th >
12
+ < th > Instructor(s)</ th >
13
+ </ tr >
14
+ </ thead >
15
+ < tbody >
16
+ < tr *ngFor ="let course of courses " (click) ="toCourse(course) ">
17
+ < td class ="md-text-cell "> {{ course.course_number }}</ td >
18
+ < td class ="md-text-cell "> {{ course.course_name }}</ td >
19
+ < td >
20
+ < div *ngFor ="let instructor of course.instructors ">
21
+ {{ instructor.name }}
22
+ </ div >
23
+ </ td >
24
+ </ tr >
25
+ </ tbody >
26
+ </ md-data-table >
27
+ </ md-card-content >
28
+ </ md-card >
29
+ </ div >
Original file line number Diff line number Diff line change
1
+ // Meteor imports
2
+ import { Meteor } from 'meteor/meteor' ;
3
+ import { Mongo } from 'meteor/mongo' ;
4
+
5
+ // Angular Imports
6
+ import { Component } from '@angular/core'
7
+ import { ROUTER_DIRECTIVES , Router } from '@angular/router' ;
8
+
9
+ // Angular Meteor Imports
10
+ import { MeteorComponent } from 'angular2-meteor' ;
11
+
12
+ // Angular Material Imports
13
+ import { MATERIAL_DIRECTIVES } from 'ng2-material' ;
14
+
15
+ // Declare Collections
16
+ declare var Collections : any ;
17
+
18
+ // Define CourseList Component
19
+ @Component ( {
20
+ selector : 'tuxlab-courselist' ,
21
+ templateUrl : '/client/imports/ui/pages/courselist/courselist.html' ,
22
+ directives : [
23
+ MATERIAL_DIRECTIVES ,
24
+ ROUTER_DIRECTIVES
25
+ ]
26
+ } )
27
+
28
+ // Export CourseList Class
29
+ export default class CourseList extends MeteorComponent {
30
+ courses : Array < Object > = [ ] ;
31
+ constructor ( private router : Router ) {
32
+ super ( ) ;
33
+ // Subscribe from user courses
34
+ this . subscribe ( 'user-courses' , ( ) => {
35
+ this . courses = Collections . courses . find ( ) . fetch ( ) ;
36
+ } , true ) ;
37
+ }
38
+ toCourse ( course : Object ) {
39
+ this . router . navigate ( [ '/course' , ( < any > course ) . _id ] ) ;
40
+ }
41
+ }
Original file line number Diff line number Diff line change 16
16
</ a >
17
17
</ md-list >
18
18
< div class ="more-button ">
19
- < button md-button > More</ button >
19
+ < a md-button [routerLink] =" ['/courses'] " > More</ a >
20
20
</ div >
21
21
</ md-content >
22
22
</ div >
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ export default class Dashboard extends MeteorComponent {
54
54
mdIconRegistry . setDefaultFontSetClass ( 'tuxicon' ) ;
55
55
56
56
this . subscribe ( 'user-courses' , ( ) => {
57
- this . courses = courses . find ( ) . fetch ( ) ;
57
+ this . courses = courses . find ( { } , { limit : 5 } ) . fetch ( ) ;
58
58
} , true ) ;
59
59
this . subscribe ( 'course-records' , ( ) => {
60
60
let records = course_records . find ( ) . fetch ( ) ;
Original file line number Diff line number Diff line change 1
- < div class ="tuxlab-taskview ">
1
+ < div class ="tuxlab-labview ">
2
2
3
3
<!--Markdown View-->
4
- < div class ="tuxlab-taskview -step ">
4
+ < div class ="tuxlab-labview -step ">
5
5
6
6
< md-sidenav-layout >
7
7
< md-sidenav #left [opened] ="false " layout-padding >
61
61
</ div >
62
62
63
63
<!--Terminal View-->
64
- < div class ="tuxlab-taskview -terminal ">
64
+ < div class ="tuxlab-labview -terminal ">
65
65
< terminal > </ terminal >
66
66
</ div >
67
67
Original file line number Diff line number Diff line change 28
28
29
29
// Meteor method imports
30
30
import "../../../lab/methods.ts"
31
- // Define TaskView Component
32
-
31
+
32
+ // Define LabView Component
33
33
@Component ( {
34
- selector : 'tuxlab-taskview ' ,
35
- templateUrl : '/client/imports/ui/pages/lab/taskview .html' ,
34
+ selector : 'tuxlab-labview ' ,
35
+ templateUrl : '/client/imports/ui/pages/lab/labview .html' ,
36
36
directives : [
37
37
MarkdownView ,
38
38
Terminal ,
49
49
} )
50
50
51
51
@InjectUser ( 'user' )
52
- export default class TaskView extends MeteorComponent {
52
+ export default class LabView extends MeteorComponent {
53
53
user : Meteor . User ;
54
54
public auth : any ;
55
55
labMarkdown : string ;
You can’t perform that action at this time.
0 commit comments