<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fi" >
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <meta http-equiv="Content-Script-Type" content="text/javascript" />
    <link rel="icon" type="image/png" href="/favicon.png" />
    <%= stylesheet_link_tag    "application" %>
    <%= javascript_include_tag "application" %>
    <%= csrf_meta_tag %>
    <title>ENSL</title>
  </head>

  <body>
    <div id="indexContainer">
      <div id="indexMain">
        <%= render :partial => "layouts/header" %>

        <div id="indexMainarea">
          <div id="indexContent">
            <% if flash[:notice] %>
              <div class="flashMsg">
                <%= flash[:notice] %>
              </div>
            <% end %>
            <% if flash[:error] %>
              <div class="flashMsg flashError">
                <%= flash[:error] %>
              </div>
            <% end %>
            <%= yield  %>
          </div>

          <div id="indexRight">
            <div class="indexBox">
              <div class="header">Shoutbox & Match search</div>
              <div class="body">
                <div class="content">
                  <%= render :partial => "widgets/shoutbox" %>
                </div>
              </div>
            </div>

            <%# if @current_controller == "contests" %>
            <div class="indexBox" id="indexHighlights">
              <%= render :partial => "widgets/highlights" %>
            </div>
            <%# end %>

            <div class="indexBox" id="indexLatest">
              <%= render :partial => "widgets/posts" %>
            </div>


            <% if @current_action == "news_index" %>
              <div class="indexBox" id="indexLatest">
                <%= render :partial => "widgets/poll" %>
              </div>
            <% end %>
          </div>

          <div style="clear:both;"></div>
        </div>
      </div>

      <div id="indexFooter">
        <% if cuser && (g = cuser.gathers.active.ordered.first) %>
          <%= link_to "You're in THIS gather", g %>
        <% elsif Gather.last && (Gather::FULL - Gather.last.gatherers.count) == 12 %>
          Be first to join the <%= link_to "Gather", Gather.last %>!
        <% elsif Gather.last %>
          <%= link_to "Gather", Gather.last %> running, <%= Gather::FULL - Gather.last.gatherers.count %> more needed.
        <% end %>
      </div>
    </div>
  </body>
</html>
