app/views/cookbooks/index.html.haml in chef-server-webui-0.9.18 vs app/views/cookbooks/index.html.haml in chef-server-webui-0.10.0.beta.0
- old
+ new
@@ -1,12 +1,27 @@
.block#block-tables
.content
- %h2.title Cookbooks
+ %h2.title
+ Cookbooks
.inner
- %table.table
+ %table.table#cookbook_version_table
%thead
%tr
- %th.first Cookbook Name
- %tbody
- - @cl.sort.each_with_index do |cookbook, index|
- %tr{:class => "#{index % 2 == 1 ? 'odd' : 'even'}"}
- %td= link_to cookbook[0], url(:cookbook, { :id => cookbook[0] })
+ %th Cookbook
+ %th Latest Version
+ %th Other Versions
+ %tbody.cookbook_versions
+ - @cl.keys.sort.each do |cookbook|
+ - versions = @cl[cookbook]
+ %tr
+ %td= cookbook
+ %td
+ %ul.cookbook_versions{ :id => "#{cookbook}_versions" }
+ - versions[0..4].each_with_index do |v, i|
+ - klass = i > 0 ? "other_version" : "latest_version"
+ %li{ :class => klass }
+ = link_to(v["version"], v["url"])
+ - if versions.length > 5
+ = all_versions_link(cookbook)
+ %td.show_more
+ = versions.length > 1 ? more_versions_link(cookbook) : ""
+= js_include_tag "cookbook_versions"