mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
Add support for high quality apps
This commit is contained in:
parent
89a0d06a74
commit
00e0701589
4 changed files with 21 additions and 6 deletions
3
src/gulp
Executable file
3
src/gulp
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
require('gulp-cli')();
|
|
@ -66,7 +66,14 @@
|
|||
var state = dataraw[v['id']]['state'];
|
||||
var levelFormatted = parseInt(dataraw[v['id']]['level']);
|
||||
var isWorking = (state === 'working' || state === 'official') && levelFormatted > 0;
|
||||
var isFeatured = (state === 'official' || dataraw[v['id']]['featured']);
|
||||
// To be a High Quality app, the app have to be over the level 7
|
||||
var isHighQuality = ( dataraw[v['id']]['high_quality'] && parseInt(dataraw[v['id']]['level']) > 7 );
|
||||
// Update the status high_quality with the previous condition
|
||||
dataraw[v['id']]['high_quality'] = isHighQuality;
|
||||
// To be a Featured app, the app have to be flag as High Quality.
|
||||
var isFeatured = ( dataraw[v['id']]['featured'] && dataraw[v['id']]['high_quality']);
|
||||
// Update the status featured with the previous condition
|
||||
dataraw[v['id']]['featured'] = isFeatured;
|
||||
// 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')) {
|
||||
|
||||
|
@ -81,7 +88,8 @@
|
|||
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']]['isFeatured'] = isFeatured;
|
||||
dataraw[v['id']]['isHighQuality'] = isHighQuality ? "isHighQuality" : "What I'm suppose to put here?";
|
||||
dataraw[v['id']]['isFeatured'] = isFeatured ? "isFeatured" : "What I'm suppose to put here?";
|
||||
|
||||
jQuery.extend(dataraw[v['id']], v);
|
||||
apps.push(dataraw[v['id']]);
|
||||
|
|
|
@ -146,7 +146,7 @@
|
|||
"everyone_has_access": "Everyone has access.",
|
||||
"experimental_warning": "Warning: this feature is experimental and not consider stable, you shouldn't be using it except if you know what you are doing.",
|
||||
"featured": "Featured",
|
||||
"featured_and_official_apps": "Featured and official apps",
|
||||
"featured_apps": "Only Featured apps",
|
||||
"filesystem": "Filesystem",
|
||||
"firewall": "Firewall",
|
||||
"footer_version": "Powered by <a href='https://yunohost.org'>YunoHost</a> %s (%s).",
|
||||
|
@ -156,6 +156,8 @@
|
|||
"gateway": "Gateway: ",
|
||||
"good_practices_about_admin_password": "You are now about to define a new admin password. The password should be at least 8 characters - though it is good practice to use longer password (i.e. a passphrase) and/or to use various kind of characters (uppercase, lowercase, digits and special characters).",
|
||||
"good_practices_about_user_password": "You are now about to define a new user password. The password should be at least 8 characters - though it is good practice to use longer password (i.e. a passphrase) and/or to use various kind of characters (uppercase, lowercase, digits and special characters).",
|
||||
"high_quality": "High Quality",
|
||||
"high_quality_apps": "Only High Quality apps",
|
||||
"home": "Home",
|
||||
"hook_adminjs_group_configuration": "Configuration",
|
||||
"hook_conf_cron": "Regular tasks",
|
||||
|
|
|
@ -25,7 +25,8 @@
|
|||
<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="isFeatured"><a class="menu-item" role="menu-item" tabindex="-1">{{t 'featured_and_official_apps'}}</a></li>
|
||||
<li role="presentation" class="button dropdownFilter" data-filter="isHighQuality"><a class="menu-item" role="menu-item" tabindex="-1">{{t 'high_quality_apps'}}</a></li>
|
||||
<li role="presentation" class="button dropdownFilter" data-filter="isFeatured"><a class="menu-item" role="menu-item" tabindex="-1">{{t 'featured_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>
|
||||
|
@ -35,7 +36,7 @@
|
|||
|
||||
<div class="list-group grid">
|
||||
{{#apps}}
|
||||
<div class="app-card panel panel-default {{status}} {{state}} {{isWorking}} {{level}}-level {{isFeatured}}">
|
||||
<div class="app-card panel panel-default {{status}} {{state}} {{isWorking}} {{level}}-level {{isFeatured}} {{isHighQuality}}">
|
||||
<div class="panel-body">
|
||||
<h2 class="app-title">{{name}}</h2>
|
||||
<div class="category">
|
||||
|
@ -43,7 +44,8 @@
|
|||
<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}}
|
||||
{{#featured}}<i class="fas fa-star"></i> {{t 'featured'}}{{/featured}}
|
||||
{{#featured}}<span class="label label-danger label-as-badge featured" title="{{t 'featured'}}">{{t 'featured'}}</span>{{/featured}}
|
||||
{{#high_quality}}<span class="label label-primary label-as-badge high_quality" title="{{t 'high_quality'}}">{{t 'high_quality'}}</span>{{/high_quality}}
|
||||
</div>
|
||||
<div class="app-card-desc">{{description}}</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue