2011-07-20 09:39:18 -07:00
|
|
|
- unless public_perspective?
|
2013-01-01 18:42:58 -08:00
|
|
|
- title t('.title_for.you')
|
2011-07-22 11:02:04 -07:00
|
|
|
- add_body_class 'current-user'
|
2011-07-29 07:52:04 -07:00
|
|
|
- secondary_nav do
|
2013-01-01 18:42:58 -08:00
|
|
|
%span#toggle-help= t('.toggle_help')
|
2011-07-15 22:09:04 -07:00
|
|
|
= form_tag items_path, :method => :get, :id => 'closet-hangers-items-search', 'data-current-user-id' => current_user.id do
|
2013-01-01 18:42:58 -08:00
|
|
|
= text_field_tag :q, nil, :placeholder => t('.item_search_placeholder')
|
|
|
|
= submit_tag t('.item_search_submit'), :name => nil
|
2011-07-12 17:03:04 -07:00
|
|
|
- else
|
2013-01-01 18:42:58 -08:00
|
|
|
- title t('.title_for.another_user', :user_name => @user.name)
|
2011-08-03 07:33:13 -07:00
|
|
|
- secondary_nav do
|
|
|
|
%span#toggle-compare Compare with Your Items
|
2011-07-15 19:52:53 -07:00
|
|
|
|
2011-07-26 15:56:14 -07:00
|
|
|
- canonical_path user_closet_hangers_path(@user)
|
|
|
|
|
2011-07-20 12:16:22 -07:00
|
|
|
- content_for :before_flashes do
|
|
|
|
#closet-hangers-contact
|
|
|
|
- if public_perspective?
|
|
|
|
- if @user.neopets_username?
|
2013-01-01 18:42:58 -08:00
|
|
|
= link_to t('.send_neomail', :neopets_username => @user.neopets_username),
|
|
|
|
send_neomail_url(@user)
|
2011-07-20 12:16:22 -07:00
|
|
|
- else
|
2011-07-26 15:41:15 -07:00
|
|
|
%span#edit-contact-link-to-replace-form.edit-contact-link{:class => @user.neopets_username? ? 'has-value' : nil}
|
2013-01-01 18:42:58 -08:00
|
|
|
%span#contact-link-no-value= t '.neopets_username.add'
|
2011-07-22 11:02:04 -07:00
|
|
|
%span#contact-link-has-value
|
2013-01-01 18:42:58 -08:00
|
|
|
= t '.neopets_username.edit',
|
|
|
|
:neopets_username => @user.neopets_username
|
2011-07-20 12:16:22 -07:00
|
|
|
= form_for @user do |f|
|
|
|
|
= f.label :neopets_username
|
|
|
|
= f.text_field :neopets_username
|
2013-01-01 18:42:58 -08:00
|
|
|
= f.submit t('.neopets_username.submit')
|
|
|
|
%span#cancel-contact-link= t('.neopets_username.cancel')
|
2011-07-22 14:55:05 -07:00
|
|
|
|
2011-07-30 23:58:45 -07:00
|
|
|
- unless public_perspective?
|
2013-01-01 18:42:58 -08:00
|
|
|
= render :partial => 'help', :locals => {:user => @user}
|
|
|
|
|
2011-07-30 23:58:45 -07:00
|
|
|
#closet-hangers-extras
|
2011-07-31 16:24:06 -07:00
|
|
|
#closet-hangers-share
|
2013-01-01 18:42:58 -08:00
|
|
|
%label{:for => 'closet-hangers-share-box'}= t '.public_url_label'
|
|
|
|
%input#closet-hangers-share-box{:type => 'text',
|
|
|
|
:value => user_closet_hangers_url(@user),
|
|
|
|
:readonly => true}
|
2011-07-31 16:24:06 -07:00
|
|
|
|
2013-01-01 18:42:58 -08:00
|
|
|
= link_to t('.import_from.closet'), new_closet_page_path
|
|
|
|
= link_to t('.import_from.safety_deposit'), new_safety_deposit_page_path
|
|
|
|
= link_to t('.import_from.neopets_user'), new_neopets_user_path
|
|
|
|
= link_to t('.export_to.petpage'), petpage_user_closet_hangers_path(@user)
|
2011-07-31 16:24:06 -07:00
|
|
|
|
2011-07-20 09:39:18 -07:00
|
|
|
#closet-hangers{:class => public_perspective? ? nil : 'current-user'}
|
2011-07-22 14:55:05 -07:00
|
|
|
- [true, false].each do |owned|
|
2011-07-30 10:40:41 -07:00
|
|
|
.closet-hangers-group{'data-owned' => owned.to_s, :id => "closet-hangers-group-#{owned}"}
|
2011-07-22 15:06:46 -07:00
|
|
|
%header
|
2013-01-01 18:42:58 -08:00
|
|
|
%h3= closet_lists_group_name(closet_hangers_subject(@user), owned)
|
|
|
|
%span.toggle.show= t '.toggle_group.show'
|
|
|
|
%span.toggle.hide= t '.toggle_group.hide'
|
2011-07-29 10:29:32 -07:00
|
|
|
- unless public_perspective?
|
2013-01-01 18:42:58 -08:00
|
|
|
= link_to_add_closet_list t('.add_list'), :owned => owned, :class => 'add-closet-list'
|
2011-07-22 14:55:05 -07:00
|
|
|
.closet-hangers-group-content
|
2011-07-29 07:52:04 -07:00
|
|
|
= render_closet_lists(@closet_lists_by_owned[owned])
|
2011-10-10 19:43:46 -07:00
|
|
|
- if !public_perspective? || unlisted_hangers_count(owned) > 0
|
|
|
|
.closet-list.unlisted{'data-hangers-count' => unlisted_hangers_count(owned)}
|
|
|
|
%header
|
|
|
|
- unless public_perspective?
|
|
|
|
= form_for @user, :html => {:class => 'visibility-form'} do |f|
|
|
|
|
= f.select hangers_group_visibility_field_name(owned),
|
|
|
|
closet_visibility_choices(:human_name)
|
2013-01-01 18:42:58 -08:00
|
|
|
= f.submit t('.unlisted.submit')
|
2011-10-10 19:43:46 -07:00
|
|
|
= closet_visibility_descriptions
|
|
|
|
- if has_lists?(owned)
|
2013-01-01 18:42:58 -08:00
|
|
|
%h4= t '.unlisted.header'
|
2011-10-10 19:43:46 -07:00
|
|
|
.closet-list-content
|
|
|
|
.closet-list-hangers
|
|
|
|
= render_unlisted_closet_hangers(owned)
|
2013-01-01 18:42:58 -08:00
|
|
|
%span.empty-list= t '.unlisted.empty'
|
2011-07-12 17:03:04 -07:00
|
|
|
|
Move closet-hangers-update form from partial to JS
We lose no-JS support, which I kinda miss, but caching is gonna be more
important down the line. Delete form moves next, then we cache.
CSRF token changes: it looks like, by setting a data attribute in AJAX, I
was overwriting the CSRF token. I don't remember it working that way, but
now we use beforeSend to add the X-CSRF-Token header instead, which is nicer,
anyway. The issue might've been something else, but this worked :/
The CSS was also not showing the loading ellipsis properly. I think that's a
dev-only issue in how live assets are being served versus static assets, but
may as well add UTF-8 charset directives everywhere, anyway.
2013-06-22 15:27:00 -07:00
|
|
|
- if user_signed_in?
|
|
|
|
- localized_cache action_suffix: 'tmpls' do
|
|
|
|
%script#autocomplete-item-tmpl{type: 'text/x-jquery-tmpl'}
|
|
|
|
%a
|
|
|
|
= t '.autocomplete.add_item_html', item_name: '${item_name}'
|
2013-01-03 10:25:14 -08:00
|
|
|
|
Move closet-hangers-update form from partial to JS
We lose no-JS support, which I kinda miss, but caching is gonna be more
important down the line. Delete form moves next, then we cache.
CSRF token changes: it looks like, by setting a data attribute in AJAX, I
was overwriting the CSRF token. I don't remember it working that way, but
now we use beforeSend to add the X-CSRF-Token header instead, which is nicer,
anyway. The issue might've been something else, but this worked :/
The CSS was also not showing the loading ellipsis properly. I think that's a
dev-only issue in how live assets are being served versus static assets, but
may as well add UTF-8 charset directives everywhere, anyway.
2013-06-22 15:27:00 -07:00
|
|
|
%script#autocomplete-add-to-list-tmpl{type: 'text/x-jquery-tmpl'}
|
|
|
|
%a
|
|
|
|
= t '.autocomplete.add_to_list_html', list_name: '${list_name}'
|
2013-01-03 10:25:14 -08:00
|
|
|
|
Move closet-hangers-update form from partial to JS
We lose no-JS support, which I kinda miss, but caching is gonna be more
important down the line. Delete form moves next, then we cache.
CSRF token changes: it looks like, by setting a data attribute in AJAX, I
was overwriting the CSRF token. I don't remember it working that way, but
now we use beforeSend to add the X-CSRF-Token header instead, which is nicer,
anyway. The issue might've been something else, but this worked :/
The CSS was also not showing the loading ellipsis properly. I think that's a
dev-only issue in how live assets are being served versus static assets, but
may as well add UTF-8 charset directives everywhere, anyway.
2013-06-22 15:27:00 -07:00
|
|
|
%script#autocomplete-add-to-group-tmpl{type: 'text/x-jquery-tmpl'}
|
|
|
|
%a
|
|
|
|
= t '.autocomplete.add_to_group_html', group_name: '${group_name}'
|
2013-01-03 10:25:14 -08:00
|
|
|
|
Move closet-hangers-update form from partial to JS
We lose no-JS support, which I kinda miss, but caching is gonna be more
important down the line. Delete form moves next, then we cache.
CSRF token changes: it looks like, by setting a data attribute in AJAX, I
was overwriting the CSRF token. I don't remember it working that way, but
now we use beforeSend to add the X-CSRF-Token header instead, which is nicer,
anyway. The issue might've been something else, but this worked :/
The CSS was also not showing the loading ellipsis properly. I think that's a
dev-only issue in how live assets are being served versus static assets, but
may as well add UTF-8 charset directives everywhere, anyway.
2013-06-22 15:27:00 -07:00
|
|
|
%script#autocomplete-already-in-collection-tmpl{type: 'text/x-jquery-tmpl'}
|
|
|
|
%span
|
|
|
|
= t '.autocomplete.already_in_collection_html',
|
|
|
|
collection_name: '${collection_name}'
|
|
|
|
|
2013-06-22 15:45:59 -07:00
|
|
|
|
|
|
|
-# Gotta do this weird subbing in the path, since the braces will be
|
|
|
|
-# escaped if they themselves are inserted. Probably deserves a more legit
|
|
|
|
-# method, especially if we ever need it again.
|
|
|
|
- templated_hanger_path = user_closet_hanger_path(user_id: '$0', id: '$1').sub('$0', '${user_id}').sub('$1', '${closet_hanger_id}')
|
Move closet-hangers-update form from partial to JS
We lose no-JS support, which I kinda miss, but caching is gonna be more
important down the line. Delete form moves next, then we cache.
CSRF token changes: it looks like, by setting a data attribute in AJAX, I
was overwriting the CSRF token. I don't remember it working that way, but
now we use beforeSend to add the X-CSRF-Token header instead, which is nicer,
anyway. The issue might've been something else, but this worked :/
The CSS was also not showing the loading ellipsis properly. I think that's a
dev-only issue in how live assets are being served versus static assets, but
may as well add UTF-8 charset directives everywhere, anyway.
2013-06-22 15:27:00 -07:00
|
|
|
%script#closet-hanger-update-tmpl{type: 'text/x-jquery-tmpl'}
|
2013-06-22 15:45:59 -07:00
|
|
|
= form_tag templated_hanger_path, method: :put, authenticity_token: false, class: 'closet-hanger-update' do
|
Move closet-hangers-update form from partial to JS
We lose no-JS support, which I kinda miss, but caching is gonna be more
important down the line. Delete form moves next, then we cache.
CSRF token changes: it looks like, by setting a data attribute in AJAX, I
was overwriting the CSRF token. I don't remember it working that way, but
now we use beforeSend to add the X-CSRF-Token header instead, which is nicer,
anyway. The issue might've been something else, but this worked :/
The CSS was also not showing the loading ellipsis properly. I think that's a
dev-only issue in how live assets are being served versus static assets, but
may as well add UTF-8 charset directives everywhere, anyway.
2013-06-22 15:27:00 -07:00
|
|
|
= hidden_field_tag 'closet_hanger[list_id]', '${list_id}'
|
|
|
|
= hidden_field_tag 'closet_hanger[owned]', '${owned}'
|
|
|
|
= number_field_tag 'closet_hanger[quantity]', '${quantity}',
|
|
|
|
min: 0, required: true
|
2013-01-03 10:25:14 -08:00
|
|
|
|
2013-06-22 15:45:59 -07:00
|
|
|
%script#closet-hanger-destroy-tmpl{type: 'text/x-jquery-tmpl'}
|
|
|
|
= form_tag templated_hanger_path, method: :delete, authenticity_token: false, class: 'closet-hanger-destroy' do
|
|
|
|
= submit_tag t('closet_hangers.closet_hanger.delete')
|
|
|
|
|
2011-07-15 22:09:04 -07:00
|
|
|
- content_for :stylesheets do
|
2013-03-08 11:43:16 -08:00
|
|
|
= stylesheet_link_tag 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/themes/south-street/jquery-ui.css'
|
2011-07-15 22:09:04 -07:00
|
|
|
|
2011-07-15 19:52:53 -07:00
|
|
|
- content_for :javascripts do
|
2013-01-03 10:25:14 -08:00
|
|
|
= include_javascript_libraries :jquery, :jquery_tmpl
|
2012-03-23 14:59:23 -07:00
|
|
|
= javascript_include_tag 'ajax_auth', 'jquery.ui', 'jquery.jgrowl',
|
2013-03-08 11:43:16 -08:00
|
|
|
'placeholder', 'closet_hangers/index'
|