app/views/contacts/index.html.erb in social_stream-base-1.1.11 vs app/views/contacts/index.html.erb in social_stream-base-2.0.0.beta1

- old
+ new

@@ -1,37 +1,44 @@ -<% content_for :title do%> - <%= t('contact.other')%> -<%end%> +<section id="contacts"> + <%= render partial: 'toolbar/profile', locals: { :subject => profile_or_current_subject } %> -<% sidebar %> + <div class="contacts tabbable"> + <ul class="nav nav-tabs"> + <% profile_or_current_subject.class.contact_index_models.each do |type| %> + <li class="<%= 'active' if current_contact_section?(type) %>"> + <a data-toggle="tab" href="#<%= type %>" data-path="<%= contacts_path %>"<%= raw ' data-loaded="true"' if current_contact_section?(type) %>><%= t "#{ type }.title", count: :other %></a> + </li> + <% end %> + </ul> -<% toolbar :home, :option => :contacts %> + <div class="tab-content"> -<div id="my_conferences"> - <div id="contacts" class="block"> - <div class="search_field_wrapper"> - <input type="text" value="Search by name" id="search_field" class="search_input" /> - <%= image_tag("btn/search.png",:size=>"20x20",:id=>"search_button") %> - </div> - <div class="space_center"></div> - <div class="row" > - <div class="center"> - <%= link_to t('contact.all_n', :count => @total_contacts.count("DISTINCT contacts.id")), contacts_path %> - - <% Actor.distinct_initials. - contacted_from(current_subject). - merge(Tie.related_by(current_subject.relation_customs.find_by_id(params[:relation]))). - distinct_initials. - each do |l| %> - <%= link_to l.initial,{:letter => l.initial,:page => 1},:class => "contact_letter_link" %> - <% end %> + <div id="contacts-loading"> + <%= render partial: 'layouts/loading' %> </div> + + <% profile_or_current_subject.class.contact_index_models.each do |type| %> + <div id="<%= type %>" class="tab-pane <%= 'active' if current_contact_section?(type) %>"> + <%= text_field_tag "contact-filter-#{ type }", (current_contact_section?(type) ? params[:q] : ""), class: "pull-right contact-filter", placeholder: "filter", autocomplete: "off" %> + + <div class="contact-list"> + <% if current_contact_section?(type) %> + <% if @contacts.any? %> + <%= render @contacts %> + <% else %> + <%= raw t("contact.empty", explore: explore_path) %> + <% end %> + <% else %> + <%= render partial: 'layouts/loading' %> + <% end %> + </div> + </div> + <% end %> </div> - <div class="space_center"></div> - <div id="list_contacts_ajax" class="tab_content block"> - <%= render :partial => "contacts/index"%> - </div> - <div class="space_center"></div> </div> -</div> - -<div class="space_center"></div> + <%= javascript_tag do %> + $(function() { + SocialStream.Contact.index(); + }); + <% end %> +</section>