Skip to content

Commit

Permalink
Don't render table header for empty automate domain and namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
mzazrivec committed Aug 2, 2018
1 parent fa447ea commit e3a6804
Showing 1 changed file with 25 additions and 21 deletions.
46 changes: 25 additions & 21 deletions app/views/miq_ae_class/_ns_details.html.haml
@@ -1,24 +1,28 @@
#ns_details_div
- unless @in_a_form
= render :partial => 'layouts/info_msg', :locals => {:message => @version_message} if @version_message
%table#ns_details_grid.table.table-striped.table-bordered.table-hover.table-clickable.table-checkable
%thead
%th.table-view-pf-select
%input.checkall{:type => 'checkbox', :title => _('Check All')}
%th
%th
%tbody{'data-click-url' => '/miq_ae_class/tree_select/'}
- @records.each do |record|
- next if record.name == '$'
- cls_cid = "#{class_prefix(record.class)}-#{record.id}"
%tr{'data-click-id' => cls_cid}
%td.table-view-pf-select.noclick
%input{:type => 'checkbox', :value => cls_cid}
%td.table-view-pf-select
%i{:class => record.decorate.fonticon}
%td
= record_name(record)
:javascript
$(function () {
$('#ns_details_grid').miqGrid();
});
- if @records.length.zero?
- info_message = @record.class.to_s == 'MiqAeDomain' ? _("The selected domain is empty") : _("The selected Namespace is empty")
= render :partial => 'layouts/info_msg', :locals => {:message => info_message}
- else
%table#ns_details_grid.table.table-striped.table-bordered.table-hover.table-clickable.table-checkable
%thead
%th.table-view-pf-select
%input.checkall{:type => 'checkbox', :title => _('Check All')}
%th
%th
%tbody{'data-click-url' => '/miq_ae_class/tree_select/'}
- @records.each do |record|
- next if record.name == '$'
- cls_cid = "#{class_prefix(record.class)}-#{record.id}"
%tr{'data-click-id' => cls_cid}
%td.table-view-pf-select.noclick
%input{:type => 'checkbox', :value => cls_cid}
%td.table-view-pf-select
%i{:class => record.decorate.fonticon}
%td
= record_name(record)
:javascript
$(function () {
$('#ns_details_grid').miqGrid();
});

0 comments on commit e3a6804

Please sign in to comment.