Skip to content

Commit ff5945b

Browse files
sandershihackerDerekTBrown
authored andcommitted
* 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 * Fixed Gradelist, Lablist and styling issues * Issue #162 Completed * TaskView toolbar color darken * remove tests * Combine Subscriptions * Reactive Subscription for CourseList and GradeList * instructor view of course dashboard * Dashboard not logged in * markdown editor for labview * . * . * remove test * Syllabus update on course_dashboard for instructors works * onChange detect for mdeditor * fixed reversed md text editor * Disable links to non-accessible tasks for students * Fixed merge issues * markdown on explore * . * indentation * indentation * indentation * Course Permissions Editing functionality complete * course settings for instructors complete * #192 * . * Wed Aug 3 11:06:55 EDT 2016 * #208 * Not Logged In View of Dashboard * #181 * #199 * . * Fri Aug 5 14:25:02 EDT 2016 * #186
1 parent 3a9614a commit ff5945b

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,24 @@
1313
<th class="md-text-cell">Lab</th>
1414
<th>Tasks Completed</th>
1515
<th>Due Date</th>
16+
<th *ngIf="isInstruct()"></th>
1617
</tr>
1718
</thead>
1819
<tbody>
19-
<tr *ngFor="let lab of getLabs()" [routerLink]="['/course/' + courseId + '/labs/' + lab._id]">
20-
<td class="md-text-cell">{{ lab.lab_name }}</td>
20+
<tr *ngFor="let lab of getLabs()">
21+
<td class="md-text-cell" [routerLink]="['/course/' + courseId + '/labs/' + lab._id]">{{ lab.lab_name }}</td>
2122
<td>{{ lab.completed }}</td>
2223
<td>soon</td>
24+
<td *ngIf="isInstruct()">
25+
<button md-button (click)="export.show(); exportLab(lab._id);">Export</button>
26+
<md-dialog #export>
27+
<md-dialog-title>
28+
Exported Markdown
29+
</md-dialog-title>
30+
<div>{{ exportData }}</div>
31+
<md-dialog-actions ok="Got It"></md-dialog-actions>
32+
</md-dialog>
33+
</td>
2334
</tr>
2435
</tbody>
2536
</md-data-table>

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

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@
88
// Angular Material Imports
99
import { MATERIAL_DIRECTIVES, MATERIAL_PROVIDERS } from 'ng2-material';
1010
import { MdProgressBar } from '@angular2-material/progress-bar';
11+
import { OVERLAY_PROVIDERS } from '@angular2-material/core/overlay/overlay';
1112

1213
// Angular Meteor Imports
1314
import { MeteorComponent } from 'angular2-meteor';
1415
import { InjectUser } from 'angular2-meteor-accounts-ui';
1516

17+
// Roles
18+
import { Roles } from '../../../../../collections/users.ts';
19+
1620
// Declare Collections
1721
declare var Collections: any;
1822
declare var _: any;
@@ -29,14 +33,15 @@
2933
ROUTER_DIRECTIVES,
3034
MATERIAL_DIRECTIVES
3135
],
32-
providers: [ MATERIAL_PROVIDERS ]
36+
providers: [ MATERIAL_PROVIDERS, OVERLAY_PROVIDERS ]
3337
})
3438

3539
export class LabList extends MeteorComponent {
3640
user: Meteor.User;
3741
courseId: string;
3842
userId: string = Meteor.userId();
3943
courseRecord: any;
44+
exportData: string = "";
4045

4146
// Test
4247
allLabs: Array<Object>;
@@ -101,4 +106,23 @@
101106
this.courseId = this.router.routerState.parent(this.route).snapshot.params['courseid'];
102107
}
103108

109+
isInstruct() {
110+
if(typeof this.courseId !== "undefined") {
111+
return Roles.isInstructorFor(this.courseId);
112+
}
113+
else {
114+
return false;
115+
}
116+
}
117+
exportLab(lab_id) {
118+
var self = this;
119+
Meteor.call('exportLab', lab_id, function(err, res) {
120+
if(err) {
121+
self.exportData = "Error getting data";
122+
}
123+
else {
124+
self.exportData = res;
125+
}
126+
});
127+
}
104128
}

0 commit comments

Comments
 (0)