diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index 02a98fc7..2dd11cf9 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -592,6 +592,26 @@ ); }); + // Get app change label page + app.get('#/apps/:app/changelabel', function (c) { + c.api('/apps/'+c.params['app']+'?raw', function(app_data) { + data = { + id: c.params['app'], + label: app_data.settings.label, + }; + c.view('app/app_changelabel', data); + }); + }); + + // Change app label + app.post('#/apps/:app/changelabel', function (c) { + params = {'new_label': c.params['label']}; + c.api('/apps/' + c.params['app'] + '/label', function(data) { // Call changelabel API + store.clear('slide'); + c.redirect('#/apps/'+ c.params['app']); + }, 'PUT', params); + }); + // Get app change URL page app.get('#/apps/:app/changeurl', function (c) { c.api('/apps/'+c.params['app']+'?raw', function(app_data) { diff --git a/src/locales/en.json b/src/locales/en.json index ff522811..f2992c44 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -13,10 +13,12 @@ "app_access_removeall_btn": "Remove all access", "app_access_removeall_desc": "No users will have access to %s.", "app_access_title": "%s access", + "app_change_label": "Change Label", "app_change_url": "Change URL", "app_debug_no_logs": "Application's logs are not available", "app_debug_tab": "Display debug information", "app_info_access_desc": "Manage user access. Allowed users: %s", + "app_info_changelabel_desc": "Change app label in the portal.", "app_info_debug_desc": "Display debugging information for this application.", "app_info_default_desc": "Redirect domain root to this application (%s).", "app_info_changeurl_desc": "Change the access URL of this application (domain and/or path).", diff --git a/src/views/app/app_changelabel.ms b/src/views/app/app_changelabel.ms new file mode 100644 index 00000000..879118ff --- /dev/null +++ b/src/views/app/app_changelabel.ms @@ -0,0 +1,30 @@ +
+ + + + diff --git a/src/views/app/app_info.ms b/src/views/app/app_info.ms index 7e01e599..e7cb40b6 100644 --- a/src/views/app/app_info.ms +++ b/src/views/app/app_info.ms @@ -15,6 +15,8 @@{{t 'app_info_changelabel_desc' settings.label}}
+ + {{t 'app_change_label'}} + +