pre pitch

pull/348/head
Youssef ABIDI 2017-10-05 23:28:02 +01:00
parent 627ff12d16
commit 26f20c3f2f
38 changed files with 939 additions and 530 deletions

BIN
src/app/.DS_Store vendored

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,87 @@
/**
* Created by k.danovsky on 13.05.2016.
*/
(function () {
'use strict';
var emailContentModels = {
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>",
s_regular: "<p>Hello </p> <p><b>{{MEMBER_NAME}}</b>,&nbsp;</p> <div><br></div> <div>Please take a few minutes to answer this survey, your answer is mandatory.&nbsp;</div> <div><br></div> <div>{{SURVEY_LINK}}</div> <div><br></div> <div>Thanks,<br></div>",
s_incognito: "<p>Hello,&nbsp;</p> <div><br></div> <div>Please take a few minutes to answer this survey, your answer is mandatory.&nbsp;</div> <div><br></div> <div>{{SURVEY_LINK}}</div> <div><br></div> <div>Thanks,<br></div>"
};
// main functional color scheme
var tags = [
"Share of expertise with the company" ,
"Acceptable work demands" ,
"Good relations with management" ,
"Team work" ,
"Happiness",
"Innovation",
"Leadership",
"Supportiveness",
"Determination",
"Trust",
"Spirituality / my life",
"Environnement respect"
];
var series = ['How the others see you', 'How you evaluated yourself'];
var survey = {
defaultTitle: "Survey Title",
defaultDescription: "Survey Description",
defaultType: "s_360",
};
// dashboard colors for charts
var apiBaseUrl = "http://localhost:9000"
var tabs = [{
label: 'management',
name: 'Top management'
},{
label: 'hr',
name: 'HR'
}, {
label: 'tech',
name: 'Tech'
}, {
label: 'product',
name: 'Product'
}, {
label: 'finance',
name: 'Finance'
}, {
label: 'media',
name: 'Media'
}, {
label: 'shops',
name: 'Shops'
}, {
label: 'innovation',
name: 'Innovation'
}];
angular.module('BlurAdmin.pages')
.provider('appConfig', appConfigProvider);
/** @ngInject */
function appConfigProvider(colorHelper) {
var conf = {
emailContentModels : emailContentModels,
apiBaseUrl : apiBaseUrl,
tags : tags,
survey : survey,
series : series,
tabs:tabs
};
conf.$get = function () {
delete conf.$get;
return conf;
};
return conf;
}
})();

View File

@ -8,8 +8,8 @@
.factory('AuthService',AuthService);
/** @ngInject */
function AuthService($http, $q) {
var apiBaseUrl = "http://localhost:9000"
function AuthService($http, $q, appConfig) {
var apiBaseUrl = appConfig.apiBaseUrl
var endpoint = apiBaseUrl + "/auth";
function login(params) {

View File

@ -1,8 +1,7 @@
<div class="login" ng-controller="authSignInCtrl as signInVm">
<main class="auth-main">
<div class="auth-block">
<h1>Sign in to Blur Admin</h1>
<a ui-sref="authSignUp" class="auth-link">New to Blur Admin? Sign up!</a>
<h1>Sign in to Avito Survey Administartion</h1>
<form class="form-horizontal" ng-submit="signInVm.login()">
<div class="form-group">
@ -22,7 +21,7 @@
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-default btn-auth">Sign in</button>
<a href class="forgot-pass">Forgot password?</a>
</div>
</div>
</form>

View File

@ -5,7 +5,7 @@
.config(routeConfig);
/** @ngInject */
function routeConfig($stateProvider) {
function routeConfig($stateProvider, $urlRouterProvider) {
$stateProvider
.state('authSignIn', {
url: '/authSignIn',
@ -16,7 +16,18 @@
order: 800,
},
authenticate: false
})
.state('logout', {
url: '/logout',
//templateUrl: 'app/pages/authSignIn/authSignIn.html',
controller: 'logoutCtrl',
authenticate: true
});
/*$urlRouterProvider.when('/logout',
template: '', //A template or templateUrl is required by AngularJS, even if your controller always redirects.
controller: 'LogoutController'
);*/
}
})();

View File

@ -0,0 +1,19 @@
(function() {
'use strict';
angular.module('BlurAdmin.pages.authSignIn')
.controller('logoutCtrl', logoutCtrl);
/** @ngInject */
function logoutCtrl($scope, localStorage, $state) {
var vm = this;
init();
function init() {
localStorage.clear();
$state.transitionTo("authSignIn");
}
}
})();

View File

@ -14,13 +14,7 @@
<footer class="al-footer clearfix">
<div class="al-footer-right">Created with <i class="ion-heart"></i></div>
<div class="al-footer-main clearfix">
<div class="al-copy">Blur Admin 2016</div>
<ul class="al-share clearfix">
<li><i class="socicon socicon-facebook"></i></li>
<li><i class="socicon socicon-twitter"></i></li>
<li><i class="socicon socicon-google"></i></li>
<li><i class="socicon socicon-github"></i></li>
</ul>
<div class="al-copy">Avito Survey 2017</div>
</div>
</footer>

View File

@ -17,7 +17,7 @@
'BlurAdmin.pages.authSignUp',
'BlurAdmin.pages.services',
'BlurAdmin.pages.config',
//'BlurAdmin.pages.main',
'BlurAdmin.pages.profile',
]).config(routeConfig)
.factory('authInterceptor', authInterceptor);

View File

@ -0,0 +1,19 @@
/**
* @author a.demeshko
* created on 21.01.2016
*/
(function () {
'use strict';
angular.module('BlurAdmin.pages.profile')
.controller('ProfileModalCtrl', ProfileModalCtrl);
/** @ngInject */
function ProfileModalCtrl($scope, $uibModalInstance) {
$scope.link = '';
$scope.ok = function () {
$uibModalInstance.close($scope.link);
};
}
})();

View File

@ -0,0 +1,89 @@
/**
* @author v.lugovsky
* created on 16.12.2015
*/
(function () {
'use strict';
angular.module('BlurAdmin.pages.profile')
.controller('ProfilePageCtrl', ProfilePageCtrl);
/** @ngInject */
function ProfilePageCtrl($scope, fileReader, $filter, $uibModal) {
$scope.picture = $filter('profilePicture')('Nasta');
$scope.removePicture = function () {
$scope.picture = $filter('appImage')('theme/no-photo.png');
$scope.noPicture = true;
};
$scope.uploadPicture = function () {
var fileInput = document.getElementById('uploadFile');
fileInput.click();
};
$scope.socialProfiles = [
{
name: 'Facebook',
href: 'https://www.facebook.com/akveo/',
icon: 'socicon-facebook'
},
{
name: 'Twitter',
href: 'https://twitter.com/akveo_inc',
icon: 'socicon-twitter'
},
{
name: 'Google',
icon: 'socicon-google'
},
{
name: 'LinkedIn',
href: 'https://www.linkedin.com/company/akveo',
icon: 'socicon-linkedin'
},
{
name: 'GitHub',
href: 'https://github.com/akveo',
icon: 'socicon-github'
},
{
name: 'StackOverflow',
icon: 'socicon-stackoverflow'
},
{
name: 'Dribbble',
icon: 'socicon-dribble'
},
{
name: 'Behance',
icon: 'socicon-behace'
}
];
$scope.unconnect = function (item) {
item.href = undefined;
};
$scope.showModal = function (item) {
$uibModal.open({
animation: false,
controller: 'ProfileModalCtrl',
templateUrl: 'app/pages/profile/profileModal.html'
}).result.then(function (link) {
item.href = link;
});
};
$scope.getFile = function () {
fileReader.readAsDataUrl($scope.file, $scope)
.then(function (result) {
$scope.picture = result;
});
};
$scope.switches = [true, true, false, true, true, false];
}
})();

