ref: refs/heads/network
commit da9fb271b2b1b5b2885702cc7a2ca1261da29664
Author: Michal Zugec
Date: Thu Sep 24 19:23:44 2009 +0200
for configuration mode use combo box (bnc#540229)
---
.../network/app/controllers/network_controller.rb | 8 +++++++-
plugins/network/app/views/network/index.html.erb | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/plugins/network/app/controllers/network_controller.rb b/plugins/network/app/controllers/network_controller.rb
index 29c2f74..65c8f46 100644
--- a/plugins/network/app/controllers/network_controller.rb
+++ b/plugins/network/app/controllers/network_controller.rb
@@ -56,7 +56,13 @@ class NetworkController < ApplicationController
@nameservers = dns.nameservers
@searchdomains = dns.searches
@default_route = rt.via
-
+ #FIXME: this is ugly and keys are duplicated, but otherwise seems it doesn't work
+ @conf_modes = [["",""], ["static","static"], ["dhcp", "dhcp"]]
+ # if unknown item, just add it into list
+ found = false
+ @conf_modes.each {|a| found=true if a[0] == @conf_mode}
+ @conf_modes << [@conf_mode, @conf_mode] if !found
+
end
diff --git a/plugins/network/app/views/network/index.html.erb b/plugins/network/app/views/network/index.html.erb
index 50a20b1..104d2e4 100644
--- a/plugins/network/app/views/network/index.html.erb
+++ b/plugins/network/app/views/network/index.html.erb
@@ -34,7 +34,7 @@
</tr>
<tr>
<td class="first" width="120"><strong><%=_("Configuration Mode")%></strong></td>
- <td class="last"><%=text_field_tag :conf_mode, @conf_mode, :disabled => disabled %></td>
+ <td class="last"><%= select_tag(:conf_mode, options_for_select(@conf_modes, @conf_mode), :disabled => disabled)%></td>
</tr>
<tr>
<td class="first" width="120"><strong><%=_("IP Address")%></strong></td>
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org