[#369] add visibility icon to platforms
This commit is contained in:
parent
bdcbcdd197
commit
d7d3ddfbd9
|
@ -25,4 +25,9 @@ module PlatformsHelper
|
|||
settings.sort_by{ |s| s.arch.name }
|
||||
end
|
||||
|
||||
def fa_platform_visibility_icon(platform)
|
||||
return nil unless platform
|
||||
image, color = platform.hidden? ? ['lock', 'text-danger fa-fw']: ['unlock-alt', 'text-success fa-fw']
|
||||
fa_icon(image, class: color)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,10 +5,13 @@
|
|||
%table.table.table-hover.offset20
|
||||
%thead
|
||||
%tr
|
||||
%th
|
||||
%th= t 'activerecord.attributes.platform.name'
|
||||
%th= t 'activerecord.attributes.platform.distrib_type'
|
||||
%tbody
|
||||
%tr{ 'ng-repeat' => 'item in platforms' }
|
||||
%td
|
||||
%i.fa.fa-lg{ 'ng-class' => 'item.visibility_class' }
|
||||
%td
|
||||
%a{ 'ng-href' => "{{item.link}}" }
|
||||
{{item.name}}
|
||||
|
|
|
@ -4,6 +4,7 @@ json.platforms do
|
|||
json.name platform_printed_name(item)
|
||||
json.link platform_path(item)
|
||||
json.distrib_type item.distrib_type
|
||||
json.visibility_class fa_platform_visibility_icon(item)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue