Skip to content

Commit 48dce13

Browse files
sandershihackerDerekTBrown
authored andcommitted
Termplate Issues (#143)
* 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
1 parent d6d37e9 commit 48dce13

29 files changed

+362
-472
lines changed
Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
11
<div class="tuxlab-exploreview">
2-
<!--Tab Groups-->
3-
<md-tab-group class="md-whiteframe-5dp" *ngFor="let course of courses">
4-
<!--First Tab-->
5-
<md-tab>
6-
<template md-tab-label>Description</template>
7-
<template md-tab-content>
8-
<md-content class="md-padding">
9-
<h2>{{ course.course_name }}</h2>
10-
<p>Course number: {{ course.course_number }}</p>
11-
<p>
12-
{{ course.course_description.content }}
13-
</p>
14-
<p>Instructor: {{ course.instructor_name }}</p>
15-
</md-content>
16-
</template>
17-
</md-tab>
18-
<!--Second Tab-->
19-
<md-tab>
20-
<template md-tab-label>Syllabus</template>
21-
<template md-tab-content>
22-
<md-content class="md-padding">
23-
<h2>Syllabus</h2>
24-
<p>
25-
{{ course.course_description.syllabus }}
26-
</p>
27-
</md-content>
28-
</template>
29-
</md-tab>
30-
</md-tab-group>
31-
32-
</div>
2+
<!--Tab Groups-->
3+
<md-tab-group class="md-whiteframe-5dp" *ngFor="let course of courses">
4+
<!--First Tab-->
5+
<md-tab>
6+
<template md-tab-label>Description</template>
7+
<template md-tab-content>
8+
<md-content class="md-padding">
9+
<h2>{{ course.course_number }} | {{ course.course_name }}</h2>
10+
<p>{{ course.instructor_name }}</p>
11+
<p>
12+
{{ course.course_description.content }}
13+
</p>
14+
<div class="course-link">
15+
<a md-button [routerLink]="['/course']">Course Page</a>
16+
</div>
17+
</md-content>
18+
</template>
19+
</md-tab>
20+
<!--Second Tab-->
21+
<md-tab>
22+
<template md-tab-label>Syllabus</template>
23+
<template md-tab-content>
24+
<md-content class="md-padding">
25+
<h2>Syllabus</h2>
26+
<p>
27+
{{ course.course_description.syllabus }}
28+
</p>
29+
</md-content>
30+
</template>
31+
</md-tab>
32+
</md-tab-group>
33+
</div>

client/imports/ui/components/explore/explore.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
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';
1314

1415
// Angular Material Imports
1516
import { MATERIAL_PROVIDERS, MATERIAL_DIRECTIVES } from 'ng2-material';
@@ -32,6 +33,7 @@
3233
MATERIAL_DIRECTIVES,
3334
MD_ICON_DIRECTIVES,
3435
MD_TABS_DIRECTIVES,
36+
ROUTER_DIRECTIVES,
3537
MD_INPUT_DIRECTIVES,
3638
MdToolbar
3739
],

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,17 @@ <h2 id="search-string">Search Results for '{{ searchQuery }}'</h2>
1919
<th class="md-text-cell">Course Number</th>
2020
<th class="md-text-cell">Course Name</th>
2121
<th>Instructor</th>
22+
<th></th>
2223
</tr>
2324
</thead>
2425
<tbody>
2526
<tr *ngFor="let course of searchResults">
2627
<td class="md-text-cell">{{ course.course_number }}</td>
2728
<td class="md-text-cell">{{ course.course_name }}</td>
2829
<td>{{ course.instructor_ids }}</td>
30+
<td>
31+
<a md-button [routerLink]="['/course']">Course Page</a>
32+
</td>
2933
</tr>
3034
</tbody>
3135
</md-data-table>

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

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,44 @@
11
// Meteor Imports
2-
import { Meteor } from 'meteor/meteor';
3-
import { Mongo } from 'meteor/mongo';
4-
import 'reflect-metadata';
5-
import 'zone.js/dist/zone';
2+
import { Meteor } from 'meteor/meteor';
3+
import { Mongo } from 'meteor/mongo';
4+
import 'reflect-metadata';
5+
import 'zone.js/dist/zone';
66

