From c6c226aa246fa4be189d71ff07b3092ee7f47015 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 30 May 2019 17:08:51 +0200 Subject: [PATCH 1/7] Remove applist management stuff from app_install_list page --- src/locales/en.json | 1 - src/views/app/app_list_install.ms | 16 ---------------- 2 files changed, 17 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index a95cfe93..bc4f66b4 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -417,7 +417,6 @@ "name": "Name", "install_community_appslists_info": "Community applications list allows you to install community maintained applications.
See the full list on yunohost.org/apps.", "install_community_appslists_warning": "Note that these applications packages are not official and not maintained by the YunoHost team.
Installing these applications is at your own risk and could break your system.", - "install_custom_app_appslists_info": "Note that you can use alternative applications lists to install some other apps maintained by the YunoHost community.", "purge_user_data_checkbox": "Purge %s's data? (This will remove the content of it's home and mail directories.)", "purge_user_data_warning": "Purging user's data is not reversible. Be sure you know what you're doing!" } diff --git a/src/views/app/app_list_install.ms b/src/views/app/app_list_install.ms index 70a54476..1e8579a6 100644 --- a/src/views/app/app_list_install.ms +++ b/src/views/app/app_list_install.ms @@ -4,15 +4,6 @@ {{t 'install'}} -
- - {{t 'appslists_manage'}} - - - {{t 'refresh_app_list'}} - -
-
@@ -79,13 +70,6 @@ {{t 'confirm_install_custom_app'}}

-
-

- {{t 'install_custom_app_appslists_info'}}

-

- {{t 'appslists_manage'}} -

-
From c8ead748ee16da39923bb0104a7e4782f284a265 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 30 May 2019 17:10:10 +0200 Subject: [PATCH 2/7] Remove 'version' entry in tools list, as 'Diagnosis' already contains it --- src/js/yunohost/controllers/tools.js | 7 ------- src/views/tools/tools_list.ms | 4 ---- src/views/tools/tools_versions.ms | 22 ---------------------- 3 files changed, 33 deletions(-) delete mode 100644 src/views/tools/tools_versions.ms diff --git a/src/js/yunohost/controllers/tools.js b/src/js/yunohost/controllers/tools.js index 98aac838..f8c033f9 100644 --- a/src/js/yunohost/controllers/tools.js +++ b/src/js/yunohost/controllers/tools.js @@ -208,13 +208,6 @@ }); - // Packages version - app.get('#/tools/versions', function (c) { - c.api('/diagnosis', function(diagnosis) { - c.view('tools/tools_versions', {'versions' : diagnosis.packages }); - }); - }); - // Reboot or shutdown button app.get('#/tools/reboot', function (c) { c.view('tools/tools_reboot'); diff --git a/src/views/tools/tools_list.ms b/src/views/tools/tools_list.ms index 8e8a70c2..3e3d2dd8 100644 --- a/src/views/tools/tools_list.ms +++ b/src/views/tools/tools_list.ms @@ -43,8 +43,4 @@

{{t 'tools_shutdown_reboot'}}

- - -

{{t 'versions'}}

-
diff --git a/src/views/tools/tools_versions.ms b/src/views/tools/tools_versions.ms deleted file mode 100644 index 4327b979..00000000 --- a/src/views/tools/tools_versions.ms +++ /dev/null @@ -1,22 +0,0 @@ - - -
- -
-
-

{{t 'versions'}}

