diff --git a/assets/css/ynh-style.css b/assets/css/ynh-style.css index 6b74919..24367f0 100644 --- a/assets/css/ynh-style.css +++ b/assets/css/ynh-style.css @@ -114,11 +114,13 @@ img { /* Layout */ .overlay { padding: 2%; + padding-top: 0; } .ynh-wrapper { width: 90%; margin: 2% 5%; + margin-top: 20px; position: relative; z-index: 1; } diff --git a/index.php b/index.php index a8e0d2e..a8c6058 100644 --- a/index.php +++ b/index.php @@ -8,43 +8,35 @@ $user_locale = substr(Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']), if (!file_exists("locales/".$user_locale.".json")) { $user_locale = 'en'; } $locale=json_decode(file_get_contents("locales/".$user_locale.".json"), true); -// Parse the official app list -$official_json=file_get_contents("https://app.yunohost.org/official.json"); -$official=json_decode($official_json, true); +// Parse the apps list +$apps_list_json=file_get_contents("http://app.yunohost.org/apps.json"); +$apps_list=json_decode($apps_list_json, true); -// Check whether the app is official, community, or neither -if(array_key_exists($app, $official)) { - // The app is in the official list - $app_status = 'official'; // The app is in the official list - $app_name = $official[$app]['manifest']['name']; // Saves the app name - $app_git = $official[$app]['git']['url']; // Saves the git URL - $app_state = $official[$app]['state']; // Saves the app state +// Check if the app is the apps list +if(array_key_exists($app, $apps_list)) { + // The app is in the apps list + $app_status = $apps_list[$app]['state']; // Saves the app state + $app_name = $apps_list[$app]['manifest']['name']; // Saves the app name + $app_git = $apps_list[$app]['git']['url']; // Saves the git URL + if (array_key_exists("level", $apps_list[$app])) { + $app_level = $apps_list[$app]['level']; + } + else { + $app_level = 0; + $app_status = null; + } } else { - // Parse the community app list - $community_json=file_get_contents("https://app.yunohost.org/community.json"); - $community=json_decode($community_json, true); - - // Check if the app is community - if(array_key_exists($app, $community)) { - // The app is in the community list - $app_status = 'community'; // The app is in the community list - $app_name = $community[$app]['manifest']['name']; // Saves the app name - $app_git = $community[$app]['git']['url']; // Saves the git URL - $app_state = $community[$app]['state']; // Saves the app state - } - else { - // The app is neither in the official, nor in the community list - $app_status = null; - $app_name = ""; - } + // The app is not in the apps list + $app_status = null; + $app_name = ""; } -// If the user submitted his or her server and the app is official, redirects to the server -if(isset($_POST['server']) AND !empty($_POST['server']) AND $app_status == 'official') { - $server = rtrim(preg_replace('#^https?://#', '', $_POST['server']),"/"); - $url = 'https://'.$server.'/yunohost/admin/#/apps/install/'.$app; - header('Location: '.$url); +// If the user submitted his or her server and the app is in apps ist, redirects to the server +if(isset($_POST['server']) AND !empty($_POST['server']) AND $app_status == 'working') { + $server = rtrim(preg_replace('#^https?://#', '', $_POST['server']),"/"); + $url = 'https://'.$server.'/yunohost/admin/#/apps/install/'.$app; + header('Location: '.$url); } ?> @@ -62,7 +54,7 @@ if(isset($_POST['server']) AND !empty($_POST['server']) AND $app_status == 'offi - + @@ -83,80 +75,49 @@ if(isset($_POST['server']) AND !empty($_POST['server']) AND $app_status == 'offi -

+

Yunohost -

+
-
+ + -
-

-

-

-
+
+

+

+

+
diff --git a/install-with-yunohost.svg b/install-with-yunohost.svg new file mode 100644 index 0000000..b087d98 --- /dev/null +++ b/install-with-yunohost.svg @@ -0,0 +1,104 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + Installwith + + + diff --git a/locales/en.json b/locales/en.json index 4662315..9f535e4 100644 --- a/locales/en.json +++ b/locales/en.json @@ -2,14 +2,12 @@ "title": "Install {app_name} with YunoHost", "server_link": "Link to your YunoHost server", "install_button": "Install {app_name}", - "community_warning": "WARNING: {app_name} is NOT officially supported by the YunoHost team yet. Install it at your own risk. The community maintainer has described this app to be in a {app_state} state.", - "community_instructions": "Copy the following link. You will then be redirected to your server apps installation page in which you will need to paste this link.", - "community_redirect": "Go to your server", "app_notfound": "This application is neither officially nor community maintained.", "working": "working", "inprogress": "in progress", "notworking": "not working", "noserver": "No YunoHost server yet?", "yunohost": "YunoHost is a server operating system aiming to make self-hosting accessible to everyone.", - "discover": "Discover YunoHost" + "discover": "Click here to discover YunoHost", + "app_state_warning": "WARNING: This app is bad-quality for now. Installation could maybe work, but it may lack important features like backup/restore, and/or it uses deprecated practices that may cause issues on your server. Please be careful." } diff --git a/locales/fr.json b/locales/fr.json index ad4c9e3..eae645b 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -2,14 +2,12 @@ "title": "Installer {app_name} avec YunoHost", "server_link": "Lien vers votre serveur YunoHost", "install_button": "Installer {app_name}", - "community_warning": "ATTENTION : {app_name} N'EST PAS officiellement prise en charge pour le moment par l'équipe YunoHost. Installez cette application à vos risques et périls. Le mainteneur de cette application la décrit comme étant dans un état {app_state}.", - "community_instructions": "Merci de copier le lien suivant. Vous serez ensuite redirigé vers la page d'installation d'applications de votre serveur dans laquelle vous devrez coller ce lien.", - "community_redirect": "Accéder au serveur", "app_notfound": "Cette application n'est maintenue ni officiellemment, ni par la communauté.", "working": "fonctionnel", "inprogress": "en cours de développement", "notworking": "non fonctionnel", "noserver": "Pas encore de serveur YunoHost ?", "yunohost": "YunoHost est un outil qui vous permet d’installer et d’utiliser facilement votre propre serveur.", - "discover": "Découvrez YunoHost" + "discover": "Cliquez ici pour découvrir YunoHost", + "app_state_warning": "ATTENTION: Cette application est pour le moment de mauvaise qualité. L'installation va peut-être fonctionner, mais certaines fonctionnalités importantes telles que la sauvegarde/restauration peuvent être manquante, et/ou l'application ne respecte pas les bonnes pratiques ce qui peut créer des problèmes sur votre serveur. Soyez prudent." }