Permalink
Browse files

Fix review ratings display.

Thought it was more simple than this. Should have created a branch. My
bad.
  • Loading branch information...
philipmjohnson committed Apr 3, 2017
1 parent eda2cc5 commit c36b6a0eb7edc7dba937d0619a05fdf3809eaee5
@@ -4,6 +4,7 @@ import { Feeds } from '../../../api/feed/FeedCollection';
import { Reviews } from '../../../api/review/ReviewCollection.js';
import { Semesters } from '../../../api/semester/SemesterCollection.js';
import { Users } from '../../../api/user/UserCollection.js';
import { reviewRatingsObjects } from '../shared/review-ratings';
import * as FormUtils from './form-fields/form-field-utilities.js';
const addSchema = new SimpleSchema({
@@ -34,12 +35,7 @@ Template.Add_Review_Widget.helpers({
return ['course', 'opportunity'];
},
ratings() {
return [{ score: 1, description: '1 (In general, this is one of the worst ICS ' +
'courses/opportunities I have ever taken)' },
{ score: 2, description: '2 (In general, this is below average for an ICS course/opportunity)' },
{ score: 3, description: '3 (In general, this is an average ICS course/opportunity)' },
{ score: 4, description: '4 (In general, this is above average for an ICS course/opportunity)' },
{ score: 5, description: '5 (In general, this is one of the best ICS courses/opportunities I have ever taken)' }];
return reviewRatingsObjects;
},
});
@@ -5,7 +5,7 @@
<option value="">Select Rating</option>
{{#each rating in ratings}}
<option value="{{rating.score}}" selected="{{isSelected rating selectedRating}}">{{> Student_Explorer_Review_Stars_Widget rating = rating.score}}
<br>{{rating.description}}</option>
{{rating.description}}</option>
{{/each}}
</select>
{{> Form_Error_Message errorMessage=errorMessage}}
@@ -6,6 +6,7 @@ import { Courses } from '../../../api/course/CourseCollection.js';
import { Opportunities } from '../../../api/opportunity/OpportunityCollection.js';
import { Users } from '../../../api/user/UserCollection.js';
import { Slugs } from '../../../api/slug/SlugCollection.js';
import { reviewRatingsObjects } from '../shared/review-ratings.js';
import * as FormUtils from './form-fields/form-field-utilities.js';
const updateSchema = new SimpleSchema({
@@ -35,12 +36,7 @@ Template.Update_Review_Widget.helpers({
return ['course', 'opportunity'];
},
ratings() {
return [{ score: 1, description: '1 (In general, this is one of the worst ICS ' +
'courses/opportunities I have ever taken)' },
{ score: 2, description: '2 (In general, this is below average for an ICS course/opportunity)' },
{ score: 3, description: '3 (In general, this is an average ICS course/opportunity)' },
{ score: 4, description: '4 (In general, this is above average for an ICS course/opportunity)' },
{ score: 5, description: '5 (In general, this is one of the best ICS courses/opportunities I have ever taken)' }];
return reviewRatingsObjects;
},
slug() {
const review = Reviews.findDoc(Template.currentData().updateID.get());
@@ -19,6 +19,8 @@ import './interest-list.js';
import './moderation.html';
import './moderation.js';
import './review-ratings.js';
import './route-user-name.js';
import '../advisor/student-selector-widget.html';
@@ -0,0 +1,10 @@
/*
Specify review ratings and descriptions for all reviewer widgets.
*/
export const reviewRatingsObjects = [
{ score: 1, description: 'One of the worst' },
{ score: 2, description: 'Below average' },
{ score: 3, description: 'Average' },
{ score: 4, description: 'Above average' },
{ score: 5, description: 'One of the best' }];
@@ -8,6 +8,7 @@ import { Semesters } from '../../../api/semester/SemesterCollection.js';
import { Reviews } from '../../../api/review/ReviewCollection.js';
import { getUserIdFromRoute } from '../shared/get-user-id-from-route';
import { getRouteUserName } from '../shared/route-user-name';
import { reviewRatingsObjects } from '../shared/review-ratings';
import * as FormUtils from '../admin/form-fields/form-field-utilities.js';
const addSchema = new SimpleSchema({
@@ -22,13 +23,7 @@ Template.Student_Explorer_Add_Review_Widget.onCreated(function onCreated() {
Template.Student_Explorer_Add_Review_Widget.helpers({
ratings() {
return [{ score: 1, description: '(In general, this is one of the worst ICS ' +
'courses/opportunities I have ever partcipiated in)' },
{ score: 2, description: '(In general, this is below average for an ICS course/opportunity)' },
{ score: 3, description: '(In general, this is an average ICS course/opportunity)' },
{ score: 4, description: '(In general, this is above average for an ICS course/opportunity)' },
{ score: 5, description: '(In general, this is one of the best ICS courses/opportunities ' +
'I have ever participated in)' }];
return reviewRatingsObjects;
},
semesters() {
const semesters = [];
@@ -6,6 +6,7 @@ import { OpportunityInstances } from '../../../api/opportunity/OpportunityInstan
import { Semesters } from '../../../api/semester/SemesterCollection.js';
import { Reviews } from '../../../api/review/ReviewCollection.js';
import { getUserIdFromRoute } from '../shared/get-user-id-from-route';
import { reviewRatingsObjects } from '../shared/review-ratings';
import * as FormUtils from '../admin/form-fields/form-field-utilities.js';
const editSchema = new SimpleSchema({
@@ -20,13 +21,7 @@ Template.Student_Explorer_Edit_Review_Widget.onCreated(function onCreated() {
Template.Student_Explorer_Edit_Review_Widget.helpers({
ratings() {
return [{ score: 1, description: '(In general, this is one of the worst ICS ' +
'courses/opportunities I have ever participated in)' },
{ score: 2, description: '(In general, this is below average for an ICS course/opportunity)' },
{ score: 3, description: '(In general, this is an average ICS course/opportunity)' },
{ score: 4, description: '(In general, this is above average for an ICS course/opportunity)' },
{ score: 5, description: '(In general, this is one of the best ICS courses/opportunities ' +
'I have ever participated in)' }];
return reviewRatingsObjects;
},
semesters() {
const semesters = [];

0 comments on commit c36b6a0

Please sign in to comment.