mirror of https://github.com/akveo/blur-admin
fixes
parent
eacef1ca2f
commit
be628ea0ec
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -7,6 +7,26 @@
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<p ng-model="survey.description" ng-attr-contenteditable="{{ editmode }}"></p>
|
<p ng-model="survey.description" ng-attr-contenteditable="{{ editmode }}"></p>
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<span class="control-label" style="display: inline-block;position: relative;;margin-right: 25px;">Survey type : </span>
|
||||||
|
<label class="radio-inline custom-radio nowrap">
|
||||||
|
<input type="radio" name="surveyType" ng-model="survey.type" value="s_360">
|
||||||
|
<span>360 Survey</span>
|
||||||
|
</label>
|
||||||
|
<label class="radio-inline custom-radio nowrap">
|
||||||
|
<input type="radio" name="surveyType" ng-model="survey.type" value="s_regular">
|
||||||
|
<span>Regular Survey</span>
|
||||||
|
</label>
|
||||||
|
<label class="radio-inline custom-radio nowrap">
|
||||||
|
<input type="radio" name="surveyType" ng-model="survey.type" value="s_incognito">
|
||||||
|
<span>Incognito Survey</span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<hr />
|
||||||
|
|
||||||
<div id="newElem"></div>
|
<div id="newElem"></div>
|
||||||
|
|
||||||
<div class="control-group col-sm-12 col-xs-12 text-center new-question-container">
|
<div class="control-group col-sm-12 col-xs-12 text-center new-question-container">
|
||||||
|
@ -44,6 +64,7 @@
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<ui-select multiple ng-model="lists.selected"
|
<ui-select multiple ng-model="lists.selected"
|
||||||
|
ng-change="selectedListsChange()"
|
||||||
ng-disabled="false"
|
ng-disabled="false"
|
||||||
search-enabled="true"
|
search-enabled="true"
|
||||||
append-to-body="true"
|
append-to-body="true"
|
||||||
|
@ -55,17 +76,14 @@
|
||||||
{{multipleItem.name}}
|
{{multipleItem.name}}
|
||||||
</ui-select-choices>
|
</ui-select-choices>
|
||||||
</ui-select>
|
</ui-select>
|
||||||
<input type="text" class="form-control compose-input default-color" placeholder="Subject" ng-model="boxCtrl.subject">
|
|
||||||
|
|
||||||
<div class="control-group">
|
<input type="text" class="form-control compose-input default-color" placeholder="Subject" ng-model="survey.subject">
|
||||||
<span class="control-label" style="display: block;float: left;margin: 7px;">360 Survey : </span>
|
|
||||||
<div><ba-switcher switcher-style="primary" switcher-value="survey.s360"></ba-switcher></div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="compose-container">
|
<div class="compose-container">
|
||||||
<text-angular-toolbar ta-toolbar-class="toolbarMain" name="toolbarMain" ta-toolbar="[['h1','h2','h3','bold','italics', 'underline', 'justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'],['userName', 'surveyLink']]"></text-angular-toolbar>
|
<text-angular-toolbar ta-toolbar-class="toolbarMain" name="toolbarMain" ta-toolbar="[['h1','h2','h3','bold','italics', 'underline', 'justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'],['userName', 'surveyLink'],['360Model', 'regularModel', 'incognitoModel']]"></text-angular-toolbar>
|
||||||
<text-angular name="htmlcontent" ta-target-toolbars='toolbarMain,toolbarFooter' ng-model="boxCtrl.text"></text-angular>
|
<text-angular name="htmlcontent" ta-target-toolbars='toolbarMain,toolbarFooter' ng-model="survey.text"></text-angular>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="compose-footer clearfix">
|
<div class="compose-footer clearfix">
|
||||||
|
@ -95,7 +113,7 @@
|
||||||
<div class="feed-messages-container" track-width="smallContainerWidth" min-width="360">
|
<div class="feed-messages-container" track-width="smallContainerWidth" min-width="360">
|
||||||
<div class="feed-message" ng-repeat="l in lists.selected">
|
<div class="feed-message" ng-repeat="l in lists.selected">
|
||||||
<h3>{{l.name}}</h3>
|
<h3>{{l.name}}</h3>
|
||||||
<img class="photo-icon roll-in-blurred-right" ng-src="{{m | profilePicture}}" ng-repeat="m in l.members">
|
<img class="photo-icon roll-in-blurred-right" ng-src="{{m.id | profilePicture}}" ng-repeat="m in l.members">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('BlurAdmin.pages.surveys.create',['BlurAdmin.pages.surveys', 'ui.select', 'ngSanitize', 'textAngular', 'ngTagsInput'])
|
angular.module('BlurAdmin.pages.surveys.create',['BlurAdmin.pages.surveys', 'ui.select', 'ngSanitize', 'textAngular', 'ngTagsInput'])
|
||||||
.directive('tagInput', tagInput)
|
|
||||||
.config(function($provide){
|
.config(function($provide){
|
||||||
$provide.decorator('taOptions', ['taRegisterTool', '$delegate', function(taRegisterTool, taOptions){
|
$provide.decorator('taOptions', ['taRegisterTool', '$delegate', function(taRegisterTool, taOptions){
|
||||||
// $delegate is the taOptions we are decorating
|
// $delegate is the taOptions we are decorating
|
||||||
|
@ -58,23 +57,39 @@
|
||||||
return moveCaret(1);
|
return moveCaret(1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
taRegisterTool('360Model', {
|
||||||
|
iconclass: "fa fa-circle-o-notch",
|
||||||
|
tooltiptext: "Insert a 360 survey text model",
|
||||||
|
action: function(){
|
||||||
|
var model = "<p>Dear {{MEMBER_NAME}},<br><br>You have been selected to participate in a 360 Feedback Survey.<br><br>The purpose of a 360 Feedback Survey is to provide feedback to our leaders that will enable them to develop and improve.<br><br>To gain access to the site, please click on the link below.<br><br>{{SURVEY_LINK}}<br><br>We appreciate your assistance in this process and request that you complete the 360 feedback by .<br><br>Please be sure to answer all questions as honestly and as accurately as you can - all information received is kept strictly confidential. Thank you for taking the time to participate in this survey.<br><br>If you have any questions regarding the survey process or experience any technical difficulties, please contact .<br><br>Thank you for your participation<br></p>";
|
||||||
|
return this.$editor().wrapSelection('insertHTML', model, true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
taRegisterTool('regularModel', {
|
||||||
|
iconclass: "fa fa-file",
|
||||||
|
tooltiptext: "Insert a regular survey text model",
|
||||||
|
action: function(){
|
||||||
|
insertTextAtCursor("REGULAR");
|
||||||
|
return moveCaret(1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
taRegisterTool('incognitoModel', {
|
||||||
|
iconclass: "fa fa-eye-slash",
|
||||||
|
tooltiptext: "Insert an incognito survey text model",
|
||||||
|
action: function(){
|
||||||
|
insertTextAtCursor("INCOGNITO");
|
||||||
|
return moveCaret(1);
|
||||||
|
}
|
||||||
|
});
|
||||||
// add the button to the default toolbar definition
|
// add the button to the default toolbar definition
|
||||||
taOptions.toolbar[1].push('colourRed');
|
taOptions.toolbar[1].push('colourRed');
|
||||||
return taOptions;
|
return taOptions;
|
||||||
}]);
|
}]);
|
||||||
});
|
});
|
||||||
|
|
||||||
function tagInput() {
|
|
||||||
return {
|
|
||||||
restrict: 'A',
|
|
||||||
link: function( $scope, elem, attr) {
|
|
||||||
console.log("tagInput", $scope);
|
|
||||||
$(elem).tagsinput({
|
|
||||||
tagClass: 'label label-' + attr.tagInput,
|
|
||||||
val: 'test'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
/** @ngInject */
|
/** @ngInject */
|
||||||
function CreateTabCtrl(SurveyService, ListService, $scope, $http, $compile, $timeout, $stateParams, $log, toastr) {
|
function CreateTabCtrl(SurveyService, ListService,MemberService, $scope, $http, $compile, $timeout, $stateParams, $log, toastr, $uibModal, $state) {
|
||||||
|
|
||||||
$scope.editmode = true;
|
$scope.editmode = true;
|
||||||
|
|
||||||
|
@ -45,15 +45,13 @@
|
||||||
$scope.survey.name = 'Page Title';
|
$scope.survey.name = 'Page Title';
|
||||||
$scope.survey.description = 'Page Description';
|
$scope.survey.description = 'Page Description';
|
||||||
$scope.survey.elements = [];
|
$scope.survey.elements = [];
|
||||||
|
$scope.survey.type = "s_360";
|
||||||
|
|
||||||
$scope.display = {};
|
$scope.display = {};
|
||||||
$scope.display.survey = true;
|
$scope.display.survey = true;
|
||||||
$scope.display.sidebar = false;
|
$scope.display.sidebar = false;
|
||||||
$scope.display.surveySending = false;
|
$scope.display.surveySending = false;
|
||||||
|
|
||||||
$scope.emailsTexts = []
|
|
||||||
$scope.emailsTexts["s_360"] = "<p>Dear {{MEMBER_NAME}},<br><br>You have been selected to participate in a 360 Feedback Survey.<br><br>The purpose of a 360 Feedback Survey is to provide feedback to our leaders that will enable them to develop and improve.<br><br>To gain access to the site, please click on the link below.<br><br>{{SURVEY_LINK}}<br><br>We appreciate your assistance in this process and request that you complete the 360 feedback by .<br><br>Please be sure to answer all questions as honestly and as accurately as you can - all information received is kept strictly confidential. Thank you for taking the time to participate in this survey.<br><br>If you have any questions regarding the survey process or experience any technical difficulties, please contact .<br><br>Thank you for your participation<br></p>"
|
|
||||||
$scope.emailsTexts["s_default"] = "Normal"
|
|
||||||
|
|
||||||
$scope.progressFunction = function() {
|
$scope.progressFunction = function() {
|
||||||
return $timeout(function() {}, 3000);
|
return $timeout(function() {}, 3000);
|
||||||
|
@ -126,21 +124,38 @@
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.saveSurvey=function(){
|
$scope.saveSurvey=function(process){
|
||||||
var survey = $scope.survey
|
|
||||||
|
if(!process)
|
||||||
|
$scope.survey.list = [];
|
||||||
|
var survey = $scope.survey;
|
||||||
|
|
||||||
if($stateParams.survey_id) {
|
if($stateParams.survey_id) {
|
||||||
SurveyService
|
SurveyService
|
||||||
.update(survey)
|
.update(survey)
|
||||||
.then(
|
.then(
|
||||||
function (data){
|
function (data){
|
||||||
console.log('Survey edited', data);
|
console.log('Survey edited', data);
|
||||||
toastr.info('The survey was edited successfuly :)', 'Surveys', {
|
if (process)
|
||||||
"autoDismiss": true,
|
$uibModal.open({
|
||||||
"positionClass": "toast-bottom-right",
|
animation: true,
|
||||||
"type": "success",
|
templateUrl: 'app/pages/surveys/create/widgets/successModal.html',
|
||||||
"timeOut": "5000",
|
//size: size,
|
||||||
"extendedTimeOut": "2000"
|
/*resolve: {
|
||||||
})
|
items: function () {
|
||||||
|
return $scope.items;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
});
|
||||||
|
else
|
||||||
|
toastr.info('The survey was edited successfuly :)', 'Surveys', {
|
||||||
|
"autoDismiss": true,
|
||||||
|
"positionClass": "toast-bottom-right",
|
||||||
|
"type": "success",
|
||||||
|
"timeOut": "5000",
|
||||||
|
"extendedTimeOut": "2000"
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
function (error){
|
function (error){
|
||||||
toastr.error('There were an error editing the survey', 'Surveys', {
|
toastr.error('There were an error editing the survey', 'Surveys', {
|
||||||
|
@ -187,7 +202,34 @@
|
||||||
$scope.display.surveySending = true;
|
$scope.display.surveySending = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.selectedListsChange=function(){
|
||||||
|
$log.info("selectedListsChange",$scope.lists.selected);
|
||||||
|
angular.forEach($scope.lists.selected, function(list) {
|
||||||
|
if(list.members.length > 0 && !list.members[0].name) {
|
||||||
|
var params = {"ids" : list.members};
|
||||||
|
MemberService
|
||||||
|
.list(params)
|
||||||
|
.then(
|
||||||
|
function (data){
|
||||||
|
list.members = data;
|
||||||
|
},
|
||||||
|
function (error){
|
||||||
|
console.log("Error getting the members");
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$scope.sendSurvey=function(){
|
$scope.sendSurvey=function(){
|
||||||
|
$scope.survey.list = $scope.lists.selected;
|
||||||
|
$scope.survey.status = "Sending";
|
||||||
|
$log.info("sendSurvey",$scope.survey);
|
||||||
|
$state.transitionTo('surveys.list'/*, {id: item.id}*/);
|
||||||
|
|
||||||
|
$scope.saveSurvey(true);
|
||||||
|
|
||||||
|
|
||||||
/*$scope.saveSurvey();
|
/*$scope.saveSurvey();
|
||||||
$("#sidebar").fadeIn();
|
$("#sidebar").fadeIn();
|
||||||
$("#survey-actions").fadeOut();*/
|
$("#survey-actions").fadeOut();*/
|
||||||
|
@ -216,12 +258,9 @@
|
||||||
SurveyService
|
SurveyService
|
||||||
.get(id)
|
.get(id)
|
||||||
.then(function (data){
|
.then(function (data){
|
||||||
$log.info("data[0]",data[0].elements);
|
$log.info("data[0]",data);
|
||||||
angular.forEach(data[0].elements, function(elem) {
|
|
||||||
elem.tagsJoined = elem.tags.join();
|
|
||||||
});
|
|
||||||
|
|
||||||
$scope.survey = data[0];
|
$scope.survey = data;
|
||||||
$scope.updateBuilder();
|
$scope.updateBuilder();
|
||||||
$log.info("Got the survey data",$scope.survey);
|
$log.info("Got the survey data",$scope.survey);
|
||||||
}, function (error){
|
}, function (error){
|
||||||
|
@ -246,7 +285,7 @@
|
||||||
|
|
||||||
$scope.activate=function(){
|
$scope.activate=function(){
|
||||||
if($stateParams.survey_id) {
|
if($stateParams.survey_id) {
|
||||||
$scope.loadSurvey($stateParams.member_id);
|
$scope.loadSurvey($stateParams.survey_id);
|
||||||
}
|
}
|
||||||
$scope.loadLists();
|
$scope.loadLists();
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,12 +52,12 @@
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-10 pull-right">
|
<!--<div class="col-md-10 pull-right">
|
||||||
<label class="checkbox-inline custom-checkbox nowrap">
|
<label class="checkbox-inline custom-checkbox nowrap">
|
||||||
<input ng-model="element.multiAnswers" type="checkbox">
|
<input ng-model="element.multiAnswers" type="checkbox">
|
||||||
<span>Allow more than one answer to this question (use checkboxes)</span>
|
<span>Allow more than one answer to this question (use checkboxes)</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>-->
|
||||||
|
|
||||||
<div class="col-md-10 pull-right">
|
<div class="col-md-10 pull-right">
|
||||||
<label class="checkbox-inline custom-checkbox nowrap">
|
<label class="checkbox-inline custom-checkbox nowrap">
|
||||||
|
@ -66,11 +66,19 @@
|
||||||
</label>
|
</label>
|
||||||
<div class="form-group" ng-show=element.comment>
|
<div class="form-group" ng-show=element.comment>
|
||||||
<label for="inputEmail3" class="col-sm-2 control-label">Label</label>
|
<label for="inputEmail3" class="col-sm-2 control-label">Label</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-5">
|
||||||
<input ng-model="element.commentLabel" type="text" class="form-control">
|
<input ng-model="element.commentLabel" type="text" class="form-control">
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<label class="checkbox-inline custom-checkbox nowrap">
|
||||||
|
<input ng-model="element.commentIsRequired" type="checkbox">
|
||||||
|
<span>Required ?</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header bg-success">
|
||||||
|
<i class="ion-checkmark modal-icon"></i><span> Survey completed</span>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body text-center">The survey is being sent to the members ...</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-success" ng-click="$dismiss()">OK</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
.controller('list', list);
|
.controller('list', list);
|
||||||
|
|
||||||
/** @ngInject */
|
/** @ngInject */
|
||||||
function list( SurveyService, $scope, $rootScope, $log, $state, toastr) {
|
function list( SurveyService, AnswerService, $scope, $rootScope, $log, $state, toastr, baConfig) {
|
||||||
var vm = this;
|
var vm = this;
|
||||||
$rootScope.$state = $state;
|
$rootScope.$state = $state;
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@
|
||||||
.list()
|
.list()
|
||||||
.then(function (data){
|
.then(function (data){
|
||||||
vm.surveys = data;
|
vm.surveys = data;
|
||||||
|
getSurveyCompletion();
|
||||||
$log.info("Got the survey data",data);
|
$log.info("Got the survey data",data);
|
||||||
}, function (error){
|
}, function (error){
|
||||||
$log.error(error);
|
$log.error(error);
|
||||||
|
@ -61,12 +62,66 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function getSurveyCompletion() {
|
||||||
|
angular.forEach(vm.surveys, function(survey, key) {
|
||||||
|
var totalMembers = 0
|
||||||
|
var totalAnswers = survey.answers.length
|
||||||
|
var totalQuestions = survey.elements.length
|
||||||
|
var completion = 0
|
||||||
|
|
||||||
|
angular.forEach(survey.list, function(list, key) {
|
||||||
|
totalMembers = totalMembers + list.members.length
|
||||||
|
});
|
||||||
|
|
||||||
|
totalQuestions = survey.type == "s_360" ? totalQuestions * totalMembers : totalQuestions;
|
||||||
|
|
||||||
|
completion = (((totalAnswers) / (totalMembers * totalQuestions))*100).toFixed(0)
|
||||||
|
|
||||||
|
survey.completion = completion;
|
||||||
|
//console.log('totalAnswers / TOTAL', totalAnswers, totalMembers * totalQuestions);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
//console.log('getSurveyCompletion', vm.surveys);
|
||||||
|
}
|
||||||
|
|
||||||
|
function analyzeSurvey(survey) {
|
||||||
|
var params = {"survey":survey.id}
|
||||||
|
AnswerService
|
||||||
|
.analyze(params)
|
||||||
|
.then(function (data){
|
||||||
|
vm.analysis = data;
|
||||||
|
vm.activeSurvey = survey;
|
||||||
|
$log.info("Got answers analysis",data);
|
||||||
|
}, function (error){
|
||||||
|
$log.error(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function activate(){
|
function activate(){
|
||||||
vm.surveys = [];
|
vm.surveys = [];
|
||||||
|
vm.activeSurvey = {};
|
||||||
vm.goToCreate = goToCreate;
|
vm.goToCreate = goToCreate;
|
||||||
|
vm.analyzeSurvey = analyzeSurvey;
|
||||||
vm.editSurvey = editSurvey;
|
vm.editSurvey = editSurvey;
|
||||||
vm.removeSurvey = removeSurvey;
|
vm.removeSurvey = removeSurvey;
|
||||||
|
|
||||||
|
var layoutColors = baConfig.colors;
|
||||||
|
vm.doughnutOptions = {
|
||||||
|
elements: {
|
||||||
|
arc: {
|
||||||
|
borderWidth: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
display: true,
|
||||||
|
position: 'bottom',
|
||||||
|
labels: {
|
||||||
|
fontColor: layoutColors.defaultText
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
loadSurveys();
|
loadSurveys();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,12 +35,18 @@
|
||||||
<td>
|
<td>
|
||||||
{{ survey.updatedAt | date:'shortDate' }}
|
{{ survey.updatedAt | date:'shortDate' }}
|
||||||
</td>
|
</td>
|
||||||
<td> {{ survey.responses || 0 }} </td>
|
<td>
|
||||||
<td> {{ survey.status }} </td>
|
<div class="progress">
|
||||||
|
<div class="progress-bar progress-bar-success progress-bar-striped active" role="progressbar" aria-valuenow="{{survey.completion}}" aria-valuemin="0" aria-valuemax="100" style="width: {{survey.completion}}%">
|
||||||
|
<span class="sr-only">{{survey.completion}}% Complete</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td> <button class="status-button btn btn-xs btn-{{survey.status=='Draft'?'warning':''}}{{survey.status=='Sending'?'info':''}}{{survey.status=='Sent'?'primary':''}}{{survey.status=='Done'?'success':''}}">{{ survey.status }}</button> </td>
|
||||||
<td>
|
<td>
|
||||||
<button class="status-button btn btn-xs btn-primary" ng-click="vm.editSurvey(survey.id)">Edit</button>
|
<button class="status-button btn btn-xs btn-primary" ng-click="vm.editSurvey(survey.id)">Edit</button>
|
||||||
<button class="status-button btn btn-xs btn-info" ng-if="survey.status == 'Draft'" ng-click="vm.goToSend(survey.id)">Send</button>
|
<button class="status-button btn btn-xs btn-info" ng-if="survey.status == 'Draft'" ng-click="vm.goToSend(survey.id)">Send</button>
|
||||||
<button class="status-button btn btn-xs btn-info" ng-if="survey.status == 'Draft'" ng-click="vm.goToAnswers(survey.id)">Answers</button>
|
<button class="status-button btn btn-xs btn-info" ng-if="survey.status == 'Sent'" ng-click="vm.analyzeSurvey(survey)">Analyse</button>
|
||||||
<button class="status-button btn btn-xs btn-danger" ng-click="vm.removeSurvey(survey.id)">Remove</button>
|
<button class="status-button btn btn-xs btn-danger" ng-click="vm.removeSurvey(survey.id)">Remove</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -50,6 +56,20 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12" ng-show="vm.activeSurvey.id">
|
||||||
|
|
||||||
|
<div
|
||||||
|
ba-panel
|
||||||
|
ba-panel-class="horizontal-tabs tabs-panel">
|
||||||
|
<div ng-include="'app/pages/surveys/list/surveyDetails.html'"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
<uib-tabset active="$tabSetStatus.activeTab">
|
||||||
|
<uib-tab heading="Question summaries">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
|
||||||
|
<div class="progress">
|
||||||
|
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="{{vm.analysis.completion}}" aria-valuemin="0" aria-valuemax="100" style="width: {{vm.analysis.completion}}%">
|
||||||
|
{{vm.activeSurvey.completion}}% of question answred (Respondents : {{vm.analysis.respondents.length}} of {{vm.analysis.recipents}})
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<div class="panel-group">
|
||||||
|
|
||||||
|
<div class="panel panel-default bootstrap-panel" ng-repeat="e in vm.activeSurvey.elements">
|
||||||
|
<div class="panel-heading">{{ e.text }}</div>
|
||||||
|
<div class="panel-body">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="chartjs-canvas-holder-first-row" style="max-width: 300px;margin:0 auto;">
|
||||||
|
<canvas id="doughnut" chart-options="vm.doughnutOptions" class="chart chart-doughnut"
|
||||||
|
chart-data="vm.analysis.data[e._id]" chart-labels="vm.analysis.labels[e._id]">
|
||||||
|
</canvas>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</uib-tab>
|
||||||
|
<uib-tab heading="Individual responses">
|
||||||
|
|
||||||
|
</uib-tab>
|
||||||
|
</uib-tabset>
|
|
@ -32,7 +32,7 @@
|
||||||
function get(id) {
|
function get(id) {
|
||||||
|
|
||||||
var deferred = $q.defer();
|
var deferred = $q.defer();
|
||||||
$http.get(endpoint)
|
$http.get(endpoint + "/" + id)
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
deferred.resolve(data);
|
deferred.resolve(data);
|
||||||
}).error(function(msg, code) {
|
}).error(function(msg, code) {
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
|
|
||||||
|
|
||||||
return $http.get(endpoint, id);
|
return $http.get(endpoint + "/" + id);
|
||||||
}
|
}
|
||||||
|
|
||||||
function create(survey) {
|
function create(survey) {
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
angular.module('BlurAdmin.pages.surveys', [
|
angular.module('BlurAdmin.pages.surveys', [
|
||||||
'BlurAdmin.pages.surveys.create',
|
'BlurAdmin.pages.surveys.create',
|
||||||
'BlurAdmin.pages.surveys.list',
|
'BlurAdmin.pages.surveys.list',
|
||||||
]).config(routeConfig);
|
]).config(routeConfig).config(chartJsConfig);
|
||||||
|
|
||||||
/** @ngInject */
|
/** @ngInject */
|
||||||
function routeConfig($stateProvider) {
|
function routeConfig($stateProvider) {
|
||||||
|
@ -45,4 +45,52 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function chartJsConfig(ChartJsProvider, baConfigProvider) {
|
||||||
|
var layoutColors = baConfigProvider.colors;
|
||||||
|
// Configure all charts
|
||||||
|
ChartJsProvider.setOptions({
|
||||||
|
chartColors: [
|
||||||
|
layoutColors.primary, layoutColors.danger, layoutColors.warning, layoutColors.success, layoutColors.info, layoutColors.default, layoutColors.primaryDark, layoutColors.successDark, layoutColors.warningLight, layoutColors.successLight, layoutColors.primaryLight],
|
||||||
|
responsive: true,
|
||||||
|
maintainAspectRatio: false,
|
||||||
|
animation: {
|
||||||
|
duration: 2500
|
||||||
|
},
|
||||||
|
scale: {
|
||||||
|
gridLines: {
|
||||||
|
color: layoutColors.border
|
||||||
|
},
|
||||||
|
scaleLabel: {
|
||||||
|
fontColor: layoutColors.defaultText
|
||||||
|
},
|
||||||
|
ticks: {
|
||||||
|
fontColor: layoutColors.defaultText,
|
||||||
|
showLabelBackdrop: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// Configure all line charts
|
||||||
|
ChartJsProvider.setOptions('Line', {
|
||||||
|
datasetFill: false
|
||||||
|
});
|
||||||
|
// Configure all radar charts
|
||||||
|
ChartJsProvider.setOptions('radar', {
|
||||||
|
scale: {
|
||||||
|
pointLabels: {
|
||||||
|
fontColor: layoutColors.defaultText
|
||||||
|
},
|
||||||
|
ticks: {
|
||||||
|
maxTicksLimit: 5,
|
||||||
|
display: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// Configure all bar charts
|
||||||
|
ChartJsProvider.setOptions('bar', {
|
||||||
|
tooltips: {
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
params = params || {};
|
params = params || {};
|
||||||
|
|
||||||
var deferred = $q.defer();
|
var deferred = $q.defer();
|
||||||
$http.get(endpoint)
|
$http.get(endpoint, { params : params})
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
deferred.resolve(data);
|
deferred.resolve(data);
|
||||||
}).error(function(msg, code) {
|
}).error(function(msg, code) {
|
||||||
|
@ -30,33 +30,46 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function create(answer) {
|
function create(answer) {
|
||||||
console.log("new Answer Object", answer);
|
return $http.post(endpoint, answer);
|
||||||
// return $http.post(endpoint, answer);
|
|
||||||
}
|
|
||||||
|
|
||||||
function put(answer) {
|
|
||||||
return $http.put(endpoint + "/" + answer.id, answer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function get(id) {
|
function get(id) {
|
||||||
return $http.get(endpoint + "/" + id);
|
return $http.get(endpoint + "/" + id);
|
||||||
}
|
}
|
||||||
|
|
||||||
function edit(answer) {
|
function update(answer) {
|
||||||
console.log("edit Answer Object", answer);
|
return $http.put(endpoint + "/"+answer.id, answer);
|
||||||
}
|
}
|
||||||
|
|
||||||
function remove(id) {
|
function remove(id) {
|
||||||
return $http.delete(endpoint + "/" + id);
|
return $http.delete(endpoint + "/" + id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function analyze(params) {
|
||||||
|
params = params || {};
|
||||||
|
endpoint = endpoint + "/analyze"
|
||||||
|
|
||||||
|
var deferred = $q.defer();
|
||||||
|
$http.get(endpoint, { params : params})
|
||||||
|
.success(function(data) {
|
||||||
|
deferred.resolve(data);
|
||||||
|
}).error(function(msg, code) {
|
||||||
|
deferred.reject(msg);
|
||||||
|
});
|
||||||
|
|
||||||
|
return deferred.promise;
|
||||||
|
|
||||||
|
|
||||||
|
return $http.get(endpoint, params);
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
list:list,
|
list:list,
|
||||||
create:create,
|
create:create,
|
||||||
edit:edit,
|
update:update,
|
||||||
get:get,
|
get:get,
|
||||||
put:put,
|
remove:remove,
|
||||||
remove:remove
|
analyze:analyze
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -14,56 +14,69 @@
|
||||||
|
|
||||||
var vm = this;
|
var vm = this;
|
||||||
|
|
||||||
function loadSurveys() {
|
function loadSurvey(id) {
|
||||||
SurveyService
|
SurveyService
|
||||||
.list()
|
.get(id)
|
||||||
.then(function (data){
|
.then(function (data){
|
||||||
vm.surveys = data;
|
vm.survey = data;
|
||||||
$log.info("Got the survey data",data);
|
$log.info("Got the survey data",data);
|
||||||
vm.survey = getSurvey();
|
|
||||||
//building forms elements
|
//building forms elements
|
||||||
vm.forms = [];
|
|
||||||
angular.forEach(vm.survey.elements, function(element, key) {
|
|
||||||
|
|
||||||
angular.forEach(vm.survey.list.members, function(member, key) {
|
//angular.forEach(vm.survey.elements, function(element, key) {
|
||||||
if(member._id != vm.activeMemberId) {
|
// console.log("element",element);
|
||||||
vm.forms[member._id] = {};
|
angular.forEach(vm.survey.list, function(list, key) {
|
||||||
//vm.forms[member._id].$element_id = false;
|
console.log("list",list);
|
||||||
/*var form = [];
|
angular.forEach(list.members, function(member, key) {
|
||||||
form[element._id] = [];
|
//console.log("member",member);
|
||||||
vm.forms.push(form);
|
vm.forms[member.id] = {};
|
||||||
var input = [];
|
vm.forms[member.id].elements = vm.survey.elements;
|
||||||
input[element._id] = false;
|
vm.forms[member.id].question = {};
|
||||||
vm.forms[member._id].push(input);*/
|
if(member.id != vm.activeMemberId) {
|
||||||
}
|
vm.members.push(member);
|
||||||
|
|
||||||
|
} else
|
||||||
|
vm.askedMember = member;
|
||||||
|
|
||||||
//.push(k + ': ' + member);
|
//.push(k + ': ' + member);
|
||||||
|
});
|
||||||
|
vm.members.push(vm.askedMember);
|
||||||
|
//Thnak You message
|
||||||
|
vm.members.push({"id": "none", "name" : ": )"});
|
||||||
});
|
});
|
||||||
});
|
// });
|
||||||
console.log(vm.survey);
|
/*console.log("loadSurvey:vm.survey",vm.survey);
|
||||||
console.log(vm.forms);
|
console.log("loadSurvey:vm.survey.list.members",vm.survey.list.members);
|
||||||
|
console.log("loadSurvey:vm.forms",vm.forms);*/
|
||||||
}, function (error){
|
}, function (error){
|
||||||
$log.error(error);
|
$log.error(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSurvey() {
|
|
||||||
$log.info("getSurvey",$stateParams.survey_id);
|
|
||||||
return vm.surveys.filter(function(s){
|
|
||||||
return s.id == $stateParams.survey_id;
|
|
||||||
})[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
function activate(){
|
function activate(){
|
||||||
vm.surveys = [];
|
vm.forms = [];
|
||||||
vm.survey = [];
|
vm.survey = {};
|
||||||
|
vm.members = [];
|
||||||
|
vm.askedMember = {};
|
||||||
vm.activeMemberId = $stateParams.member_id;
|
vm.activeMemberId = $stateParams.member_id;
|
||||||
loadSurveys();
|
loadSurvey($stateParams.survey_id);
|
||||||
console.log(vm.activeMemberId)
|
console.log(vm.activeMemberId)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vm.getInitials = function(string) {
|
||||||
|
var names = string.split(' '),
|
||||||
|
initials = names[0].substring(0, 1).toUpperCase();
|
||||||
|
|
||||||
|
if (names.length > 1) {
|
||||||
|
initials += names[names.length - 1].substring(0, 1).toUpperCase();
|
||||||
|
}
|
||||||
|
//console.log("getInitials", string, initials)
|
||||||
|
return initials;
|
||||||
|
};
|
||||||
|
|
||||||
vm.test = function(form){
|
vm.test = function(form){
|
||||||
//$scope.submitted = true;
|
//$scope.submitted = true;
|
||||||
alert("Angular is Awesome!!!");
|
alert("Angular is Awesome!!!");
|
||||||
|
|
|
@ -11,13 +11,18 @@
|
||||||
|
|
||||||
<div class="separator"></div>
|
<div class="separator"></div>
|
||||||
<ba-wizard>
|
<ba-wizard>
|
||||||
<ba-wizard-step title="{{ m.name }}" ng-repeat="m in vm.survey.list.members" ng-if='m._id != vm.activeMemberId' ng-init="memberId = m._id" form="vm.forms[memberId]" >
|
|
||||||
<form name="vm.forms[memberId]" novalidate>
|
<ba-wizard-step title="{{ m.id != vm.activeMemberId ? vm.getInitials(m.name) : 'ME' }}" ng-repeat="m in vm.members track by $index" ng-init="memberId = m.id" form="vm.forms[memberId]" mid="{{ m.id }}" elements="{{vm.survey.elements}}" evaluated="{{m}}" asked="{{vm.askedMember}}">
|
||||||
|
<form name="vm.forms[memberId]" novalidate ng-if="m.id != 'none'">
|
||||||
<ng-form name="innerForm">
|
<ng-form name="innerForm">
|
||||||
<div class="member-survey">
|
<div class="member-survey">
|
||||||
|
<div class="separator"></div>
|
||||||
|
<h3 class="member-full-name">{{ m.name }}</h3>
|
||||||
<div class="separator"></div>
|
<div class="separator"></div>
|
||||||
<div id="{{e.id}}" class="form-group answer" ng-repeat="e in vm.survey.elements"
|
<div id="{{e.id}}" class="form-group answer" ng-repeat="e in vm.survey.elements"
|
||||||
ng-init="elementId = vm.survey.id+'_'+memberId+'_'+vm.activeMemberId+'_'+e._id" ng-class="{'has-error': innerForm[elementId].$invalid && (vm.forms[memberId].$submitted)}">
|
ng-init="elementId = vm.survey.id+'_'+memberId+'_'+vm.activeMemberId+'_'+e._id" ng-class="{'has-error': innerForm[elementId].$invalid && (vm.forms[memberId].$submitted)}">
|
||||||
|
<input type="hidden" name="{{ elementId }}_submitted" ng-model="vm.innerForm[elementId].submitted" ng-value="false"/>
|
||||||
|
<!--<input type="hidden" name="{{ elementId }}_question" ng-model="vm.innerForm[elementId].question.$viewValue" ng-value="e"/>-->
|
||||||
<p>{{ e.text }}</p>
|
<p>{{ e.text }}</p>
|
||||||
<label ng-class="el.multiple ? 'custom-checkbox radio-checkbox nowrap' : 'custom-radio radio-inline nowrap'" ng-repeat="el in e.items">
|
<label ng-class="el.multiple ? 'custom-checkbox radio-checkbox nowrap' : 'custom-radio radio-inline nowrap'" ng-repeat="el in e.items">
|
||||||
<input ng-attr-type="{{el.multiple? 'checkbox' : 'radio'}}" name="{{elementId}}" ng-model="vm.innerForm[elementId].$viewValue" ng-value="el.value" ng-attr-required="{{el.required}}">
|
<input ng-attr-type="{{el.multiple? 'checkbox' : 'radio'}}" name="{{elementId}}" ng-model="vm.innerForm[elementId].$viewValue" ng-value="el.value" ng-attr-required="{{el.required}}">
|
||||||
|
@ -33,8 +38,16 @@
|
||||||
</div>
|
</div>
|
||||||
</ng-form>
|
</ng-form>
|
||||||
</form>
|
</form>
|
||||||
|
<form class="form-horizontal" name="vm.finishForm" novalidate ng-if="m.id == 'none'">
|
||||||
|
<div class="separator"></div>
|
||||||
|
<h3 class="member-full-name">Congratulations! You have successfully filled the form!</h3>
|
||||||
|
<div class="separator"></div>
|
||||||
|
|
||||||
|
</form>
|
||||||
</ba-wizard-step>
|
</ba-wizard-step>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ba-wizard>
|
</ba-wizard>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
<div class="ba-wizard">
|
<div class="ba-wizard">
|
||||||
<div class="ba-wizard-navigation-container">
|
<div class="ba-wizard-navigation-container">
|
||||||
<div ng-repeat="t in $baWizardController.tabs" class="ba-wizard-navigation {{$baWizardController.tabNum == $index ? 'active' : ''}}" ng-click="$baWizardController.selectTab($index)">
|
<div ng-repeat="t in $baWizardController.tabs" class="ba-wizard-navigation {{$baWizardController.tabNum == $index ? 'active heartbeat' : ''}}" ng-click="$baWizardController.selectTab($index)">
|
||||||
{{t.title}}
|
{{ $baWizardController.tabNum != $index ? t.title : ''}}
|
||||||
|
<img ng-if="$baWizardController.tabNum == $index" ng-src="{{t.mid | profilePicture}}" class="little-human-picture">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
.directive('baWizardStep', baWizardStep);
|
.directive('baWizardStep', baWizardStep);
|
||||||
|
|
||||||
/** @ngInject */
|
/** @ngInject */
|
||||||
function baWizardStep($http) {
|
function baWizardStep($http, AnswerService, $filter) {
|
||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
transclude: true,
|
transclude: true,
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
form: '='
|
form: '='
|
||||||
},
|
},
|
||||||
templateUrl: 'app/theme/components/baWizard/baWizardStep.html',
|
templateUrl: 'app/theme/components/baWizard/baWizardStep.html',
|
||||||
link: function($scope, $element, $attrs, wizard, AnswerService) {
|
link: function($scope, $element, $attrs, wizard) {
|
||||||
$scope.selected = true;
|
$scope.selected = true;
|
||||||
|
|
||||||
var tab = {
|
var tab = {
|
||||||
|
@ -24,7 +24,8 @@
|
||||||
isComplete: isComplete,
|
isComplete: isComplete,
|
||||||
isAvailiable: isAvailiable,
|
isAvailiable: isAvailiable,
|
||||||
prevTab: undefined,
|
prevTab: undefined,
|
||||||
setPrev: setPrev
|
setPrev: setPrev,
|
||||||
|
mid: $attrs.mid
|
||||||
};
|
};
|
||||||
|
|
||||||
wizard.addTab(tab);
|
wizard.addTab(tab);
|
||||||
|
@ -38,34 +39,94 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function submit() {
|
function submit() {
|
||||||
var apiBaseUrl = "http://localhost:9000"
|
|
||||||
var endpoint = apiBaseUrl + "/answers";
|
var elements = angular.fromJson($attrs.elements);
|
||||||
|
var memberEvaluated = angular.fromJson($attrs.evaluated);
|
||||||
|
var memberAsked = angular.fromJson($attrs.asked);
|
||||||
|
|
||||||
$scope.form && $scope.form.$setSubmitted(true);
|
$scope.form && $scope.form.$setSubmitted(true);
|
||||||
if($scope.form && $scope.form.$invalid == false) {
|
if($scope.form && $scope.form.$invalid == false) {
|
||||||
|
|
||||||
//console.log("inner", $scope.form.innerForm);
|
console.log("$attrs.elements", elements);
|
||||||
|
console.log("inner", $scope.form.innerForm);
|
||||||
|
|
||||||
angular.forEach($scope.form.innerForm, function(val, key) {
|
angular.forEach($scope.form.innerForm, function(val, key) {
|
||||||
if((key.indexOf("_") !== -1) && (key.indexOf("_comment") == -1)) {
|
|
||||||
|
if((key.indexOf("_") !== -1) && (key.indexOf("_comment") == -1) && (key.indexOf("_submitted") == -1) && (key.indexOf("_question") == -1)) {
|
||||||
var res = key.split("_");
|
var res = key.split("_");
|
||||||
//console.log("res", res);
|
console.log("res", res);
|
||||||
//console.log("val", val);
|
//console.log("val", val);
|
||||||
var commentKey = key + "_comment";
|
var commentKey = key + "_comment";
|
||||||
|
var submittedKey = key + "_submitted";
|
||||||
|
//console.log("key", key);
|
||||||
|
//console.log("commentKey", commentKey);
|
||||||
|
//console.log("submittedKey", submittedKey);
|
||||||
|
var element = $filter('filter')(elements, {'_id':res[3]})
|
||||||
var answer = {
|
var answer = {
|
||||||
"value" : val.$viewValue,
|
"value" : val.$viewValue,
|
||||||
"comment" : $scope.form.innerForm[commentKey].$viewValue,
|
"comment" : ($scope.form.innerForm[commentKey]) ? $scope.form.innerForm[commentKey].$viewValue : '',
|
||||||
"survey" : res[0],
|
"survey" : res[0],
|
||||||
"memberEvaluated" : res[1],
|
"evaluated" : memberEvaluated,
|
||||||
"memberAsked" : res[2]
|
"asked" : memberAsked,
|
||||||
|
"question": element[0]
|
||||||
}
|
}
|
||||||
console.log($scope);
|
console.log("$attrs",$attrs);
|
||||||
//AnswerService.create(answer);
|
console.log("submit:answer",answer);
|
||||||
/*$http.post(endpoint, answer).success(function(data) {
|
if ($scope.form.innerForm[submittedKey].$viewValue) {
|
||||||
console.log(data.data);
|
answer.id = $scope.form.innerForm[submittedKey].$viewValue;
|
||||||
//return response.data;
|
AnswerService
|
||||||
}).error(function(msg, code) {
|
.update(answer)
|
||||||
//deferred.reject(msg);
|
.then(
|
||||||
});*/
|
function (data){
|
||||||
|
console.log("answer.update",data);
|
||||||
|
$scope.form.innerForm[submittedKey].$viewValue = data.data.id;
|
||||||
|
},
|
||||||
|
function (error){
|
||||||
|
console.log("Error updating the answer");
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
//checking if the answer already exist
|
||||||
|
var params = {"survey":answer.survey, "asked":answer.asked.id, "evaluated":answer.evaluated.id, "question":answer.question._id}
|
||||||
|
AnswerService
|
||||||
|
.list(params)
|
||||||
|
.then(
|
||||||
|
function (data){
|
||||||
|
console.log("answer.check",data);
|
||||||
|
if(data.length > 0) {
|
||||||
|
answer.id = data[0].id;
|
||||||
|
AnswerService
|
||||||
|
.update(answer)
|
||||||
|
.then(
|
||||||
|
function (data){
|
||||||
|
console.log("answer.update",data);
|
||||||
|
$scope.form.innerForm[submittedKey].$viewValue = data.data.id;
|
||||||
|
},
|
||||||
|
function (error){
|
||||||
|
console.log("Error updating the answer");
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else
|
||||||
|
AnswerService
|
||||||
|
.create(answer)
|
||||||
|
.then(
|
||||||
|
function (data){
|
||||||
|
console.log("answer.create",data);
|
||||||
|
$scope.form.innerForm[submittedKey].$viewValue = data.data.id;
|
||||||
|
},
|
||||||
|
function (error){
|
||||||
|
console.log("Error creating the answer");
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
},
|
||||||
|
function (error){
|
||||||
|
console.log("Error getting the answer");
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 7.6 KiB |
|
@ -6,12 +6,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.roll-in-blurred-right {
|
.roll-in-blurred-right {
|
||||||
-webkit-animation: roll-in-blurred-right 0.65s cubic-bezier(0.230, 1.000, 0.320, 1.000) 1s both;
|
-webkit-animation: roll-in-blurred-right 0.65s cubic-bezier(0.230, 1.000, 0.320, 1.000) 1500ms both;
|
||||||
animation: roll-in-blurred-right 0.65s cubic-bezier(0.230, 1.000, 0.320, 1.000) 1s both;
|
animation: roll-in-blurred-right 0.65s cubic-bezier(0.230, 1.000, 0.320, 1.000) 1500ms both;
|
||||||
}
|
}
|
||||||
.roll-in-blurred-left {
|
.roll-in-blurred-left {
|
||||||
-webkit-animation: roll-in-blurred-left 0.65s cubic-bezier(0.230, 1.000, 0.320, 1.000) both;
|
-webkit-animation: roll-in-blurred-left 0.65s cubic-bezier(0.230, 1.000, 0.320, 1.000) 1500ms both;
|
||||||
animation: roll-in-blurred-left 0.65s cubic-bezier(0.230, 1.000, 0.320, 1.000) both;
|
animation: roll-in-blurred-left 0.65s cubic-bezier(0.230, 1.000, 0.320, 1.000) 1500ms both;
|
||||||
}
|
}
|
||||||
.slide-out-blurred-left {
|
.slide-out-blurred-left {
|
||||||
-webkit-animation: slide-out-blurred-left 0.45s cubic-bezier(0.755, 0.050, 0.855, 0.060) both;
|
-webkit-animation: slide-out-blurred-left 0.45s cubic-bezier(0.755, 0.050, 0.855, 0.060) both;
|
||||||
|
@ -21,6 +21,10 @@
|
||||||
-webkit-animation: slide-out-blurred-right 0.45s cubic-bezier(0.755, 0.050, 0.855, 0.060) both;
|
-webkit-animation: slide-out-blurred-right 0.45s cubic-bezier(0.755, 0.050, 0.855, 0.060) both;
|
||||||
animation: slide-out-blurred-right 0.45s cubic-bezier(0.755, 0.050, 0.855, 0.060) both;
|
animation: slide-out-blurred-right 0.45s cubic-bezier(0.755, 0.050, 0.855, 0.060) both;
|
||||||
}
|
}
|
||||||
|
.heartbeat {
|
||||||
|
-webkit-animation: heartbeat 1.5s ease-in-out infinite both;
|
||||||
|
animation: heartbeat 1.5s ease-in-out infinite both;
|
||||||
|
}
|
||||||
|
|
||||||
@-webkit-keyframes roll-in-blurred-right {
|
@-webkit-keyframes roll-in-blurred-right {
|
||||||
0% {
|
0% {
|
||||||
|
@ -175,4 +179,75 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@-webkit-keyframes heartbeat {
|
||||||
|
from {
|
||||||
|
-webkit-transform: scale(1);
|
||||||
|
transform: scale(1);
|
||||||
|
-webkit-transform-origin: center center;
|
||||||
|
transform-origin: center center;
|
||||||
|
-webkit-animation-timing-function: ease-out;
|
||||||
|
animation-timing-function: ease-out;
|
||||||
|
}
|
||||||
|
10% {
|
||||||
|
-webkit-transform: scale(0.91);
|
||||||
|
transform: scale(0.91);
|
||||||
|
-webkit-animation-timing-function: ease-in;
|
||||||
|
animation-timing-function: ease-in;
|
||||||
|
}
|
||||||
|
17% {
|
||||||
|
-webkit-transform: scale(0.98);
|
||||||
|
transform: scale(0.98);
|
||||||
|
-webkit-animation-timing-function: ease-out;
|
||||||
|
animation-timing-function: ease-out;
|
||||||
|
}
|
||||||
|
33% {
|
||||||
|
-webkit-transform: scale(0.87);
|
||||||
|
transform: scale(0.87);
|
||||||
|
-webkit-animation-timing-function: ease-in;
|
||||||
|
animation-timing-function: ease-in;
|
||||||
|
}
|
||||||
|
45% {
|
||||||
|
-webkit-transform: scale(1);
|
||||||
|
transform: scale(1);
|
||||||
|
-webkit-animation-timing-function: ease-out;
|
||||||
|
animation-timing-function: ease-out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes heartbeat {
|
||||||
|
from {
|
||||||
|
-webkit-transform: scale(1);
|
||||||
|
transform: scale(1);
|
||||||
|
-webkit-transform-origin: center center;
|
||||||
|
transform-origin: center center;
|
||||||
|
-webkit-animation-timing-function: ease-out;
|
||||||
|
animation-timing-function: ease-out;
|
||||||
|
}
|
||||||
|
10% {
|
||||||
|
-webkit-transform: scale(0.91);
|
||||||
|
transform: scale(0.91);
|
||||||
|
-webkit-animation-timing-function: ease-in;
|
||||||
|
animation-timing-function: ease-in;
|
||||||
|
}
|
||||||
|
17% {
|
||||||
|
-webkit-transform: scale(0.98);
|
||||||
|
transform: scale(0.98);
|
||||||
|
-webkit-animation-timing-function: ease-out;
|
||||||
|
animation-timing-function: ease-out;
|
||||||
|
}
|
||||||
|
33% {
|
||||||
|
-webkit-transform: scale(0.87);
|
||||||
|
transform: scale(0.87);
|
||||||
|
-webkit-animation-timing-function: ease-in;
|
||||||
|
animation-timing-function: ease-in;
|
||||||
|
}
|
||||||
|
45% {
|
||||||
|
-webkit-transform: scale(1);
|
||||||
|
transform: scale(1);
|
||||||
|
-webkit-animation-timing-function: ease-out;
|
||||||
|
animation-timing-function: ease-out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -278,6 +278,12 @@ a {
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#surveys #survey-sending .compose-container {
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
#surveys #survey-sending .compose-footer {
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -334,3 +340,28 @@ a {
|
||||||
color: #262626;
|
color: #262626;
|
||||||
background-color: #ffff00;
|
background-color: #ffff00;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ba-wizard-navigation{
|
||||||
|
display: inline-block !important;
|
||||||
|
color: rgb(255, 255, 255); background-color: #60afdd;
|
||||||
|
display: inline-block; font-family: Arial,"Helvetica Neue",Helvetica,sans-serif;
|
||||||
|
font-size: 36px !important; border-radius: 80px; width: 80px; height: 80px; line-height: 80px !important; margin: 3px; text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ba-wizard-navigation-container {
|
||||||
|
padding: 0px 0 !important;
|
||||||
|
}
|
||||||
|
.ba-wizard-navigation.active{
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
.ba-wizard-navigation .little-human-picture {
|
||||||
|
border-radius: 80px; width: 80px; height: 80px;margin-top: -5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ng-invalid.form-control {
|
||||||
|
border: 1px solid #ed7878;
|
||||||
|
}
|
||||||
|
|
||||||
|
#surveys .progress{
|
||||||
|
margin: 10px;
|
||||||
|
}
|
Loading…
Reference in New Issue