MiraitSystems/enju_trunk

View on GitHub
app/views/page/_header.html.erb

Summary

Maintainability
Test Coverage
<div class="header_and_footer">
  <div id="header_left">
    <div id="library_system_name">
      <h1 class="resource_title"><%= link_to LibraryGroup.system_name(@locale), root_path, :title => LibraryGroup.system_name(@locale) %></h1>
    </div>
    <div id="header_micro_advertisement"></div>
  </div>

  <div id="header_advertisement"></div>

  <div id="header_right">
    <div id="user_account">
      <% if user_signed_in? %>
        <%= t('page.logged_in_as', :login_name => current_user.try(:agent).try(:full_name)) -%>
        <br />
        <%= link_to image_tag('icons/email.png', :size => '16x16', :alt => t('activerecord.models.message'), :title => t('tooltip.message')), messages_path %>
        <% if current_user.received_messages.unread.size > 0 %>
          <%= link_to "(#{h(current_user.received_messages.unread.size)})", messages_path %>
        <% else %>
          (<%= current_user.received_messages.unread.size %>)
        <% end %>
        <%= link_to t('page.account'), edit_my_account_path -%>
        <%= link_to t('page.sign_out'), destroy_user_session_path, method: :delete -%>
        <br />
      <% else %>
        <% unless controller_name == 'sessions' %>
          <%- unless SystemConfiguration.login_link_hidden? %>
            <%= link_to t('page.sign_in'), new_user_session_path -%>
          <%- end -%>
        <% end %>
      <% end %>
      <br />
    </div>

    <%= render 'page/select_locale' -%>
    <%= l(Time.now, :format => :only_date) if SystemConfiguration.get("header.disp_date") == 1 -%>
    <%= wareki_dateformat(Time.now) if SystemConfiguration.get("header.disp_date") == 2 -%>
    <%- if SystemConfiguration.get('display_manual') -%>    
      <div id="header_manual" %><%= link_to t('page.get_manual'), get_manual_path %></div>
    <%- end -%>
  </div>
</div>