From 39833577e3eca3ac480abffa5885d3669995e11a Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 7 Feb 2021 21:16:16 +0000 Subject: [PATCH] (Grav GitSync) Automatic Commit from yunohost-bot --- pages/02.apps/01.catalog/.apps.md.swp | Bin 32768 -> 24576 bytes pages/02.apps/01.catalog/apps.md | 204 +++++++------------------- 2 files changed, 55 insertions(+), 149 deletions(-) diff --git a/pages/02.apps/01.catalog/.apps.md.swp b/pages/02.apps/01.catalog/.apps.md.swp index c328706555ed296aa9c7b4fb8db700404898c827..bbf68c34daff96636a69d248ebef99c05bb588ab 100644 GIT binary patch delta 2364 zcmaLYe@v8h9KiAK9UKCp9wdSa`0(RQQ120S3W5-Z3oL)2l?YQjxaZi7>yGX@Eii;N z+g$%R{MO3aDok^;mge1#|VwN@reu;xn8^A66n0PY@Tt9<*a8)Y`q+4jt+Ea+VNZU=+jfU=5u3i;M34!OUs7;Y@ZI`m-`s<0BP(QK>bZ$)9PZgz$Jy^%UGP+lW6E?u9T zll$tbXHAY&gq-88u*@uzXUsfVP@iY{q(VztEn+uFnj&Fhd8TD~;*%P8(wb?~h@^m6 z(uMUomV`?zGr5+TGRw?j%gj>COtEFA$TBlc=8~lEJ@H^#@=N1k=37!(lb2dzTm{L= zYmUr}C^o}b&a7{jC&QI?x|hR?RpYEL zkws>y>Nc3VYI@D$yY&C&QmdI?{J56w@d{ByZI{^j!?y01+1qXnZe%}|;Wm3|6mR1c zUPCwjU_X6?H*f&`SczZQOA(j|z`!1~U>mk#6RNNpt6;|o_T8&6Q9FZ;zL3sMHr)v9 z_?1)Y98%E2`Q=Ta#l5J48_Tf-xyXhSGmwUBJl;>ZgpctgI#7dkD1~|j#o%ag70OpU zsj?$@HM(s_z#(t!%9TfUT~6r=d8NPYf?aEuw(|VDy@t=TFAyo&-Q|fG-Jx(_hu3fR z20VQoLC+(G)~*LUokn1{tZbVrtJ~KO8bPlw6xLh=f*;_3OJnT!O$|*WqD`M^{p7qm z;*SIjw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xd#=#qd5vGqG4{cTSNxAUi6dy%iVuMm`{&p0Z^3<2IJ1LLrW`%_j50 zp}DB9z$-mci%A!TB2iu!jtKrtWciHFPfzus!r;q$rM*l%XR7#A!gq7e=zaIY=!M?eFR+XFq{xrWC%1fJoP=+GRObiko6XZ^cZgDowkHgu z-7tIM`^dHh4NB|={IRN;q({^D@J#G<4!N%9)T$JZ{p$9UT=Klx92xJ1zuR@r5OND! zRW_spL%c->gZ3ok=@rmZu -function timeConverter(UNIX_timestamp) { - var a = new Date(UNIX_timestamp*1000); - var months = ['January','February','March','April','May','June','July','August','September','October','November','December']; - var year = a.getFullYear(); - var month = months[a.getMonth()]; - var date = a.getDate(); - var hour = a.getHours(); - var min = a.getMinutes(); - if (hour < 10) { hour = '0' + hour; } - if (min < 10) { min = '0' + min; } - var time = date+' '+month+' '+year;//+' at '+hour+':'+min - return time; -} - - $(document).ready(function () { var default_lang = "en"; @@ -287,130 +279,44 @@ $(document).ready(function () { //================================================= // Upload apps lists //================================================= - var catalog = undefined; - - // Fetch application catalog - - //$.getJSON('https://app.yunohost.org/default/v2/apps.json', {}, function(data) { - - catalog = $.map(data["apps"], function(el) { return el; }); - - // Clarify high quality state, and level if undefined or inprogress or notworking... - - $.each(catalog, function(k, infos) { - if ((infos.level === undefined) || (infos.level === 0) || (infos.state === "inprogress") || (infos.state === "notworking")) { - infos.level = null; - } - if ((infos.high_quality === true) && (infos.level === 8)) { - infos.state = "high quality"; - } - else if ((infos.state === "working") && (infos.level !== null) && (infos.level <= 4)) { - infos.state = "low quality"; - } - }); - - // Sort apps according to their state and level... - - catalog.sort(function(a, b){ - a_state = (a.state === "high quality")?4:(a.level > 4)?3:(a.state > 0)?2:1; - b_state = (b.state === "high quality")?4:(b.level > 4)?3:(b.state > 0)?2:1; - if (a_state < b_state || a_state == b_state && a.level < b.level || a_state == b_state && a.level == b.level && a.manifest.id > b.manifest.id) {return 1;} - else if (a.manifest.id == b.manifest.id) {return 0;} - return -1; - }); - - // Add the card for each app - - $.each(catalog, function(k, infos) { - - app_id = infos.manifest.id; - - // Define what style to use for state, level and install button - // according to the app quality .... - - if (infos.state === "high quality") { - app_quality = "high,decent,working,none"; - app_badge = "high quality"; - app_badge_css_style = "epic"; - app_install_css_style = "success"; - } else if ((infos.state === "working") && (infos.level > 4)) { - app_quality = "decent,working,none"; - app_badge = null; - app_badge_css_style = "success"; - app_install_css_style = "success"; - } else if (infos.state === "low quality") { - app_quality = "working,none"; - app_badge = "low quality"; - app_badge_css_style = "warning"; - app_install_css_style = "warning"; - } else { - app_quality = "none"; - app_badge = "not working"; - app_badge_css_style = "danger"; - app_install_css_style = "danger"; - } - - // If level is null, we wanna display '?' - if (infos.level == null) { - infos.level = '?'; - } - - // Fill the template - html = $('#app-template2').html() - .replace(/{app_id}/g, app_id) - .replace(/{app_name}/g, infos.manifest.name) - .replace('{app_description}', infos.manifest.description[default_lang] || infos.manifest.description["en"]) - .replace(/{app_git}/g, infos.git.url) - .replace('{app_branch}', infos.git.branch) - .replace('{app_level}', infos.level) - .replace('{app_quality}', app_quality) - .replace('{app_update}', timeConverter(infos.lastUpdate)) - .replace('{app_install_css_style}', app_install_css_style); - - // Handle the maintainer info - if (infos.maintained == false) - { - html = html - .replace('{maintained_state}', 'unmaintained') - .replace('{maintained_icon}', 'warning-sign') - .replace('{app_maintainer}', "Unmaintained") - .replace('{maintained_help}', "This package is currently unmaintained. Feel free to propose yourself as the new maintainer !"); - } - else { - html = html - .replace('{maintained_state}', 'maintained') - .replace('{maintained_icon}', 'user') - .replace('{maintained_help}', "Current maintainer of this package"); - - if ((infos.manifest.developer) && (infos.manifest.developer.name)) { - html = html.replace('{app_maintainer}', infos.manifest.developer.name); - } - else if ((infos.manifest.maintainer) && (infos.manifest.maintainer.name)) { - html = html.replace('{app_maintainer}', infos.manifest.maintainer.name); - } - else { - html = html.replace('{app_maintainer}', "???"); - } - } - - // Fill the template - $('#app-cards-list').append(html); - $('.app-card_'+ app_id).attr('id', 'app-card_'+ app_id); - if (app_badge !== null) { - $('.app-card_'+ app_id + ' .app-title').append(' '+app_badge+''); - } - if (typeof(infos.category) === "string") { - category = data["categories"].find(function(el) { return el.id == infos.category; }); - if (typeof(category) !== "undefined") - { - display = category["title"][default_lang] || category["title"]["en"]; - $('.app-card_'+ app_id + ' .app-title').append(' '+display.toLowerCase()+''); - } - } - }); - - // filter(); - //}); - //================================================= +/* +// // Clarify high quality state, and level if undefined or inprogress or notworking... +// +// $.each(catalog, function(k, infos) { +// if ((infos.level === undefined) || (infos.level === 0) || (infos.state === "inprogress") || (infos.state === "notworking")) { +// infos.level = null; +// } +// if ((infos.high_quality === true) && (infos.level === 8)) { +// infos.state = "high quality"; +// } +// else if ((infos.state === "working") && (infos.level !== null) && (infos.level <= 4)) { +// infos.state = "low quality"; +// } +// }); +// +// // Sort apps according to their state and level... +// +// catalog.sort(function(a, b){ +// a_state = (a.state === "high quality")?4:(a.level > 4)?3:(a.state > 0)?2:1; +// b_state = (b.state === "high quality")?4:(b.level > 4)?3:(b.state > 0)?2:1; +// if (a_state < b_state || a_state == b_state && a.level < b.level || a_state == b_state && a.level == b.level && a.manifest.id > b.manifest.id) {return 1;} +// else if (a.manifest.id == b.manifest.id) {return 0;} +// return -1; +// }); +// +// // Add the card for each app +// +// $.each(catalog, function(k, infos) { +// +// // if (infos.maintained == false) +// +// // Fill the template +// $('#app-cards-list').append(html); +// $('.app-card_'+ app_id).attr('id', 'app-card_'+ app_id); +// if (app_badge !== null) { +// $('.app-card_'+ app_id + ' .app-title').append(' '+app_badge+''); +// } +// }); +*/ });