Skip to content

Commit 289428e

Browse files
sandershihackerDerekTBrown
authored andcommitted
Issue #160, Rename of TaskView to LabView, Enrollable field for explore buttons. (#182)
* 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 * delete userlist * publish for global admin * Fixed router params * Issue 161 fixed: instructor field in courses * . * fix nextButton * . * Issue #171 * Issue #168 * Issue 160: CourseList * Removed LabView * Enrollable field for buttons on explore pages * TaskView -> LabView
1 parent 1311ac0 commit 289428e

File tree

18 files changed

+111
-42
lines changed

18 files changed

+111
-42
lines changed

client/imports/ui/components/explore/explore.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ <h2>{{ course.course_number }} | {{ course.course_name }}</h2>
1515
{{ course.course_description.content }}
1616
</p>
1717
<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>
1920
</div>
2021
</md-content>
2122
</template>

client/imports/ui/components/explore/search.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ <h2 id="search-string">Search Results for '{{ searchQuery }}'</h2>
3232
</div>
3333
</td>
3434
<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>
3637
</td>
3738
</tr>
3839
</tbody>

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

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

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

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
}

client/imports/ui/pages/dashboard/dashboard.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</a>
1717
</md-list>
1818
<div class="more-button">
19-
<button md-button>More</button>
19+
<a md-button [routerLink]="['/courses']">More</a>
2020
</div>
2121
</md-content>
2222
</div>

client/imports/ui/pages/dashboard/dashboard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default class Dashboard extends MeteorComponent {
5454
mdIconRegistry.setDefaultFontSetClass('tuxicon');
5555

5656
this.subscribe('user-courses', () => {
57-
this.courses = courses.find().fetch();
57+
this.courses = courses.find({}, { limit: 5 }).fetch();
5858
}, true);
5959
this.subscribe('course-records', () => {
6060
let records = course_records.find().fetch();

client/imports/ui/pages/lab/taskview.html renamed to client/imports/ui/pages/lab/labview.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<div class="tuxlab-taskview">
1+
<div class="tuxlab-labview">
22

33
<!--Markdown View-->
4-
<div class="tuxlab-taskview-step">
4+
<div class="tuxlab-labview-step">
55

66
<md-sidenav-layout>
77
<md-sidenav #left [opened]="false" layout-padding>
@@ -61,7 +61,7 @@
6161
</div>
6262

6363
<!--Terminal View-->
64-
<div class="tuxlab-taskview-terminal">
64+
<div class="tuxlab-labview-terminal">
6565
<terminal></terminal>
6666
</div>
6767

client/imports/ui/pages/lab/taskview.ts renamed to client/imports/ui/pages/lab/labview.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828

2929
// Meteor method imports
3030
import "../../../lab/methods.ts"
31-
// Define TaskView Component
32-
31+
32+
// Define LabView Component
3333
@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',
3636
directives: [
3737
MarkdownView,
3838
Terminal,
@@ -49,7 +49,7 @@
4949
})
5050

5151
@InjectUser('user')
52-
export default class TaskView extends MeteorComponent {
52+
export default class LabView extends MeteorComponent {
5353
user: Meteor.User;
5454
public auth : any;
5555
labMarkdown: string;

0 commit comments

Comments
 (0)