Project

General

Profile

« Previous | Next » 

Revision 72479d52

Added by Ohad Levy over 10 years ago

fixes #3709 - explicitly say puppet environments vs just 'environments'

View differences:

app/helpers/environments_helper.rb
module EnvironmentsHelper
include PuppetclassesAndEnvironmentsHelper
def environments_title_actions
title_actions import_proxy_select(hash_for_import_environments_environments_path),
button_group(display_link_if_authorized(_('New Puppet Environment'), hash_for_new_environment_path))
end
end
app/views/environments/index.html.erb
<% title _("Environments") %>
<% title _('Puppet Environments') %>
<% title_actions import_proxy_select(hash_for_import_environments_environments_path), button_group(display_link_if_authorized(_("New Environment"), hash_for_new_environment_path)) %>
<%= environments_title_actions %>
<table class="table table-bordered table-striped table-two-pane">
<tr>
<th><%= sort :name, :as => s_("Environment|Name") %></th>
<th><%= sort :name, :as => s_('Environment|Name') %></th>
<th><%= _('Hosts') %></th>
<th></th>
</tr>
<% for environment in @environments %>
<% @environments.each do |environment| %>
<tr>
<td>
<%= link_to_if_authorized h(environment.name), hash_for_edit_environment_path(:id=> environment.name) %>
<%= link_to_if_authorized environment.name, hash_for_edit_environment_path(:id => environment.name) %>
</td>
<td><%= link_to @counter[environment.id] || 0, hosts_path(:search => "environment = #{environment}") %>
<td>
<%= action_buttons(link_to(_("Classes"), puppetclasses_path(:search => "environment = #{environment}")),
display_delete_if_authorized(hash_for_environment_path(:id => environment.name), :confirm => "Delete #{environment.name}?")) %>
<%= action_buttons(link_to(_('Classes'), puppetclasses_path(:search => "environment = #{environment}")),
display_delete_if_authorized(hash_for_environment_path(:id => environment.name), :confirm => "Delete #{environment.name}?")) %>
</td>
</tr>
<% end %>
</table>
<%= page_entries_info @environments %>
<%= will_paginate @environmentsS %>
<%= will_paginate @environments %>
app/views/environments/welcome.html.erb
<% title_actions import_proxy_select(hash_for_import_environments_environments_path), button_group(display_link_if_authorized(_("New Environment"), hash_for_new_environment_path)) %>
<% title _("Environment configuration") %>
<%= environments_title_actions %>
<% title _('Puppet environments configuration') %>
<div id="welcome">
<p>
<%= _('If you are planning to use Foreman as an external node classifier you should provide information about one or more environments.') %>
<%= _('This information is commonly imported from a pre-existing puppet configuration by the use of the') %>
<a href="http://www.theforeman.org/manuals/<%=SETTINGS[:version].short%>/index.html#4.2.2Classes" rel="external"><%= _('Puppet classes and environment importer') %></a>
<%= _('If you are planning to use Foreman as an external node classifier you should provide information about one or more environments.') %>
<%= _('This information is commonly imported from a pre-existing puppet configuration by the use of the') %>
<a href="http://www.theforeman.org/manuals/<%= SETTINGS[:version].short %>/index.html#4.2.2Classes" rel="external"><%= _('Puppet classes and environment importer') %></a>
</p>
<p>
<%= _('Environments may be manually created and only require the name of the environment to be declared.') %>
<%= _('Environments may be manually created and only require the name of the environment to be declared.') %>
</p>
</div>
test/integration/environment_test.rb
class EnvironmentTest < ActionDispatch::IntegrationTest
test "index page" do
assert_index_page(environments_path,"Environments","New Environment")
assert_index_page(environments_path,"Environments","New Puppet Environment")
end
test "create new page" do
assert_new_button(environments_path,"New Environment",new_environment_path)
assert_new_button(environments_path,"New Puppet Environment",new_environment_path)
fill_in "environment_name", :with => "golive"
assert_submit_button(environments_path)
assert page.has_link? 'golive'

Also available in: Unified diff