-
-
-
- {{#each versions}} -
{{@key}}
-
{{version}} ({{repo}})
- {{/each}} -
- {{t 'system_update'}} -
-
From adc00664c5f476f740ddcc13df12a2d47bac50ba Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 30 May 2019 19:28:26 +0200 Subject: [PATCH 3/7] In tools list, add an 'advanced' category --- src/locales/en.json | 1 + src/views/tools/tools_list.ms | 26 +++++++++++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index bc4f66b4..1d8f1461 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -2,6 +2,7 @@ "action": "Action", "active": "Active", "add": "Add", + "advanced": "Advanced", "remove": "Remove", "administration_password": "Administration password", "allowed_users": "Allowed users", diff --git a/src/views/tools/tools_list.ms b/src/views/tools/tools_list.ms index 3e3d2dd8..17d889dd 100644 --- a/src/views/tools/tools_list.ms +++ b/src/views/tools/tools_list.ms @@ -5,7 +5,6 @@
- + +
+
+ +

{{t 'advanced'}}

+ + + From a24e0743bb13840ebbe6927971ac8d9f59afaf2d Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 31 May 2019 14:21:07 +0200 Subject: [PATCH 4/7] Move appslist manage to tools section --- src/js/yunohost/controllers/apps.js | 65 -------------- src/js/yunohost/controllers/tools.js | 89 +++++++++++++++++++ .../tools_appslists_info.ms} | 10 +-- .../tools_appslists_list.ms} | 6 +- src/views/tools/tools_list.ms | 4 + 5 files changed, 101 insertions(+), 73 deletions(-) rename src/views/{app/app_appslists_info.ms => tools/tools_appslists_info.ms} (79%) rename src/views/{app/app_appslists_list.ms => tools/tools_appslists_list.ms} (95%) diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index 9a7aafc9..d34b0b50 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -156,71 +156,6 @@ }, 'GET'); }); - // Add a new apps list - app.post('#/apps/lists', function (c) { - list = { - 'name' : c.params['appslist_name'], - 'url' : c.params['appslist_url'] - } - - c.api('/appslists', function(data) { - store.clear('slide'); - c.redirect('#/apps/lists/' + list.name); - }, 'PUT', list); - }); - - // Show appslist info and operations - app.get('#/apps/lists/:appslist', function (c) { - c.api('/appslists', function(data) { - if (typeof data[c.params['appslist']] !== 'undefined') { - list = { - 'name' : c.params['appslist'], - 'url': data[c.params['appslist']]['url'], - 'lastUpdate': data[c.params['appslist']]['lastUpdate'], - 'removable' : (c.params['appslist'] !== 'yunohost') ? true : false // Do not remove default apps list - }; - c.view('app/app_appslists_info', {appslist: list}); - } - else { - c.flash('warning', y18n.t('appslists_unknown_list', [c.params['appslist']])); - store.clear('slide'); - c.redirect('#/apps/lists'); - } - }, 'GET'); - }); - - // Refresh available apps list - app.get('#/apps/lists/refresh', function (c) { - c.api('/appslists', function(data) { - // c.redirect(store.get('path')); - c.redirect('#/apps/install'); - }, 'PUT'); - }); - - // Refresh specific apps list - app.get('#/apps/lists/:appslist/refresh', function (c) { - c.api('/appslists', function(data) { - c.redirect('#/apps/lists'); - }, 'PUT', {'name' : c.params['appslist']}); - }); - - // Remove apps list - app.get('#/apps/lists/:appslist/remove', function (c) { - c.confirm( - y18n.t('appslist'), - y18n.t('appslists_confirm_remove', [c.params['app']]), - function() { - c.api('/appslists', function() { - c.redirect('#/apps/lists'); - }, 'DELETE', {'name' : c.params['appslist']}); - }, - function() { - store.clear('slide'); - c.redirect('#/apps/lists/'+ c.params['appslist']); - } - ); - }); - // Get app information app.get('#/apps/:app', function (c) { c.api('/apps/'+c.params['app']+'?raw', function(data) { // http://api.yunohost.org/#!/app/app_info_get_9 diff --git a/src/js/yunohost/controllers/tools.js b/src/js/yunohost/controllers/tools.js index f8c033f9..ffee7d49 100644 --- a/src/js/yunohost/controllers/tools.js +++ b/src/js/yunohost/controllers/tools.js @@ -364,4 +364,93 @@ ); }); + // List available apps lists + app.get('#/tools/appslists', function (c) { + c.api('/appslists', function(data) { + list = []; + var has_community_list = false; + $.each(data, function(listname, listinfo) { + list.push({ + 'name': listname, + 'url': listinfo['url'], + 'lastUpdate': listinfo['lastUpdate'] + }); + + // Check for community list + if (listname == 'community' || listinfo['url'] == 'https://app.yunohost.org/community.json') { + has_community_list = true; + } + }); + + c.view('tools/tools_appslists_list', { + appslists: list, + has_community_list: has_community_list + }); + }, 'GET'); + }); + + // Add a new apps list + app.post('#/tools/appslists', function (c) { + list = { + 'name' : c.params['appslist_name'], + 'url' : c.params['appslist_url'] + } + + c.api('/appslists', function(data) { + store.clear('slide'); + c.redirect('#/apps/lists/' + list.name); + }, 'PUT', list); + }); + + // Show appslist info and operations + app.get('#/tools/appslists/:appslist', function (c) { + c.api('/appslists', function(data) { + if (typeof data[c.params['appslist']] !== 'undefined') { + list = { + 'name' : c.params['appslist'], + 'url': data[c.params['appslist']]['url'], + 'lastUpdate': data[c.params['appslist']]['lastUpdate'], + 'removable' : (c.params['appslist'] !== 'yunohost') ? true : false // Do not remove default apps list + }; + c.view('tools/tools_appslists_info', {appslist: list}); + } + else { + c.flash('warning', y18n.t('appslists_unknown_list', [c.params['appslist']])); + store.clear('slide'); + c.redirect('#/apps/lists'); + } + }, 'GET'); + }); + + // Refresh available apps list + app.get('#/tools/appslists/refresh', function (c) { + c.api('/appslists', function(data) { + // c.redirect(store.get('path')); + c.redirect('#/apps/install'); + }, 'PUT'); + }); + + // Refresh specific apps list + app.get('#/tools/appslists/:appslist/refresh', function (c) { + c.api('/appslists', function(data) { + c.redirect('#/apps/lists'); + }, 'PUT', {'name' : c.params['appslist']}); + }); + + // Remove apps list + app.get('#/tools/appslists/:appslist/remove', function (c) { + c.confirm( + y18n.t('appslist'), + y18n.t('appslists_confirm_remove', [c.params['app']]), + function() { + c.api('/appslists', function() { + c.redirect('#/apps/lists'); + }, 'DELETE', {'name' : c.params['appslist']}); + }, + function() { + store.clear('slide'); + c.redirect('#/apps/lists/'+ c.params['appslist']); + } + ); + }); })(); diff --git a/src/views/app/app_appslists_info.ms b/src/views/tools/tools_appslists_info.ms similarity index 79% rename from src/views/app/app_appslists_info.ms rename to src/views/tools/tools_appslists_info.ms index 4fa09040..bb41beb6 100644 --- a/src/views/app/app_appslists_info.ms +++ b/src/views/tools/tools_appslists_info.ms @@ -1,8 +1,8 @@
@@ -32,7 +32,7 @@

