From 6572aa5aad04d14f2a334ed224cd52fa0a9ccd87 Mon Sep 17 00:00:00 2001 From: magdev Date: Sat, 29 Apr 2023 11:48:02 +0200 Subject: [PATCH] added switch to control the webapp function --- .vscode/settings.json | 3 -- app/views/application/_header.html.erb | 32 +++++++++++---------- app/views/manifest/index.json.erb | 2 ++ app/views/settings/_baupm_settings.html.erb | 8 ++++++ config/locales/de.yml | 1 + config/locales/en.yml | 1 + init.rb | 1 + 7 files changed, 30 insertions(+), 18 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index efd7793..e69de29 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +0,0 @@ -{ - "nuxt.isNuxtApp": false -} diff --git a/app/views/application/_header.html.erb b/app/views/application/_header.html.erb index e49c242..240d188 100755 --- a/app/views/application/_header.html.erb +++ b/app/views/application/_header.html.erb @@ -2,20 +2,22 @@ <%= javascript_include_tag "baupm.js", :plugin => 'baupm_core' %> <%= stylesheet_link_tag 'jquery-fab.css', :plugin => 'baupm_core', :media => "screen" %> <%= stylesheet_link_tag 'baupm.css', :plugin => 'baupm_core', :media => "screen" %> - - - - - - - -<% if Setting.plugin_baupm_core['baupm_theme_color'].present? %> - +<% if Setting.plugin_baupm_core['baupm_enable_webapp'] == 1 %> + + + + + + + + <% if Setting.plugin_baupm_core['baupm_theme_color'].present? %> + + <% end %> + <% if Setting.plugin_baupm_core['baupm_manifest_orientation'].present? %> + + <% end %> + + + <% end %> -<% if Setting.plugin_baupm_core['baupm_manifest_orientation'].present? %> - -<% end %> - - - diff --git a/app/views/manifest/index.json.erb b/app/views/manifest/index.json.erb index 23b9b0c..1639ffa 100755 --- a/app/views/manifest/index.json.erb +++ b/app/views/manifest/index.json.erb @@ -1,3 +1,4 @@ +<% if Setting.plugin_baupm_core['baupm_enable_webapp'] == 1 %> { "name": "<%= Setting.plugin_baupm_core['baupm_application_title'] %>", <% if Setting.plugin_baupm_core['baupm_application_short_title'].present? %> @@ -39,3 +40,4 @@ } ] } +<% end %> diff --git a/app/views/settings/_baupm_settings.html.erb b/app/views/settings/_baupm_settings.html.erb index 41eef47..bd42f33 100644 --- a/app/views/settings/_baupm_settings.html.erb +++ b/app/views/settings/_baupm_settings.html.erb @@ -2,6 +2,14 @@ <%= l(:baupm_manifest_settings) %> + + + +
<%= l(:baupm_enable_webapp) %> + +
<%= l(:baupm_application_title) %> diff --git a/config/locales/de.yml b/config/locales/de.yml index 35707ed..ee7de05 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -15,6 +15,7 @@ de: baupm_display_browser: Browser baupm_display_fullscreen: Vollbild baupm_display_minimal_ui: Minimal + baupm_enable_webapp: Webapp aktivieren # Redmine translation modifications notice_unable_delete_version: Der Meilenstein konnte nicht gelöscht werden diff --git a/config/locales/en.yml b/config/locales/en.yml index f1dc064..4cc59cf 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -15,6 +15,7 @@ en: baupm_display_browser: Browser baupm_display_fullscreen: Fullscreen baupm_display_minimal_ui: Minimal UI + baupm_enable_webapp: Enable Webapp # Redmine translation modifications (@TODO Translate this) notice_unable_delete_version: Unable to delete the Milestone diff --git a/init.rb b/init.rb index edc404f..cbe8c9e 100644 --- a/init.rb +++ b/init.rb @@ -23,5 +23,6 @@ Redmine::Plugin.register :baupm_core do 'baupm_manifest_orientation' => 'portrait', 'baupm_manifest_display' => 'standalone', 'baupm_manifest_start_url' => '.' + 'baupm_enable_webapp' => 1 }, :partial => 'settings/baupm_settings' end