Skip to content

Commit ecadc23

Browse files
sandershihackerDerekTBrown
authored andcommitted
Fixed Router Params, Issue #161 (#174)
* 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 * .
1 parent 4d16e87 commit ecadc23

File tree

11 files changed

+173
-154
lines changed

11 files changed

+173
-154
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
<template md-tab-content>
88
<md-content class="md-padding">
99
<h2>{{ course.course_number }} | {{ course.course_name }}</h2>
10-
<p>{{ course.instructor_name }}</p>
10+
<p *ngFor="let instructor of course.instructors" class="instructors">
11+
{{ instructor.name }}
12+
</p>
13+
<br><br>
1114
<p>
1215
{{ course.course_description.content }}
1316
</p>

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,19 @@ <h2 id="search-string">Search Results for '{{ searchQuery }}'</h2>
1818
<tr>
1919
<th class="md-text-cell">Course Number</th>
2020
<th class="md-text-cell">Course Name</th>
21-
<th>Instructor</th>
21+
<th>Instructor(s)</th>
2222
<th></th>
2323
</tr>
2424
</thead>
2525
<tbody>
2626
<tr *ngFor="let course of searchResults">
2727
<td class="md-text-cell">{{ course.course_number }}</td>
2828
<td class="md-text-cell">{{ course.course_name }}</td>
29-
<td>{{ course.instructor_ids }}</td>
29+
<td>
30+
<div *ngFor="let instructor of course.instructors">
31+
{{ instructor.name }}
32+
</div>
33+
</td>
3034
<td>
3135
<a md-button [routerLink]="['/course/' + course._id]">Enroll</a>
3236
</td>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@
4848
mdIconRegistry.setDefaultFontSetClass('tuxicon');
4949
}
5050
ngOnInit() {
51-
this.courseId = <string>((<any>(this.route.snapshot.params)).courseid);
51+
this.courseId = (<any>(this.route.snapshot.params)).courseid;
5252
}
5353
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
<!--Lab List Card-->
6363
<tuxlab-lablist></tuxlab-lablist>
6464

65+
<!--Edit Course Card-->
66+
<!--
6567
<md-card>
6668
<md-card-title>
6769
<md-card-title-text>
@@ -76,5 +78,6 @@
7678
</form>
7779
</md-card-content>
7880
</md-card>
81+
-->
7982

8083
</div>

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +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, ActivatedRoute } from '@angular/router';
13+
import { ROUTER_DIRECTIVES, ActivatedRoute, Router, RouterState } from '@angular/router';
1414

1515
// Angular Material Imports
1616
import { MATERIAL_PROVIDERS, MATERIAL_DIRECTIVES } from 'ng2-material';
@@ -52,11 +52,8 @@ declare var Collections: any;
5252
courseDescription: String = "";
5353
courseName: String = "";
5454

55-
constructor(mdIconRegistry: MdIconRegistry, private route: ActivatedRoute) {
55+
constructor(private route: ActivatedRoute, private router: Router) {
5656
super();
57-
// Create Icon Font
58-
mdIconRegistry.registerFontClassAlias('tux', 'tuxicon');
59-
mdIconRegistry.setDefaultFontSetClass('tuxicon');
6057
// Subscribe to courses database and set current course
6158
this.subscribe('user-courses', this.courseId, () => {
6259
this.course = Collections.courses.findOne({ _id: this.courseId });
@@ -67,6 +64,7 @@ declare var Collections: any;
6764
}, true);
6865
}
6966
ngOnInit() {
70-
this.courseId = (<any>(this.route.snapshot.params)).courseid;
67+
this.courseId = this.router.routerState.parent(this.route).snapshot.params['courseid'];
68+
console.log(this.courseId);
7169
}
7270
}

client/imports/ui/pages/lab/taskview.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ export default class TaskView extends MeteorComponent {
107107
}
108108
else{
109109
if(res.verified){
110-
slf.nextButton = true;
111-
}
112-
else{
113-
slf.nextButton = false;
114-
}
110+
slf.nextButton = true;
111+
}
112+
else{
113+
slf.nextButton = false;
114+
}
115115
slf.taskUpdates = res.taskUpdates;
116116
}
117117
});

client/imports/ui/routes/routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ import { provideRouter, RouterConfig } from '@angular/router';
2121

2222
// Explore
2323
import Explore from '../pages/explore/explore.ts';
24-
import Terms from '../pages/static/terms.ts';
2524

2625
// Static
2726
import Privacy from '../pages/static/privacy.ts';
27+
import Terms from '../pages/static/terms.ts';
2828

2929
/* ROUTES */
3030
const routes : RouterConfig = [

client/style/explore/_explore.scss

Lines changed: 128 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -1,145 +1,146 @@
11
.tuxlab-explore {
2-
width:100%;
3-
max-width:$tuxlab-max-width;
4-
margin:0 auto;
2+
width:100%;
3+
max-width:$tuxlab-max-width;
4+
margin:0 auto;
55

6-
md-tab-group {
7-
background-color: white;
8-
margin: 30px;
9-
.md-active.md-tab-label {
10-
background-color: #ffd54f;
11-
}
12-
md-ink-bar {
13-
background-color: white;
14-
}
15-
}
16-
.md-tab-header {
17-
background-color: #ffc400;
18-
}
6+
md-tab-group {
7+
background-color: white;
8+
margin: 30px;
9+
.md-active.md-tab-label {
10+
background-color: #ffd54f;
11+
}
12+
md-ink-bar {
13+
background-color: white;
14+
}
15+
}
16+
.md-tab-header {
17+
background-color: #ffc400;
18+
}
1919

20-
#search-view {
21-
display: none;
22-
}
20+
#search-view {
21+
display: none;
22+
}
2323
}
2424

