2022-10-05 23:00:52 +08:00
|
|
|
<%
|
|
|
|
var btns = [];
|
|
|
|
btns.push({
|
|
|
|
key: 'followers',
|
2022-10-06 01:21:36 +08:00
|
|
|
desc: 'followers',
|
2022-10-15 00:28:26 +08:00
|
|
|
tab: 'followers'
|
2022-10-05 23:00:52 +08:00
|
|
|
});
|
|
|
|
btns.push({
|
|
|
|
key: 'following',
|
2022-10-06 01:21:36 +08:00
|
|
|
desc: 'following',
|
2022-10-15 00:28:26 +08:00
|
|
|
tab: 'following'
|
2022-10-05 23:00:52 +08:00
|
|
|
});
|
|
|
|
btns.push({
|
|
|
|
key: 'public_repos',
|
2022-10-06 01:21:36 +08:00
|
|
|
desc: 'repos',
|
2022-10-15 00:28:26 +08:00
|
|
|
tab: 'repositories'
|
2022-10-05 23:00:52 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
function layoutDiv() {
|
|
|
|
var el = '';
|
|
|
|
if (item.username == undefined || item.username.length == 0) {
|
|
|
|
return el;
|
|
|
|
}
|
2022-10-11 20:00:24 +08:00
|
|
|
|
2024-01-19 01:05:44 +08:00
|
|
|
el += `<widget class="widget-wrapper${scrollreveal(' ')} ghuser">`
|
2022-10-08 16:48:13 +08:00
|
|
|
// body
|
2022-11-22 23:08:30 +08:00
|
|
|
el += '<div class="widget-body stellar-ghinfo-api" api="' + theme.api_host.ghapi + '/users/' + item.username + '">';
|
2022-10-08 16:48:13 +08:00
|
|
|
if (item.avatar) {
|
|
|
|
el += '<div class="avatar" ><img no-lazy type="img" id="avatar_url" src="' + config.avatar + '"></div>';
|
|
|
|
}
|
|
|
|
// username
|
2022-10-15 00:28:26 +08:00
|
|
|
el += '<p class="username" ff="title" type="text" id="name"> </p>';
|
2022-10-08 16:48:13 +08:00
|
|
|
el += '<p class="bio" type="text" id="bio"> </p>';
|
2022-10-11 20:00:24 +08:00
|
|
|
|
2022-10-05 23:00:52 +08:00
|
|
|
el += '<div class="buttons">';
|
|
|
|
btns.forEach((btn, i) => {
|
2022-10-15 00:28:26 +08:00
|
|
|
el += '<a class="btn" href="https://github.com/' + item.username + '?tab=' + btn.tab + '">';
|
2022-10-08 16:48:13 +08:00
|
|
|
el += '<span class="title" type="text" id="' + btn.key + '">0</span>';
|
2022-10-05 23:00:52 +08:00
|
|
|
el += '<span class="desc">' + btn.desc + '</span>';
|
|
|
|
el += '</a>';
|
|
|
|
});
|
|
|
|
el += '</div>';
|
|
|
|
// follow
|
|
|
|
el += '<a class="follow" href="https://github.com/' + item.username + '">';
|
2024-01-19 13:51:55 +08:00
|
|
|
el += icon('github:logo')
|
2022-10-05 23:00:52 +08:00
|
|
|
el += 'Follow';
|
|
|
|
el += '</a>';
|
|
|
|
el += '</div>';
|
2022-11-23 21:54:21 +08:00
|
|
|
el += '</widget>';
|
2022-10-05 23:00:52 +08:00
|
|
|
return el;
|
|
|
|
}
|
|
|
|
%>
|
|
|
|
<%- layoutDiv() %>
|