Changeset 531 for Dev/trunk/src/client/qed-client
- Timestamp:
- 03/27/14 14:44:36 (11 years ago)
- Location:
- Dev/trunk/src/client/qed-client
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/src/client/qed-client/model/classes/_Class.js
r525 r531 64 64 }, 65 65 _formatDate: function(date) { 66 return stamp.toISOString(date,{zulu:true,milliseconds: false});66 return stamp.toISOString(date,{zulu:true,milliseconds:true}); 67 67 }, 68 68 _sanitize: function(obj) { -
Dev/trunk/src/client/qed-client/model/widgets/SurveyRunWidget.js
r513 r531 11 11 var endDateBox = this.endDateBox; 12 12 this.own(this.startDateBox.on('change', function(value){ 13 endDateBox.constraints.min 13 endDateBox.constraints.min = value; 14 14 })); 15 15 }, … … 24 24 value.respondentCanDeleteOwnResponse ? ["on"] : []; 25 25 this.inherited(arguments); 26 this.endDateBox.constraints.min = 27 this.startDateBox.get('value'); 26 28 } 27 29 }); -
Dev/trunk/src/client/qed-client/pages/surveys.js
r529 r531 18 18 this.draftsTab.set('title','Drafts (<span class="qedLoading"></span>)'); 19 19 this.publishedTab.set('title','Published (<span class="qedLoading"></span>)'); 20 this.runsTab.set('title','Runs (<span class="qedLoading"></span>)');21 20 this.refresh(); 22 21 }, … … 56 55 _onRunSurvey:function(survey){ 57 56 var surveyRun = surveyRuns.create(); 58 surveyRun.title = 'Run of "' + survey.title + '" of '+(new Date().toString()); 57 surveyRun.title = 'Run of "'+survey.title+'" of '+ 58 (new Date().toString()); 59 59 surveyRun.survey = survey; 60 60 surveyRuns.save(surveyRun) 61 61 .then(lang.hitch(this,function(surveyRun){ 62 this._onRunDetails(surveyRun); 63 }),lang.hitch(this,function(err){ 64 this.notify(err.error,'error'); 65 })); 66 }, 67 _onRunDetails: function(surveyRun) { 68 Router.go(surveyRuns.getObjectPath(surveyRun)); 69 }, 70 _onRunDelete: function(surveyRun) { 71 if ( !confirm("Are you sure you want to delete this survey run?") ) { 72 return; 73 } 74 surveyRuns.remove(surveyRun) 75 .then(lang.hitch(this,function(){ 76 this.notify("SurveyRun successfully deleted."); 77 this.refreshRuns(); 62 Router.go(surveyRuns.getObjectPath( 63 surveyRuns.getId(surveyRun))); 78 64 }),lang.hitch(this,function(err){ 79 65 this.notify(err.error,'error'); … … 83 69 this.refreshDrafts(); 84 70 this.refreshPublished(); 85 this.refreshRuns();86 71 }, 87 72 refreshDrafts: function() { 88 this.draftsContainer.set('content',' ');73 this.draftsContainer.set('content','Loading draft surveys <span class="qedLoading"></span>'); 89 74 when(surveys.query({drafts:true}), lang.hitch(this,function(surveys) { 90 75 this.draftsTab.set('title','Drafts ('+surveys.length+')'); 76 this.draftsContainer.set('content',''); 91 77 array.forEach(surveys,function(survey){ 92 78 var w = new LineWithActionsWidget({ … … 127 113 }, 128 114 refreshPublished: function() { 129 this.publishedContainer.set('content',' ');115 this.publishedContainer.set('content','Loading published surveys <span class="qedLoading"></span>'); 130 116 when(surveys.query({published:true}), lang.hitch(this, function(surveys) { 117 this.publishedContainer.set('content',''); 131 118 this.publishedTab.set('title','Published ('+surveys.length+')'); 132 119 array.forEach(surveys,function(survey){ … … 152 139 },this); 153 140 })); 154 },155 refreshRuns: function() {156 this.runsContainer.set('content','');157 when(surveyRuns.query(), lang.hitch(this,function(surveyRuns){158 this.runsTab.set('title','Runs ('+surveyRuns.length+')');159 array.forEach(surveyRuns,function(surveyRun){160 var w = new LineWithActionsWidget({161 title: surveyRun.title || "",162 actions:[{163 callback: lang.hitch(this,'_onRunDetails',surveyRun),164 properties: {165 label: 'Details',166 tooltip: 'Show details for this run',167 icon: 'Edit'168 }169 },{170 callback: lang.hitch(this,'_onRunDelete',surveyRun),171 properties: {172 label: 'Delete',173 tooltip: 'Delete this run',174 icon: 'Delete'175 }176 }]177 });178 this.runsContainer.addChild(w);179 },this);180 }));181 141 } 182 142 }); -
Dev/trunk/src/client/qed-client/pages/templates/surveys.html
r529 r531 34 34 </div> 35 35 36 <div data-dojo-type="dijit/layout/BorderContainer"37 title="Runs"38 data-dojo-attach-point="runsTab">39 <div data-dojo-type="dijit/layout/ContentPane"40 data-dojo-props="region: 'center'"41 data-dojo-attach-point="runsContainer">42 </div>43 <div data-dojo-type="dijit/layout/ContentPane"44 data-dojo-props="region: 'bottom'"45 style="height: 40px;">46 </div>47 </div>48 36 </div> 49 37 -
Dev/trunk/src/client/qed-client/routes.js
r490 r531 1 1 define([ 2 2 "./model/classes/questions", 3 "./model/classes/sessions", 3 4 "./model/classes/surveyRuns", 4 5 "./model/classes/surveys", … … 9 10 "./pages/survey", 10 11 "./pages/surveyRun", 12 "./pages/surveyRuns", 11 13 "./pages/surveys" 12 ], function(questionsClass, s urveyRunsClass, surveysClass, index, previewSurvey, question, questions, survey, surveyRun, surveys) {14 ], function(questionsClass, sessionsClass, surveyRunsClass, surveysClass, index, previewSurvey, question, questions, survey, surveyRun, surveyRuns, surveys) { 13 15 14 16 return [ … … 19 21 { path: surveysClass.getCollectionPath(), constructor: surveys }, 20 22 { path: surveysClass.getObjectPath(':objectId'), constructor: survey }, 23 { path: surveyRunsClass.getCollectionPath(), constructor: surveyRuns }, 21 24 { path: surveyRunsClass.getObjectPath(':objectId'), constructor: surveyRun }, 22 //{ path: "/sessions", constructor: sessions },23 //{ path: "/session/:sessionId", constructor: session },25 //{ path: sessionsClass.getObjectPath(''), constructor: sessions }, 26 //{ path: sessionsClass.getObjectPath(':objectId'), constructor: session }, 24 27 { path: surveysClass.getPreviewPath(':surveyId'), constructor: previewSurvey } 25 28 ]; -
Dev/trunk/src/client/qed-client/ui/templates/MainMenu.html
r466 r531 1 1 <div class="mainMenu"> 2 2 <div data-dojo-type="dijit/MenuBar"> 3 <div class="rftMainMenuButton" data-dojo-type="./MenuBarLink" data-dojo-props="path:'/sessions'">Sessions</div> 4 <div class="rftMainMenuButton" data-dojo-type="dijit/PopupMenuBarItem"> 3 <div class="rftMainMenuButton" 4 data-dojo-type="./MenuBarLink" data-dojo-props="path:'/sessions'">Sessions</div> 5 <div class="rftMainMenuButton" 6 data-dojo-type="dijit/PopupMenuBarItem"> 5 7 <span>Content</span> 6 8 <div data-dojo-type="dijit/DropDownMenu"> 7 <div data-dojo-type="./MenuLink" class="blue bgColorHover" data-dojo-props="path:'/surveys', iconClass:'rftIcon rftIconSurvey'">Surveys</div> 8 <div data-dojo-type="./MenuLink" class="orange bgColorHover" data-dojo-props="path:'/questions', iconClass:'rftIcon rftIconQuestion'">Questions</div> 9 <div data-dojo-type="./MenuLink" class="purple bgColorHover" data-dojo-props="path:'/applications', iconClass: 'rftIcon rftIconApplication'">Applications</div> 10 <div data-dojo-type="./MenuLink" class="red bgColorHover" data-dojo-props="path:'/dashboards', iconClass: 'rftIcon rftIconDashboard'">Dashboards</div> 9 <div data-dojo-type="./MenuLink" 10 class="blue bgColorHover" 11 data-dojo-props="path:'/surveys', iconClass:'rftIcon rftIconSurvey'"> 12 Surveys</div> 13 <div data-dojo-type="./MenuLink" 14 class="orange bgColorHover" 15 data-dojo-props="path:'/questions', iconClass:'rftIcon rftIconQuestion'"> 16 Questions</div> 11 17 </div> 12 18 </div> 13 <div class="rftMainMenuButton" data-dojo-type="./MenuBarLink" data-dojo-props="path:'/results'">Results</div> 14 <div class="rftMainMenuButton" data-dojo-type="./SessionMenu"></div> 19 <div class="rftMainMenuButton" 20 data-dojo-type="./MenuBarLink" data-dojo-props="path:'/surveyRuns'"> 21 Results</div> 22 <div class="rftMainMenuButton" 23 data-dojo-type="./SessionMenu"></div> 15 24 </div> 16 25 </div>
Note: See TracChangeset
for help on using the changeset viewer.