application-ng.rhtml 5.7 KB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= html_language %>" lang="<%= html_language %>">
  <head>
    <title><%= page_title %></title>
    <%= meta_tags_for_article(@page) %>
    <!--<meta http-equiv="refresh" content="1"/>-->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="description" content="<%= @environment.name %>" />
    <link rel="shortcut icon" href="<%= '/designs/themes/' + current_theme + '/favicon.ico' %>" type="image/x-icon" />
    <%= noosfero_javascript %>
    <%= import_blocks_stylesheets %>
    <%= import_controller_stylesheets %>
    <%= stylesheet_import(
          %w( common help menu article button search ),
          %w( blocks forms login-box thickbox profiles),
          template_stylesheet_path(),
          icon_theme_stylesheet_path(),
          theme_stylesheet_path(),
          pngfix_stylesheet_path()
        ) %>
    <%# Add custom tags/styles/etc via content_for %>
    <%= yield :head %>
  </head>
  <body class="<%=
    # Identify the current controller and action for the CSS:
    " controller-"+ @controller.controller_name() +
    " action-"+ @controller.controller_name() +"-"+ @controller.action_name() +
    " template-"+ ( profile.nil? ? "default" : profile.layout_template )
    %>" onresize="registerDocumentSize()">
    <script type="text/javascript">
      /* Adds a class to "msie" to the body element if a Microsoft browser is
       * detected. This is needed to workaround several of their limitations.
       */
      if ( navigator.appVersion.indexOf("MSIE") > -1 ) {
        document.body.className += " msie msie" +
          navigator.appVersion.replace(/^.*MSIE\s+([0-9]+).*$/, "$1");
      }
      function registerDocumentSize() {
        document.body.className = document.body.className
                                          .replace(/(^| )docSize.+( |$)/g, " ");
        for ( var x=100; x<=1500; x+=100 ) {
          if ( document.body.clientWidth > x ) {
            document.body.className += " docSize-GT-" + x;
          } else {
            document.body.className += " docSize-LT-" + x;
          }
        }
      }
      registerDocumentSize();
    </script>

    <a href="#content" id="link-go-content"><span>Ir para o conteúdo</span></a>

    <div id="wrap-1">
      <div id='theme-header'>
        <%= theme_header %>
      </div>
      <div id="wrap-2">
        <div id="user">
          <% if logged_in? %>
            <%= _('Welcome, %s.') % link_to('<i></i><strong>' + user.identifier + '</strong>', user.url, :id => "homepage-link", :title => _('Go to your homepage')) %>
            <% if user.is_admin?(environment) %>
              <%= link_to('<i class="icon-menu-admin"></i><strong>' + _('Administration') + '</strong>', { :controller => 'admin_panel', :action => 'index' }, :id => "controlpanel", :title => _("Configure the environment")) %>
            <% end %>
            <% if (user.environment == environment) %>
              <%= link_to('<i class="icon-menu-ctrl-panel"></i><strong>' + _('Control panel') + '</strong>', user.admin_url, :id => "controlpanel", :title => _("Configure your personal account and content")) %>
            <% end %>
            <%= link_to('<i class="icon-menu-logout"></i><strong>' + _('Logout') + '</strong>', { :controller => 'account', :action => 'logout'} , :id => "logout", :title => _("Leave the system")) %>
          <% else %>
            <% if params[:controller] != 'account' || params[:action] != 'signup' %>
              <%= _('%s or %s') % [thickbox_inline_popup_link('<i class="icon-menu-login"></i><strong>' + _('Login') + '</strong>', login_url, 'inlineLoginBox', :id => 'link_login'), link_to('<strong>' + _('Register') + '</strong>', :controller => 'account', :action => 'signup') ] %>
              <div id='inlineLoginBox' style='display: none;'>
                <%= render :file => 'account/login', :locals => { :is_thickbox => true } %>
              </div>
            <% end %>
          <% end %>

          <form action="/search" class="search_form" method="get" class="clean">
            <input name="query" size="15" value="<%=_('Search...')%>"
                onfocus="this.form.className='focused';
                         if(this.value=='<%=_('Search...')%>'){this.value=''}"
                onblur="this.form.className='';
                        if(/^\s*$/.test(this.value)){
                          this.value='<%=_('Search...')%>';
                          this.form.className='clean'
                        }" />
            <div><%=_('Press <strong>Enter</strong> to send the search query.')%></div>
          </form>
        </div><!-- end id="user" -->

        <h1 id="site-title">
          <%= link_to content_tag('span', environment.name), environment.top_url %>
        </h1>
        <div id="navigation">
          <ul>
            <li><%= link_to '<span class="icon-menu-people">' + _('People') + '</span>',
                            '/assets/people', :id=>'people'           %></li>
            <li><%= link_to '<span class="icon-menu-community">' + _('Communities') + '</span>',
                            '/assets/communities', :id=>'communities' %></li>
            <%= theme_extra_navigation %>
          </ul>
          <div id="navigation-end"></div>
        </div><!-- end id="navigation" -->
        <div id="content">
          <%= insert_boxes(yield) %>
          <br style='clear: both'/>
        </div><!-- end id="content" -->
      </div><!-- end id="wrap-2" -->
    </div><!-- end id="wrap-1" -->
    <div id="theme-footer">
      <%= theme_footer %>
    </div><!-- end id="theme-footer" -->
    <%= noosfero_layout_features %>
  </body>
</html>