Project

General

Profile

Download (4.32 KB) Statistics
| Branch: | Tag: | Revision:
<% breadcrumbs(
switchable: false,
items: [
{
caption: _("Audits"),
url: (url_for(audits_path) if authorized_for(hash_for_hosts_path))
},
{
caption: "#{@audit.action.camelize} #{audited_type @audit}: #{audit_title @audit}"
},
]
) %>
<%= title_actions link_to_if_authorized(_("Host details"),
hash_for_host_path(:id => @audit.auditable.to_param).merge(:auth_object => @audit.auditable, :auth_action => 'view'),
:title => _("Host details"),
:class => 'btn btn-info') if @audit.auditable_type == 'Host::Base' && @audit.auditable %>
<%= title_actions link_to_if_authorized(_("Associated Host"),
hash_for_host_path(:id => @audit.associated.to_param).merge(:auth_object => @audit.associated, :auth_action => 'view'),
:title => _("Host details"),
:class => 'btn btn-default') if @audit.auditable_type.match(/^Nic/) && @audit.associated_type == 'Host::Base' && @audit.associated %>
<% tmplt = audit_template?(@audit) %>

<div class="tabbable">
<ul class="nav nav-tabs">
<% if tmplt %>
<li class="active"><a href="#tab0" data-toggle="tab"><%= _('Template Diff') %></a></li>
<% end %>
<li class='<%= "active" unless tmplt %>' ><a href="#tab1" data-toggle="tab"><%= _('Details') %></a></li>
<li><a href="#tab2" data-toggle="tab"><%= _('History') %></a></li>
</ul>
<div class="tab-content">
<% if tmplt %>
<div class="tab-pane active" id="tab0">
<%= render 'provisioning_templates/diff', :templates => @audit.audited_changes["template"], :file_name => audit_title(@audit) %>
</div>
<% end %>
<div class='tab-pane <%= "active" unless tmplt%>' id="tab1">
<div class="row">
<h3 class="col-md-12"><%= _("Audit Metadata:") %></h3>
</div>
<div class="row">
<strong class="col-md-2"><%= _("Audit Time:")%></strong>
<div class="col-md-10"><%= audit_time(@audit) %></div>
</div>
<div class="row">
<strong class="col-md-2"><%= _("User Name:")%></strong>
<div class="col-md-10"><%= audit_user(@audit) %></div>
</div>
<% if Taxonomy.organizations_enabled %>
<div class="row">
<strong class="col-md-2"><%= _("Affected Organizations:")%></strong>
<div class="col-md-10"><%= audit_affected_organizations(@audit) %></div>
</div>
<% end %>
<% if Taxonomy.locations_enabled %>
<div class="row">
<strong class="col-md-2"><%= _("Affected Locations:")%></strong>
<div class="col-md-10"><%= audit_affected_locations(@audit) %></div>
</div>
<% end %>
<hr/>
<h3><%= _("Changes:") %></h3>
<table class="<%= table_css_classes %>">
<% if @audit.audited_changes.key?("template") && @audit.audited_changes.size == 1 %>
<%= alert :class => 'alert-info', :header => _('There are no changes'), :text => _(' in the provisioning template.') %>
<%else%>
<thead>
<tr>
<th><%= _('Item') %></th>
<% if @audit.action == 'update' %>
<th><%= _('Old') %></th>
<th><%= _('New') %></th>
<% else %>
<th><%= _('Value') %></th>
<% end %>
</tr>
</thead>
<% end %>
<tbody>
<% @audit.audited_changes.each do |name,change| %>
<% next if change.nil? or change.to_s.empty? %>
<% next if name == "template" %>
<tr>
<td><%= name.humanize %></td>
<% if @audit.action == 'update' %>
<% change.each do |v| %>
<td><%= id_to_label(name,v,false) %></td>
<% end %>
<% else %>
<td><%= id_to_label(name,change,false) %></td>
<% end %>
</tr>
<% end %>
</tbody>
</table>
<% unless @audit.comment.blank? %>
<%= alert(:class => 'alert-info', :close => false, :header => '', :text => @audit.comment) %>
<% end %>
</div>
<div class="tab-pane" id="tab2">
<%= render :partial => 'list', :locals =>{:audits => @history} %>
</div>
</div>
</div>
(3-3/3)