Changeset 421
- Timestamp:
- 12/27/12 17:46:05 (12 years ago)
- Location:
- Dev/branches/rest-dojo-ui
- Files:
-
- 8 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/rest-dojo-ui/client/admin.html
r420 r421 2 2 <html> 3 3 <head> 4 <title>QED </title>4 <title>QED - Researcher</title> 5 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 6 6 <link rel="stylesheet" type="text/css" href="qed/css/main.css" /> -
Dev/branches/rest-dojo-ui/client/qed/css/hva-mods.css
r420 r421 18 18 } 19 19 20 #rft.claro .qedField.qedFill { 21 width: 350px; 22 } 23 20 24 #rft.claro .qedFieldset { 21 25 margin: 1em 0px; -
Dev/branches/rest-dojo-ui/client/qed/main-admin.js
r420 r421 6 6 'qed/app/Router', 7 7 'qed/ui/MainMenu', 8 'qed/routes ',8 'qed/routes-admin', 9 9 'qed/store', 10 10 'qed/stddeps', -
Dev/branches/rest-dojo-ui/client/qed/model/widgets/QuestionWidgetFactory.js
r417 r421 353 353 354 354 var MultipleChoiceInputEdit = declare([_WidgetBase, _Container], { 355 _codeInput: null,356 355 _multipleInput: null, 357 356 postCreate: function() { 358 357 var table = new TableContainer({ cols: 1, customClass: "labelsAndValues"} ); 359 360 this._codeInput = new TextBox({361 title: "Code"362 });363 table.addChild(this._codeInput);364 this._codeInput.startup();365 358 366 359 this._multipleInput = new CheckBox({ … … 390 383 391 384 _setValueAttr: function(value) { 392 this._codeInput.set('value', value.code || "");393 385 this._multipleInput.set('checked', value.multiple); 394 386 this._optionsList.deleteItems(); … … 398 390 return { 399 391 type: "MultipleChoiceInput", 400 code: this._codeInput.get('value') || "",401 392 multiple: this._multipleInput.get('checked'), 402 393 items: array.map(this._optionsList.getItems(),function(item){ -
Dev/branches/rest-dojo-ui/client/qed/pages/surveyRun.js
r420 r421 10 10 '../app/Page', 11 11 '../model/classes/SurveyRun', 12 '../widgets/LineWithActionsWidget', 12 13 'dojo/text!./templates/surveyRun.html' 13 ],function(declare,event,lang,when,Content,Router,func,store,Page,SurveyRun, template){14 ],function(declare,event,lang,when,Content,Router,func,store,Page,SurveyRun,LineWithActionsWidget,template){ 14 15 return declare([Page],{ 15 16 templateString: template, … … 21 22 if ( this.surveyRunId ) { 22 23 this._loadSurveyRun(); 24 this._loadResponses(); 23 25 } else { 24 26 throw "No valid uid or survey passed!"; … … 29 31 .then(lang.hitch(this,function(surveyRun){ 30 32 this.surveyRun = surveyRun; 31 this.refresh ();33 this.refreshSurveyRun(); 32 34 })); 33 35 }, 34 refresh : function() {36 refreshSurveyRun: function() { 35 37 this.titleNode.innerHTML = SurveyRun.DisplayTitle.get(this.surveyRun); 36 38 this.surveyNode.set('value',SurveyRun.Survey.get(this.surveyRun)); … … 38 40 this._onPropChange(); 39 41 }, 42 _loadResponses: function() { 43 when(store.query("_design/responses/_view/by_surveyrun",{key:this.surveyRunId})) 44 .forEach(lang.hitch(this,function(response){ 45 var actions = { 46 view: { 47 callback: function(){}, 48 properties: { 49 title: "View response" 50 } 51 } 52 }; 53 if ( !response.publicationDate ) { 54 actions.remove = { 55 callback: function(){}, 56 properties: { 57 title: "Remove response" 58 } 59 }; 60 } 61 var w = new LineWithActionsWidget({ 62 actions: actions 63 }); 64 var responseId = store.getIdentity(response); 65 w.set('title',this._link(this._getResponseURL(this.surveyRunId,responseId),responseId)); 66 w.placeAt(this.responsesNode); 67 })); 68 }, 40 69 _onPropChange: function(e) { 41 70 var surveyRun = this.propertiesForm.get('value'); 42 71 if ( surveyRun.mode === "open" ) { 43 var url = 'response.html#!/'+store.getIdentity(this.surveyRun); 44 this.runURLNode.innerHTML = '<a target="_black" href="'+url+'">'+url+'</a>'; 72 this.runURLNode.innerHTML = this._link(this._getGeneralURL(store.getIdentity(this.surveyRun))); 45 73 } else { 46 74 this.runURLNode.innerHTML = "No general URL. Add individual respondents below."; 47 75 } 76 }, 77 _getGeneralURL: function(surveyRunId) { 78 return 'response.html#!/'+surveyRunId; 79 }, 80 _getResponseURL: function(surveyRunId,responseId) { 81 return 'response.html#!/'+surveyRunId+'!id='+responseId; 82 }, 83 _link: function(url,label) { 84 return '<a target="_black" href="'+url+'">'+(label || url)+'</a>'; 48 85 }, 49 86 _onSave: function(evt) { -
Dev/branches/rest-dojo-ui/client/qed/pages/templates/surveyRun.html
r420 r421 16 16 <fieldset class="qedFieldset"> 17 17 <div><div class="qedLabel">General URL</div><div class="qedField" data-dojo-attach-point="runURLNode" style="overflow: ellipsis"></div></div> 18 <div><div class="qedLabel">Responses <span data-dojo-attach-point="responsesCountNode"></span></div><div class="qedField qedFill" data-dojo-attach-point="responsesNode"></div> 18 19 </fieldset> 19 20 </div> -
Dev/branches/rest-dojo-ui/client/response.html
r420 r421 2 2 <html> 3 3 <head> 4 <title> Survey</title>4 <title>QED - Respondent</title> 5 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 6 6 <link rel="stylesheet" type="text/css" href="qed/css/main.css" /> -
Dev/branches/rest-dojo-ui/server/couchdb-admin/config/data/design-docs.js
r415 r421 100 100 } 101 101 } 102 }, 103 "qed/_design/responses": { 104 __configAction: "replace", 105 _id: "_design/responses", 106 language: "javascript", 107 views: { 108 by_surveyrun: { 109 map: function(doc){ 110 if ( doc.type !== 'Response' ) { return; } 111 emit(doc.surveyRunId, doc); 112 } 113 } 114 } 102 115 } 103 116 };
Note: See TracChangeset
for help on using the changeset viewer.