View File

@ -0,0 +1,211 @@
<div ba-panel ba-panel-class="profile-page">
<div class="panel-content">
<div class="progress-info">Your profile is 70% Complete</div>
<div class="progress">
<div class="progress-bar progress-bar-primary progress-bar-striped active" role="progressbar"
aria-valuenow="70" aria-valuemin="0" aria-valuemax="100" style="width: 70%">
</div>
</div>
<h3 class="with-line">General Information</h3>
<div class="row">
<div class="col-md-6">
<div class="form-group row clearfix">
<label for="inputFirstName" class="col-sm-3 control-label">Picture</label>
<div class="col-sm-9">
<div class="userpic">
<div class="userpic-wrapper">
<img ng-src="{{ picture }}" ng-click="uploadPicture()">
</div>
<i class="ion-ios-close-outline" ng-click="removePicture()" ng-if="!noPicture"></i>
<a href class="change-userpic" ng-click="uploadPicture()">Change Profile Picture</a>
<input type="file" ng-show="false" id="uploadFile" ng-file-select="onFileSelect($files)">
</div>
</div>
</div>
</div>
<div class="col-md-6"></div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group row clearfix">
<label for="inputFirstName" class="col-sm-3 control-label">First Name</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="inputFirstName" placeholder="" value="Anastasiya">
</div>
</div>
<div class="form-group row clearfix">
<label for="inputLastName" class="col-sm-3 control-label">Last Name</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="inputLastName" placeholder="" value="">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row clearfix">
<label class="col-sm-3 control-label">Department</label>
<div class="col-sm-9">
<select class="form-control" selectpicker>
<option>Web Development</option>
<option>System Development</option>
<option>Sales</option>
<option>Human Resources</option>
</select>
</div>
</div>
<div class="form-group row clearfix">
<label for="inputOccupation" class="col-sm-3 control-label">Occupation</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="inputOccupation" placeholder="" value="Front End Web Developer">
</div>
</div>
</div>
</div>
<h3 class="with-line">Change Password</h3>
<div class="row">
<div class="col-md-6">
<div class="form-group row clearfix">
<label for="inputPassword" class="col-sm-3 control-label">Password</label>
<div class="col-sm-9">
<input type="password" class="form-control" id="inputPassword" placeholder="" value="12345678">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row clearfix">
<label for="inputConfirmPassword" class="col-sm-3 control-label">Confirm Password</label>
<div class="col-sm-9">
<input type="password" class="form-control" id="inputConfirmPassword" placeholder="">
</div>
</div>
</div>
</div>
<h3 class="with-line">Contact Information</h3>
<div class="row">
<div class="col-md-6">
<div class="form-group row clearfix">
<label for="inputEmail3" class="col-sm-3 control-label">Email</label>
<div class="col-sm-9">
<input type="email" class="form-control" id="inputEmail3" placeholder="" value="contact@akveo.com">
</div>
</div>
<div class="form-group row clearfix">
<label for="inputPhone" class="col-sm-3 control-label">Phone</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="inputPhone" placeholder="" value="+1 (23) 456 7890">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row clearfix">
<label class="col-sm-3 control-label">Office Location</label>
<div class="col-sm-9">
<select class="form-control" title="Standard Select" selectpicker>
<option>San Francisco</option>
<option>London</option>
<option>Minsk</option>
<option>Tokio</option>
</select>
</div>
</div>
<div class="form-group row clearfix">
<label for="inputRoom" class="col-sm-3 control-label">Room</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="inputRoom" placeholder="" value="303">
</div>
</div>
</div>
</div>
<h3 class="with-line">Social Profiles</h3>
<div class="social-profiles row clearfix">
<div class="col-md-3 col-sm-4" ng-repeat="item in socialProfiles">
<a class="sn-link" href ng-click="showModal(item)" ng-if="!item.href">
<i class="socicon {{ item.icon }}"></i>
<span>{{ item.name }}</span>
</a>
<a class="sn-link connected" href="{{ item.href }}" target="_blank" ng-if="item.href">
<i class="socicon {{ item.icon }}"></i>
<span>{{ item.name }}</span>
<em class="ion-ios-close-empty sn-link-close" ng-mousedown="unconnect(item)"></em>
</a>
</div>
</div>
<h3 class="with-line">Send Email Notifications</h3>
<div class="notification row clearfix">
<div class="col-sm-6">
<div class="form-group row clearfix">
<label class="col-xs-8">When I receive a message</label>
<div class="col-xs-4">
<switch color="primary" ng-model="switches[0]"></switch>
</div>
</div>
<div class="form-group row clearfix">
<label class="col-xs-8">When Someone sends me an invitation</label>
<div class="col-xs-4">
<switch color="primary" ng-model="switches[1]"></switch>
</div>
</div>
<div class="form-group row clearfix">
<label class="col-xs-8">When profile information changes</label>
<div class="col-xs-4">
<switch color="primary" ng-model="switches[2]"></switch>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group row clearfix">
<label class="col-xs-8">When anyone logs into your account from a new device or browser</label>
<div class="col-xs-4">
<switch color="primary" ng-model="switches[3]"></switch>
</div>
</div>
<div class="form-group row clearfix">
<label class="col-xs-8">Weekly Reports</label>
<div class="col-xs-4">
<switch color="primary" ng-model="switches[4]"></switch>
</div>
</div>
<div class="form-group row clearfix">
<label class="col-xs-8">Daily Reports</label>
<div class="col-xs-4">
<switch color="primary" ng-model="switches[5]"></switch>
</div>
</div>
</div>
</div>
<button type="button" class="btn btn-primary btn-with-icon save-profile">
<i class="ion-android-checkmark-circle"></i>Update Profile
</button>
</div>
</div>

View File