{{t 'appslists_info_refresh_desc'}}

- + {{t 'refresh_app_list'}}
@@ -40,7 +40,7 @@

{{t 'appslists_info_remove_desc'}}

- + {{t 'remove'}}
diff --git a/src/views/app/app_appslists_list.ms b/src/views/tools/tools_appslists_list.ms similarity index 95% rename from src/views/app/app_appslists_list.ms rename to src/views/tools/tools_appslists_list.ms index 3a677f9a..7158ba5d 100644 --- a/src/views/app/app_appslists_list.ms +++ b/src/views/tools/tools_appslists_list.ms @@ -1,7 +1,7 @@
@@ -13,7 +13,7 @@
{{#appslists}} - +

{{name}} diff --git a/src/views/tools/tools_list.ms b/src/views/tools/tools_list.ms index 17d889dd..218a88e3 100644 --- a/src/views/tools/tools_list.ms +++ b/src/views/tools/tools_list.ms @@ -46,6 +46,10 @@

{{t 'tools_adminpw'}}

+ + +

{{t 'appslists'}}

+

{{t 'tools_download_ca'}}

From 5dc91715b1dcc3fb2b864d047868e357bda75224 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 31 May 2019 14:30:35 +0200 Subject: [PATCH 5/7] Remove old references to community list --- src/js/yunohost/controllers/tools.js | 9 +-------- src/locales/en.json | 3 --- src/views/tools/tools_appslists_list.ms | 25 +------------------------ 3 files changed, 2 insertions(+), 35 deletions(-) diff --git a/src/js/yunohost/controllers/tools.js b/src/js/yunohost/controllers/tools.js index ffee7d49..61c79b06 100644 --- a/src/js/yunohost/controllers/tools.js +++ b/src/js/yunohost/controllers/tools.js @@ -368,23 +368,16 @@ app.get('#/tools/appslists', function (c) { c.api('/appslists', function(data) { list = []; - var has_community_list = false; $.each(data, function(listname, listinfo) { list.push({ 'name': listname, 'url': listinfo['url'], 'lastUpdate': listinfo['lastUpdate'] }); - - // Check for community list - if (listname == 'community' || listinfo['url'] == 'https://app.yunohost.org/community.json') { - has_community_list = true; - } }); c.view('tools/tools_appslists_list', { - appslists: list, - has_community_list: has_community_list + appslists: list }); }, 'GET'); }); diff --git a/src/locales/en.json b/src/locales/en.json index 1d8f1461..aa9d8dcf 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -414,10 +414,7 @@ "appslists_info_remove_desc": "Applications from this list will not be available anymore.", "appslists_last_update": "Last update", "appslists_unknown_list": "Unknown apps list: %s", - "appslists_community_list": "Community applications list", "name": "Name", - "install_community_appslists_info": "Community applications list allows you to install community maintained applications.
See the full list on
yunohost.org/apps.", - "install_community_appslists_warning": "Note that these applications packages are not official and not maintained by the YunoHost team.
Installing these applications is at your own risk and could break your system.", "purge_user_data_checkbox": "Purge %s's data? (This will remove the content of it's home and mail directories.)", "purge_user_data_warning": "Purging user's data is not reversible. Be sure you know what you're doing!" } diff --git a/src/views/tools/tools_appslists_list.ms b/src/views/tools/tools_appslists_list.ms index 7158ba5d..ede16f19 100644 --- a/src/views/tools/tools_appslists_list.ms +++ b/src/views/tools/tools_appslists_list.ms @@ -29,29 +29,6 @@
-{{^has_community_list}} -
-
-

{{t 'appslists_community_list'}}

-
-
- - - -
-
-

{{t 'install_community_appslists_info'}}

-

- {{t 'install_community_appslists_warning'}} -

- -
-
- -
-
-{{/has_community_list}} -

{{t 'appslists_custom'}}

@@ -67,7 +44,7 @@
- +
From bb9eeccb1036e8b750599f2dcb507a9f02e4b443 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 31 May 2019 15:08:41 +0200 Subject: [PATCH 6/7] Remove / fix remaining old refs --- src/js/yunohost/controllers/apps.js | 25 ------------------------- src/js/yunohost/controllers/tools.js | 10 +++++----- src/views/tools/tools_appslists_list.ms | 2 +- 3 files changed, 6 insertions(+), 31 deletions(-) diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index d34b0b50..e2cc23e1 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -131,31 +131,6 @@ }); }); - // List available apps lists - app.get('#/apps/lists', function (c) { - c.api('/appslists', function(data) { - list = []; - var has_community_list = false; - $.each(data, function(listname, listinfo) { - list.push({ - 'name': listname, - 'url': listinfo['url'], - 'lastUpdate': listinfo['lastUpdate'] - }); - - // Check for community list - if (listname == 'community' || listinfo['url'] == 'https://app.yunohost.org/community.json') { - has_community_list = true; - } - }); - - c.view('app/app_appslists_list', { - appslists: list, - has_community_list: has_community_list - }); - }, 'GET'); - }); - // Get app information app.get('#/apps/:app', function (c) { c.api('/apps/'+c.params['app']+'?raw', function(data) { // http://api.yunohost.org/#!/app/app_info_get_9 diff --git a/src/js/yunohost/controllers/tools.js b/src/js/yunohost/controllers/tools.js index 61c79b06..7749a105 100644 --- a/src/js/yunohost/controllers/tools.js +++ b/src/js/yunohost/controllers/tools.js @@ -391,7 +391,7 @@ c.api('/appslists', function(data) { store.clear('slide'); - c.redirect('#/apps/lists/' + list.name); + c.redirect('#/tools/appslists/' + list.name); }, 'PUT', list); }); @@ -410,7 +410,7 @@ else { c.flash('warning', y18n.t('appslists_unknown_list', [c.params['appslist']])); store.clear('slide'); - c.redirect('#/apps/lists'); + c.redirect('#/tools/appslists'); } }, 'GET'); }); @@ -426,7 +426,7 @@ // Refresh specific apps list app.get('#/tools/appslists/:appslist/refresh', function (c) { c.api('/appslists', function(data) { - c.redirect('#/apps/lists'); + c.redirect('#/tools/appslists'); }, 'PUT', {'name' : c.params['appslist']}); }); @@ -437,12 +437,12 @@ y18n.t('appslists_confirm_remove', [c.params['app']]), function() { c.api('/appslists', function() { - c.redirect('#/apps/lists'); + c.redirect('#/tools/appslists'); }, 'DELETE', {'name' : c.params['appslist']}); }, function() { store.clear('slide'); - c.redirect('#/apps/lists/'+ c.params['appslist']); + c.redirect('#/tools/appslists/'+ c.params['appslist']); } ); }); diff --git a/src/views/tools/tools_appslists_list.ms b/src/views/tools/tools_appslists_list.ms index ede16f19..3357de3e 100644 --- a/src/views/tools/tools_appslists_list.ms +++ b/src/views/tools/tools_appslists_list.ms @@ -34,7 +34,7 @@

{{t 'appslists_custom'}}

-
+
From d3c7c7ca9b396a5b423c8dbb2903fd6845f1d1af Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 18 Jun 2019 23:26:14 +0200 Subject: [PATCH 7/7] Changing admin password can be deemed to not be an "advanced" operation ;P --- src/views/tools/tools_list.ms | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/tools/tools_list.ms b/src/views/tools/tools_list.ms index 218a88e3..1442b625 100644 --- a/src/views/tools/tools_list.ms +++ b/src/views/tools/tools_list.ms @@ -22,6 +22,10 @@

{{t 'tools_shutdown_reboot'}}

+ + +

{{t 'tools_adminpw'}}

+
@@ -42,10 +46,6 @@

{{t 'tools_security_feed'}}

- - -

{{t 'tools_adminpw'}}

-

{{t 'appslists'}}