app/views/beer_db_admin/breweries/show.html.erb in beerdb-admin-0.1.1 vs app/views/beer_db_admin/breweries/show.html.erb in beerdb-admin-0.1.2
- old
+ new
@@ -15,22 +15,28 @@
<% if brewery.founded.present? %>
| <%= brewery.founded %>
<% end %>
||
- <%= image_tag_for_country( brewery.country ) %>
- <%= link_to brewery.country.title, short_country_path( brewery.country ) %>
-
+ <%= link_to_country( brewery.country, flag: true ) %>
+ - <%= brewery.beers.count %> Beers
+
<% if brewery.tags.count > 0 %>
<span class='tags tag-list'>
<%= render_tags( brewery.tags ) %>
</span>
<% end %>
</h3>
+<!-- add some quick search services for convenience
+ fix: move to shared ?? use render_brewery_actions() ???
+-->
+<%= render partial: 'actions', locals: { brewery: brewery } %>
+
+
<p>
<%= brewery.address %>
</p>
<% if brewery.web.present? %>
@@ -39,73 +45,35 @@
</p>
<% end %>
<!-- add all beers -->
-
<hr>
<ul>
<% brewery.beers.each do |beer| %>
<li>
- <%= link_to beer.title, beer_path( beer.id ) %>
-
- <% if beer.synonyms.present? %>
- • <%= beer.synonyms %>
- <% end %>
- /
- <% if beer.abv.present? %>
- <%= beer.abv %>
- <% else %>
- -
- <% end %>
- %
- <% if beer.plato.present? %>
- / <%= beer.plato %>°
- <% end %>
-
-<% if beer.tags.count > 0 %>
- /
- <span class='tags'>
- <% beer.tags.each_with_index do |tag,i| %>
- <% if i > 0 %>
- •
- <% end %>
- <%= tag.key %>
- <% end %>
- </span>
-<% end %>
-
-
-
+ <%= render_beer( beer ) %>
</li>
<% end %>
</ul>
<hr>
+<% if brewery.city.present? %>
+ <!-- check number of breweries !!! only if more than one!!! -->
+ <%= render_breweries_for_city( brewery.city ) %>
+<% end %>
+
+<hr>
+
<% if brewery.region.present? %>
<%= render_breweries_for_region( brewery.region ) %>
<% else %>
<%= render_breweries_for_country( brewery.country ) %>
<% end %><!-- if brewery.region.present? -->
-
<hr>
-<p>
- <% if brewery.city.present? %>
- <%= brewery.city.title %>
- <% else %>
- -
- <% end %>
- /
- <% if brewery.region.present? %>
- <%= brewery.region.title %>
- <% else %>
- -
- <% end %>
- /
- <%= image_tag_for_country( brewery.country ) %>
- <%= link_to brewery.country.title, short_country_path( brewery.country ) %>
-</p>
+<%= render_world_tree( brewery ) %>
+