1
0
Fork 0
forked from OpenNeo/impress

Delete outfits/show page, point to the editor instead

Now, like in DTI 2020, opening an outfit will go straight to the editor.

I'm not 100% on whether this is actually like. the superior behavior?
But I think it's good enough, and it's what the wardrobe-2020 code
expects, so let's just roll with it for now!
This commit is contained in:
Emi Matchu 2023-10-24 18:02:18 -07:00
parent 3d07d7f360
commit 5ba711a413
11 changed files with 13 additions and 121 deletions

View file

@ -1,10 +0,0 @@
var main_wardrobe = new Wardrobe(), View = Wardrobe.getStandardView({
Preview: {
swf_url: '/swfs/preview.swf?v=0.12',
wrapper: $('#preview-wrapper'),
placeholder: $('#preview-swf')
}
});
main_wardrobe.registerViews(View);
main_wardrobe.initialize();
main_wardrobe.outfits.loadData(INITIAL_OUTFIT_DATA);

View file

@ -20,7 +20,6 @@
@import items/show @import items/show
@import outfits/index @import outfits/index
@import outfits/new @import outfits/new
@import outfits/show
@import pets/bulk @import pets/bulk
@import static/image_mode @import static/image_mode
@import static/pardon_our_dust @import static/pardon_our_dust

View file

@ -1,37 +0,0 @@
@import "partials/campaign-progress"
body.outfits-show
+campaign-progress
#title
float: left
#outfit-wardrobe-link
float: left
font-size: 85%
margin:
left: 2em
top: .75em
#outfit-user
float: right
margin-top: 1em
#prank-color-message
clear: both
#preview-wrapper
clear: both
height: 600px
margin: 0 auto 1em
position: relative
width: 600px
#preview-swf
left: 0
position: absolute
top: 0
#outfit-items
text-align: center

View file

@ -81,11 +81,7 @@ class OutfitsController < ApplicationController
def show def show
@outfit = Outfit.find(params[:id]) @outfit = Outfit.find(params[:id])
@campaign = Campaign.current rescue nil render "outfits/edit", layout: false
respond_to do |format|
format.html { render }
format.json { render :json => @outfit }
end
end end
def start def start

View file

@ -81,16 +81,6 @@ module OutfitsHelper
content_tags = contents.map { |c| content_tag(:p, c) } content_tags = contents.map { |c| content_tag(:p, c) }
content_tags.join('').html_safe content_tags.join('').html_safe
end end
def outfit_creation_summary(outfit)
user = outfit.user
user_link = link_to(user.name, user_contributions_path(user))
created_at_ago = content_tag(:abbr, time_ago_in_words(@outfit.created_at),
:title => @outfit.created_at)
translate 'outfits.show.creation_summary_html',
:user_link => user_link,
:created_at_ago => created_at_ago
end
def outfit_li_for(outfit, &block) def outfit_li_for(outfit, &block)
class_name = outfit.starred? ? 'starred' : nil class_name = outfit.starred? ? 'starred' : nil
@ -106,18 +96,5 @@ module OutfitsHelper
options = {:spellcheck => false, :id => nil}.merge(options) options = {:spellcheck => false, :id => nil}.merge(options)
text_field_tag 'name', nil, options text_field_tag 'name', nil, options
end end
def prank_color_message(unfunny_human_name, artist_name, artist_url)
content_key_base = Color.pranks_funny? ? 'funny' : 'unfunny'
if artist_url
artist = link_to(artist_name, artist_url,
:class => 'prank-color-message-artist')
else
artist = artist_name
end
content = t("colors.prank_message.#{content_key_base}_html",
color: unfunny_human_name, artist: artist)
content_tag('p', content, id: 'prank-color-message', :class => 'warning')
end
end end

View file

