denny/ShinyCMS

View on GitHub
root/admin/includes/header.tt

Summary

Maintainability
Test Coverage
    <header class="app-header navbar">
      <button class="navbar-toggler sidebar-toggler d-lg-none mr-auto" type="button" data-toggle="sidebar-show">
        <span class="navbar-toggler-icon"></span>
      </button>
      <a class="navbar-brand" href="#">
        <img class="navbar-brand-full"      src="[% c.uri_for( '/static/admin/images/ShinyCMS-logo.png'   ) %]" width="153" height="47" alt="ShinyCMS">
        <img class="navbar-brand-minimized" src="[% c.uri_for( '/static/admin/images/ShinyCMS-spiral.png' ) %]" width="30"  height="30" alt="ShinyCMS">
      </a>
      <button class="navbar-toggler sidebar-toggler d-md-down-none" type="button" data-toggle="sidebar-lg-show">
        <span class="navbar-toggler-icon"></span>
      </button>

      [% INCLUDE 'admin/includes/breadcrumb.tt' %]

      <ul class="nav navbar-nav ml-auto">
        [%- IF c.user_exists %]
        <li class="nav-item dropdown">
          <a class="nav-link" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
            [%- IF c.user.profile_pic %]
            <img class="img-avatar" src="[% c.uri_for( '/static/cms-uploads/user-profile-pics', c.user.username, c.user.profile_pic ) %]" alt="[% c.user.username %]">
            [%- ELSE %]
            <b>[% c.user.username %]</b>
            [%- END %]
          </a>
          <div class="dropdown-menu dropdown-menu-right">
            <a class="dropdown-item" href="[% c.uri_for( '/user', c.user.username ) %]">
              <i class="fa fa-user"></i> View profile</a>
            <a class="dropdown-item" href="[% c.uri_for( '/admin/users/user', c.user.id, 'edit' ) %]">
              <i class="fa fa-pencil"></i> Edit profile</a>
            <a class="dropdown-item" href="[% c.uri_for( '/admin/users/user', c.user.id, 'change-password' ) %]">
              <i class="fa fa-lock"></i> Change password</a>
            <a class="dropdown-item" href="[% c.uri_for( '/user/logout' ) %]">
              <i class="fa fa-sign-out"></i> Logout</a>
          </div>
        </li>
        [%- END %]
      </ul>
    </header>