diff --git a/client/app/projectchooser/projectchooser.less b/client/app/projectchooser/projectchooser.less index 459ae5e6..e532ea5f 100644 --- a/client/app/projectchooser/projectchooser.less +++ b/client/app/projectchooser/projectchooser.less @@ -11,5 +11,15 @@ height: auto; width: auto; max-height: 100%; - max-width: 100% + max-width: 100%; + background-color: #eee; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + + button { + margin-bottom: 10px; + } + + } diff --git a/client/app/projects/profile/profile.controller.js b/client/app/projects/profile/profile.controller.js index 54f4ebe4..fab19fb6 100644 --- a/client/app/projects/profile/profile.controller.js +++ b/client/app/projects/profile/profile.controller.js @@ -24,6 +24,9 @@ angular.module('observatory3App') }; updateProject(); + $scope.selectImage = function() { + angular.element('#uploadImage').trigger('click'); + }; $scope.editProject = function() { $scope.editedProject = angular.copy($scope.project); @@ -66,25 +69,37 @@ angular.module('observatory3App') $scope.getPic = function(user) { if (! ('avatar' in user)){ user.avatar = "//www.gravatar.com/avatar/00000000000000000000000000000000?d=monsterid"; - $http.get('/api/users/' + user._id + '/avatar') .success(function(avatar){ + $http.get('/api/users/' + user._id + '/avatar').success(function(avatar){ user.avatar = avatar; - }) + }); + } else { } return user.avatar } var initializeSlides = function(photos) { var slides = []; - for (var i = 0; i < photos.length; i++){ - slides.push({ - id: i, - active: false, - image: $scope.imgPrefix + photos[i], - src: photos[i] - }); - if (i === 0) { - slides[0].active = true; - } + if(photos.length > 0) { + for (var i = 0; i < photos.length; i++){ + slides.push({ + id: i, + active: false, + image: $scope.imgPrefix + photos[i], + src: photos[i] + }); + if (i === 0) { + slides[0].active = true; + } + } + } + else { + slides.push({ + id: 0, + active: true, + placeholder: true, + image: '../../assets/images/projectplaceholder.png', + src: '../../assets/images/projectplaceholder.png' + }); } $scope.slides = slides; } @@ -99,7 +114,7 @@ angular.module('observatory3App') $scope.isLoggedIn = Auth.isLoggedIn; $scope.isAdmin = Auth.isAdmin; - + $scope.isMentor = Auth.isMentor; $scope.joinProject = function(){ $http.put('/api/users/' + $scope.user._id + '/project',{ @@ -212,18 +227,4 @@ angular.module('observatory3App') }; //end tech bubble code - - -}) -.directive('desc', function() { - return { - restrict:'E', - template: '
\ - ' - }; -}).directive('pname', function() { - return { - restrict:'E', - template: '
-