@ -0,0 +1,22 @@
/**
* @author v.lugovsky
* created on 16.12.2015
*/
(function () {
'use strict';
angular.module('BlurAdmin.pages.profile', [])
.config(routeConfig);
/** @ngInject */
function routeConfig($stateProvider) {
$stateProvider
.state('main.profile', {
url: '/profile',
title: 'Profile',
templateUrl: 'app/pages/profile/profile.html',
controller: 'ProfilePageCtrl',
});
}
})();

View File

@ -0,0 +1,20 @@
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" ng-click="$dismiss()" aria-label="Close">
<em class="ion-ios-close-empty sn-link-close"></em>
</button>
<h4 class="modal-title" id="myModalLabel">Add Account</h4>
</div>
<form name="linkForm">
<div class="modal-body">
<p>Paste a link to your profile into the box below</p>
<div class="form-group">
<input type="text" class="form-control" placeholder="Link to Profile" ng-model="link">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" ng-click="ok(link)">Save changes</button>
</div>
</form>
</div>

View File

@ -7,7 +7,7 @@
angular.module('BlurAdmin.pages.surveys.create',['BlurAdmin.pages.surveys', 'ui.select', 'ngSanitize', 'textAngular', 'ngTagsInput'])
.config(function($provide){
$provide.decorator('taOptions', ['taRegisterTool', '$delegate', function(taRegisterTool, taOptions){
$provide.decorator('taOptions', ['taRegisterTool', '$delegate', 'appConfig', function(taRegisterTool, taOptions, appConfig){
// $delegate is the taOptions we are decorating
// register the tool with textAngular
function insertTextAtCursor(text) {
@ -41,6 +41,10 @@
}
}
function getAppConfig(appConfig) {
return appConfig
}
taRegisterTool('userName', {
iconclass: "fa fa-user",
tooltiptext: "Insert the member name",
@ -62,8 +66,8 @@
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);
//var appConfig = getAppConfig()
return this.$editor().wrapSelection('insertHTML', appConfig.emailContentModels.s_360, true);
}
});
@ -71,8 +75,8 @@
iconclass: "fa fa-file",
tooltiptext: "Insert a regular survey text model",
action: function(){
insertTextAtCursor("REGULAR");
return moveCaret(1);
//var appConfig = getAppConfig()
return this.$editor().wrapSelection('insertHTML', appConfig.emailContentModels.s_regular, true);
}
});
@ -80,8 +84,8 @@
iconclass: "fa fa-eye-slash",
tooltiptext: "Insert an incognito survey text model",
action: function(){
insertTextAtCursor("INCOGNITO");
return moveCaret(1);
//var appConfig = getAppConfig()
return this.$editor().wrapSelection('insertHTML', appConfig.emailContentModels.s_incognito, true);
}
});
// add the button to the default toolbar definition

View File

@ -48,7 +48,7 @@
});
/** @ngInject */
function CreateTabCtrl(SurveyService, ListService,MemberService, $scope, $http, $compile, $timeout, $stateParams, $log, toastr, $uibModal, $state) {
function CreateTabCtrl(SurveyService, ListService,MemberService, $scope, $http, $compile, $timeout, $stateParams, $log, toastr, $uibModal, $state, appConfig) {
$scope.editmode = true;
@ -57,10 +57,10 @@
$scope.$watch('lists.selected', $scope.updateLists);
$scope.survey = {};
$scope.survey.name = 'Page Title';
$scope.survey.description = 'Page Description';
$scope.survey.name = appConfig.survey.defaultTitle;
$scope.survey.description = appConfig.survey.defaultDescription;
$scope.survey.elements = [];
$scope.survey.type = "s_360";
$scope.survey.type = appConfig.survey.defaultType;
$scope.display = {};
$scope.display.survey = true;
@ -169,34 +169,27 @@
function (data){
console.log('Survey edited', data);
if (process)
//send the survey
SurveyService
.send(survey)
.then(
function (data){
console.log('Survey is being sent', data);
$uibModal.open({
animation: true,
templateUrl: 'app/pages/surveys/create/widgets/successModal.html',
//size: size,
/*resolve: {
items: function () {
return $scope.items;
}
}*/
});
},
function (error){
toastr.error('There were an error sending the survey', 'Surveys', $scope.errorToastrOptions)
}
);
else
toastr.info('The survey was edited successfuly :)', 'Surveys', {
"autoDismiss": true,
"positionClass": "toast-bottom-right",
"type": "success",
"timeOut": "5000",
"extendedTimeOut": "2000"
})
toastr.info('The survey was edited successfuly :)', 'Surveys', $scope.successToastrOptions)
},
function (error){
toastr.error('There were an error editing the survey', 'Surveys', {
"autoDismiss": true,
"positionClass": "toast-bottom-right",
"type": "error",
"timeOut": "5000",
"extendedTimeOut": "2000"
})
toastr.error('There were an error editing the survey', 'Surveys', $scope.errorToastrOptions)
}
);
} else {
@ -205,22 +198,10 @@
.then(
function (data){
console.log('Survey created', data);
toastr.info('The survey was created successfuly :)', 'Surveys', {
"autoDismiss": true,
"positionClass": "toast-bottom-right",
"type": "success",
"timeOut": "5000",
"extendedTimeOut": "2000"
})
toastr.info('The survey was created successfuly :)', 'Surveys', $scope.successToastrOptions)
},
function (error){
toastr.error('There were an error creating the survey', 'Surveys', {
"autoDismiss": true,
"positionClass": "toast-bottom-right",
"type": "error",
"timeOut": "5000",
"extendedTimeOut": "2000"
})
toastr.error('There were an error creating the survey', 'Surveys', $scope.errorToastrOptions)
}
);
}
@ -257,9 +238,9 @@
$scope.survey.list = $scope.lists.selected;
$scope.survey.status = "Sending";
$log.info("sendSurvey",$scope.survey);
$state.transitionTo('main.surveys.list'/*, {id: item.id}*/);
$scope.saveSurvey(true);
$state.transitionTo('main.surveys.list'/*, {id: item.id}*/);
/*$scope.saveSurvey();
@ -321,20 +302,22 @@
}
$scope.loadLists();
$scope.tags = [
"Share of expertise with the company" ,
"Acceptable work demands" ,
"Good relations with management" ,
"Team work" ,
"Happiness",
"Innovation",
"Leadership",
"Supportiveness",
"Determination",
"Trust",
"Spirituality / my life",
"Environnement respect"
];
$scope.errorToastrOptions = {
"autoDismiss": true,
"positionClass": "toast-bottom-right",
"type": "error",
"timeOut": "5000",
"extendedTimeOut": "2000"
};
$scope.successToastrOptions = {
"autoDismiss": true,
"positionClass": "toast-bottom-right",
"type": "success",
"timeOut": "5000",
"extendedTimeOut": "2000"
};
$scope.tags = appConfig.tags;
}
$scope.activate();

View File

@ -5,7 +5,7 @@
.controller('list', list);
/** @ngInject */
function list( SurveyService, AnswerService, MemberService, $scope, $rootScope, $log, $state, toastr, baConfig, $q, $http, $sce, $filter) {
function list( SurveyService, AnswerService, MemberService, $scope, $rootScope, $log, $state, toastr, baConfig, $q, $http, $sce, $filter, appConfig) {
var vm = this;
$rootScope.$state = $state;
@ -26,37 +26,69 @@
$state.go('main.surveys.create');
}
function editSurvey(id){
function editSurvey(survey){
$log.info("Edit");
$state.go('main.surveys.edit', {'survey_id': id})
if(survey.status == 'Draft' )
$state.go('main.surveys.edit', {'survey_id': survey.id})
else
toastr.error('You can only edit surveys in Draft status', 'Surveys', vm.errorToastrOptions)
};
function removeSurvey(id){
function resendSurvey(survey){
if (confirm("Are you sure you want to resend this survey ?"))
SurveyService
.send(survey)
.then(
function (data){
console.log('Survey is being sent', data);
loadSurveys();
toastr.info('The survey is being resent :)', 'Surveys', vm.successToastrOptions)
},
function (error){
toastr.error('There were an error resending the survey', 'Surveys', vm.errorToastrOptions)
}
);
};
function duplicateSurvey(survey){
$log.info("Remove");
var s = survey
s.id = null;
s.name = "COPY OF " + s.name
s.status = "Draft"
s.list = []
s.respondents = []
s.sent = []
s.notSent = []
SurveyService
.create(s)
.then(
function (data){
console.log('Survey duplicated', data);
loadSurveys();
toastr.info('The survey was duplicated successfuly :)', 'Surveys', vm.successToastrOptions)
},
function (error){
toastr.error('There were an error duplicating the survey', 'Surveys', vm.errorToastrOptions)
}
);
};
function removeSurvey(survey){
if (confirm("Are you sure?"))
{
$log.info("Remove");
SurveyService
.remove(id)
.remove(survey.id)
.then(
function (data){
console.log('Survey deleted', data);
$("tr#"+id).slideUp();
toastr.info('The survey was deleted successfuly :)', 'Surveys', {
"autoDismiss": true,
"positionClass": "toast-bottom-right",
"type": "success",
"timeOut": "5000",
"extendedTimeOut": "2000"
})
loadSurveys();
toastr.info('The survey was deleted successfuly :)', 'Surveys', vm.successToastrOptions)
},
function (error){
toastr.error('There were an error deleting the survey', 'Surveys', {
"autoDismiss": true,
"positionClass": "toast-bottom-right",
"type": "error",
"timeOut": "5000",
"extendedTimeOut": "2000"
})
toastr.error('There were an error deleting the survey', 'Surveys', vm.errorToastrOptions)
}
);
}
@ -98,8 +130,19 @@
function getPDF(){
vm.loading = true;
var q = $q.defer();
var endpoint = appConfig.apiBaseUrl+'/pdf/regular';
$http.defaults.headers.common['content-type']= 'application/pdf';
$http.get('http://localhost:9000/pdf/regular', {params : {"survey":vm.activeSurvey.id}, responseType:'arraybuffer'})
var paramz = {}
paramz.survey = vm.activeSurvey.id
paramz.survey_type = vm.activeSurvey.type
paramz.survey_summary_labels = vm.activeSurvey.type == "s_360" ? vm.s360Analysis.overall.labels.join(', ') : vm.regularAnalysis.overall.labels.join(', ');
paramz.survey_summary_data = vm.activeSurvey.type == "s_360" ? vm.s360Analysis.overall.data.join(', ') : vm.regularAnalysis.overall.data.join(', ');
// paramz.lists_summary_labels = vm.activeSurvey.type == "s_360" ? vm.s360Analysis.lists.labels.join(', ') : vm.regularAnalysis.overall.labels.join(', ');
// paramz.lists_summary_data = vm.activeSurvey.type == "s_360" ? vm.s360Analysis.lists.data.join(', ') : vm.regularAnalysis.overall.data.join(', ');
$http.get(endpoint, {params : paramz, responseType:'arraybuffer'})
.success(function (response) {
console.log(response);
var file = new Blob([response], {type: 'application/pdf'});
@ -125,7 +168,7 @@
getRespondents(survey);
if(vm.activeSurvey.type != "s_360")
getListAnalysis();
getRegularAnalysis();
else
getS360Analysis();
@ -141,8 +184,13 @@
.list(params)
.then(function (data){
vm.members = data;
$log.info("Got members",data);
angular.forEach(vm.members, function(member, key) {
if (survey.type == 's_incognito'){
member.name = 'unknown'
member.email = 'unknown'
}
member.answers = $filter('filter')(vm.analysis.answers, {'asked' : {'id' : member.id}})
})
vm.selectedMember = (vm.members.length > 0) ? vm.members[0] : [];
@ -155,157 +203,133 @@
function getS360Analysis(){
vm.s360Analysis = {"lists" : {}, "overall": {}}
//overall
vm.s360Analysis.overall = gets360Data(vm.analysis.data.overall);
vm.s360Analysis.overall = gets360Data(vm.analysis.data.overall, vm.analysis.labels);
//lists
angular.forEach(vm.activeSurvey.list, function(list) {
vm.s360Analysis.lists[list._id] = {}
vm.s360Analysis.lists[list._id].labels = []
vm.s360Analysis.lists[list._id] = gets360Data(vm.analysis.data.lists[list._id]);
vm.s360Analysis.lists[list._id] = gets360Data(vm.analysis.data.lists[list._id], vm.analysis.labels);
});
//individual
vm.s360Analysis.individual = gets360IndividualData(vm.analysis.data.overall);
console.log("listAnalysis", vm.s360Analysis)
vm.s360Analysis.individual = gets360IndividualData(vm.analysis.data.overall, vm.analysis.labels);
console.log("s360Analysis", vm.s360Analysis)
}
function gets360Data(listData){
function gets360Data(listData, labels){
var data = {}
data.labels = []
data.data = []
angular.forEach(vm.activeSurvey.elements, function(element) {
var index = 0;
var sumElementScore = 0;
data.labels.push(element.tag)
angular.forEach(listData.data, function(asked) {
angular.forEach(asked, function(evaluated) {
index++
sumElementScore += evaluated[element._id] ? evaluated[element._id] : 0
//console.log("evaluated, element._id, evaluated[element._id]", evaluated, element._id, evaluated[element._id])
})
angular.forEach(labels, function(label, el) {
var elemSum = 0
var i = 0
angular.forEach(listData.data, function(asked, a) {
var askedSum = 0
angular.forEach(asked, function(evaluated, e) {
elemSum = elemSum + evaluated[el]
i++
})
var average = sumElementScore / index
data.data.push(average);
})
var avg = elemSum / i
//console.log("element, elemSum, i, avg",el, elemSum, i, avg)
data.data.push(avg);
})
return data;
}
function gets360IndividualData(listData, labels){
var data = {}
data.labels = []
data.data = []
angular.forEach(vm.activeSurvey.elements, function(element) {
data.labels.push(element.tag)
})
var tempAskedData = []
var othersData = []
angular.forEach(listData.data, function(askd, as) {
tempAskedData[as] = []
othersData[as] = []
angular.forEach(labels, function(label, el) {
var elemSum = 0
var myVal = 0
var i = 0
angular.forEach(listData.data, function(asked, a) {
var askedSum = 0
angular.forEach(asked, function(evaluated, e) {
//others evaluation
if(e == as) {
i++
elemSum = elemSum + evaluated[el]
}
//auto evaluation
if (e == as && e == a)
myVal = evaluated[el]
})
})
var avg = elemSum / i
othersData[as].push(avg);
tempAskedData[as].push(myVal);
})
})
//merging all together
//console.log("here",othersData)
angular.forEach(listData.data, function(askd, as) {
//console.log("asasasas",as)
data.data[as] = [othersData[as], tempAskedData[as]]
})
data.labels = data.labels
//console.log("othersData[as], tempAskedData[as]",othersData, tempAskedData, data)
return data;
}
function gets360IndividualData(listData){
//var data = {}
var data = {}
/*data.labels = []
data.data = {}
angular.forEach(listData.members, function(member) {
data.data[member] = {}
//angular.forEach(listData.members, function(m) {
data.data[member] = {}
angular.forEach(vm.activeSurvey.elements, function(element) {
data.data[member][element._id] = []
})
//})
})
var askedData = {}
angular.forEach(vm.activeSurvey.elements, function(element) {
angular.forEach(listData.data, function(asked, a) {
var askedScore = 0
askedData[a] = askedData[a] ? askedData[a] : []
angular.forEach(asked, function(evaluated, e) {
if(e=='59b7f2d5c59b371d734ac120' && element._id =='59b7f8bbc59b371d734ac144')
console.log("evaluated[element._id]",evaluated[element._id])
askedScore += evaluated[element._id] ? evaluated[element._id] : 100
if (a == e) {
var val = evaluated[element._id] ? evaluated[element._id] : 0
//askedData[a][element._id].push(val)
//console.log("a, val, askedData", a, val, askedData)
}
if(e=='59b7f2d5c59b371d734ac120' && element._id =='59b7f8bbc59b371d734ac144')
console.log("askedScore",askedScore)
})
var avg = askedScore / listData.members.length
data.data[a][element._id].push(avg);
})
})*/
//console.log("data.data", data.data)
data.data = {}
data.labels = []
var askedData = {}
angular.forEach(vm.activeSurvey.elements, function(element) {
var index = 0;
var sumElementScore = 0;
data.labels.push(element.tag)
angular.forEach(listData.data, function(asked, a) {
var i = 0;
var askedScore = 0
askedData[a] = askedData[a] ? askedData[a] : []
data.data[a] = data.data[a] ? data.data[a] : []
angular.forEach(asked, function(evaluated, e) {
i++
askedScore = askedScore + evaluated[element._id]
if(e=='59b7f2d5c59b371d734ac120' && element._id =='59b7f8bbc59b371d734ac144')
{
console.log("evaluated[element._id], askedScore, i",evaluated[element._id], askedScore, evaluated)
//console.log("i, evaluated[element._id], a", i, evaluated[element._id], a)
}
if (a == e) {
var val = evaluated[element._id] ? evaluated[element._id] : 0
askedData[a].push(val)
if(e=='59b7f2d5c59b371d734ac120' && element._id =='59b7f8bbc59b371d734ac144')
console.log("a, val, askedData askedScore", a, val, askedData)
}
//console.log("evaluated, element._id, evaluated[element._id]", evaluated, element._id, evaluated[element._id])
})
var avg = askedScore / listData.members.length
data.data[a].push(avg);
})
//var average = sumElementScore / index
//data.data.push(average);
//console.log("data.data, askedData", data.data, askedData);
//data.data.push(average);
})
function getRegularAnalysis(){
var finalData = {}
finalData.data = {}
angular.forEach(data.data, function(el, key) {
finalData.data[key] = []
angular.forEach(askedData, function(ask, k) {
if(key == k) {
finalData.data[key] = [el, ask]
}
})
})
finalData.labels = data.labels
return finalData;
}
function getListAnalysis(){
vm.listAnalysis = {}
vm.regularAnalysis = {"lists" : {}, "overall": {}}
//overall
vm.regularAnalysis.overall = getRegularData(vm.analysis.data.overall, vm.analysis.labels);
//lists
angular.forEach(vm.activeSurvey.list, function(list) {
vm.listAnalysis[list._id] = {}
//analysis.id = list._id
//analysis.name = list.name
vm.listAnalysis[list._id].labels = []
vm.listAnalysis[list._id].data = []
var listData = vm.analysis.data.lists[list._id]
//console.log(vm.analysis.data.lists[list._id])
vm.regularAnalysis.lists[list._id] = {}
vm.regularAnalysis.lists[list._id].labels = []
vm.regularAnalysis.lists[list._id] = getRegularData(vm.analysis.data.lists[list._id], vm.analysis.labels);
});
console.log("regularAnalysis", vm.regularAnalysis)
}
function getRegularData(listData, labels){
var data = {}
data.labels = []
data.data = []
angular.forEach(vm.activeSurvey.elements, function(element) {
vm.listAnalysis[list._id].labels.push(element.tag)
if (element.tag)
data.labels.push(element.tag)
else
data.labels.push(element.text)
var perfectScore = listData.respondents.length * element.items.length //totalParticip * nbrChoix
// nobreReponseN * coeficientN + ...
var totalScore = 0;
@ -313,12 +337,11 @@
totalScore += listData.data[element._id][i] * (i+1)
}
var percent = totalScore * 100 / perfectScore
vm.listAnalysis[list._id].data.push(percent);
data.data.push(percent);
//console.log("listData.data[element._id], perfectScore, totalScore, percent", listData.data[element._id], perfectScore, totalScore, percent)
})
//vm.listAnalysis.push(analysis)
});
console.log("listAnalysis", vm.listAnalysis)
return data;
}
@ -332,6 +355,8 @@
vm.editSurvey = editSurvey;
vm.removeSurvey = removeSurvey;
vm.printPdf = printPdf;
vm.duplicateSurvey = duplicateSurvey;
vm.resendSurvey = resendSurvey;
vm.s360ChartOption = {
scales: {
@ -349,7 +374,23 @@
}]
}
};
vm.series = ['How the others see you', 'How you evaluated yourself'];
vm.errorToastrOptions = {
"autoDismiss": true,
"positionClass": "toast-bottom-right",
"type": "error",
"timeOut": "5000",
"extendedTimeOut": "2000"
};
vm.successToastrOptions = {
"autoDismiss": true,
"positionClass": "toast-bottom-right",
"type": "success",
"timeOut": "5000",
"extendedTimeOut": "2000"
};
vm.series = appConfig.series;
loadSurveys();
}

View File

@ -44,10 +44,12 @@
</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>
<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-warning" ng-click="vm.editSurvey(survey)" ng-if="survey.status == 'Draft'">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 == '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-info" ng-if="survey.status=='Sent'" ng-click="vm.resendSurvey(survey)">Resend</button>
<button class="status-button btn btn-xs btn-success" ng-if="survey.status == 'Sent'" ng-click="vm.analyzeSurvey(survey)">Analyse</button>
<button class="status-button btn btn-xs btn-primary" ng-click="vm.duplicateSurvey(survey)">Duplicate</button>
<button ng-if="survey.status != 'Sending'" class="status-button btn btn-xs btn-danger" ng-click="vm.removeSurvey(survey)">Remove</button>
</td>
</tr>
</tbody>

View File

@ -1,7 +1,8 @@
<div id="analysis">
<uib-tabset active="$tabSetStatus.activeTab">
<uib-tab heading="Question summaries" ng-if="vm.activeSurvey.type != 's_360'">
<button type="button" ng-click="vm.printPdf()">Print PDF in new window</button>
<uib-tab heading="Survey summary" ng-if="vm.activeSurvey.type != 's_360'">
<div class="row">
<div class="col-md-12">
@ -14,15 +15,21 @@
<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 panel-default bootstrap-panel">
<div class="panel-heading">
{{ vm.activeSurvey.name }}
<button type="button" class="btn btn-default btn-with-icon pull-right" ng-click="vm.printPdf()" style="margin-top:-9px"><i class="ion-stats-bars"></i>Export as PDF</button>
</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.overall.data[e._id]" chart-labels="vm.analysis.labels[e._id]">
<div class="chartjs-canvas-holder-first-row" style="width: 100%;margin:0 auto;">
<canvas id="bar" class="chart chart-bar"
chart-data="vm.regularAnalysis.overall.data" chart-labels="vm.regularAnalysis.overall.labels">
</canvas>
</div>
@ -51,7 +58,10 @@
<div class="panel-group">
<div class="panel panel-default bootstrap-panel">
<div class="panel-heading">{{ vm.activeSurvey.name }}</div>
<div class="panel-heading">
{{ vm.activeSurvey.name }}
<button type="button" class="btn btn-default btn-with-icon pull-right" ng-click="vm.printPdf()" style="margin-top:-9px"><i class="ion-stats-bars"></i>Export as PDF</button>
</div>
<div class="panel-body">
@ -77,6 +87,18 @@
<uib-tab heading="Lists summaries">
<div class="row">
@ -95,7 +117,7 @@
<div class="panel-body">
<div class="chartjs-canvas-holder-first-row" style="width: 100%;margin:0 auto;" ng-if="vm.activeSurvey.type != 's_360'">
<canvas id="bar" class="chart chart-bar"
chart-data="vm.listAnalysis[e._id].data" chart-labels="vm.listAnalysis[e._id].labels">
chart-data="vm.regularAnalysis.lists[e._id].data" chart-labels="vm.regularAnalysis.lists[e._id].labels">
</canvas>
</div>
@ -116,6 +138,40 @@
</uib-tab>
<uib-tab heading="Question summaries" ng-if="vm.activeSurvey.type != 's_360'">
<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.data.overall.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" class="chart chart-doughnut"
chart-data="vm.analysis.data.overall.data[e._id]" chart-labels="vm.analysis.labels[e._id]">
</canvas>
</div>
</div>
</div>
</div>
</div>
</div>
</uib-tab>
<uib-tab heading="Individual report" ng-if="vm.activeSurvey.type == 's_360'">

View File

@ -8,8 +8,8 @@
.factory('SurveyService',SurveyService);
/** @ngInject */
function SurveyService($http, $q) {
var apiBaseUrl = "http://localhost:9000"
function SurveyService($http, $q, appConfig) {
var apiBaseUrl = appConfig.apiBaseUrl
var endpoint = apiBaseUrl + "/surveys";
function list(params) {
@ -49,6 +49,10 @@
return $http.post(endpoint, survey);
}
function send(survey) {
return $http.get(endpoint + "/" + survey.id + "/send");
}
function update(survey) {
return $http.put(endpoint + "/"+survey.id, survey);
}
@ -62,7 +66,8 @@
get:get,
create:create,
update:update,
remove:remove
remove:remove,
send:send
}
}
})();

View File

@ -67,6 +67,15 @@
fontColor: layoutColors.defaultText,
showLabelBackdrop: false
}
},
tooltips: {
enabled: true
},
});
ChartJsProvider.setOptions('doughnut', {
legend: {
display: true,
position:'bottom'
}
});
// Configure all line charts

View File

@ -8,8 +8,8 @@
.factory('AnswerService', AnswerService);
/** @ngInject */
function AnswerService($http, $q) {
var apiBaseUrl = "http://localhost:9000"
function AnswerService($http, $q, appConfig) {
var apiBaseUrl = appConfig.apiBaseUrl
var endpoint = apiBaseUrl + "/answers";
function list(params) {

View File

@ -20,12 +20,13 @@
});
/** @ngInject */
function ListsTabCtrl($scope, baConfig, membersList, ListService,MemberService, $log, $state,$stateParams) {
function ListsTabCtrl($scope, baConfig, ListService,MemberService, $log, $state,$stateParams,appConfig) {
var vm = this;
vm.searchResult = [];
function loadLists() {
console.log("appConfig", appConfig)
ListService
.list()
.then(function (data){
@ -86,7 +87,7 @@
return colors[i];
}
vm.tabs = membersList.getTabs();
vm.tabs = appConfig.tabs;

View File

@ -8,8 +8,8 @@
.factory('ListService', ListService);
/** @ngInject */
function ListService($http, $q) {
var apiBaseUrl = "http://localhost:9000"
function ListService($http, $q, appConfig) {
var apiBaseUrl = appConfig.apiBaseUrl
var endpoint = apiBaseUrl + "/lists";
function list(params) {

View File

@ -9,7 +9,7 @@
.controller('MembersTabCtrl', MembersTabCtrl);
/** @ngInject */
function MembersTabCtrl(composeModal, membersList, MemberService, $log) {
function MembersTabCtrl(composeModal, MemberService, $log, appConfig) {
var vm = this;
vm.navigationCollapsed = true;
@ -19,20 +19,24 @@
.get(id)
.then(function (data){
vm.member = data.data;
$log.info("Got the member data",data.data);
}, function (error){
$log.error(error);
});
//vm.member = membersList.getMemberById(id);
//vm.actualIndex = membersList.getIndexById(id);
}
else
vm.member = {};
composeModal.open({
member : vm.member,
//actualIndex : vm.actualIndex
})
$log.info("Got the member data",data.data);
}, function (error){
$log.error(error);
});
}
else {
vm.member = {};
composeModal.open({
member : vm.member,
//actualIndex : vm.actualIndex
})
}
};
vm.removeMember = function(id) {
@ -49,7 +53,7 @@
};
vm.tabs = membersList.getTabs();
vm.tabs = appConfig.tabs;
}
})();

View File

@ -9,13 +9,27 @@
.controller('composeBoxCtrl', composeBoxCtrl);
/** @ngInject */
function composeBoxCtrl($scope ,member, membersList,MemberService,fileReader, $filter, toastr, $state) {
function composeBoxCtrl($scope ,member,MemberService,fileReader, $filter, toastr, $state, composeModal, appConfig) {
var vm = this;
vm.successToastrOption = {
"autoDismiss": true,
"positionClass": "toast-bottom-right",
"type": "success",
"timeOut": "5000",
"extendedTimeOut": "2000"
}
vm.errorToastrOption = {
"autoDismiss": true,
"positionClass": "toast-bottom-right",
"type": "error;",
"timeOut": "5000",
"extendedTimeOut": "2000"
}
vm.member = member;
//vm.actualIndex = actualIndex;
//console.log("member",member)
vm.picture = $filter('profilePicture')(member.id, "jpeg") ;//: $filter('appImage')('theme/no-photo.png');
vm.Labels = membersList.getTabs();
vm.Labels = appConfig.tabs;
$scope.removePicture = function () {
vm.picture = $filter('appImage')('theme/no-photo.png');
@ -36,38 +50,40 @@
};
vm.updateMember = function () {
//vm.member.picture = vm.picture;
//vm.member.fileExt = "jpeg";
vm.member.picture = vm.picture.replace(/^data:image\/(png|jpg|jpeg);base64,/, "");
vm.member.fileExt = "jpeg";
console.log('composeBoxCtrl.updateMember', membersList.getIndexById(vm.member.id), vm.member);
MemberService
.put(vm.member)
.then(function (data){
vm.member = {}
vm.picture = $filter('profilePicture')('undefined', "jpeg") ;
$state.go('main.teams.members');
toastr.info('The member was updated successfuly :)', 'Members', vm.successToastrOption)
}, function (error){
$log.error(error);
toastr.error('There were an error updating the memeber', 'Members', vm.errorToastrOption)
});
};
vm.createMember = function () {
vm.member.picture = vm.picture.replace(/^data:image\/(png|jpg|jpeg);base64,/, "");
vm.member.fileExt = "jpeg";
console.log(vm.member);
if(vm.member.id)
vm.updateMember()
else
MemberService
.create(vm.member)
.then(function (data){
vm.member = {}
vm.picture = $filter('profilePicture')('undefined', "jpeg") ;
$state.go('main.teams.members');
toastr.info('The member was created successfuly :)', 'Members', {
"autoDismiss": true,
"positionClass": "toast-bottom-right",
"type": "success",
"timeOut": "5000",
"extendedTimeOut": "2000"
})
toastr.info('The member was created successfuly :)', 'Members', vm.successToastrOption)
}, function (error){
$log.error(error);
toastr.error('There were an error creating the memeber', 'Members', {
"autoDismiss": true,
"positionClass": "toast-bottom-right",
"type": "error",
"timeOut": "5000",
"extendedTimeOut": "2000"
})
toastr.error('There were an error creating the memeber', 'Members', vm.errorToastrOption)
});
};

View File

@ -28,6 +28,10 @@
});
}
this.cancel = function () {
this.dismiss({$value: 'cancel'});
};
}
})();

View File

@ -9,13 +9,8 @@
.controller('MemberDetailCtrl', MemberDetailCtrl);
/** @ngInject */
function MemberDetailCtrl($stateParams, membersList, MemberService, $log) {
function MemberDetailCtrl($stateParams, MemberService, $log) {
var vm = this;
//vm.member = membersList.getMemberById($stateParams.id);
//vm.label = $stateParams.label;
//var vm = this;
//vm.members = ($stateParams.label == "listing") ? membersList.getAllMessages() : membersList.getMembersByLabel($stateParams.label);
function loadMembers() {
MemberService

View File

@ -34,7 +34,7 @@
controller: "MemberDetailCtrl",
controllerAs: "detailCtrl"
});
$urlRouterProvider.when('/teams/members','/teams/members/listing');
$urlRouterProvider.when('/main/teams/members','/main/teams/members/listing');
}
})();

