<%
  const titleText = typeof title !== "undefined" ? title : "";
  const subtitleText = typeof subtitle !== "undefined" ? subtitle : "";
  const showUser = typeof showUserName !== "undefined" ? showUserName : true;
%>

<div class="page-header">

  <!-- links -->
  <div class="page-header-left"></div>

  <!-- center -->
  <div class="page-header-center">
    <% if (showUser && user?.username) { %>
      <div class="page-header-username">
        <%=t.global.welcome%>, <%= user.title + " " + user.firstname  + " " + user.lastname %>
      </div>
    <% } %>

    <% if (titleText) { %>
      <div class="page-header-title">
        <%= titleText %>
        <% if (subtitleText) { %>
          <span class="page-header-subtitle"> - <%= subtitleText %></span>
        <% } %>
      </div>
    <% } %>
  </div>

  <!-- rechts -->
  <div class="page-header-right">
    <span id="datetime" class="page-header-datetime"></span>
  </div>
</div>
