فهرست منبع

don't show the user details area on project list if algolia instituions has not be setup

Henry Oswald 12 سال پیش
والد
کامیت
cc1b9472b2
2فایلهای تغییر یافته به همراه30 افزوده شده و 29 حذف شده
  1. 1 0
      services/web/app/coffee/Features/Project/ProjectController.coffee
  2. 29 29
      services/web/app/views/project/list.jade

+ 1 - 0
services/web/app/coffee/Features/Project/ProjectController.coffee

@@ -99,6 +99,7 @@ module.exports =
 					return res.send 500
 				logger.log results:results, user_id:user_id, "rendering project list"
 				viewModel = _buildListViewModel results.projects[0], results.projects[1], results.projects[2], results.tags[0], results.tags[1]
+				viewModel.showUserDetailsArea = Settings?.algolia?.institutions?.app_id? and Settings?.algolia?.institutions?.api_key?
 				res.render 'project/list', viewModel
 				timer.done()
 

+ 29 - 29
services/web/app/views/project/list.jade

@@ -100,35 +100,35 @@ block content
 							i.icon-remove
 						ul#projectList
 							mixin projectList(projects)
-
-					.span3#userProfileInformation(ng-cloak)
-						div(ng-controller="UpdateForm").userProfileInformationArea
-							div(ng-hide="hidePersonalInfoSection").alert.alert-info
-
-									div(ng-show="percentComplete >= 100")
-										h4 100% complete, well done!
-									div(ng-hide="percentComplete >= 100")
-										h4 Your account is 
-											strong {{percentComplete}}% 
-											| complete
-
-									.progress
-										.bar.bar-success(ng-style="{'width' : (percentComplete+'%')}")
-
-									button#completeUserProfileInformation.btn.btn-primary(ng-hide="formVisable", ng-click="showForm()") Complete now
-
-									div(ng-show="formVisable")
-										form(enctype='multipart/form-data', method='post')
-											.input
-												input(type='text',  name='first_name', ng-model="userInfoForm.first_name",  ng-blur="sendUpdate()", placeholder="First Name", focus-input="formVisable")
-											.input
-												input(type='text', name='last_name', ng-model="userInfoForm.last_name", ng-blur="sendUpdate()", placeholder='Last Name')
-											.input#institution_auto_complete
-												autocomplete(ng-model="userInfoForm.institution", data="institutions", ng-blur="sendUpdate()", on-type="updateInstitutionsList", attr-placeholder="Institution")
-											.input
-												input(type='text', name='role',  ng-model="userInfoForm.role", placeholder='Role', ng-blur="sendUpdate()", list="_roles")
-												datalist#_roles
-													option(ng-repeat='role in roles') {{role}}
+					- if (showUserDetailsArea)
+						.span3#userProfileInformation(ng-cloak)
+							div(ng-controller="UpdateForm").userProfileInformationArea
+								div(ng-hide="hidePersonalInfoSection").alert.alert-info
+
+										div(ng-show="percentComplete >= 100")
+											h4 100% complete, well done!
+										div(ng-hide="percentComplete >= 100")
+											h4 Your account is 
+												strong {{percentComplete}}% 
+												| complete
+
+										.progress
+											.bar.bar-success(ng-style="{'width' : (percentComplete+'%')}")
+
+										button#completeUserProfileInformation.btn.btn-primary(ng-hide="formVisable", ng-click="showForm()") Complete now
+
+										div(ng-show="formVisable")
+											form(enctype='multipart/form-data', method='post')
+												.input
+													input(type='text',  name='first_name', ng-model="userInfoForm.first_name",  ng-blur="sendUpdate()", placeholder="First Name", focus-input="formVisable")
+												.input
+													input(type='text', name='last_name', ng-model="userInfoForm.last_name", ng-blur="sendUpdate()", placeholder='Last Name')
+												.input#institution_auto_complete
+													autocomplete(ng-model="userInfoForm.institution", data="institutions", ng-blur="sendUpdate()", on-type="updateInstitutionsList", attr-placeholder="Institution")
+												.input
+													input(type='text', name='role',  ng-model="userInfoForm.role", placeholder='Role', ng-blur="sendUpdate()", list="_roles")
+													datalist#_roles
+														option(ng-repeat='role in roles') {{role}}
 					.span3
 						.tag-list
 							h2 Tags