Skip to content
Browse files

Admin: Survey: Add comments report

Add a rough comments report.
  • Loading branch information...
1 parent 8038ee6 commit 63c0d662776a651f0f744edbdd973ad05bd7dbca @exclsr exclsr committed Jan 30, 2014
Showing with 92 additions and 0 deletions.
  1. +1 −0 admin/default.aspx
  2. +1 −0 admin/js/app.js
  3. +21 −0 admin/js/controllers.js
  4. +69 −0 admin/partials/survey/comments.html
View
1 admin/default.aspx
@@ -36,6 +36,7 @@
<li><a href="#/survey/next-year">Next Year</a></li>
<li><a href="#/survey/who">Who</a></li>
<li><a href="#/survey/music">Music</a></li>
+ <li><a href="#/survey/comments">Comments</a></li>
<li><a href="#/survey">All</a></li>
</ul>
View
1 admin/js/app.js
@@ -21,6 +21,7 @@ angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.directives'])
$routeProvider.when('/survey/next-year', {templateUrl: 'partials/survey/next-year.html', controller:SurveyNextYearCtrl});
$routeProvider.when('/survey/music', {templateUrl: 'partials/survey/music.html', controller:SurveyMusicCtrl});
$routeProvider.when('/survey/who', {templateUrl: 'partials/survey/who.html', controller:SurveyWhoCtrl});
+ $routeProvider.when('/survey/comments', {templateUrl: 'partials/survey/comments.html', controller:SurveyCommentsCtrl});
$routeProvider.otherwise({redirectTo: '/guests'});
View
21 admin/js/controllers.js
@@ -796,4 +796,25 @@ function SurveyWhoCtrl($scope, $http) {
appendAllYearsChart();
}
+function SurveyCommentsCtrl($scope, $http) {
+ getSurveyData($scope, $http, '/data/admin/survey/all');
+
+ $scope.wasPresent = function(survey) {
+ if (survey.attendance === "present") {
+ return true;
+ }
+
+ if (!survey.present) {
+ return false;
+ }
+ if (survey.present.friday
+ || survey.present.saturday
+ || survey.present.sunday) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ };
+}
View
69 admin/partials/survey/comments.html
@@ -0,0 +1,69 @@
+<style>
+.entry {
+ padding-left: 2ex;
+ padding-top: 1.1em;
+}
+.entry h4 {
+ font-weight: normal;
+}
+.entry h6 {
+ color: #888;
+}
+.entry pre {
+ font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
+ margin-top: 0;
+ padding-top: 0;
+ border: none;
+ background-color: transparent;
+ white-space: pre-wrap;
+ word-wrap: break-word;
+}
+.entry.odd {
+ background-color: #f6f6f6;
+}
+</style>
+
+<h4>Survey: Comments</h4>
+<div class="show{{loggedOut}}">(You are probably not logged in, at the moment.
+ <a href='/data/admin/auth/google'>Log in</a>.)</div>
+
+<h4>Count: {{surveys.length}}</h4>
+<div class="entry" ng-repeat="survey in surveys" ng-class-odd="'odd'" style="margin-top: 2.4em">
+ <h6>survey id: {{survey._id}}</h6>
+ <h4>Which days?</h4>
+ <ul>
+ <li ng-show="survey.present.friday">Friday</li>
+ <li ng-show="survey.present.saturday">Saturday</li>
+ <li ng-show="survey.present.sunday">Sunday</li>
+ <li ng-hide="survey.present.friday || survey.present.saturday || survey.present.sunday">
+ None <span ng-show="wasPresent(survey)">... Actually, this person said they attended, but did not say which days.</span></li>
+ </ul>
+
+ <div ng-show="wasPresent(survey)">
+ <h4>Why did you decide to attend?</h4>
+ <pre>{{survey.whyAttended}}</pre>
+
+ <h4>How did it go for you?</h4>
+ <pre>{{survey.howDidItGo}}</pre>
+
+ <h4>Anything else we should know about?</h4>
+ <pre>{{survey.anythingElse}}</pre>
+
+ <h4>Any comments for the DJs?</h4>
+ <pre>{{survey.event.DJcomments}}</pre>
+
+ <h4>Last words?</h4>
+ <pre>{{survey.lastWords}}</pre>
+ </div>
+
+ <div ng-show="!wasPresent(survey)">
+ <h4>What town do you live in?</h4>
+ <pre>{{survey.absent.zip}}</pre>
+
+ <h4>Did someone invite you?</h4>
+ <pre>{{survey.absent.invited}}</pre>
+
+ <h4>Any comments?</h4>
+ <pre>{{survey.absent.comments}}</pre>
+ </div>
+</div>

0 comments on commit 63c0d66

Please sign in to comment.
Something went wrong with that request. Please try again.