mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
Fix maintainers display
This commit is contained in:
parent
6116f99459
commit
1ad5c362a7
2 changed files with 35 additions and 1 deletions
|
@ -77,6 +77,39 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function extractMaintainer(manifest) {
|
||||||
|
if (manifest.maintainer === undefined)
|
||||||
|
{
|
||||||
|
if ((manifest.developer !== undefined) && (manifest.developer.name !== undefined))
|
||||||
|
{
|
||||||
|
return manifest.developer.name;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "?";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (Array.isArray(manifest.maintainer))
|
||||||
|
{
|
||||||
|
maintainers = [];
|
||||||
|
manifest.maintainer.forEach(function(maintainer) {
|
||||||
|
if (maintainer.name !== undefined)
|
||||||
|
{
|
||||||
|
maintainers.push(maintainer.name);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return maintainers.join(', ');
|
||||||
|
}
|
||||||
|
else if (manifest.maintainer.name !== undefined)
|
||||||
|
{
|
||||||
|
return manifest.maintainer.name;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "?";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// List available apps
|
// List available apps
|
||||||
app.get('#/apps/install', function (c) {
|
app.get('#/apps/install', function (c) {
|
||||||
c.api('/apps', function (data) { // http://api.yunohost.org/#!/app/app_list_get_8
|
c.api('/apps', function (data) { // http://api.yunohost.org/#!/app/app_list_get_8
|
||||||
|
@ -99,6 +132,7 @@
|
||||||
app.maintained = "maintained";
|
app.maintained = "maintained";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
app.manifest.maintainer = extractMaintainer(app.manifest);
|
||||||
var isWorking = (app.state === 'working' || app.state === "high-quality") && app.level > 0;
|
var isWorking = (app.state === 'working' || app.state === "high-quality") && app.level > 0;
|
||||||
|
|
||||||
// Keep only the first instance of each app and remove not working apps
|
// Keep only the first instance of each app and remove not working apps
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="app-card-date-maintainer">
|
<div class="app-card-date-maintainer">
|
||||||
<i class="fa-refresh"></i> {{formatDate updateDate day="numeric" month="long" year="numeric"}} -
|
<i class="fa-refresh"></i> {{formatDate updateDate day="numeric" month="long" year="numeric"}} -
|
||||||
<span title="{{t 'current_maintainer_title'}}" class="maintained"></span><i class="fa-user"></i> {{manifest.maintainer.name}}</span>
|
<span title="{{t 'current_maintainer_title'}}" class="maintained"></span><i class="fa-user"></i> {{manifest.maintainer}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group" role="group">
|
<div class="btn-group" role="group">
|
||||||
<a href="{{git.url}}" target="_BLANK" type="button" role="button" class="btn btn-default col-xs-4">
|
<a href="{{git.url}}" target="_BLANK" type="button" role="button" class="btn btn-default col-xs-4">
|
||||||
|
|
Loading…
Reference in a new issue