added hierarchical user info display, closes #787
parent
7f44132abc
commit
e52fff58f5
|
@ -14,8 +14,7 @@ CREATE TEMPORARY TABLE IF NOT EXISTS users_TEMP (
|
||||||
enabled boolean not null);
|
enabled boolean not null);
|
||||||
|
|
||||||
CREATE TEMPORARY TABLE IF NOT EXISTS user_info_TEMP (
|
CREATE TEMPORARY TABLE IF NOT EXISTS user_info_TEMP (
|
||||||
id BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) PRIMARY KEY,
|
sub VARCHAR(256) not null primary key,
|
||||||
sub VARCHAR(256),
|
|
||||||
preferred_username VARCHAR(256),
|
preferred_username VARCHAR(256),
|
||||||
name VARCHAR(256),
|
name VARCHAR(256),
|
||||||
given_name VARCHAR(256),
|
given_name VARCHAR(256),
|
||||||
|
|
|
@ -469,11 +469,28 @@ var UserProfileView = Backbone.View.extend({
|
||||||
|
|
||||||
$(this.el).html($('#tmpl-user-profile').html());
|
$(this.el).html($('#tmpl-user-profile').html());
|
||||||
|
|
||||||
|
var t = this.template;
|
||||||
|
|
||||||
_.each(this.model, function (value, key) {
|
_.each(this.model, function (value, key) {
|
||||||
if (key && value) {
|
if (key && value) {
|
||||||
$('dl', this.el).append(
|
|
||||||
this.template({key: key, value: value})
|
if (typeof(value) === 'object') {
|
||||||
);
|
|
||||||
|
var el = this.el;
|
||||||
|
var k = key;
|
||||||
|
|
||||||
|
_.each(value, function (value, key) {
|
||||||
|
$('dl', el).append(
|
||||||
|
t({key: key, value: value, category: k})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
} else if (typeof(value) === 'array') {
|
||||||
|
// TODO: handle array types
|
||||||
|
} else {
|
||||||
|
$('dl', this.el).append(
|
||||||
|
t({key: key, value: value})
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,8 @@
|
||||||
|
|
||||||
<script type="text/html" id="tmpl-user-profile-element">
|
<script type="text/html" id="tmpl-user-profile-element">
|
||||||
|
|
||||||
<dt><%- key %></dt>
|
<dt><% if (typeof(category) !== 'undefined') { %>
|
||||||
|
<small class="muted"><%- category %>.</small><% } %><%- key %></dt>
|
||||||
<dd><%- value %></dd>
|
<dd><%- value %></dd>
|
||||||
|
|
||||||
</script>
|
</script>
|
Loading…
Reference in New Issue