View File

@ -1,182 +0,0 @@
/**
* @author a.demeshko
* created on 12/29/15
*/
(function () {
'use strict';
angular.module('BlurAdmin.pages.teams.members')
.service('membersList', membersList);
/** @ngInject */
function membersList($sce, $stateParams) {
var members = [
{
"id": "4563faass",
"name": "Nasta Linnie",
"pic": "img/Nasta.png",
"email": "petraramsey@mail.com",
"position": "Great Employee",
"labels": ['content']
},
{
"id": "4563fdfvd",
"name": "Nasta Linnie",
"pic": "img/Nasta.png",
"email": "petraramsey@mail.com",
"position": "Great Employee",
"labels": ['content']
},
{
"id": "4563zxcss",
"name": "Nasta Linnie",
"pic": "img/Nasta.png",
"email": "petraramsey@mail.com",
"position": "Great Employee",
"labels": ['product', 'content']
},
{
"id": "8955sddf",
"name": "Nick Cat",
"pic": "img/Nick.png",
"email": "barlowshort@mail.com",
"position": "Graphical designer",
"labels": ['shops']
},
{
"id": "8955sdfcc",
"name": "Nick Cat",
"pic": "img/Nick.png",
"email": "barlowshort@mail.com",
"position": "Graphical designer",
"labels": ['innovation']
},
{
"id": "8955asewf",
"name": "Nick Cat",
"pic": "img/Nick.png",
"email": "barlowshort@mail.com",
"position": "Graphical designer",
"labels": ['shops', 'media']
},
{
"id": "2334uudsa",
"name": "Kostya Danovsky",
"pic": "img/Kostya.png",
"email": "schwart@mail.com",
"position": "Technical Chef",
"labels": ['hr', 'innovation']
},
{
"id": "2334aefvv",
"name": "Kostya Danovsky",
"pic": "img/Kostya.png",
"email": "schwart@mail.com",
"position": "Technical Chef",
"labels": ['tech', 'product']
},
{
"id": "2334cvdss",
"name": "Kostya Danovsky",
"pic": "img/Kostya.png",
"email": "schwart@mail.com",
"position": "Technical Chef",
"labels": ['product']
},
{
"id": "8223xzxfn",
"name": "Andrey Hrabouski",
"pic": "img/Andrey.png",
"email": "lakeishaphillips@mail.com",
"position": "Mobile Developer",
"labels": ['tech']
},
{
"id": "8223sdffn",
"name": "Andrey Hrabouski",
"pic": "img/Andrey.png",
"email": "lakeishaphillips@mail.com",
"position": "Mobile Developer",
"labels": ['tech']
},
{
"id": "9391xdsff",
"name": "Vlad Lugovsky",
"pic": "img/Vlad.png",
"email": "carlsongoodman@mail.com",
"position": "Fullstack man",
"labels": ['tech']
},
{
"id": "8223xsdaa",
"name": "Andrey Hrabouski",
"pic": "img/Andrey.png",
"email": "lakeishaphillips@mail.com",
"position": "Mobile Developer",
"labels": ['hr']
},
{
"id": "9391xdsfd",
"name": "Vlad Lugovsky",
"pic": "img/Vlad.png",
"email": "carlsongoodman@mail.com",
"position": "Fullstack man",
"labels": ['hr']
}
];
var tabs = [{
label: 'hr',
name: 'HR'
}, {
label: 'tech',
name: 'Tech'
}, {
label: 'product',
name: 'Product'
}, {
label: 'finance',
name: 'Finance'
}, {
label: 'media',
name: 'Media'
}, {
label: 'shops',
name: 'Shops'
}, {
label: 'innovation',
name: 'Innovation'
}];
return{
getTabs : function(){
return tabs
},
getMembersByLabel : function(label){
return members.filter(function(m){
return m.labels.indexOf(label) != -1;
});
},
getAllMessages : function(){
return members;
},
getMemberById : function(id){
console.log('getMemberById');
return members.filter(function(m){
return m.id == id;
})[0];
},
getIndexById : function(id){
console.log('getIndexById');
members.filter(function(m){
if (m.id == id){
console.log(m);
console.log(members.indexOf(m));
return members.indexOf(m);
}
})[0];
}
}
}
})();

