forked from OpenNeo/impress
Add basic zone info to simpler item previews
We're missing the feature where we enumerate the exact species in ambiguous cases, though!
This commit is contained in:
parent
5cbab5a766
commit
bd62476722
3 changed files with 43 additions and 1 deletions
|
@ -160,3 +160,26 @@ body.items-show
|
|||
select
|
||||
border-color: $error-border-color
|
||||
color: $error-color
|
||||
|
||||
.item-zones-info
|
||||
margin-top: .5em
|
||||
|
||||
h3
|
||||
display: inline
|
||||
font: inherit
|
||||
font-weight: bold
|
||||
&:after
|
||||
content: ": "
|
||||
|
||||
ul
|
||||
list-style-type: none
|
||||
display: inline
|
||||
|
||||
li
|
||||
display: inline
|
||||
&:not(:last-of-type):after
|
||||
content: ", "
|
||||
|
||||
.no-zones
|
||||
font-style: italic
|
||||
opacity: .85
|
||||
|
|
|
@ -287,7 +287,7 @@ class Item < ApplicationRecord
|
|||
options[:scope] ||= Zone.all
|
||||
all_body_ids = []
|
||||
zone_body_ids = {}
|
||||
selected_assets = swf_assets.select('body_id, zone_id').each do |swf_asset|
|
||||
selected_assets = swf_assets.each do |swf_asset|
|
||||
zone_body_ids[swf_asset.zone_id] ||= []
|
||||
body_ids = zone_body_ids[swf_asset.zone_id]
|
||||
body_ids << swf_asset.body_id unless body_ids.include?(swf_asset.body_id)
|
||||
|
|
|
@ -33,6 +33,25 @@
|
|||
"id", "human_name", @selected_preview_pet_type.species_id)
|
||||
= submit_tag "Go", name: nil
|
||||
|
||||
.item-zones-info
|
||||
%section
|
||||
%h3 Occupies
|
||||
- if @item.occupied_zones.present?
|
||||
%ul
|
||||
- @item.occupied_zones.sort_by(&:label).each do |zone|
|
||||
%li= zone.label
|
||||
- else
|
||||
%span.no-zones (None)
|
||||
|
||||
%section
|
||||
%h3 Restricts
|
||||
- if @item.restricted_zones.present?
|
||||
%ul
|
||||
- @item.restricted_zones.sort_by(&:label).each do |zone|
|
||||
%li= zone.label
|
||||
- else
|
||||
%span.no-zones (None)
|
||||
|
||||
- unless @contributors_with_counts.empty?
|
||||
#item-contributors
|
||||
%header #{t '.contributors.header'}:
|
||||
|
|
Loading…
Reference in a new issue