teacher profile update
This commit is contained in:
1 parent
f641c0b4d3
commit
7a81a26bdd
3 files changed
+18
-7
No files matched your search
@@ -1,3 +1,4 @@
|
|||||||
|
import {splitName} from '../../models/collective';
|
||||||
import template from '../../templates/components/teacher-profile.html';
|
import template from '../../templates/components/teacher-profile.html';
|
||||||
|
|
||||||
export default function (app) {
|
export default function (app) {
|
||||||
@@ -5,6 +6,15 @@ export default function (app) {
|
|||||||
bindings: {
|
bindings: {
|
||||||
member: '='
|
member: '='
|
||||||
},
|
},
|
||||||
template: template
|
template: template,
|
||||||
|
controller: function($sce){
|
||||||
|
let [first, middle, last] = splitName(this.member.name);
|
||||||
|
this.firstName = first;
|
||||||
|
this.middleName = middle;
|
||||||
|
this.lastName = last;
|
||||||
|
|
||||||
|
if (this.member.picture) this.image = this.member.picture.big.url;
|
||||||
|
this.biography = $sce.trustAsHtml(this.member.biography);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -1,13 +1,12 @@
|
|||||||
import {splitName} from '../../models/collective';
|
|
||||||
import {collectiveSortPattern} from '../config';
|
import {collectiveSortPattern} from '../config';
|
||||||
|
|
||||||
export default function (app) {
|
export default function (app) {
|
||||||
app.controller('CollectiveController', ($scope, api) => {
|
app.controller('CollectiveController', ($scope, api) => {
|
||||||
api.collective.list(collectiveSortPattern)
|
api.collective.list(collectiveSortPattern)
|
||||||
.success(collective => {
|
.success(collective => {
|
||||||
$scope.members = collective.map(person => {
|
$scope.members = collective;
|
||||||
if (person.picture) person.image = person.picture.big.url;
|
collective.map(person => {
|
||||||
person.names = splitName(person.name);
|
|
||||||
return person;
|
return person;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
<a name="{{$ctrl.member.anchor}}"></a>
|
<a name="{{$ctrl.member.anchor}}"></a>
|
||||||
|
|
||||||
<div class="teacher-profile__picture">
|
<div class="teacher-profile__picture">
|
||||||
<img ng-src="{{$ctrl.member.image }}">
|
<img ng-src="{{$ctrl.image }}">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="teacher-profile__info">
|
<div class="teacher-profile__info">
|
||||||
<h3>{{$ctrl.member.names[1]}} {{$ctrl.member.names[2]}} <span>{{$ctrl.member.names[3]}}</span></h3>
|
<h3>{{$ctrl.firstName}} {{$ctrl.middleName}} <strong>{{$ctrl.lastName}}</strong></h3>
|
||||||
|
|
||||||
<p>{{$ctrl.member.position}}</p>
|
<p>{{$ctrl.member.position}}</p>
|
||||||
<p>{{$ctrl.member.status}}</p>
|
<p>{{$ctrl.member.status}}</p>
|
||||||
@@ -14,5 +14,7 @@
|
|||||||
|
|
||||||
<p class="edu">{{$ctrl.member.edu}} </p>
|
<p class="edu">{{$ctrl.member.edu}} </p>
|
||||||
<p class="diploma">Диплом {{$ctrl.member.diploma}}</p>
|
<p class="diploma">Диплом {{$ctrl.member.diploma}}</p>
|
||||||
|
|
||||||
|
<div ng-bind-html="$ctrl.biography"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
Reference in new issue
Block a user