impress/app/views/closet_hangers/index.html.haml

100 lines
No EOL
4.5 KiB
Text

- unless public_perspective?
- title t('.title_for.you')
- add_body_class 'current-user'
- secondary_nav do
%span#toggle-help= t('.toggle_help')
= form_tag items_path, :method => :get, :id => 'closet-hangers-items-search', 'data-current-user-id' => current_user.id do
= text_field_tag :q, nil, :placeholder => t('.item_search_placeholder')
= submit_tag t('.item_search_submit'), :name => nil
- else
- title t('.title_for.another_user', :user_name => @user.name)
- secondary_nav do
%span#toggle-compare Compare with Your Items
- canonical_path user_closet_hangers_path(@user)
- content_for :before_flashes do
#closet-hangers-contact
- if public_perspective?
- if @user.neopets_username?
= link_to t('.send_neomail', :neopets_username => @user.neopets_username),
send_neomail_url(@user)
- else
%span#edit-contact-link-to-replace-form.edit-contact-link{:class => @user.neopets_username? ? 'has-value' : nil}
%span#contact-link-no-value= t '.neopets_username.add'
%span#contact-link-has-value
= t '.neopets_username.edit',
:neopets_username => @user.neopets_username
= form_for @user do |f|
= f.label :neopets_username
= f.text_field :neopets_username
= f.submit t('.neopets_username.submit')
%span#cancel-contact-link= t('.neopets_username.cancel')
- unless public_perspective?
= render :partial => 'help', :locals => {:user => @user}
#closet-hangers-extras
#closet-hangers-share
%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}
= 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)
#closet-hangers{:class => public_perspective? ? nil : 'current-user'}
- [true, false].each do |owned|
.closet-hangers-group{'data-owned' => owned.to_s, :id => "closet-hangers-group-#{owned}"}
%header
%h3= closet_lists_group_name(closet_hangers_subject(@user), owned)
%span.toggle.show= t '.toggle_group.show'
%span.toggle.hide= t '.toggle_group.hide'
- unless public_perspective?
= link_to_add_closet_list t('.add_list'), :owned => owned, :class => 'add-closet-list'
.closet-hangers-group-content
= render_closet_lists(@closet_lists_by_owned[owned])
- 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)
= f.submit t('.unlisted.submit')
= closet_visibility_descriptions
- if has_lists?(owned)
%h4= t '.unlisted.header'
.closet-list-content
.closet-list-hangers
= render_unlisted_closet_hangers(owned)
%span.empty-list= t '.unlisted.empty'
- localized_cache :action_suffix => 'autocomplete_tmpls' do
%script#autocomplete-item-tmpl{:type => 'text/x-jquery-tmpl'}
%a
= t '.autocomplete.add_item_html', :item_name => '${item_name}'
%script#autocomplete-add-to-list-tmpl{:type => 'text/x-jquery-tmpl'}
%a
= t '.autocomplete.add_to_list_html', :list_name => '${list_name}'
%script#autocomplete-add-to-group-tmpl{:type => 'text/x-jquery-tmpl'}
%a
= t '.autocomplete.add_to_group_html', :group_name => '${group_name}'
%script#autocomplete-already-in-collection-tmpl{:type => 'text/x-jquery-tmpl'}
%span
= t '.autocomplete.already_in_collection_html',
:collection_name => '${collection_name}'
- content_for :stylesheets do
= stylesheet_link_tag 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/themes/south-street/jquery-ui.css'
- content_for :javascripts do
= include_javascript_libraries :jquery, :jquery_tmpl
= javascript_include_tag 'ajax_auth', 'jquery.ui', 'jquery.jgrowl',
'placeholder', 'closet_hangers/index'