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;

client/imports/ui/routes/course.routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import { CourseGuardRecord } from './course.guard.record.ts';
1111
import { GradeList } from '../pages/course/gradelist.ts';
1212
import { LabList } from '../pages/course/lablist.ts';
1313
import { CourseDashboard } from '../pages/course/course_dashboard.ts';
14-
import { LabView } from '../pages/course/labview.ts';
1514
import { GradeView } from '../pages/course/gradeview.ts';
15+
import LabView from '../pages/lab/labview.ts';
1616

1717
export const courseRoutes: RouterConfig = [
1818
{

client/imports/ui/routes/routes.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ import { provideRouter, RouterConfig } from '@angular/router';
1515
import ErrorPage from '../pages/error/error.ts'
1616

1717
// Lab
18-
import TaskView from '../pages/lab/taskview.ts';
1918
import LabCreate from '../pages/lab/labcreate.ts'
2019

2120
// Course
2221
import { courseRoutes } from './course.routes.ts';
2322
import { CourseGuardRecord } from './course.guard.record.ts';
2423

24+
// Course List
25+
import CourseList from '../pages/courselist/courselist.ts';
26+
2527
// Explore
2628
import Explore from '../pages/explore/explore.ts';
2729

@@ -38,7 +40,9 @@ const routes : RouterConfig = [
3840
{ path: 'login', component: Login },
3941
{ path: 'terms', component: Terms },
4042
{ path: 'privacy', component: Privacy },
43+
{ path: 'lab-create', component: LabCreate },
4144
{ path: 'explore', component: Explore },
45+
{ path: 'courses', component: CourseList },
4246
{ path: 'error/:code', component: ErrorPage },
4347
{ path: '**', component: ErrorPage }
4448
]

client/style/account/_login.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
.google-login-button{
3131
margin:0 auto !important;
32-
32+
cursor: pointer;
3333
display: flex;
3434
flex-direction: row;
3535
justify-content: flex-start;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.tuxlab-courselist {
2+
max-width: $tuxlab-max-width;
3+
margin: 0 auto;
4+
width: 100%;
5+
tbody {
6+
tr {
7+
cursor: pointer;
8+
}
9+
}
10+
}

client/style/lab/_labview.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
.tuxlab-taskview {
1+
.tuxlab-labview {
22
display: flex;
33
flex-direction: row;
44
flex-wrap: nowrap;
55

6-
.tuxlab-taskview-terminal{
6+
.tuxlab-labview-terminal{
77
height: 100vh;
88
width: 50%;
99

@@ -52,7 +52,7 @@
5252
/**
5353
Markdown
5454
**/
55-
.tuxlab-taskview-step{
55+
.tuxlab-labview-step{
5656
width: 50%;
5757
md-sidenav-layout {
5858
height: 100vh;

client/style/tuxlab.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
// Course Packages
2626
@import "{}/client/style/course/_courseview.scss";
2727

28+
// Courselist Packages
29+
@import "{}/client/style/courselist/_courselist.scss";
30+
2831
// Dashboard Packages
2932
@import "{}/client/style/dashboard/_dashboard.scss";
3033

client/tuxlab.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<div class="tux-toolbar-nav">
5050
<a md-button [routerLink]="['/']"> Dashboard </a>
5151
<a md-button [routerLink]="['/explore']"> Explore </a>
52-
<a md-button [routerLink]="['/']"> Courses </a>
52+
<a md-button [routerLink]="['/courses']"> Courses </a>
5353
</div>
5454
<span flex></span>
5555
<!-- Profile Dropdown -->
@@ -73,7 +73,7 @@ <h2> {{ user.profile.school }} </h2>
7373
<div class="mobile-toolbar-buttons">
7474
<a [routerLink]="['/']"><md-icon fontIcon="tuxicon-home"></md-icon></a>
7575
<a [routerLink]="['/explore']"><md-icon fontIcon="tuxicon-wire"></md-icon></a>
76-
<a [routerLink]="['/']"><md-icon fontIcon="tuxicon-book"></md-icon></a>
76+
<a [routerLink]="['/courses']"><md-icon fontIcon="tuxicon-book"></md-icon></a>
7777
<a (click)="right.toggle()" *ngIf="user">
7878
<md-icon fontIcon="tuxicon-person"></md-icon>
7979
</a>

server/imports/course/search.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ export function course_search(text : string, results_per_page : number, page_no
2929
"course_number" : 1,
3030
"course_name" : 1,
3131
"instructors" : 1,
32-
"course_description" : 1
32+
"course_description" : 1,
33+
"permissions" : 1
3334
}
3435
};
3536
async.parallel(

0 commit comments

Comments
 (0)