2020-05-23 17:32:24 +02:00
# Catalogue d'applications
2017-09-05 22:38:25 +02:00
2018-11-26 19:26:20 +01:00
< span class = "javascriptDisclaimer" >
Cette page requiert que Javascript soit activé pour s'afficher correctement :s.
< br / >
< br / >
< / span >
2019-10-21 02:13:09 +02:00
<!--
Search bar
-->
2017-09-05 22:38:25 +02:00
< div class = "input-group" >
2019-10-21 02:13:09 +02:00
< span id = "basic-addon1" class = "input-group-addon" > < span class = "glyphicon glyphicon-search" > < / span > < / span >
< input id = "filter-app-cards" type = "text" class = "form-control" placeholder = "Rechercher des apps..." aria-describedby = "basic-addon1" / >
2017-09-05 22:38:25 +02:00
< div class = "input-group-btn" >
< button type = "button" class = "btn btn-default dropdown-toggle" data-toggle = "dropdown" aria-haspopup = "true" aria-expanded = "false" >
2019-10-21 02:13:09 +02:00
< span id = "current-quality-filter" data-filter = "decent" > Seulement les apps de qualité décente< / span > < span class = "caret" > < / span >
2017-09-05 22:38:25 +02:00
< / button >
2019-10-21 02:13:09 +02:00
2017-09-05 22:38:25 +02:00
< ul class = "dropdown-menu" >
2019-10-21 02:13:09 +02:00
< li > < a href = "#" data-quality-filter = "high" > Seulement les apps haute-qualité< / a > < / li >
< li > < a href = "#" data-quality-filter = "decent" > Seulement les apps de qualité décente< / a > < / li >
< li > < a href = "#" data-quality-filter = "working" > Seulement les apps fonctionelles< / a > < / li >
< li > < a href = "#" data-quality-filter = "none" > Toutes les apps< / a > < / li >
2017-09-05 22:38:25 +02:00
< / ul >
< / div >
2015-10-05 12:57:17 +02:00
< / div >
2017-09-05 22:38:25 +02:00
< br / >
2015-10-05 12:57:17 +02:00
2019-10-21 02:13:09 +02:00
<!--
Disclaimers
-->
2020-09-14 12:00:19 +02:00
< div class = "alert alert-info" > L'équipe de packaging d'applications sera heureuse de recevoir vos commentaires ! Si vous trouvez des problèmes ou des améliorations possibles en installant une app, n'hésitez pas à contribuer en créant un ticket (issue) directement sur le dépôt de code.< / div >
2019-10-21 02:13:09 +02:00
< div id = "bad-quality-apps-disclaimer" class = "alert alert-warning" >
2020-05-23 17:32:24 +02:00
Les applications étiquettées < span class = "label label-warning label-as-badge" > low quality< / span > fonctionnent peut-être, mais ne respectent pas les bonnes pratiques de packaging ou ne supportent pas certaines fonctionnalités comme les sauvegardes/restauration ou l'authentication unifiée. Soyez prudent si vous les installez.
2019-10-21 02:13:09 +02:00
< / div >
2013-11-17 13:36:38 +01:00
2019-10-21 02:13:09 +02:00
< div id = "broken-apps-disclaimer" class = "alert alert-danger" >
2020-09-14 12:00:19 +02:00
Les applications étiquettées < span class = "label label-danger label-as-badge" > not working</ span > sont connues pour être cassées et/ou encore en développement. **Ne les installez pas** sur un serveur de production !
2017-09-05 22:38:25 +02:00
< / div >
2019-10-21 02:13:09 +02:00
< div id = "app-cards-list" class = "app-cards-list" > < / div >
2017-09-05 22:38:25 +02:00
2020-09-14 12:00:19 +02:00
< div class = "alert alert-warning" > Si vous ne trouvez pas une application précise que vous recherchez, vous pouvez chercher un dépôt nommé nomdelapp_ynh sur GitHub ou internet, ou bien l'ajouter à la < a href = "/apps_wishlist" > liste d'apps souhaitées< / a > .< / div >
2019-10-21 02:13:09 +02:00
<!--
Custom CSS for this page
-->
2017-09-05 22:38:25 +02:00
< style >
2020-05-23 17:32:24 +02:00
#wrapper {
max-width: 1100px;
}
2017-09-05 22:38:25 +02:00
/*=================================================
Search bar
=================================================*/
#filter-app-cards, #app-cards-list {
width:100%;
}
/*===============================================*/
/*=================================================
Force return space after card list
=================================================*/
#app-cards-list:after {
content:'';
display:block;
clear: both;
}
/*===============================================*/
/*=================================================
App card
=================================================*/
2020-05-23 17:32:24 +02:00
2017-09-05 22:38:25 +02:00
.app-card {
2017-09-07 00:54:26 +02:00
margin-bottom:20px;
2020-05-23 17:32:24 +02:00
width:31.2%;
2017-09-05 22:38:25 +02:00
float:left;
min-height: 1px;
margin-right: 10px;
2017-09-07 00:54:26 +02:00
margin-left: 10px;
2019-10-21 02:13:09 +02:00
border-radius: 3px;
2020-05-23 17:32:24 +02:00
position: relative;
height: 230px;
2017-09-05 22:38:25 +02:00
}
2020-05-23 17:32:24 +02:00
.app-title {
margin-top: 0;
margin-bottom: 5px;
font-size: 1.2em;
font-weight: 700;
line-height: 1.1;
color: black;
padding: 15px;
padding-bottom: 0;
2017-09-05 22:38:25 +02:00
}
2020-05-23 17:32:24 +02:00
.app-title .label {
font-size: 0.5em;
display: inline-block;
vertical-align: middle;
padding: 0.5em 0.6em;
padding-bottom: 0.3em;
2019-10-21 02:13:09 +02:00
}
.label-epic {
background-color: darkorchid;
2017-09-05 22:38:25 +02:00
}
2019-10-21 02:13:09 +02:00
2020-05-23 17:32:24 +02:00
.app-descr {
height:100px;
overflow: hidden;
padding: 0 15px;
2017-09-05 22:38:25 +02:00
}
2020-05-23 17:32:24 +02:00
.app-footer {
width:100%;
position: absolute;
bottom: 0;
2019-10-21 02:13:09 +02:00
}
2020-05-23 17:32:24 +02:00
.app-maintainer {
font-size: 0.7em;
text-align: right;
margin-right: 5px;
2017-09-05 22:38:25 +02:00
}
2020-05-23 17:32:24 +02:00
.app-card .unmaintained {
color: #e0aa33 ;
}
/*===============================================
App buttons
2017-09-05 22:38:25 +02:00
=================================================*/
2020-05-23 17:32:24 +02:00
.app-buttons {
2017-09-05 22:38:25 +02:00
width:100%;
}
2020-05-23 17:32:24 +02:00
.app-buttons > .btn {
2017-09-05 22:38:25 +02:00
border-bottom:0;
2019-10-21 02:13:09 +02:00
font-size: 0.9em;
line-height: 1.58;
2017-09-05 22:38:25 +02:00
}
2020-05-23 17:32:24 +02:00
.app-buttons > .btn:first-child {
2017-09-05 22:38:25 +02:00
border-left:0;
border-top-left-radius:0;
}
2020-05-23 17:32:24 +02:00
.app-buttons > .btn:last-child {
2017-09-05 22:38:25 +02:00
border-right:0;
border-top-right-radius:0;
margin-left: 0px;
2017-09-07 00:54:26 +02:00
width: 33.6%;
2017-09-05 22:38:25 +02:00
}
2020-05-23 17:32:24 +02:00
2017-09-05 22:38:25 +02:00
/*===============================================*/
< / style >
2019-10-21 02:13:09 +02:00
<!--
App card template
-->
2017-09-05 22:38:25 +02:00
< script type = "text/template" id = "app-template2" >
2019-10-21 02:13:09 +02:00
< div class = "app-card_{app_id} app-card panel panel-default" data-quality = "{app_quality}" >
2017-09-05 22:38:25 +02:00
2020-05-23 17:32:24 +02:00
< div class = "app-title" > {app_name}< / div >
< div class = "app-descr" > {app_description}< / div >
< div class = "app-footer" >
< div class = "app-maintainer" >
2019-10-21 02:13:09 +02:00
< span class = "glyphicon glyphicon-refresh" > < / span > {app_update} -
< span title = "{maintained_help}" class = "{maintained_state}" > < span class = "glyphicon glyphicon-{maintained_icon}" > < / span > {app_maintainer}< / span >
2017-09-05 22:38:25 +02:00
< / div >
2020-05-23 17:32:24 +02:00
< div class = "app-buttons btn-group" role = "group" >
< a href = "{app_git}" target = "_BLANK" type = "button" class = "btn btn-default col-sm-4" > < span class = "glyphicon glyphicon-globe" aria-hidden = "true" > < / span > Code< / a >
< a href = "#/app_{app_id}" target = "_BLANK" type = "button" class = "btn btn-default col-sm-4" > < span class = "glyphicon glyphicon-book" aria-hidden = "true" > < / span > Doc< / a >
< a href = "https://install-app.yunohost.org/?app={app_id}" target = "_BLANK" type = "button" class = "btn btn-{app_install_css_style} col-sm-4 active" > < span class = "glyphicon glyphicon-plus" aria-hidden = "true" > < / span > Install< / a >
< / div >
< / div >
2019-10-21 02:13:09 +02:00
< / div >
2013-11-17 13:36:38 +01:00
< / script >
2019-10-21 02:13:09 +02:00
<!--
Javascript helpers
-->
2013-11-17 13:36:38 +01:00
< script >
2019-10-21 02:13:09 +02:00
2013-11-17 13:36:38 +01:00
function timeConverter(UNIX_timestamp) {
var a = new Date(UNIX_timestamp*1000);
2017-09-05 22:38:25 +02:00
var months = ['January','February','March','April','May','June','July','August','September','October','November','December'];
2013-11-17 13:36:38 +01:00
var year = a.getFullYear();
var month = months[a.getMonth()];
var date = a.getDate();
var hour = a.getHours();
var min = a.getMinutes();
2013-12-09 15:14:36 +01:00
if (hour < 10 ) { hour = '0' + hour ; }
if (min < 10 ) { min = '0' + min ; }
2017-09-05 22:38:25 +02:00
var time = date+' '+month+' '+year;//+' at '+hour+':'+min
2013-11-17 13:36:38 +01:00
return time;
}
2019-10-21 02:13:09 +02:00
2013-11-17 13:36:38 +01:00
$(document).ready(function () {
2019-10-21 02:13:09 +02:00
2020-05-23 17:32:24 +02:00
var default_lang = "fr";
2019-10-21 02:13:09 +02:00
// Hide warrant about states when we're using the default filter
$('#state-disclaimer').hide();
var quality_filters = "decent";
2017-09-05 22:38:25 +02:00
function filter(){
2019-10-21 02:13:09 +02:00
var current_quality_filter = $('#current-quality-filter').data("filter");
var user_input_in_search_field = $('#filter-app-cards').val().toLowerCase();
$('.app-card').each(function() {
// This is where we actually define how apps are filtered:
// we look for the name of the app (h3) and try to find the user input
// + we check this app match the current quality filter
2020-05-23 17:32:24 +02:00
var text = $(this).find('.app-title').text().toLowerCase() + " " + $(this).find('.app-descr').text().toLowerCase();
if (text.indexOf(user_input_in_search_field) >= 0 & & $(this).data("quality").indexOf(current_quality_filter) >= 0)
2019-10-21 02:13:09 +02:00
{
$(this).show();
}
else
{
$(this).hide();
}
2017-09-05 22:38:25 +02:00
});
2019-10-21 02:13:09 +02:00
// Display or hide the disclaimers depending on the current filter...
((current_quality_filter == "working") || (current_quality_filter == "none")) ? $("#bad-quality-apps-disclaimer").show() : $("#bad-quality-apps-disclaimer").hide();
((current_quality_filter == "none")) ? $("#broken-apps-disclaimer").show() : $("#broken-apps-disclaimer").hide();
2017-09-05 22:38:25 +02:00
}
//=================================================
// Search & filter bar event
//=================================================
$('#filter-app-cards').keyup(filter);
2019-10-21 02:13:09 +02:00
$('a[data-quality-filter]').on("click", function(){
$('#current-quality-filter').text($(this).text());
$('#current-quality-filter').data("filter", $(this).data("quality-filter"));
2017-09-05 22:38:25 +02:00
filter();
});
2020-05-23 17:32:24 +02:00
2019-10-21 02:13:09 +02:00
filter();
2017-09-05 22:38:25 +02:00
2019-10-21 02:13:09 +02:00
//=================================================
// Upload apps lists
//=================================================
var catalog = undefined;
2017-09-05 22:38:25 +02:00
2019-10-21 02:13:09 +02:00
// Fetch application catalog
2017-09-05 22:38:25 +02:00
2020-05-23 17:32:24 +02:00
$.getJSON('https://app.yunohost.org/default/v2/apps.json', {}, function(data) {
2017-09-05 22:38:25 +02:00
2020-05-23 17:32:24 +02:00
catalog = $.map(data["apps"], function(el) { return el; });
2017-09-05 22:38:25 +02:00
2019-10-21 02:13:09 +02:00
// Clarify high quality state, and level if undefined or inprogress or notworking...
$.each(catalog, function(k, infos) {
2020-05-23 17:32:24 +02:00
if ((infos.level === undefined) || (infos.level === 0) || (infos.state === "inprogress") || (infos.state === "notworking")) {
2019-10-21 02:13:09 +02:00
infos.level = null;
}
if ((infos.high_quality === true) & & (infos.level === 8)) {
infos.state = "high quality";
}
2020-05-23 17:32:24 +02:00
else if ((infos.state === "working") & & (infos.level !== null) & & (infos.level < = 4)) {
infos.state = "low quality";
}
2019-10-21 02:13:09 +02:00
});
// 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;
2017-09-05 22:38:25 +02:00
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;
});
2019-10-21 02:13:09 +02:00
// Add the card for each app
$.each(catalog, function(k, infos) {
2017-09-05 22:38:25 +02:00
app_id = infos.manifest.id;
2019-10-21 02:13:09 +02:00
// 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";
2020-05-23 17:32:24 +02:00
app_badge = "high quality";
app_badge_css_style = "epic";
2019-10-21 02:13:09 +02:00
app_install_css_style = "success";
2020-05-23 17:32:24 +02:00
} else if ((infos.state === "working") & & (infos.level > 4)) {
2019-10-21 02:13:09 +02:00
app_quality = "decent,working,none";
2020-05-23 17:32:24 +02:00
app_badge = null;
app_badge_css_style = "success";
2019-10-21 02:13:09 +02:00
app_install_css_style = "success";
2020-05-23 17:32:24 +02:00
} else if (infos.state === "low quality") {
2019-10-21 02:13:09 +02:00
app_quality = "working,none";
2020-05-23 17:32:24 +02:00
app_badge = "low quality";
app_badge_css_style = "warning";
2019-10-21 02:13:09 +02:00
app_install_css_style = "warning";
} else {
app_quality = "none";
2020-05-23 17:32:24 +02:00
app_badge = "not working";
app_badge_css_style = "danger";
2019-10-21 02:13:09 +02:00
app_install_css_style = "danger";
2017-09-05 22:38:25 +02:00
}
2019-10-21 02:13:09 +02:00
// If level is null, we wanna display '?'
if (infos.level == null) {
2017-09-05 22:38:25 +02:00
infos.level = '?';
}
// Fill the template
html = $('#app-template2').html()
2013-11-17 13:36:38 +01:00
.replace(/{app_id}/g, app_id)
.replace(/{app_name}/g, infos.manifest.name)
2020-05-23 17:32:24 +02:00
.replace('{app_description}', infos.manifest.description[default_lang] || infos.manifest.description["en"])
2015-01-05 21:46:26 +01:00
.replace(/{app_git}/g, infos.git.url)
2013-11-17 13:36:38 +01:00
.replace('{app_branch}', infos.git.branch)
2017-01-31 10:17:11 +01:00
.replace('{app_level}', infos.level)
2019-10-21 02:13:09 +02:00
.replace('{app_quality}', app_quality)
2017-09-05 22:38:25 +02:00
.replace('{app_update}', timeConverter(infos.lastUpdate))
2019-10-21 02:13:09 +02:00
.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 !");
2017-09-05 22:38:25 +02:00
}
2019-10-21 02:13:09 +02:00
else {
2017-09-05 22:38:25 +02:00
html = html
2019-10-21 02:13:09 +02:00
.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}', "???");
}
2017-09-05 22:38:25 +02:00
}
// Fill the template
$('#app-cards-list').append(html);
$('.app-card_'+ app_id).attr('id', 'app-card_'+ app_id);
2020-05-23 17:32:24 +02:00
if (app_badge !== null) {
$('.app-card_'+ app_id + ' .app-title').append(' < span class = "label label-'+app_badge_css_style+'" > '+app_badge+'< / span > ');
}
if (typeof(infos.category) === "string") {
2020-05-23 17:58:14 +02:00
category = data["categories"].find(function(el) { return el.id == infos.category; });
2020-05-23 17:32:24 +02:00
if (typeof(category) !== "undefined")
{
display = category["title"][default_lang] || category["title"]["en"];
$('.app-card_'+ app_id + ' .app-title').append(' < span class = "label label-default" > '+display.toLowerCase()+'< / span > ');
}
2017-09-05 22:38:25 +02:00
}
});
2019-10-21 02:13:09 +02:00
2017-09-05 22:38:25 +02:00
filter();
2013-11-17 13:36:38 +01:00
});
2019-10-21 02:13:09 +02:00
//=================================================
2013-11-17 13:36:38 +01:00
});
2017-01-12 13:11:55 +01:00
< / script >