LibreCat/LibreCat

View on GitHub
views/header.tt

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html lang="[% h.loc('language_code') %]">
[% lang = h.locale() -%]
[% lf = h.config.locale.$lang -%]
[% qp = params_query %]
[% path_info = request.path_info -%]

<!-- BEGIN header.tt -->
  <head>
    <title>
      [%- IF title %][% title | html %][% ELSE %][% h.loc("appname") %][% END %]
    </title>
    <link rel="icon" href="[% uri_base %]/images/brand_logo.png" type="image/png">
    [%- IF title AND !backend %]
      <!-- Google Scholar -->
      [%- IF title %]<meta name="citation_title" content="[% title | html %]">[% END %]
      [%- FOREACH author_entry IN author %]<meta name="citation_author" content="[% author_entry.full_name | html %]">
      [% END -%]
      [%- IF year %]<meta name="citation_date" content="[% year | html %]">[% END %]
      [%- IF file %][% FOREACH fi IN file %][% IF fi.file_name %]
      <meta name="citation_pdf_url" content="[% uri_base %]/download/[% _id %]/[% fi.file_id %]/[% fi.file_name | uri %]">[% END %][% END %][% END %]
      [%- IF doi %]<meta name="citation_pdf_url" content="https://doi.org/[% doi | html %]">[% ELSIF link %]<meta name="citation_pdf_url" content="[% link.0.url | html %]">[% END %]
      [%- IF publication %]<meta name="citation_journal_title" content="[% publication | html %]" />[% END %]
      [%- IF volume %]<meta name="citation_volume" content="[% volume | html %]" />[% END %]
      [%- IF issue %]<meta name="citation_issue" content="[% issue | html %]" />[% END %]
      [%- IF publication_identifier.issn.0 %]<meta name="citation_issn" content="[% publication_identifier.issn.0 | html %]">[% END %]
      [%- IF publication_identifier.isbn.0 %]<meta name="citation_isbn" content="[% publication_identifier.isbn.0 | html %]">[% END %]
      <!-- DC-Tags -->
      <link rel="schema.DC" href="http://purl.org/dc/elements/1.1/">
      <meta name="DC.title" content="[% IF personPageTitle %][% personPageTitle | html %][% ELSE %][% title | html %][% END %]">
      [%- FOREACH author_entry IN author %]<meta name="DC.creator" content="[% author_entry.full_name %]">
      [% END -%]
      [%- IF year %]<meta name="DC.date" content="[% year | html %]">[% END %]
      [%- IF language %]<meta name="DC.language" content="[% language.0.iso | html %]">[% END %]
      <meta name="DC.identifier" content="[% uri_base %][% path_info %]/[% _id %]">
      [%- IF abstract %][% FOREACH abstract_entry IN abstract %][% UNLESS loop.first %][% END %]<meta name="DC.description" content="[% abstract_entry.text | html %]">[% END %][% END %]
      [%- FOREACH rel_entry IN entry.host %][% IF rel_entry.issn %]<meta name="DC.source.ISSN" content="[% rel_entry.issn.0 | html %]">[% END %][% IF rel_entry.isbn %]<meta name="DC.source.ISBN" content="[% rel_entry.isbn.0 | html %]">[% END %][% END %]
      [%- lowtype = type.lower %]
      <meta name="DC.type" content="[% h.get_list('gs_doc_type').$lowtype %]">
      [%- IF doi %]<link rel="DC.relation" href="https://doi.org/[% doi | html %]">[% END %]
      [%- IF urn %]<link rel="DC.relation" href="http://nbn-resolving.de/[% urn | html %]">[% END %]
      [%- IF publication_identifier.issn.0 %]<link rel="DC.relation" href="urn:ISSN:[% publication_identifier.issn.0 | html %]">[% END %]
      [%- IF publication_identifier.isbn.0 %]<link rel="DC.relation" href="urn:ISBN:[% publication_identifier.isbn.0 | html %]">[% END %]
    [%- END %]
    [% personid = path_info.search('person/(\d{1,})') -%]
    [% query = qp.q | replace('"', '&quot;') -%]
    [%- IF path_info.match("person/") %]
      [%- query = "person%2D$personid"%]
      <link rel="alternate" type="application/rss+xml" href="[% h.uri_for('/feed/daily', q = query) %]" title="[% thisPerson.first_name | html %] [% thisPerson.last_name | html %]'s Publication (today)">
      <link rel="alternate" type="application/rss+xml" href="[% h.uri_for('/feed/weekly', q = query) %]" title="[% thisPerson.first_name | html %] [% thisPerson.last_name | html %]'s Publication (last week)">
      <link rel="alternate" type="application/rss+xml" href="[% h.uri_for('/feed/monthly', q = query) %]" title="[% thisPerson.first_name | html %] [% thisPerson.last_name | html %]'s Publication (last month)">
    [%- ELSIF path_info.match("text") %]
      [%- qp.q = query %]
      <link rel="alternate" type="application/rss+xml" href="[% h.uri_for('/feed/monthly', q = query) %]" title="Publications last month">
    [%- END %]
    [% UNLESS backend %]
    <meta name="robots" content="index,follow,noimageindex" />
    [% ELSE -%]
    <meta name="robots" content="noindex,nofollow,noimageindex" />
    [% END %]
    [% INCLUDE head_meta.tt %]
  </head>

  <body>
  [% INCLUDE topbar.tt %]

  <div class="row">
    <div class="col-xs-12" id="messages">
      [%- FOREACH flash_type IN ['danger', 'warning', 'success', 'info'] %]
      [%- IF flash.$flash_type %]
      <div class="alert alert-[% flash_type %] alert-dismissible mbottom-default" role="alert">
        <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        [% flash.$flash_type %]
      </div>
      [%- END %]
      [%- END %]
    </div>
  </div>

<!-- END header.tt -->