@ -1,11 +1,22 @@
- title(@outfit.name || t('.default_outfit_name'))
- if @outfit
- open_graph type: 'openneo-impress:outfit', title: yield(:title),
url: outfit_url(@outfit)
- if @outfit.image?
- open_graph image: absolute_url(@outfit.image.url)
!!! 5 !!! 5
%html %html
%head %head
%meta{charset: 'utf-8'} %meta{charset: 'utf-8'}
%meta{name: 'viewport', content: 'width=device-width, initial-scale=1'} %meta{name: 'viewport', content: 'width=device-width, initial-scale=1'}
%title Dress to Impress %title
- if content_for? :title
= yield :title
| #{t 'app_name'}
%link{href: image_path('favicon.png'), rel: 'icon'} %link{href: image_path('favicon.png'), rel: 'icon'}
= stylesheet_link_tag 'fonts' = stylesheet_link_tag 'fonts'
= javascript_include_tag 'wardrobe-2020-page', defer: true = javascript_include_tag 'wardrobe-2020-page', defer: true
= open_graph_tags
%body %body
#wardrobe-2020-root #wardrobe-2020-root

View file

@ -1,31 +0,0 @@
- title(@outfit.name || t('.default_outfit_name'))
- content_for :before_title, advertise_campaign_progress(@campaign)
- open_graph :type => 'openneo-impress:outfit', :title => yield(:title),
:url => outfit_url(@outfit)
- if @outfit.image?
- open_graph :image => absolute_url(@outfit.image.url)
= link_to_edit_outfit(@outfit, :class => 'button', :id => 'outfit-wardrobe-link') do
- if user_signed_in? && @outfit.user == current_user
= t '.edit'
- else
= t '.clone'
- if @outfit.user_id
#outfit-user
= outfit_creation_summary(@outfit)
- if @outfit.color.prank?
= prank_color_message(@outfit.color.unfunny_human_name,
@outfit.pet_state.artist_name, @outfit.pet_state.artist_url)
#preview-wrapper
#preview-swf
%img{src: @outfit.image.url}
#outfit-items= render @outfit.worn_items
- content_for :javascripts do
:javascript
var INITIAL_OUTFIT_DATA = #{safely_to_json @outfit};
= include_javascript_libraries :jquery, :swfobject
= javascript_include_tag 'wardrobe', 'outfits/show'

View file

@ -643,7 +643,6 @@ en-MEEP:
default_outfit_name: Meeped outfit default_outfit_name: Meeped outfit
edit: Meep edit: Meep
clone: Meep a copy clone: Meep a copy
creation_summary_html: Meeped by %{user_link}, %{created_at_ago} ago
pet_states: pet_states:
description: description:

View file

@ -220,15 +220,6 @@ en:
colors: colors:
default_human_name: (a new color) default_human_name: (a new color)
prank_suffix: (fake) prank_suffix: (fake)
prank_message:
funny_html: This pet is painted %{color}, a totally real,
obviously not-made-up color. You should <em>totally</em> go spend all
your hard-earned Neopoints on a %{color} Paint Brush and fall for
%{color} pet trade scams, because %{color} is <em>totally</em> a real
thing. C'mon, would I lie to you? On today of all days?
unfunny_html: This pet is painted %{color}, a fake color drawn by
%{artist} for April Fools 2014. Anyone who claims to have a
<em>real</em> %{color} pet is a big fat liar.
contributions: contributions:
contributed_description: contributed_description:
@ -719,7 +710,6 @@ en:
default_outfit_name: Shared outfit default_outfit_name: Shared outfit
edit: Edit edit: Edit
clone: Edit a copy clone: Edit a copy
creation_summary_html: Created by %{user_link}, %{created_at_ago} ago
pet_states: pet_states:
description: description:

View file

@ -503,7 +503,6 @@ es:
default_outfit_name: Atuendos compartidos default_outfit_name: Atuendos compartidos
edit: Editar edit: Editar
clone: Hacer una copia clone: Hacer una copia
creation_summary_html: Creado por %{user_link} hace %{created_at_ago}
pet_states: pet_states:
description: description:
main: "%{mood} %{gender}" main: "%{mood} %{gender}"

View file

@ -501,7 +501,6 @@ pt:
default_outfit_name: Roupas Compartilhadas default_outfit_name: Roupas Compartilhadas
edit: Editar edit: Editar
clone: Editar uma cópia clone: Editar uma cópia
creation_summary_html: Criado por %{user_link}, %{created_at_ago} atrás
pet_states: pet_states:
description: description:
main: "%{mood} %{gender}" main: "%{mood} %{gender}"