Show title in participant names.

This commit is contained in:
Emanuel Schuetze 2016-01-18 16:28:48 +01:00
parent d083309a30
commit 8ac3254d04

View File

@ -83,33 +83,39 @@ angular.module('OpenSlidesApp.users', [])
},
get_short_name: function() {
// should be the same as in the python user model.
var firstName = _.trim(this.first_name),
var title = _.trim(this.title),
firstName = _.trim(this.first_name),
lastName = _.trim(this.last_name),
name;
name = '';
if (title) {
name = title + ' ';
}
if (firstName && lastName) {
// TODO: check config
name = [firstName, lastName].join(' ');
name += [firstName, lastName].join(' ');
} else {
name = firstName || lastName || this.username;
name += firstName || lastName || this.username;
}
return name;
},
get_full_name: function() {
// should be the same as in the python user model.
var firstName = _.trim(this.first_name),
var title = _.trim(this.title),
firstName = _.trim(this.first_name),
lastName = _.trim(this.last_name),
structure_level = _.trim(this.structure_level),
name;
name = '';
if (title) {
name = title + ' ';
}
if (firstName && lastName) {
// TODO: check config
name = [firstName, lastName].join(' ');
name += [firstName, lastName].join(' ');
} else {
name = firstName || lastName || this.username;
name += firstName || lastName || this.username;
}
if (structure_level) {
name = name + " (" + structure_level + ")";
name += " (" + structure_level + ")";
}
return name;
},