diff --git a/app/controllers/review/edit.js b/app/controllers/review/edit.js deleted file mode 100644 index 8647a23..0000000 --- a/app/controllers/review/edit.js +++ /dev/null @@ -1,22 +0,0 @@ -import Ember from 'ember'; - -var ReviewEditController = Ember.Controller.extend({ - ratingChoices: [1,2,3,4,5,6,7,8,9,10], - - actions: { - saveChanges: function () { - var _this = this; - var review = this.get('model'); - review.save().then(function () { - _this.transitionToRoute('reviews.index'); - }); - }, - - cancel: function() { - this.get('model').rollback(); - } - } - -}); - -export default ReviewEditController; diff --git a/app/controllers/reviews/index.js b/app/controllers/reviews/index.js deleted file mode 100644 index 29f1956..0000000 --- a/app/controllers/reviews/index.js +++ /dev/null @@ -1,37 +0,0 @@ -import Ember from 'ember'; - -var ReviewsIndexController = Ember.ArrayController.extend({ - needs: ['currentUser'], - currentUser: Ember.computed.alias('controllers.currentUser'), - - sortProperties: ['createdAt'], - sortAscending: false, - - filteredReviews: function() { - return this.get('arrangedContent').filter(function(review) { - return !review.get('isDirty'); - }); - }.property('arrangedContent.@each.isDirty'), - - isAlreadyReviewed: function () { - var currentUserId = this.get('currentUser.id'), - currentUserReview = this.get('content').findBy('model.user.id', currentUserId); - - return !!currentUserReview; - }.property('content'), - - averageRating: function() { - var sumOfRatings = this.get('filteredReviews').reduce(function (total, review) { - return total + review.get('rating'); - }, 0), - reviewsCount = this.get('filteredReviews').length; - - return sumOfRatings / reviewsCount; - }.property('filteredReviews.@each.rating'), - - averageRatingRoundedToNearestHalf: function() { - return (Math.round(this.get('averageRating') * 2) / 2).toFixed(1); - }.property('averageRating') -}); - -export default ReviewsIndexController; diff --git a/app/controllers/reviews/new.js b/app/controllers/reviews/new.js deleted file mode 100644 index cc0776f..0000000 --- a/app/controllers/reviews/new.js +++ /dev/null @@ -1,19 +0,0 @@ -import Ember from 'ember'; - -var ReviewsNewController = Ember.Controller.extend({ - - ratingChoices: [1,2,3,4,5,6,7,8,9,10], - - actions: { - submitReview: function () { - var _this = this; - var review = this.get('content'); - review.save().then(function () { - _this.transitionToRoute('reviews.index'); - }); - } - } - -}); - -export default ReviewsNewController; diff --git a/app/models/course.js b/app/models/course.js index a1949d7..71fdc64 100644 --- a/app/models/course.js +++ b/app/models/course.js @@ -12,7 +12,6 @@ var Course = DS.Model.extend({ scorecards: DS.hasMany('scorecard', { async: true }), holes: DS.hasMany('hole', { async: true }), holeCount: DS.attr('number'), - reviews: DS.hasMany('review', { async: true }), photos: DS.hasMany('photo', {async: true}), isApproved: function() { diff --git a/app/models/review.js b/app/models/review.js deleted file mode 100644 index ce5cc4f..0000000 --- a/app/models/review.js +++ /dev/null @@ -1,15 +0,0 @@ -import DS from 'ember-data'; -import Ember from 'ember'; - -var Review = DS.Model.extend({ - rating: DS.attr('number'), - canUpdate: DS.attr('boolean'), - post: DS.attr('string'), - course: DS.belongsTo('course', { async: true }), - user: DS.belongsTo('user', { async: true }), - createdAt: DS.attr('date'), - - userFullName: Ember.computed.alias('user.fullName') -}); - -export default Review; diff --git a/app/router.js b/app/router.js index b61f939..1a43908 100644 --- a/app/router.js +++ b/app/router.js @@ -18,12 +18,6 @@ Router.map(function() { this.resource('courseRounds', { path: '/rounds' }); this.resource('courseStatLog', { path: '/stats' }); this.resource('holeStatLogs', { path: '/holes' }); - this.resource('reviews', function() { - this.route('new'); - }); - this.resource('review', { path: '/reviews/:review_id' }, function() { - this.route('edit'); - }); }); this.resource('friends'); this.resource('profile', function() { diff --git a/app/routes/review.js b/app/routes/review.js deleted file mode 100644 index 645f2a7..0000000 --- a/app/routes/review.js +++ /dev/null @@ -1,9 +0,0 @@ -import AuthenticatedRoute from './authenticated'; - -var ReviewRoute = AuthenticatedRoute.extend({ - model: function(params) { - return this.store.find('review', params.review_id); - } -}); - -export default ReviewRoute; diff --git a/app/routes/reviews/index.js b/app/routes/reviews/index.js deleted file mode 100644 index 0cc9c5e..0000000 --- a/app/routes/reviews/index.js +++ /dev/null @@ -1,9 +0,0 @@ -import AuthenticatedRoute from '../authenticated'; - -var ReviewsIndexRoute = AuthenticatedRoute.extend({ - model: function() { - return this.modelFor('course').get('reviews'); - } -}); - -export default ReviewsIndexRoute; diff --git a/app/routes/reviews/new.js b/app/routes/reviews/new.js deleted file mode 100644 index 76b34fb..0000000 --- a/app/routes/reviews/new.js +++ /dev/null @@ -1,13 +0,0 @@ -import AuthenticatedRoute from '../authenticated'; - -var ReviewsNewRoute = AuthenticatedRoute.extend({ - - model: function() { - return this.store.createRecord('review', { - course: this.modelFor('course') - }); - } - -}); - -export default ReviewsNewRoute; diff --git a/app/styles/app.scss b/app/styles/app.scss index 68dcddd..888db89 100644 --- a/app/styles/app.scss +++ b/app/styles/app.scss @@ -12,7 +12,6 @@ @import "flatboot"; @import "variables_and_overrides"; @import "round-show-table"; -@import "reviews"; @import "twitter-typeahead"; @import "block-grids"; @import "turns"; diff --git a/app/styles/reviews.scss b/app/styles/reviews.scss deleted file mode 100644 index a267f91..0000000 --- a/app/styles/reviews.scss +++ /dev/null @@ -1,12 +0,0 @@ -.review-header { - background-color: #fafafa; - padding: 5px; -} - -.review-body { - padding: 5px; -} - -.review { - margin-bottom: 10px; -} diff --git a/app/templates/course.hbs b/app/templates/course.hbs index 37c1323..af403ff 100644 --- a/app/templates/course.hbs +++ b/app/templates/course.hbs @@ -37,15 +37,6 @@ {{/link-to}} - {{#link-to "reviews" tagName="li" classNames="u-pointer"}} - - - - - - {{/link-to}} {{#link-to "leaderboard" tagName="li" classNames="u-pointer"}}