header.html.erb 4.74 KB
<% user = (session[:user] && User.find_by_id(session[:user])) || nil %>
<%= theme_include "user_menu", :locals => {:person => user.person} if user %>

<%= render :file => File.join(File.dirname(__FILE__), "/top_search_bar") %>

<% if controller_name != 'home' %>


<%= 
#render :file => File.join(File.dirname(__FILE__), "/user_bar") 
%>
<!--
<%= #FIXME Manu bar is not being used at this moment
# render :file => File.join(File.dirname(__FILE__), "/user_menu_bar") 
%>
<%= #FIXME Chat is not being used at this moment
# render :file => File.join(File.dirname(__FILE__), "/user_chat_bar") 
%>
-->

<!-- Nova Barra de usuário -->
<div id="top-bar" class="top" >
  <div class="btn_control_panel btn_control" title="Painel de Controle" alt="menu">
    <div class="layout_user">
      <%= render :partial => 'layouts/user' %>
    </div>
  </div>

<!--
  <div id="categories_menu">
    <%= theme_include 'categories' %>
  </div>
 -->
  <span class="btn_home" title="Página Inicial"><a href="<%=environment.top_url%>">&nbsp;</a></span>
</div>
<!-- FIM Nova Barra de usuário -->

<% else %> 

<header>

  <div id="header-left">
    <div id="logo">
      <%= link_to(image_tag("/designs/themes/participa-web/images/medium-logo.png"), environment.top_url) %>
    </div>
  </div><!-- #header-left -->

  <div id="header-right">
    <div id="header-right-1">

      <%= link_to(image_tag("/designs/themes/participa-web/images/tile-forum.png") + "<span class='tile-title'>" + _('CONTENT') + "</span>", {:controller => 'search', :action => 'contents', :filter => 'more_recent'}, :class => 'tile tile-forum') %>
      <%= link_to(image_tag("/designs/themes/participa-web/images/tile-groups.png") + "<span class='tile-title'>" + _('GROUPS') + "</span>", {:controller => 'search', :action => 'communities', :filter => 'more_active'}, :class => 'tile tile-groups') %>
      <%= link_to(image_tag("/designs/themes/participa-web/images/tile-info.png") + "<span class='tile-title'>" + _('ABOUT US') + "</span>", {:profile => 'save-organic-food'}, :class => 'tile tile-info') %>
      <%= link_to(image_tag("/designs/themes/participa-web/images/tile-members.png") + "<span class='tile-title'>" + _('MEMBERS') + "</span>", {:controller => 'search', :action => 'people', :filter => 'more_recent'}, :class => 'tile tile-users')%>
    </div><!-- #header-right-1 -->

    <div id="header-right-2">
      <div class="tile2">

        <div id="tile-user">

        <% if logged_in? %>
          <span class='not-logged-in'>
            <div class="tile-avatar"> <%= link_to(profile_image(current_person), current_person.url) %></div>
            <div class="tile-username"><%= _('Hello,') %> <br/><%= current_person.name %> </div>
            <span class='tile-title'>
              <%= admin_link %>
              <span> <%= _('or') %> </span>
              <%= link_to(_('Logout'), :controller => :account, :action => :logout) %>
            </span>
        <% else %>
          <span class='not-logged-in'>
            <div class="tile-avatar"> <%= image_tag("/designs/themes/participa-web/images/avatar.gif") %></div>
            <div class="tile-username"><%= _('Hello') %> <br/><%= _('Guest') %> </div>
            <span class='tile-title'>
              <%= modal_inline_link_to('<i class="icon-menu-login"></i><strong>' + _('Login') + '</strong>', login_url, 'inlineLoginBox', :id => 'link_login') %>
              <%= @plugins.dispatch(:alternative_authentication_link).collect { |content| instance_exec(&content) }.join("") %>
              <% unless @plugins.dispatch(:allow_user_registration).include?(false) %>
                <span> <%= _('or') %> </span>
                <span class='tile-register'>
                  <%= link_to('<strong>' + _('Sign up') + '</strong>', :controller => 'account', :action => 'signup')%>
                </span>
              <% end %>
            <div id='inlineLoginBox' style='display: none;'>
              <%= render :file => 'account/login', :locals => { :is_thickbox => true } %>
            </div>
          </span>
        <% end %>
        </div>

      </div><!-- .tile2 -->

      <div class="header-right-2-bottom">
        <% if logged_in? %>
          <%= link_to(image_tag("/designs/themes/participa-web/images/tile-activities.png") + "<span class='tile-title'>" + _('ACTIVITY') + "</span>", {:controller => 'profile', :profile => current_person.identifier, :anchor => 'profile-network'}, :class => 'tile tile-activities') %>
          <%= link_to(image_tag("/designs/themes/participa-web/images/tile-blog.png") + "<span class='tile-title'>" + _('BLOG') + "</span>", {:controller => 'profile', :profile => current_person.identifier}, :class => 'tile tile-blog') %>
        <% end %>
      </div><!-- .header-right-2-bottom -->
    </div><!-- .header-right-2 -->
  </div><!-- #header-right -->


</header>
<% end %>