<%
   selected_section = controller.class::SECTION if defined?(controller.class::SECTION)
   if selected_section==Navigation::SECTION_RESOURCE && !@project && !@resource
     selected_section = Navigation::SECTION_HOME
   end
   @project=@resource unless @project || selected_section==Navigation::SECTION_HOME
   has_context_nav = selected_section==Navigation::SECTION_RESOURCE || selected_section==Navigation::SECTION_CONFIGURATION
   period_param = "period=#{u(params[:period])}" if params[:period]
%>
<div class="page-wrapper <% if has_context_nav %>page-wrapper-context<% else %>page-wrapper-global<% end %>" id="container">
  <nav class="navbar navbar-global page-container" id="global-navigation"></nav>

  <% if has_context_nav %>
    <nav class="navbar navbar-context page-container" id="context-navigation"></nav>
  <% end %>

  <%= yield :header -%>

  <div id="body" class="page-container">
    <div id="content">
      <div class="panel hidden" id="messages-panel">
        <div class="alert alert-danger hidden" id="error">
          <span id="errormsg"></span> &nbsp;&nbsp;[<a href="#" onclick="return hideError();"><%= message('hide').downcase -%></a>]
        </div>
        <div class="alert alert-info hidden" id="info">
          <span id="infomsg"></span> &nbsp;&nbsp;[<a href="#" onclick="return hideInfo();"><%= message('hide').downcase -%></a>]
        </div>
        <div class="alert alert-warning hidden" id="warning">
          <span id="warningmsg"></span> &nbsp;&nbsp;[<a href="#" onclick="return hideWarning();"><%= message('hide').downcase -%></a>]
        </div>
      </div>
      <%= yield %>
    </div>
  </div>
</div>

<% unless params[:hd]=='false' %>
  <%= yield :footer %>
  <div id="footer" class="page-footer page-container">
    <% controller.java_facade.getWebFooters().each do |footer| %>
      <% if footer.getHtml() %>
        <div><%= footer.getHtml().to_s %></div>
      <% end %>
    <% end %>
    <% unless DatabaseVersion.production? %>
      <div class="alert alert-danger">
        <p class="big" id="evaluation_warning">Embedded database should be used for evaluation purpose only</p>
        <p>The embedded database will not scale, it will not support upgrading to newer versions of SonarQube, and there is no support for migrating your data out of it into a different database engine.</p>
      </div>
    <% end %>
    <%= render 'branding/footer' -%>
    <div>
      Version <%= sonar_version -%> -
      <a href="http://www.gnu.org/licenses/lgpl-3.0.txt" target="lgpl_v3">LGPL v3</a> -
      <a href="http://www.sonarqube.org" target="sonar">Community</a> -
      <a href="http://www.sonarqube.org/documentation" target="sonar_doc">Documentation</a> -
      <a href="http://www.sonarqube.org/support" target="support">Get Support</a> -
      <a href="http://redirect.sonarsource.com/doc/plugin-library.html" target="plugins">Plugins</a> -
      <a href="<%= ApplicationController.root_context -%>/api_documentation">Web Service API</a>
    </div>
    <!--[if lte IE 8 ]><p class="spacer-top alert alert-danger">IE 8 is not supported. Some widgets may not be properly displayed. Please switch to a <a target="_blank" href="http://redirect.sonarsource.com/doc/requirements.html">supported version or another supported browser</a>.</p><!--<![endif]-->
  </div>
<% end %>
