Changeset 531 for Dev/trunk/src/client


Ignore:
Timestamp:
03/27/14 14:44:36 (11 years ago)
Author:
hendrikvanantwerpen
Message:
  • Return to using truly ISO formatted dates, including milliseconds.
  • Also set constraint on surveyrun dates when value is initially set.
  • Separate runs & results from surveys and questions.
  • Moved date & email format to schema itself.
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  
    6464        },
    6565        _formatDate: function(date) {
    66             return stamp.toISOString(date,{zulu:true,milliseconds:false});
     66            return stamp.toISOString(date,{zulu:true,milliseconds:true});
    6767        },
    6868        _sanitize: function(obj) {
  • Dev/trunk/src/client/qed-client/model/widgets/SurveyRunWidget.js

    r513 r531  
    1111            var endDateBox = this.endDateBox;
    1212            this.own(this.startDateBox.on('change', function(value){
    13                 endDateBox.constraints.min  = value;
     13                endDateBox.constraints.min = value;
    1414            }));
    1515        },
     
    2424                value.respondentCanDeleteOwnResponse ? ["on"] : [];
    2525            this.inherited(arguments);
     26            this.endDateBox.constraints.min =
     27                this.startDateBox.get('value');
    2628        }
    2729    });
  • Dev/trunk/src/client/qed-client/pages/surveys.js

    r529 r531  
    1818            this.draftsTab.set('title','Drafts (<span class="qedLoading"></span>)');
    1919            this.publishedTab.set('title','Published (<span class="qedLoading"></span>)');
    20             this.runsTab.set('title','Runs (<span class="qedLoading"></span>)');
    2120            this.refresh();
    2221        },
     
    5655        _onRunSurvey:function(survey){
    5756            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());
    5959            surveyRun.survey = survey;
    6060            surveyRuns.save(surveyRun)
    6161            .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)));
    7864            }),lang.hitch(this,function(err){
    7965                this.notify(err.error,'error');
     
    8369            this.refreshDrafts();
    8470            this.refreshPublished();
    85             this.refreshRuns();
    8671        },
    8772        refreshDrafts: function() {
    88             this.draftsContainer.set('content','');
     73            this.draftsContainer.set('content','Loading draft surveys <span class="qedLoading"></span>');
    8974            when(surveys.query({drafts:true}), lang.hitch(this,function(surveys) {
    9075                this.draftsTab.set('title','Drafts ('+surveys.length+')');
     76                this.draftsContainer.set('content','');
    9177                array.forEach(surveys,function(survey){
    9278                    var w = new LineWithActionsWidget({
     
    127113        },
    128114        refreshPublished: function() {
    129             this.publishedContainer.set('content','');
     115            this.publishedContainer.set('content','Loading published surveys <span class="qedLoading"></span>');
    130116            when(surveys.query({published:true}), lang.hitch(this, function(surveys) {
     117                this.publishedContainer.set('content','');
    131118                this.publishedTab.set('title','Published ('+surveys.length+')');
    132119                array.forEach(surveys,function(survey){
     
    152139                },this);
    153140            }));
    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             }));
    181141        }
    182142    });
  • Dev/trunk/src/client/qed-client/pages/templates/surveys.html

    r529 r531  
    3434        </div>
    3535
    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>
    4836    </div>
    4937
  • Dev/trunk/src/client/qed-client/routes.js

    r490 r531  
    11define([
    22    "./model/classes/questions",
     3    "./model/classes/sessions",
    34    "./model/classes/surveyRuns",
    45    "./model/classes/surveys",
     
    910    "./pages/survey",
    1011    "./pages/surveyRun",
     12    "./pages/surveyRuns",
    1113    "./pages/surveys"
    12 ], function(questionsClass, surveyRunsClass, surveysClass, index, previewSurvey, question, questions, survey, surveyRun, surveys) {
     14], function(questionsClass, sessionsClass, surveyRunsClass, surveysClass, index, previewSurvey, question, questions, survey, surveyRun, surveyRuns, surveys) {
    1315
    1416    return [
     
    1921        { path: surveysClass.getCollectionPath(), constructor: surveys },
    2022        { path: surveysClass.getObjectPath(':objectId'), constructor: survey },
     23        { path: surveyRunsClass.getCollectionPath(), constructor: surveyRuns },
    2124        { 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 },
    2427        { path: surveysClass.getPreviewPath(':surveyId'), constructor: previewSurvey }
    2528    ];
  • Dev/trunk/src/client/qed-client/ui/templates/MainMenu.html

    r466 r531  
    11<div class="mainMenu">
    22    <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">
    57            <span>Content</span>
    68            <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>
    1117            </div>
    1218        </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>
    1524    </div>
    1625</div>
Note: See TracChangeset for help on using the changeset viewer.