_profile.rhtml 1.77 KB
<li class="search-profile-item">
<% if @empty_query or @results.size > 1 or !profile.enterprise?  %>
  <%= profile_image_link profile, :portrait, 'div' %>
<% else %>
  <div class="search-enterprise-item">
    <div class="search-enterprise-item-column-left">
      <%= profile_image_link profile, :portrait, 'div' %>
    </div>
    <div class="search-enterprise-item-column-right">
      <%= link_to_homepage(profile.name, profile.identifier, :class => "search-result-title") %>
      <div class="search-enterprise-description">
        <% if profile.description %>
          <% body_stripped = strip_tags(profile.description) %>
        <% elsif profile.home_page and profile.home_page.body %>
          <% body_stripped = strip_tags(profile.home_page.body) %>
        <% end %>
        <%= excerpt(body_stripped, body_stripped.first(3), 200) if body_stripped %>
      </div>
      <div class="search-enterprise-region">
        <span class="search-enterprise-region-label"><%= _("City") %></span>
        <% if profile.region %>
          <span class="search-enterprise-region-name"><%= city_with_state(profile.region) %></span>
        <% end %>
      </div>

      <div class="search-enterprise-categorization">
        <% profile.top_level_categorization.each do |parent, children| %>
          <% if parent.name != "Territórios" %>
            <div class="search-enterprise-category-<%=parent.id%> search-enterprise-category">
              <span class="search-enterprise-categorization-parent"><%= parent.name %></span>
              <span class="search-enterprise-categorization-children">
                <%= children.collect(&:name).join(', ')  %>
              </span>
            </div>
          <% end %>
        <% end %>
      </div>
    </div>

    <hr class="clearfix" />
  </div>
<% end %>
</li>