<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
    <title>eKommunalabwasser: <%= controller.action_name %></title>
    <%= favicon_link_tag asset_path('wassertropfen-ico-64x64.png'), :rel => 'icon', :type =>  'image/png' %>
    <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">

    <link href="https://fonts.googleapis.com/css?family=Lato:300,400,700|Open+Sans:300,400,600,700" rel="stylesheet">

    <%= csrf_meta_tags %>
    <!-- <%= stylesheet_link_tag 'scaffold', :media => 'all' %> -->
    <%= stylesheet_link_tag "application", :media => "all" %>
    <%= javascript_include_tag 'application' %> <!-- original from layouts/_header.html.erb file (first line) -->

    <%= content_for :head %> <!-- get page specific .js files -->

  </head>
  <body>
    <% if flash[:notice] %>
      <div class='notice'>
        <%= flash[:notice] %>
      </div>
    <% end %>

    <div class="module">
      <div class="side_module">
          <div class="sidebar__toggle">
            <span class="icon"></span>
          </div>
          <div class="sidebar">
              <div class="flex-wrapper">
                <div class="header__wrapper">
                    <%= render :partial => 'layouts/header' %>
                </div>
                <div class="main-navigation navigation">
                      <% if theUser(session).can_read? || theUser(session).can_write? %>
                        <div class="nav-wrapper">
                          <div class="nav-title">
                            <span>Agglomerationen</span>
                          </div>
                          <ul class="navigation">
                            <% if theUser(session).can_read? %>
                              <li><%= link_to('Liste der Agglomerationen', { :controller => :agglomerations, :action => :index }, { id:'menu-agglomerationen' }) %></li>
                              <li><%= link_to('Agglomerationen abfragen', { :controller => :agglomerations_abfrage, :action => :index }, { id:'menu-agglomerationen-abfragen' }) %></li>
                            <% end %>
                            <% if theUser(session).can_write? %>
                              <li><%= link_to('Agglomeration erstellen', { :controller => :agglomerations, :action => :new }, { id:'menu-agglomeration-erstellen' }) %></li>
                            <% end %>
                          </ul>
                        </div>
                      <% end %>

                      <div class="nav-wrapper">
                        <div class="nav-title">
                          <span>Anlagen</span>
                        </div>
                        <ul class="navigation">
                            <li><%= link_to('Liste der Anlagen', { :controller => :plants, :action => :index }, { id:'menu-anlagen' }) %></li>
                            <li><%= link_to('Anlagen abfragen', { :controller => :plants_abfrage, :action => :index }, { id:'menu-anlagen-abfragen' }) %></li>
                            <% if theUser(session).can_write? %>
                              <li><%= link_to('Anlage erstellen', { :controller => :plants, :action => :new }, { id:'menu-anlage-erstellen' }) %></li>
                            <% end %>
                        </ul>
                    </div>
                    <div class="nav-wrapper">
                      <div class="nav-title">
                        <span>Einleitstellen</span>
                      </div>
                      <ul class="navigation">
                            <li><%= link_to('Liste der Einleitstellen', { :controller => :discharge_points, :action => :index }, { id:'menu-einleitstellen' }) %></li>
                            <li><%= link_to('Einleitstellen abfragen', { :controller => :einleitstellen_abfrage, :action => :index }, { id:'menu-einleitstellen-abfragen' }) %></li>
                            <% if theUser(session).can_write? %>
                              <li><%= link_to('Einleitstelle erstellen', { :controller => :discharge_points, :action => :new }, { id:'menu-einleitstelle-erstellen' }) %></li>
                            <% end %>
                        </ul>
                      </div>
                      <div class="nav-wrapper">
                        <div class="nav-title">
                          <span>Landesspezifische Daten</span>
                        </div>
                        <ul class="navigation">
                          <li><%= link_to('Liste landesspezifischer Daten', { :controller => :federal_state_info, :action => :index }, { id:'menu-landesspezifische-daten' }) %></li>
                       </ul>
                     </div>
                     <div class="nav-wrapper">
                       <div class="nav-title">
                         <span>Qualitätssicherung</span>
                       </div>
                       <ul class="navigation">
                          <li><%= link_to('QS Menü', { :controller => :inkonsistenzen, :action => :links_hash }, { id:'menu-qs-menue' }) %></li>
                          <li><%= link_to('QS Zusammenfassung', { :controller => :inkonsistenzen, :action => :index_hash }, { id:'menu-qs-zusammenfassung' }) %></li>
                       </ul>
                     </div>

                     <% if theUser(session).can_import_any? || theUser(session).can_read? %>
                       <div class="nav-wrapper">
                         <div class="nav-title">
                           <span>CSV Import &amp; Export</span>
                         </div>
                         <ul class="navigation">
                            <% if theUser(session).can_import_any? %>
                              <li><%= link_to('CSV-Import', { :controller => :csv, :action => :index }, { id:'menu-csv-import' }) %></li>
                            <% end %>
                            <% if theUser(session).can_read? %>
                              <li><%= link_to('CSV-Export (alle Dateien)', { :controller => :csv_export, :action => :index, 'datensatz' => 'all' }, { id:'menu-csv-export' }) %></li>
                            <% end %>
                         </ul>
                       </div>
                     <% end %>
                     <!-- <div class="nav-wrapper">
                       <div class="nav-title">
                         <span>XML Import &amp; Export</span>
                       </div>
                       <ul class="navigation">
                          <% if theUser(session).can_import_any? %>
                            <li><%= link_to('XML-Import', { :controller => :xml, :action => :import }, { id:'menu-xml-import' }) %></li>
                          <% end %>
                          <% if theUser(session).can_export_any? %>
                            <li><%= link_to('XML-Export', { :controller => :xml, :action => :export }, { id:'menu-xml-export' }) %></li>
                          <% end %>
                       </ul>
                     </div> -->
                     <div class="nav-wrapper">
                       <div class="nav-title">
                         <span>Einstellungen</span>
                       </div>
                       <ul class="navigation">
                         <% if theUser(session).is_team_admin? || theUser(session).is_admin? %>
                           <li><%= link_to('Benutzerverwaltung', { :controller => :users }, { id:'menu-benutzerverwaltung' }) %></li>
                         <% else %>
                           <li><%= link_to('Benutzerkonto', { :controller => :users }, { id:'menu-benutzerkonto' }) %></li>
                         <% end %>
                         <% if false and theUser(session).is_global_data_admin? %>
                           <li><%= link_to('Datenbankbackup', {:controller => :admin, :action => :pg_dump}, { id:'menu-datenbankbackup', :target => "_BLANK" }) %></li>
                         <% end %>
                         <% if theUser(session).can_read_global? %>
                           <li><%= link_to('Datenfelder', { :controller => :start, :action => :required_fields }, { id:'menu-datenfelder' }) %></li>
                         <% end %>
                       </ul>
                     </div>
                     <div class="nav-wrapper">
                       <div class="nav-title">
                         <span>Hilfe</span>
                       </div>
                       <ul class="navigation">
                         <li><%= link_to('Hilfe-Wiki', 'https://wiki.e-kommu.de', :target => '_blank') %></li>
                         <li><%= link_to('Tutorial Teil 1 - Einführung',  'https://app.e-kommu.de/videos/Tutorial_1.mp4', :target => '_blank') %></li>
                         <li><%= link_to('Tutorial Teil 2 - Nutzung', 'https://app.e-kommu.de/videos/Tutorial_2.mp4', :target => '_blank') %></li>
                       </ul>
                     </div>
                   </div>
                  </div>
                  <div class="flex-wrapper">
                   <div class="footer">
<!--                      <span><a target="_blank" href="https://wiki.e-kommu.de/index.php/E-Kommunalabwasser:Portal">Hilfe</a></span>-->
                      <!-- <span><%= link_to('Impressum' , { :controller => 'login', :action => 'impressum' }, { id:'menu-impressum', :class => 'nav_link' }) %></span> -->
                      <span><%= link_to('Impressum' , { :controller => :start, :action => :impressum }, { id:'menu-impressum', :class => 'nav_link' }) %></span>
                      <span><%= link_to("v"+::VERSION,{:controller => :start, :action => :versions},{:class => 'version'}) %> </span>
                    </div>
                  </div>
           </div> <!-- end sidebar -->
      </div> <!-- end side_module -->
      <div class="center_module" id="main_content">
        <!-- application.html.erb yields now -->
        <%= yield %>
        <!-- application.html.erb finishes up -->
      </div>
    </div>
     <!-- <a href="#" id="back-to-top" class=""></a> -->
  </body>
</html>
