[checkmk-commits] 3723 FIX Mobile GUI: Don' t mix classic and mobile GUI when choosing classic on mobile device

Lars Michelsen lm at mathias-kettner.de
Tue Jul 26 08:35:20 CEST 2016


Module: check_mk
Branch: master
Commit: 92defe0494318ebe019af4c5b9aac46532dea845
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=92defe0494318ebe019af4c5b9aac46532dea845

Author: Lars Michelsen <lm at mathias-kettner.de>
Date:   Tue Jul 26 08:32:58 2016 +0200

3723 FIX Mobile GUI: Don't mix classic and mobile GUI when choosing classic on mobile device

---

 .werks/3723                   |   10 ++++++++++
 ChangeLog                     |    1 +
 web/htdocs/html_mod_python.py |    6 ++++++
 3 files changed, 17 insertions(+)

diff --git a/.werks/3723 b/.werks/3723
new file mode 100644
index 0000000..6c52be3
--- /dev/null
+++ b/.werks/3723
@@ -0,0 +1,10 @@
+Title: Mobile GUI: Don't mix classic and mobile GUI when choosing classic on mobile device
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1469514754
+
+
diff --git a/ChangeLog b/ChangeLog
index 789f3ea..ac16e0c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -407,6 +407,7 @@
     * 3670 FIX: Fixed empty AV PDF report when exporting it from a quicksearch result view
     * 3622 FIX: Fix labelling of V-Achsis on graphs with very large numbers...
     * 3722 FIX: Mobile GUI: Prevent it from being opened with regular sidebar
+    * 3723 FIX: Mobile GUI: Don't mix classic and mobile GUI when choosing classic on mobile device
 
     WATO:
     * 3244 WATO BI Module: swap order of aggregation function and child node selection...
diff --git a/web/htdocs/html_mod_python.py b/web/htdocs/html_mod_python.py
index 3e5239f..bc8a346 100644
--- a/web/htdocs/html_mod_python.py
+++ b/web/htdocs/html_mod_python.py
@@ -131,6 +131,12 @@ class html_mod_python(htmllib.html):
     def init_mobile(self):
         if self.has_var("mobile"):
             self.mobile = bool(self.var("mobile"))
+            # Persist the explicitly set state in a cookie to have it maintained through further requests
+            self.set_cookie("mobile", str(int(self.mobile)))
+
+        elif self.has_cookie("mobile"):
+            self.mobile = self.cookie("mobile", "0") == "1"
+
         else:
             self.mobile = mobile.is_mobile(self.get_user_agent())
 



More information about the checkmk-commits mailing list