Skip to content

Commit bf8fb05

Browse files
Add implementation status to rubies#show
1 parent 936c879 commit bf8fb05

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

‎config.rb‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,17 @@ def link_to_implementation_website slug
5151
link_to implementation_website(slug), implementation_website(slug)
5252
end
5353

54-
def implementation_slugs
55-
data.implementations.keys
54+
def implementation_status slug
55+
data.status.select { |_status, rubies| rubies.include? slug }.keys.first
56+
end
57+
58+
def implementation_status_color slug
59+
status = implementation_status(slug).to_sym
60+
{
61+
main: :primary,
62+
alternative: :info,
63+
inactive: :danger
64+
}[status]
5665
end
5766
end
5867

‎source/rubies/show.html.erb‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
<h1 class='display-1'><%= implementation_name slug %></h1>
2+
<span class='badge bg-<%= implementation_status_color slug %> text-uppercase'>
3+
<%= implementation_status slug %>
4+
</span>

0 commit comments

Comments
 (0)