mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
Add unmaintained states
This commit is contained in:
parent
db6722c510
commit
6b15bc50a6
3 changed files with 38 additions and 2 deletions
|
@ -46,6 +46,21 @@
|
|||
}
|
||||
}
|
||||
|
||||
function stateToMaintained(state) {
|
||||
if ( state === "request_help" ) {
|
||||
return 'info';
|
||||
}
|
||||
else if ( state === "request_adoption" ) {
|
||||
return 'warning';
|
||||
}
|
||||
else if ( state === "orphaned" ) {
|
||||
return 'danger';
|
||||
}
|
||||
else {
|
||||
return 'default';
|
||||
}
|
||||
}
|
||||
|
||||
function combineColors(stateColor, levelColor, installable) {
|
||||
if (stateColor === "danger" || levelColor === "danger") {
|
||||
return 'danger';
|
||||
|
@ -75,6 +90,24 @@
|
|||
var state = dataraw[v['id']]['state'];
|
||||
var levelFormatted = parseInt(dataraw[v['id']]['level']);
|
||||
var isWorking = (state === 'working' || state === "high-quality") && levelFormatted > 0;
|
||||
|
||||
if ( dataraw[v['id']]['maintained'] !== true )
|
||||
{
|
||||
// Set the maintained status at Orphaned if the value of 'maintained' is 'false'
|
||||
if ( dataraw[v['id']]['maintained'] === false )
|
||||
{
|
||||
dataraw[v['id']]['MaintainedStatus'] = "orphaned";
|
||||
}
|
||||
// Otherwise, set 'MaintainedStatus' at the value of 'maintained' and set 'maintained' as 'false'
|
||||
else
|
||||
{
|
||||
dataraw[v['id']]['MaintainedStatus'] = dataraw[v['id']]['maintained'];
|
||||
dataraw[v['id']]['maintained'] = false;
|
||||
}
|
||||
// Set the color for the label
|
||||
dataraw[v['id']]['MaintainedColor'] = stateToMaintained(dataraw[v['id']]['MaintainedStatus']);
|
||||
}
|
||||
|
||||
// Keep only the first instance of each app and remove not working apps
|
||||
if (!v['id'].match(/__[0-9]{1,5}$/) && (state !== 'notworking')) {
|
||||
|
||||
|
|
|
@ -230,6 +230,7 @@
|
|||
"only_decent_quality_apps": "Only decent quality apps",
|
||||
"open": "Open",
|
||||
"operations": "Operations",
|
||||
"orphaned": "Orphaned",
|
||||
"os": "OS",
|
||||
"password": "Password",
|
||||
"password_confirmation": "Password confirmation",
|
||||
|
@ -279,6 +280,8 @@
|
|||
"reception": "Reception",
|
||||
"refresh_app_list": "Refresh list",
|
||||
"remove_access": "Remove access",
|
||||
"request_adoption": "Request for adoption",
|
||||
"request_help": "Request for help",
|
||||
"restore": "Restore",
|
||||
"run": "Run",
|
||||
"running": "Running",
|
||||
|
|
|
@ -47,8 +47,8 @@
|
|||
</div>
|
||||
<div class="app-card-date-maintainer">
|
||||
<i class="fa-refresh"></i> {{formatDate updateDate day="numeric" month="long" year="numeric"}} -
|
||||
{{#maintained}}<span title="{{t 'current_maintainer_title'}}" class="maintained"></span><i class="fa-user"></i> {{manifest.maintainer.name}}</span>{{/maintained}}
|
||||
{{^maintained}}<i class="fas fa-warning"></i> {{t 'unmaintained'}}{{/maintained}}
|
||||
<span title="{{t 'current_maintainer_title'}}" class="maintained"></span><i class="fa-user"></i> {{manifest.maintainer.name}}</span>
|
||||
{{^maintained}}<span class="label label-{{MaintainedColor}} label-as-badge MaintainedStatus" title="{{t MaintainedStatus}}"><i class="fa-warning"></i> {{t MaintainedStatus}}</span>{{/maintained}}
|
||||
</div>
|
||||
<div class="btn-group" role="group">
|
||||
<a href="{{git.url}}" target="_BLANK" type="button" role="button" class="btn btn-default col-xs-4">
|
||||
|
|
Loading…
Reference in a new issue