foreman/app/views/audits/show.html.erb @ 38f854cd
833e2aef | Amir Fefer | <% 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}"
|
|||
},
|
|||
]
|
|||
) %>
|
|||
3dfb6e4c | Dominic Cleal | <%= title_actions link_to_if_authorized(_("Host details"),
|
|
acfbc458 | Marek Hulan | hash_for_host_path(:id => @audit.auditable.to_param).merge(:auth_object => @audit.auditable, :auth_action => 'view'),
|
|
3dfb6e4c | Dominic Cleal | :title => _("Host details"),
|
|
1f6a9b2c | Ivan Nečas | :class => 'btn btn-info') if @audit.auditable_type == 'Host::Base' && @audit.auditable %>
|
|
2a663a34 | Timo Goebel | <%= 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 %>
|
|||
acfbc458 | Marek Hulan | <% tmplt = audit_template?(@audit) %>
|
|
09ce1364 | Amos Benari | ||
<div class="tabbable">
|
|||
<ul class="nav nav-tabs">
|
|||
4d4557e9 | Joseph Magen | <% 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>
|
|||
09ce1364 | Amos Benari | </ul>
|
|
<div class="tab-content">
|
|||
4d4557e9 | Joseph Magen | <% if tmplt %>
|
|
09ce1364 | Amos Benari | <div class="tab-pane active" id="tab0">
|
|
510d53cd | Marek Hulan | <%= render 'provisioning_templates/diff', :templates => @audit.audited_changes["template"], :file_name => audit_title(@audit) %>
|
|
09ce1364 | Amos Benari | </div>
|
|
<% end %>
|
|||
29972d83 | Amos Benari | <div class='tab-pane <%= "active" unless tmplt%>' id="tab1">
|
|
682269f4 | Tomer Brisker | <div class="row">
|
|
<h3 class="col-md-12"><%= _("Audit Metadata:") %></h3>
|
|||
</div>
|
|||
<div class="row">
|
|||
<strong class="col-md-2"><%= _("Audit Time:")%></strong>
|
|||
af09d634 | Marek Hulan | <div class="col-md-10"><%= audit_time(@audit) %></div>
|
|
682269f4 | Tomer Brisker | </div>
|
|
<div class="row">
|
|||
<strong class="col-md-2"><%= _("User Name:")%></strong>
|
|||
af09d634 | Marek Hulan | <div class="col-md-10"><%= audit_user(@audit) %></div>
|
|
682269f4 | Tomer Brisker | </div>
|
|
<% if Taxonomy.organizations_enabled %>
|
|||
<div class="row">
|
|||
<strong class="col-md-2"><%= _("Affected Organizations:")%></strong>
|
|||
af09d634 | Marek Hulan | <div class="col-md-10"><%= audit_affected_organizations(@audit) %></div>
|
|
682269f4 | Tomer Brisker | </div>
|
|
<% end %>
|
|||
<% if Taxonomy.locations_enabled %>
|
|||
<div class="row">
|
|||
<strong class="col-md-2"><%= _("Affected Locations:")%></strong>
|
|||
af09d634 | Marek Hulan | <div class="col-md-10"><%= audit_affected_locations(@audit) %></div>
|
|
682269f4 | Tomer Brisker | </div>
|
|
<% end %>
|
|||
<hr/>
|
|||
<h3><%= _("Changes:") %></h3>
|
|||
ff9de7d6 | Ondrej Prazak | <table class="<%= table_css_classes %>">
|
|
d79cc18d | Shira Maximov | <% 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 %>
|
|||
e77dd577 | Shimon Shtein | <tbody>
|
|
4d4557e9 | Joseph Magen | <% @audit.audited_changes.each do |name,change| %>
|
|
e77dd577 | Shimon Shtein | <% next if change.nil? or change.to_s.empty? %>
|
|
<% next if name == "template" %>
|
|||
<tr>
|
|||
<td><%= name.humanize %></td>
|
|||
38f854cd | Tomer Brisker | <% if @audit.action == 'update' %>
|
|
d79cc18d | Shira Maximov | <% change.each do |v| %>
|
|
<td><%= id_to_label(name,v,false) %></td>
|
|||
<% end %>
|
|||
e77dd577 | Shimon Shtein | <% else %>
|
|
d79cc18d | Shira Maximov | <td><%= id_to_label(name,change,false) %></td>
|
|
e77dd577 | Shimon Shtein | <% end %>
|
|
</tr>
|
|||
4d4557e9 | Joseph Magen | <% end %>
|
|
e77dd577 | Shimon Shtein | </tbody>
|
|
09ce1364 | Amos Benari | </table>
|
|
59e7136a | Shlomi Zadok | <% unless @audit.comment.blank? %>
|
|
d79cc18d | Shira Maximov | <%= alert(:class => 'alert-info', :close => false, :header => '', :text => @audit.comment) %>
|
|
59e7136a | Shlomi Zadok | <% end %>
|
|
09ce1364 | Amos Benari | </div>
|
|
<div class="tab-pane" id="tab2">
|
|||
de3fb0d7 | Amos Benari | <%= render :partial => 'list', :locals =>{:audits => @history} %>
|
|
09ce1364 | Amos Benari | </div>
|
|
</div>
|
|||
</div>
|