77
// Angular Imports
8-
import { Component, ViewEncapsulation, provide, Input } from '@angular/core';
9-
import { bootstrap } from 'angular2-meteor-auto-bootstrap';
10-
import { APP_BASE_HREF, FORM_DIRECTIVES } from '@angular/common';
11-
import { HTTP_PROVIDERS } from '@angular/http';
12-
import { InjectUser } from 'angular2-meteor-accounts-ui';
8+
import { Component, ViewEncapsulation, provide, Input } from '@angular/core';
9+
import { bootstrap } from 'angular2-meteor-auto-bootstrap';
10+
import { APP_BASE_HREF, FORM_DIRECTIVES } from '@angular/common';
11+
import { HTTP_PROVIDERS } from '@angular/http';
12+
import { InjectUser } from 'angular2-meteor-accounts-ui';
13+
import { ROUTER_DIRECTIVES } from '@angular/router';
1314

1415
// Angular Material Imports
15-
import { MATERIAL_PROVIDERS, MATERIAL_DIRECTIVES } from 'ng2-material';
16-
import { MeteorComponent } from 'angular2-meteor';
17-
import { MD_TABS_DIRECTIVES } from '@angular2-material/tabs'
18-
import { MD_INPUT_DIRECTIVES } from '@angular2-material/input';
19-
import { MdToolbar } from '@angular2-material/toolbar';
16+
import { MATERIAL_PROVIDERS, MATERIAL_DIRECTIVES } from 'ng2-material';
17+
import { MeteorComponent } from 'angular2-meteor';
18+
import { MD_TABS_DIRECTIVES } from '@angular2-material/tabs'
19+
import { MD_INPUT_DIRECTIVES } from '@angular2-material/input';
20+
import { MdToolbar } from '@angular2-material/toolbar';
2021

2122
// Icon
22-
import { MD_ICON_DIRECTIVES, MdIconRegistry } from '@angular2-material/icon';
23+
import { MD_ICON_DIRECTIVES, MdIconRegistry } from '@angular2-material/icon';
2324

2425
// Courses Database Imports
25-
import { courses } from '../../../../../collections/courses.ts';
26+
import { courses } from '../../../../../collections/courses.ts';
2627

2728
// Define SearchView Component
28-
@Component({
29-
selector: 'tuxlab-searchview',
30-
templateUrl: '/client/imports/ui/components/explore/search.html',
31-
directives: [ MATERIAL_DIRECTIVES,
32-
MD_ICON_DIRECTIVES,
33-
MD_TABS_DIRECTIVES,
34-
MD_INPUT_DIRECTIVES,
35-
MdToolbar ],
36-
viewProviders: [ MdIconRegistry ],
37-
encapsulation: ViewEncapsulation.None
38-
})
29+
@Component({
30+
selector: 'tuxlab-searchview',
31+
templateUrl: '/client/imports/ui/components/explore/search.html',
32+
directives: [ MATERIAL_DIRECTIVES,
33+
MD_ICON_DIRECTIVES,
34+
MD_TABS_DIRECTIVES,
35+
ROUTER_DIRECTIVES,
36+
MD_INPUT_DIRECTIVES,
37+
MdToolbar
38+
],
39+
viewProviders: [ MdIconRegistry ],
40+
encapsulation: ViewEncapsulation.None
41+
})
3942

