Disable button and add tooltip if change_url unavailable

(needed to add a span holding the tooltip, because tooltips aren't displayed for disabled buttons)
This commit is contained in:
Jimmy Monin 2018-01-12 08:13:04 +01:00
parent 977ee7192f
commit 268543ec4e
2 changed files with 17 additions and 9 deletions

View file

@ -20,6 +20,7 @@
"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).",
"app_info_change_url_disabled_tooltip": "This feature hasn't been implemented in this app yet",
"app_info_uninstall_desc": "Remove this application.",
"app_install_cancel": "Installation cancelled.",
"app_install_custom_no_manifest": "No manifest.json file",

View file

@ -48,15 +48,21 @@
</a>
</div>
<hr>
{{#if change_url}}
<div class="container">
<p>{{t 'app_info_changeurl_desc' settings.domain}}</p>
<a href="#/apps/{{settings.id}}/changeurl" class="btn btn-info slide">
<span class="fa-exchange"></span> {{t 'app_change_url'}}
</a>
</div>
<hr>
{{/if}}
<div class="container">
<p>{{t 'app_info_changeurl_desc' settings.domain}}</p>
{{#if change_url}}
<a href="#/apps/{{settings.id}}/changeurl" class="btn btn-info slide">
<span class="fa-exchange"></span> {{t 'app_change_url'}}
</a>
{{else}}
{{#tooltip (t 'app_info_change_url_disabled_tooltip') }}
<a href="#/apps/{{settings.id}}/changeurl" class="btn btn-info slide disabled">
<span class="fa-exchange"></span> {{t 'app_change_url'}}
</a>
{{/tooltip}}
{{/if}}
</div>
<hr>
<div class="container">
<p>{{t 'app_info_uninstall_desc'}}</p>
<a href="#/apps/{{settings.id}}/uninstall" class="btn btn-danger slide back">
@ -72,3 +78,4 @@
</div>
</div>
</div>
{{load_tooltips}}