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:
parent
3d07d7f360
commit
5ba711a413
11 changed files with 13 additions and 121 deletions
|
@ -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);
|
|
@ -20,7 +20,6 @@
|
|||
@import items/show
|
||||
@import outfits/index
|
||||
@import outfits/new
|
||||
@import outfits/show
|
||||
@import pets/bulk
|
||||
@import static/image_mode
|
||||
@import static/pardon_our_dust
|
||||
|
|
|
@ -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
|
||||
|
|
@ -81,11 +81,7 @@ class OutfitsController < ApplicationController
|
|||
|
||||
def show
|
||||
@outfit = Outfit.find(params[:id])
|
||||
@campaign = Campaign.current rescue nil
|
||||
respond_to do |format|
|
||||
format.html { render }
|
||||
format.json { render :json => @outfit }
|
||||
end
|
||||
render "outfits/edit", layout: false
|
||||
end
|
||||
|
||||
def start
|
||||
|
|
|
@ -81,16 +81,6 @@ module OutfitsHelper
|
|||
content_tags = contents.map { |c| content_tag(:p, c) }
|
||||
content_tags.join('').html_safe
|
||||
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)
|
||||
class_name = outfit.starred? ? 'starred' : nil
|
||||
|
@ -106,18 +96,5 @@ module OutfitsHelper
|
|||
options = {:spellcheck => false, :id => nil}.merge(options)
|
||||
text_field_tag 'name', nil, options
|
||||
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
|
||||
|
||||
|
|
|
@ -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
|
||||
%html
|
||||
%head
|
||||
%meta{charset: 'utf-8'}
|
||||
%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'}
|
||||
= stylesheet_link_tag 'fonts'
|
||||
= javascript_include_tag 'wardrobe-2020-page', defer: true
|
||||
= open_graph_tags
|
||||
%body
|
||||
#wardrobe-2020-root
|
||||
|
|
|
@ -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'
|
|
@ -643,7 +643,6 @@ en-MEEP:
|
|||
default_outfit_name: Meeped outfit
|
||||
edit: Meep
|
||||
clone: Meep a copy
|
||||
creation_summary_html: Meeped by %{user_link}, %{created_at_ago} ago
|
||||
|
||||
pet_states:
|
||||
description:
|
||||
|
|
|
@ -220,15 +220,6 @@ en:
|
|||
colors:
|
||||
default_human_name: (a new color)
|
||||
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:
|
||||
contributed_description:
|
||||
|
@ -719,7 +710,6 @@ en:
|
|||
default_outfit_name: Shared outfit
|
||||
edit: Edit
|
||||
clone: Edit a copy
|
||||
creation_summary_html: Created by %{user_link}, %{created_at_ago} ago
|
||||
|
||||
pet_states:
|
||||
description:
|
||||
|
|
|
@ -503,7 +503,6 @@ es:
|
|||
default_outfit_name: Atuendos compartidos
|
||||
edit: Editar
|
||||
clone: Hacer una copia
|
||||
creation_summary_html: Creado por %{user_link} hace %{created_at_ago}
|
||||
pet_states:
|
||||
description:
|
||||
main: "%{mood} %{gender}"
|
||||
|
|
|
@ -501,7 +501,6 @@ pt:
|
|||
default_outfit_name: Roupas Compartilhadas
|
||||
edit: Editar
|
||||
clone: Editar uma cópia
|
||||
creation_summary_html: Criado por %{user_link}, %{created_at_ago} atrás
|
||||
pet_states:
|
||||
description:
|
||||
main: "%{mood} %{gender}"
|
||||
|
|
Loading…
Reference in a new issue