-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Paul Kelly
committed
Oct 4, 2010
1 parent
9282caa
commit 251af69
Showing
4 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module ApplicationHelper | ||
def settings_dropdown | ||
choices = [ | ||
['Additional Settings', ""], | ||
['Architectures', architectures_url], | ||
['Domains', domains_url], | ||
['Environments', environments_url], | ||
["External Variables", lookup_keys_url], | ||
['Global Parameters', common_parameters_url], | ||
['Hardware Models', models_url], | ||
['Host Groups', hostgroups_url], | ||
['Installation Medias', medias_url], | ||
['LDAP Authentication', auth_source_ldaps_url], | ||
['Operating Systems', operatingsystems_url], | ||
['Partition Tables', ptables_url], | ||
['Puppet Classes', puppetclasses_url], | ||
['Subnets', subnets_url] | ||
] | ||
choices += [ | ||
['Users', users_url], | ||
['Usergroups', usergroups_url] | ||
] if SETTINGS[:login] | ||
|
||
concat( | ||
content_tag(:select, :id => "settings_dropdown") do | ||
options_for_select choices, :selected => @controller.request.url | ||
end | ||
) | ||
concat( | ||
observe_field('settings_dropdown', :function => "window.location.href = value;") | ||
) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<% field_set_tag 'Unattended settings', :id => "unattended" do -%> | ||
<% field_set_tag 'Network settings', :id => "network" do -%> | ||
<table> | ||
<tr> | ||
<td>Domain</td> | ||
<td><%= f.collection_select :domain_id, Domain.all, :id, :to_label %></td> | ||
<td>Subnet</td> | ||
<td><%= f.collection_select :subnet_id, Subnet.all, :id, :to_label %></td> | ||
<td>IP</td> | ||
<td><%= f.text_field :ip, :size => 16 %></td> | ||
<td>MAC</td> | ||
<td><%= f.text_field :mac, :size => 17 %></td> | ||
</tr> | ||
</table> | ||
<% end -%> | ||
|
||
<% field_set_tag 'Operating system settings', :id => "operatingsystem" do -%> | ||
<table> | ||
<tr> | ||
<td colspan="6"> | ||
<span id="architecture"> | ||
Architecture | ||
<%= f.collection_select :architecture_id, Architecture.all, :id, :to_label, :include_blank => true %> | ||
<span id="host_os"> | ||
<% if @architecture -%> | ||
<%= render "architecture" -%> | ||
<% end -%> | ||
</span> | ||
</span> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>Root password</td> | ||
<td><%= f.password_field :root_pass %></td> | ||
<td>Model</td> | ||
<td><%= f.collection_select :model_id, Model.all, :id, :to_label, :include_blank => true %></td> | ||
<td>Serial</td> | ||
<td><%= f.select :serial, ["","0,9600n8","0,19200n8","1,9600n8","1,19200n8"] %></td> | ||
</tr> | ||
</table> | ||
<%= link_to_function "Switch to custom disk layout", toggle_div("custom_disk") %> <br/> | ||
<span id="custom_disk" style="display:<%= @host.disk.empty? ? "none" : "inline" %>;"> | ||
<%= f.text_area :disk, :size => "80x10", :title => 'Use custom Disk layout' %><br/> | ||
<small>What ever text you use in here, would be used as your OS disk layout options<br/> | ||
If you want to use the partition table option, delete all of the text from this field | ||
</small> | ||
</span> | ||
<% end -%> | ||
|
||
<% end -%> | ||
|
||
<%= observe_field(:host_architecture_id, | ||
:url => { :action => :architecture_selected, :id => @host.id }, | ||
:update => :host_os, | ||
:with => :architecture_id) | ||
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
ActiveSupport::Dependencies.load_once_paths.delete File.dirname(__FILE__) | ||
# Patch the host with a transactional update facility that we use to hook our update code | ||
require 'netdb_manager/host_ext' | ||
|
||
# Rails Engines works against us in some ways as it ensures that the last loaded module overrides the first. | ||
# As the application's version of application_helper.rb is loaded last it overrides our overrides. | ||
# Never mind, just load our overrides again, as the last loaded module. Maybe I should drop engines. . . . | ||
require_or_load File.join(File.dirname(__FILE__), '..',"app", "helpers", "application_helper.rb") | ||
|
||
#HostsController.prepend_view_path(File.join(File.dirname(__FILE__), '..', 'app', 'views')) | ||
|
||
# If we define a view then this is the one we should use. | ||
Engines.disable_application_view_loading = true |