Compare commits
2 commits
59da1fa04d
...
77872311e6
| Author | SHA1 | Date | |
|---|---|---|---|
| 77872311e6 | |||
| c78c0cb237 |
2 changed files with 24 additions and 4 deletions
|
|
@ -15,15 +15,25 @@ class AltStylesController < ApplicationController
|
||||||
@alt_styles.merge!(@color.alt_styles) if @color
|
@alt_styles.merge!(@color.alt_styles) if @color
|
||||||
@alt_styles.merge!(@species.alt_styles) if @species
|
@alt_styles.merge!(@species.alt_styles) if @species
|
||||||
|
|
||||||
# We're using the HTML5 image for our preview, so make sure we have all the
|
|
||||||
# manifests ready!
|
|
||||||
SwfAsset.preload_manifests @alt_styles.map(&:swf_assets).flatten
|
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
@alt_styles = @alt_styles.
|
@alt_styles = @alt_styles.
|
||||||
by_creation_date.order(:color_id, :species_id, :series_name).
|
by_creation_date.order(:color_id, :species_id, :series_name).
|
||||||
paginate(page: params[:page], per_page: 30)
|
paginate(page: params[:page], per_page: 30)
|
||||||
|
|
||||||
|
# We're using the HTML5 image for our preview, so make sure we have all the
|
||||||
|
# manifests ready!
|
||||||
|
SwfAsset.preload_manifests @alt_styles.map(&:swf_assets).flatten
|
||||||
|
|
||||||
|
if support_staff?
|
||||||
|
@counts = {
|
||||||
|
total: AltStyle.count,
|
||||||
|
unlabeled: AltStyle.unlabeled.count,
|
||||||
|
}
|
||||||
|
@counts[:labeled] = @counts[:total] - @counts[:unlabeled]
|
||||||
|
@unlabeled_style = AltStyle.unlabeled.newest.first
|
||||||
|
end
|
||||||
|
|
||||||
render
|
render
|
||||||
}
|
}
|
||||||
format.json {
|
format.json {
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,16 @@
|
||||||
|
|
||||||
[1]: https://www.neopets.com/mall/stylingstudio/
|
[1]: https://www.neopets.com/mall/stylingstudio/
|
||||||
|
|
||||||
|
- if support_staff?
|
||||||
|
%p
|
||||||
|
%strong 💡 Support summary:
|
||||||
|
✅ #{number_with_delimiter @counts[:labeled]} labeled
|
||||||
|
- if @unlabeled_style
|
||||||
|
+ ❓️
|
||||||
|
= link_to "#{number_with_delimiter @counts[:unlabeled]} unlabeled",
|
||||||
|
edit_alt_style_path(@unlabeled_style, next: "unlabeled-style")
|
||||||
|
\= #{number_with_delimiter @counts[:total]} total
|
||||||
|
|
||||||
= form_with url: alt_styles_path, method: :get,
|
= form_with url: alt_styles_path, method: :get,
|
||||||
class: "rainbow-pool-filters" do |f|
|
class: "rainbow-pool-filters" do |f|
|
||||||
%fieldset
|
%fieldset
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue