Mailinglist Archive: yast-commit (883 mails)

< Previous Next >
[yast-commit] <web-client> master : improved layout
  • From: Stefan Schubert <schubi@xxxxxxx>
  • Date: Fri, 10 Jul 2009 12:40:59 +0200
  • Message-id: <E1MPDXi-0001rW-59@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit bc63564ec9300e89f76da243c40c420f285e9644
Author: Stefan Schubert <schubi@xxxxxxx>
Date: Fri Jul 10 12:40:59 2009 +0200

improved layout
---
.../status/app/controllers/status_controller.rb | 8 ++++++--
plugins/status/app/views/status/index.html.erb | 10 +++++++---
2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/plugins/status/app/controllers/status_controller.rb
b/plugins/status/app/controllers/status_controller.rb
index 8dda8eb..ea56bc8 100644
--- a/plugins/status/app/controllers/status_controller.rb
+++ b/plugins/status/app/controllers/status_controller.rb
@@ -73,13 +73,17 @@ class StatusController < ApplicationController
end
end
graph_list = []
+ store_data = false #take only a list which has one value greater than
0 at least
for i in 0..list_value.size-1
+ store_data = true if list_value[i] != 0
value_list = [i]
value_list << list_value[i]
graph_list << value_list
end
- group_map[label_name] = graph_list
- @data_group[key_split[1]] = group_map
+ if store_data
+ group_map[label_name] = graph_list
+ @data_group[key_split[1]] = group_map
+ end
else
logger.error "empty key: #{@key} #{list.inspect}"
end
diff --git a/plugins/status/app/views/status/index.html.erb
b/plugins/status/app/views/status/index.html.erb
index 924e91f..2732b1c 100644
--- a/plugins/status/app/views/status/index.html.erb
+++ b/plugins/status/app/views/status/index.html.erb
@@ -3,8 +3,12 @@

<% last = false %>
<% @data_group.each do |key, map| %>
- <h3><%= key.capitalize %></h3>
- <br><br>
+ <% if last %>
+ <br style='clear: both'>
+ <% last = !last %>
+ <% end %>
+ <h3><%= key.tr('_',' ').capitalize %></h3>
+
<% map.each do |graph_key, list_value| %>
<% graph_id = key + "_" + graph_key.tr('/','_') %>
<%= graph(graph_id, 400, 300, last) %>
@@ -37,7 +41,7 @@ function plotLineGraph(graph_id, graph_title, graph_data ) {
<% map.each do |graph_key, list_value| %>
<% graph_id = key + "_" + graph_key.tr('/','_') %>
$('#' + '<%= graph_id %>').html("");
- plotLineGraph('<%= graph_id %>', '<%= graph_key %>', [<%=
list_value.inspect %>]);
+ plotLineGraph('<%= graph_id %>', '<%= graph_key.tr('/','_').tr('_','
').capitalize %>', [<%= list_value.inspect %>]);
<% end %>
<% end %>
});
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >