No more notion of official/community apps, update filter for high-quality apps instead

This commit is contained in:
Alexandre Aubin 2019-04-26 00:12:48 +02:00
parent 426bd60d8a
commit 3e3f75dc72
3 changed files with 7 additions and 8 deletions

View file

@ -75,11 +75,10 @@
var state = dataraw[v['id']]['state'];
var levelFormatted = parseInt(dataraw[v['id']]['level']);
var isWorking = (state === 'working' || state === "high-quality") && levelFormatted > 0;
// Keep only the first instance of each app and remove community not working apps
if (!v['id'].match(/__[0-9]{1,5}$/) && (dataraw[v['id']]['repository'] === 'yunohost' || state !== 'notworking')) {
// Keep only the first instance of each app and remove not working apps
if (!v['id'].match(/__[0-9]{1,5}$/) && (state !== 'notworking')) {
dataraw[v['id']]['installable'] = (!v['installed'] || dataraw[v['id']].manifest.multi_instance)
dataraw[v['id']]['isCommunity'] = !(dataraw[v['id']]['repository'] === 'yunohost');
dataraw[v['id']]['levelFormatted'] = isNaN(levelFormatted) ? '?' : levelFormatted;
dataraw[v['id']]['levelColor'] = levelToColor(levelFormatted);
dataraw[v['id']]['stateColor'] = stateToColor(state);
@ -89,6 +88,7 @@
dataraw[v['id']]['updateDate'] = dataraw[v['id']]['lastUpdate'] * 1000 || 0;
dataraw[v['id']]['isSafe'] = (dataraw[v['id']]['installColor'] !== 'danger');
dataraw[v['id']]['isWorking'] = isWorking ? "isworking" : "notFullyWorking";
dataraw[v['id']]['isHighQuality'] = (state === "high-quality") ? "ishighquality" : "";
jQuery.extend(dataraw[v['id']], v);
apps.push(dataraw[v['id']]);

View file

@ -37,7 +37,7 @@
"app_state": "Application state: ",
"app_state_inprogress": "In progress",
"app_state_notworking": "Not working",
"app_state_official": "Official",
"app_state_highquality": "High quality",
"app_state_working": "Working",
"application": "Application",
"applications": "Applications",
@ -225,7 +225,7 @@
"no_user_to_add": "No more users to add.",
"non_compatible_api": "Non-compatible API",
"ok": "OK",
"only_official_apps": "Only official apps",
"only_highquality_apps": "Only high-quality apps",
"only_working_apps": "Only working apps",
"open": "Open",
"operations": "Operations",

View file

@ -24,7 +24,7 @@
</button>
<ul id="dropdownFilter" class="dropdown-menu" data-filter="isworking" role="menu">
<li role="presentation" class="button dropdownFilter" data-filter="isworking"><a class="menu-item" role="menu-item" tabindex="-1">{{t 'only_working_apps'}}</a></li>
<li role="presentation" class="button dropdownFilter" data-filter="official"><a class="menu-item" role="menu-item" tabindex="-1">{{t 'only_official_apps'}}</a></li>
<li role="presentation" class="button dropdownFilter" data-filter="ishighquality"><a class="menu-item" role="menu-item" tabindex="-1">{{t 'only_highquality_apps'}}</a></li>
<li role="presentation" class="button dropdownFilter" data-filter="*"><a class="menu-item" role="menu-item" tabindex="-1">{{t 'all_apps'}}</a></li>
</ul>
</div>
@ -34,11 +34,10 @@
<div class="list-group grid">
{{#apps}}
<div class="app-card panel panel-default {{status}} {{state}} {{isWorking}} {{level}}-level">
<div class="app-card panel panel-default {{status}} {{state}} {{isWorking}} {{isHighQuality}} {{level}}-level">
<div class="panel-body">
<h2 class="app-title">{{name}}</h2>
<div class="category">
{{#isCommunity}} <span class="label label-info label-as-badge app-status">{{t 'community'}}</span>{{/isCommunity}}
<span class="label label-{{stateColor}} label-as-badge app-state">{{t state}}</span>
<a target="_BLANK" href="https://yunohost.org/#/packaging_apps_levels"><span class="label label-{{levelColor}} label-as-badge app-level" title="{{t 'app_level'}}">{{t 'level'}} {{levelFormatted}}</span></a>
{{#displayLicense}}<span class="label label-default app-license" title="{{t 'app_license'}}">{{license}}</span>{{/displayLicense}}