forked from OpenNeo/impress
Refactor Item Getting Guide table rows to use a shared template
I'm gonna add more stuff like linking to the item page and stuff, and that's starting to get complex enough to not want to repeat myself!
This commit is contained in:
parent
8440a28898
commit
39c05b8dac
2 changed files with 13 additions and 15 deletions
4
app/views/items/_item_list_row.html.haml
Normal file
4
app/views/items/_item_list_row.html.haml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
%tr
|
||||||
|
%td.thumbnail-cell= item_thumbnail_for(item)
|
||||||
|
%td= item.name
|
||||||
|
%td.actions-cell= yield
|
|
@ -24,10 +24,7 @@
|
||||||
Buy all in NC Mall
|
Buy all in NC Mall
|
||||||
%tbody
|
%tbody
|
||||||
- @nc_mall_items.each do |item|
|
- @nc_mall_items.each do |item|
|
||||||
%tr
|
= render "item_list_row", item: do
|
||||||
%td.thumbnail-cell= item_thumbnail_for(item)
|
|
||||||
%td= item.name
|
|
||||||
%td.actions-cell
|
|
||||||
%button{onclick: "alert('Todo!')"}
|
%button{onclick: "alert('Todo!')"}
|
||||||
= cart_icon alt: ""
|
= cart_icon alt: ""
|
||||||
Buy (#{item.current_nc_price} NC)
|
Buy (#{item.current_nc_price} NC)
|
||||||
|
@ -50,10 +47,7 @@
|
||||||
Total: #{pluralize @np_items.size, "item"}
|
Total: #{pluralize @np_items.size, "item"}
|
||||||
%tbody
|
%tbody
|
||||||
- @np_items.each do |item|
|
- @np_items.each do |item|
|
||||||
%tr
|
= render "item_list_row", item: do
|
||||||
%td.thumbnail-cell= item_thumbnail_for(item)
|
|
||||||
%td= item.name
|
|
||||||
%td.actions-cell
|
|
||||||
= button_link_to "Shops", shop_wizard_url_for(item),
|
= button_link_to "Shops", shop_wizard_url_for(item),
|
||||||
target: "_blank", icon: search_icon
|
target: "_blank", icon: search_icon
|
||||||
= button_link_to "Trades", trading_post_url_for(item),
|
= button_link_to "Trades", trading_post_url_for(item),
|
||||||
|
|
Loading…
Reference in a new issue