View File

@ -9,7 +9,7 @@
.controller('MembersListCtrl', MembersListCtrl);
/** @ngInject */
function MembersListCtrl($scope, $stateParams,MemberService, $log, membersList) {
function MembersListCtrl($scope, $stateParams,MemberService, $log) {
var vm = this;
//vm.members = ($stateParams.label == "listing") ? membersList.getAllMessages() : membersList.getMembersByLabel($stateParams.label);
@ -29,6 +29,7 @@
function activate(){
console.log("activate");
vm.members = [];
loadMembers();

View File

@ -1,26 +1,6 @@
<div class="side-message-navigation" ng-class="{'expanded': tabCtrl.navigationCollapsed}">
<div class="mail-messages-control side-message-navigation-item">
<div class="toggle-navigation-container">
<a href class="collapse-navigation-link ion-navicon"
ng-click="tabCtrl.navigationCollapsed=!tabCtrl.navigationCollapsed"></a>
</div>
<label class="checkbox-inline custom-checkbox nowrap">
<input type="checkbox" id="inlineCheckbox01" value="option1">
<span class="select-all-label">Select All</span>
</label>
<button type="button" class="btn btn-icon refresh-button"><i class="ion-refresh"></i></button>
<div class="btn-group" uib-dropdown>
<button type="button" class="btn more-button" uib-dropdown-toggle>
More <span class="caret"></span>
</button>
<ul uib-dropdown-menu>
<li><a href>Action</a></li>
<li><a href>Another action</a></li>
<li><a href>Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a href>Separated link</a></li>
</ul>
</div>
</div>
<div class="messages">
<table>
@ -28,10 +8,7 @@
class="side-message-navigation-item little-human shineHover {{m.tag}}">
<td class="check-td">
<div class="mail-checkbox">
<label class="checkbox-inline custom-checkbox nowrap">
<input type="checkbox">
<span></span>
</label>
</div>
</td>
<td class="photo-td" ui-sref="main.teams.members.detail({id: m.id, label: listCtrl.label})">

View File

@ -8,8 +8,8 @@
.factory('MemberService', MemberService);
/** @ngInject */
function MemberService($http, $q) {
var apiBaseUrl = "http://localhost:9000"
function MemberService($http, $q, appConfig) {
var apiBaseUrl = appConfig.apiBaseUrl
var endpoint = apiBaseUrl + "/members";
function list(params) {

View File

@ -146,10 +146,12 @@
console.log("commentKey", commentKey);
console.log("submittedKey", submittedKey);
var element = $filter('filter')(vm.survey.elements, {'_id':elementId})
var incognito = (vm.survey.type == 's_incognito') ? true : false
var answer = {
"value" : val.value,
"comment" : (val.comment) ? val.comment : '',
"survey" : vm.survey.id,
"incognito" : incognito,
"asked" : vm.askedMember,
"question": element[0]
}

BIN
src/app/theme/.DS_Store vendored Normal file

Binary file not shown.

View File

@ -12,7 +12,8 @@
function pageTop() {
return {
restrict: 'E',
templateUrl: 'app/theme/components/pageTop/pageTop.html'
templateUrl: 'app/theme/components/pageTop/pageTop.html',
controller: 'PageTopCtrl'
};
}

View File

@ -2,25 +2,19 @@
<a href class="collapse-menu-link ion-navicon" ba-sidebar-toggle-menu></a>
<a href="#/dashboard" class="al-logo clearfix"><span>Avito</span> Survey Admin</a>
<div class="search">
<i class="ion-ios-search-strong" ng-click="startSearch()"></i>
<input id="searchInput" type="text" placeholder="Search for...">
</div>
<div class="user-profile clearfix">
<!--<div class="al-user-profile" uib-dropdown>
<div class="al-user-profile" uib-dropdown>
<a uib-dropdown-toggle class="profile-toggle-link">
<img ng-src="{{::( 'Nasta' | profilePicture )}}">
<img src="{{user.picture}}">
</a>
<ul class="top-dropdown-menu profile-dropdown" uib-dropdown-menu>
<li><i class="dropdown-arr"></i></li>
<li><a href="#/profile"><i class="fa fa-user"></i>Profile</a></li>
<li><a href="#/main/profile"><i class="fa fa-user"></i>Profile</a></li>
<li><a href><i class="fa fa-cog"></i>Settings</a></li>
<li><a href class="signout"><i class="fa fa-power-off"></i>Sign out</a></li>
<li><a href="#/logout" class="signout"><i class="fa fa-power-off"></i>Sign out</a></li>
</ul>
</div>-->
</div>
<msg-center></msg-center>
</div>

View File

@ -0,0 +1,25 @@
/**
* @author v.lugovksy
* created on 16.12.2015
*/
(function () {
'use strict';
angular.module('BlurAdmin.theme.components')
.controller('PageTopCtrl', PageTopCtrl);
/** @ngInject */
function PageTopCtrl($scope, localStorage) {
$scope.user = {};
if (localStorage.getObject('user'))
$scope.user = localStorage.getObject('user')
/*$scope.getMessage = function(msg) {
var text = msg.template;
if (msg.userId || msg.userId === 0) {
text = text.replace('&name', '<strong>' + $scope.users[msg.userId].name + '</strong>');
}
return $sce.trustAsHtml(text);
};*/
}
})();