Module: check_mk
Branch: master
Commit: 82f9355674892487dc5321ee863ca20b33f8a809
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=82f93556748924…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Jun 8 20:54:59 2011 +0200
WATO: improve layout
---
web/htdocs/check_mk.css | 35 +++++++++++++++++++++++++++++++++++
web/htdocs/wato.py | 26 +++++++++++++-------------
2 files changed, 48 insertions(+), 13 deletions(-)
diff --git a/web/htdocs/check_mk.css b/web/htdocs/check_mk.css
index c8be9b8..347969b 100644
--- a/web/htdocs/check_mk.css
+++ b/web/htdocs/check_mk.css
@@ -1721,6 +1721,41 @@ table.add_snapin i {
.wato div.inherited h3 a {
color: #468;
}
+
+/* Path to current folder at top of screen */
+.wato div.folderpath {
+ margin-bottom: 6px;
+}
+.wato div.folderpath a,
+.wato div.folderpath b {
+ -moz-border-radius: 3px;
+ background-color: #eee;
+ padding: 1px 5px;
+ color: #468;
+}
+.wato div.folderpath a {
+/* color: #46c; */
+ font-weight: bold;
+ text-decoration: none;
+}
+.wato div.folderpath a:hover {
+ color: black;
+ background-color: #fff;
+ /* text-decoration: underline; */
+}
+
+/* Information boxes displayed directly in the data area */
+.wato div.info {
+ margin-top: 10px;
+ marign-bottom: 10px;
+ padding: 5px 8px;
+ width: 800px;
+ -moz-border-radius: 3px;
+ background-image: url("images/form_background.png");
+ background-repeat: repeat;
+}
+
+
/*
____
| _ \ _ __ ___ __ _ _ __ ___ ___ ___
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 93587f1..3f27d41 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -196,6 +196,7 @@ def mode_folder(phase):
raise MKGeneralException(_("You called this page with a non-existing
folder/file %s") % delname)
else:
+ render_folder_path()
show_filefolder_list(g_folder, "folder", _("Subfolders"))
show_filefolder_list(g_folder, "file", _("Host lists"))
@@ -563,10 +564,10 @@ def mode_file(phase):
return "bulkcleanup"
elif len(g_hosts) == 0:
- html.write(_("There are no hosts in this file."))
+ render_folder_path()
+ html.write("<div class=info>" + _("There are no hosts in
this file.") + "</div>")
else:
- html.write(_("Hosts in file "))
render_folder_path()
html.write("<p>")
@@ -758,7 +759,7 @@ def mode_edithost(phase, new):
html.write('<table class="form">\n')
# host name
- html.write("<tr><td class=legend>" +
_("Hostname") + "</td><td class=content></td><td
class=content>")
+ html.write("<tr><td class=legend colspan=2>" +
_("Hostname") + "</td><td class=content>")
if hostname and mode == "edit":
html.write(hostname)
else:
@@ -772,7 +773,7 @@ def mode_edithost(phase, new):
html.button("save", _("Save & Finish"),
"submit")
if not new:
html.button("delete", _("Delete host!"),
"submit")
- html.button("services", _("Save & got to Services"),
"submit")
+ html.button("services", _("Save & go to Services"),
"submit")
html.write("</td></tr>\n")
html.write("</table>\n")
html.hidden_fields()
@@ -853,7 +854,7 @@ def mode_search(phase):
html.write("<table class=form>")
# host name
- html.write("<tr><td class=legend>" +
_("Hostname") + "</td><td class=content></td><td
class=content>")
+ html.write("<tr><td class=legend colspan=2>" +
_("Hostname") + "</td><td class=content>")
html.text_input("host")
html.set_focus("host")
html.write("</td></tr>\n")
@@ -931,10 +932,7 @@ def search_hosts_in_file(the_folder, the_file, crit):
found.append((hostname, host, effective))
if found:
- render_folder_path(the_folder, 0, True)
- file_url = make_link_to([("mode", "file")],
the_folder[".path"], the_file[".name"])
- html.write(' / <a href="%s">%s</a>' % (file_url,
the_file["title"]))
- html.write(":")
+ render_folder_path(the_folder, the_file, True)
found.sort()
html.write("<table class=data><tr><th>%s</th>"
% (_("Hostname"), ))
for attr in host_attributes:
@@ -2132,12 +2130,14 @@ def move_host_to(hostname, target_filename):
move_hosts_to([hostname], target_filename)
def render_folder_path(the_folder = 0, the_file = 0, link_to_last = False):
+
if the_folder == 0:
the_folder = g_folder
the_file = g_file
def render_component(p, title):
- return '<a href="%s">%s</a>' % (make_link_to([],
path), title)
+ return '<a href="%s">%s</a>' % (
+ html.makeuri_contextless([("filename", "/" +
"/".join(p))]), title)
path = ()
comps = []
@@ -2153,12 +2153,12 @@ def render_folder_path(the_folder = 0, the_file = 0, link_to_last
= False):
if link_to_last:
comps.append(render_component(the_file[".path"],
the_file["title"]))
else:
- comps.append(the_file["title"])
+ comps.append("<b>" + the_file["title"] +
"</b>")
if not the_file and not link_to_last:
- comps.append(the_folder["title"])
+ comps.append("<b>" + the_folder["title"] +
"</b>")
- html.write(" / ".join(comps))
+ html.write("<div class=folderpath>%s</div>\n" % " /
".join(comps))
# +----------------------------------------------------------------------+
# | ____ |