4043
// Export Explore Class
4144
export class SearchView extends MeteorComponent {

client/imports/ui/components/gradelist/gradelist.ts

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

client/imports/ui/components/markdown/markdown.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919

2020
<!--Markdown-->
2121
<div class="markdown-content">
22-
<div id="task-markdown" [innerHTML]="convertedData">Task loading...</div>
22+
<div id="task-markdown" [innerHTML]="convert(mdData)"></div>
2323
</div>
2424
</div>

client/imports/ui/components/markdown/markdown.ts

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import { MATERIAL_PROVIDERS, MATERIAL_DIRECTIVES } from 'ng2-material';
1616
import { MeteorComponent } from 'angular2-meteor';
1717
import { OVERLAY_PROVIDERS } from '@angular2-material/core/overlay/overlay';
18+
import { MD_INPUT_DIRECTIVES } from '@angular2-material/input';
1819

1920
// Toolbar
2021
import { MD_TOOLBAR_DIRECTIVES } from '@angular2-material/toolbar';
@@ -32,31 +33,38 @@
3233
@Component({
3334
selector: 'tuxlab-markdown',
3435
templateUrl: '/client/imports/ui/components/markdown/markdown.html',
35-
directives: [MATERIAL_DIRECTIVES,
36-
MD_TOOLBAR_DIRECTIVES,
37-
MD_ICON_DIRECTIVES],
36+
directives: [
37+
MATERIAL_DIRECTIVES,
38+
MD_TOOLBAR_DIRECTIVES,
39+
MD_ICON_DIRECTIVES,
40+
MD_INPUT_DIRECTIVES
41+
],
3842

3943
viewProviders: [ MdIconRegistry ],
4044
providers: [ OVERLAY_PROVIDERS ],
4145
encapsulation: ViewEncapsulation.None
4246
})
4347

4448
// Export MarkdownView Class
45-
export class MarkdownView {
46-
data = (new TaskView).labMarkdown;
47-
convertedData: String;
49+
export class MarkdownView extends MeteorComponent{
50+
@Input() mdData = "";
4851
labName = "Lab Name Here";
4952
labProgress = "3/10";
5053

5154
constructor(mdIconRegistry: MdIconRegistry) {
55+
super();
5256
// Create Icon Font
5357
mdIconRegistry.registerFontClassAlias('tux', 'tuxicon');
5458
mdIconRegistry.setDefaultFontSetClass('tuxicon');
5559

56-
// Parse markdown string
60+
}
61+
convert(markdown: string) {
5762
let md = marked.setOptions({});
58-
if(typeof this.data !== "undefined") {
59-
this.convertedData = md.parse(this.data);
63+
if(typeof markdown !== "undefined") {
64+
return md.parse(markdown);
65+
}
66+
else {
67+
return "";
6068
}
6169
}
6270
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { RouterConfig } from '@angular/router';
22
import CourseView from './course.ts';
3-
import { CourseGradeList } from './course_gradelist.ts';
4-
import { CourseLabList } from './course_lablist.ts';
3+
import { GradeList } from './gradelist.ts';
4+
import { LabList } from './lablist.ts';
55
import { CourseDashboard } from './course_dashboard.ts';
66
import { LabView } from './labview.ts';
77

@@ -11,8 +11,8 @@ export const courseRoutes: RouterConfig = [
1111
component: CourseView,
1212
children: [
1313
{ path: '', component: CourseDashboard },
14-
{ path: 'grades', component: CourseGradeList },
15-
{ path: 'labs', component: CourseLabList },
14+
{ path: 'grades', component: GradeList },
15+
{ path: 'labs', component: LabList },
1616
{ path: 'labs/lab', component: LabView }
1717
// { path: '/:courseid', as: 'CourseView', component: CourseView },
1818
// { path: '/:courseid/users', as: 'UserList', component: UserList },
@@ -21,4 +21,4 @@ export const courseRoutes: RouterConfig = [
2121
// { path: '/:courseid/lab/:labid', as: 'LabView', component: LabView },
2222
]
2323
}
24-
];
24+
];

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020
// Icon
2121
import { MD_ICON_DIRECTIVES, MdIconRegistry } from '@angular2-material/icon';
2222

23-
// LabList and Grades import
24-
import { LabList } from "../../components/lablist/lablist.ts";
25-
import { GradeList } from "../../components/gradelist/gradelist.ts";
26-
2723
// Courses and Course Record Imports
2824
import { courses } from "../../../../../collections/courses.ts";
2925
import { course_records } from "../../../../../collections/course_records.ts";
@@ -35,9 +31,7 @@
3531
directives: [
3632
MATERIAL_DIRECTIVES,
3733
MD_ICON_DIRECTIVES,
38-
ROUTER_DIRECTIVES,
39-
LabList,
40-
GradeList
34+
ROUTER_DIRECTIVES
4135
],
4236
viewProviders: [MdIconRegistry],
4337
providers: [OVERLAY_PROVIDERS],

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,6 @@
5353
</tbody>
5454
</md-data-table>
5555
</md-card-content>
56-
<md-card-actions layout="row" layout-align="end center">
57-
<md-dialog #alert>
58-
<md-dialog-title>Nice Try</md-dialog-title>
59-
Go home and think about what you did.
60-
<md-dialog-actions ok="Fine"></md-dialog-actions>
61-
</md-dialog>
62-
<button md-button class="right" (click)="alert.show()">
63-
Complain
64-
</button>
65-
</md-card-actions>
6656
</md-card>
6757
</div>
6858
</div>

0 commit comments

Comments
 (0)