2525

2626
// Searchbar
2727
.search-toolbar{
28-
margin-bottom: 30px;
29-
md-toolbar{
30-
min-height:inherit;
31-
background-color: white;
32-
.search-toolbar-nav {
33-
height: 100%;
34-
width: 100%;
35-
.wrapper{
36-
display: flex;
37-
flex-direction: row;
38-
flex-wrap: nowrap;
39-
justify-content: flex-start;
40-
width:100%;
41-
height: 100%;
42-
max-width:$tuxlab-max-width;
43-
margin: 0 auto;
44-
.icon {
45-
cursor: pointer;
46-
margin-left: 20px;
47-
}
48-
.icon:hover {
49-
background-color: #efefef;
50-
}
51-
52-
.tuxicon:before {
53-
font-size: 48px;
54-
}
55-
md-icon {
56-
margin-right: 20px;
57-
color: dimgrey;
58-
line-height: 50px;
59-
}
60-
div{
61-
height: 100%;
62-
}
63-
.searchbar {
64-
width: 100%;
65-
height: 100%;
66-
form {
67-
height: 100%;
68-
input {
69-
width: 100%;
70-
height: 100%;
71-
background-color: white;
72-
border: 0;
73-
transition: 500ms;
74-
padding-top: 0;
75-
padding-bottom: 0;
76-
padding-left: 20px;
77-
margin-right: 10px;
78-
}
79-
input:focus {
80-
background-color: #efefef;
81-
transition: 500ms;
82-
outline: none;
83-
}
84-
}
85-
}
86-
}
87-
}
88-
}
28+
margin-bottom: 30px;
29+
md-toolbar{
30+
min-height:inherit;
31+
background-color: white;
32+
.search-toolbar-nav {
33+
height: 100%;
34+
width: 100%;
35+
.wrapper{
36+
display: flex;
37+
flex-direction: row;
38+
flex-wrap: nowrap;
39+
justify-content: flex-start;
40+
width:100%;
41+
height: 100%;
42+
max-width:$tuxlab-max-width;
43+
margin: 0 auto;
44+
.icon {
45+
cursor: pointer;
46+
margin-left: 20px;
47+
}
48+
.icon:hover {
49+
background-color: #efefef;
50+
}
51+
.tuxicon:before {
52+
font-size: 48px;
53+
}
54+
md-icon {
55+
margin-right: 20px;
56+
color: dimgrey;
57+
line-height: 50px;
58+
}
59+
div{
60+
height: 100%;
61+
}
62+
.searchbar {
63+
width: 100%;
64+
height: 100%;
65+
form {
66+
height: 100%;
67+
input {
68+
width: 100%;
69+
height: 100%;
70+
background-color: white;
71+
border: 0;
72+
transition: 500ms;
73+
padding-top: 0;
74+
padding-bottom: 0;
75+
padding-left: 20px;
76+
margin-right: 10px;
77+
}
78+
input:focus {
79+
background-color: #efefef;
80+
transition: 500ms;
81+
outline: none;
82+
}
83+
}
84+
}
85+
}
86+
}
87+
}
8988
}
9089

9190
.tuxlab-searchview {
92-
.course-search-list {
93-
background-color: white;
94-
padding: 40px;
95-
margin-bottom: 40px;
91+
.course-search-list {
92+
background-color: white;
93+
padding: 40px;
94+
margin-bottom: 40px;
9695

97-
h2 {
98-
color: #999999;
99-
}
96+
h2 {
97+
color: #999999;
98+
}
10099

101-
.selector {
102-
text-align: right;
103-
color: #999999;
104-
button {
105-
color: #999999;
106-
}
107-
md-icon {
108-
line-height: 16px;
109-
}
110-
.tuxicon:before {
111-
font-size: 36px;
112-
}
113-
}
100+
.selector {
101+
text-align: right;
102+
color: #999999;
103+
button {
104+
color: #999999;
105+
}
106+
md-icon {
107+
line-height: 16px;
108+
}
109+
.tuxicon:before {
110+
font-size: 36px;
111+
}
112+
}
114113

115-
}
116-
md-data-table {
117-
tbody {
118-
td {
119-
a {
120-
color: black;
121-
}
122-
}
123-
}
124-
}
114+
}
115+
md-data-table {
116+
tbody {
117+
td {
118+
a {
119+
color: black;
120+
}
121+
}
122+
}
123+
}
125124
}
126125

127126
.tuxlab-exploreview {
128-
md-content {
129-
h1 {
130-
padding: 10px;
131-
}
132-
p {
133-
padding: 10px;
134-
text-indent: 1em;
135-
}
136-
.course-link {
137-
text-align: right;
138-
a {
139-
color: black;
140-
align-self: right;
141-
}
142-
}
143-
144-
}
127+
md-content {
128+
h1 {
129+
padding: 10px;
130+
}
131+
p {
132+
padding: 10px;
133+
text-indent: 1em;
134+
}
135+
.course-link {
136+
text-align: right;
137+
a {
138+
color: black;
139+
align-self: right;
140+
}
141+
}
142+
p.instructors {
143+
float: left;
144+
}
145+
}
145146
}

0 commit comments

Comments
 (0)