Module: check_mk
Branch: master
Commit: e36156ad6e9ec5ba04b199a19fdd84564e9e7655
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e36156ad6e9ec5…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri Jan 13 12:07:37 2012 +0100
MobileUI: Corrected sorting and changed Classic UI link
---
web/htdocs/mobile.py | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/web/htdocs/mobile.py b/web/htdocs/mobile.py
index 7fb74cd..560e334 100644
--- a/web/htdocs/mobile.py
+++ b/web/htdocs/mobile.py
@@ -120,11 +120,11 @@ def jqm_page_navfooter(items, current, page_id):
def jqm_page_index(title, items):
manual_sort = [_("Hosts"), _("Services"), _("Events")]
+ items.sort(cmp = lambda a,b: cmp((a[0],a[2]),(b[0],b[2])))
for topic in manual_sort:
jqm_page_index_topic_renderer(topic, items)
other_topics = list(set([ x[0] for x in items if x[0] not in manual_sort]))
- other_topics.sort()
for topic in other_topics:
jqm_page_index_topic_renderer(topic, items)
@@ -184,14 +184,16 @@ def page_index():
for view_name, view in html.available_views.items():
if view.get("mobile") and not view.get("hidden"):
url = "mobile_view.py?view_name=%s" % view_name
- count = ""
+ count = ""
if not view.get("mustsearch"):
count = views.show_view(view, only_count = True)
- count = '<span class="ui-li-count">%d</span>' %
count
+ count = '<span
class="ui-li-count">%d</span>' % count
items.append((view.get("topic"), url, '%s %s' %
(view["title"], count)))
jqm_page_index(_("Check_MK Mobile"), items)
# Link to non-mobile GUI
- html.write('<ul data-role="listview"
data-inset="true">\n')
+
+ html.write('<hr>')
+ html.write('<ul data-role="listview" data-theme="b"
data-inset="true">\n')
html.write('<li><a data-ajax="false"
data-transition="fade" href="%s">%s</a></li>\n' %
("index.py?mobile=", _("Classical web GUI")))
html.write('</ul>\n')
jqm_page_footer()