Implement #37: Add avatar to navbar and profile page.
[phorkie.git] / data / templates / base.htm
index ec2b7469d1398f2f7b229b62fbcc225693626002..75f9d180b5fc58f79a7760f39ae7f8cc2c6d01aa 100644 (file)
@@ -1,43 +1,69 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE html>
 <html>
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE html>
 <html>
- <head>
+  <head>
+  <base href="{{baseurl}}" />
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+  <link rel="stylesheet" href="css/bootstrap.min.css"/>
+  <link rel="stylesheet" href="css/font-awesome.css"/>
+  <link rel="stylesheet" href="css/phorkie.css"/>
+  {% if css %}
   <link rel="stylesheet" href="{{css}}"/>
   <link rel="stylesheet" href="{{css}}"/>
-  <link rel="stylesheet" href="/css/phorkie.css" />
+  {% endif %}
+  {% if iconpng %}
+  <link rel="shortcut icon" href="{{iconpng}}" type="image/png"/>
+  {% endif %}
   <title>{% block title %}{% endblock %} - {{title}}</title>
   <title>{% block title %}{% endblock %} - {{title}}</title>
-  <script src="/js/jquery-1.7.2.min.js"></script>
-  <script src="/js/phorkie.js"></script>
+  <script src="js/jquery.js"></script>
+  <script src="js/bootstrap.min.js"></script>
+  <script src="js/phorkie.js"></script>
   {% block meta %}{% endblock %}
  </head>
  <body>
   {{topbar|raw}}
   {% block meta %}{% endblock %}
  </head>
  <body>
   {{topbar|raw}}
-  <div class="navbar">
+  <div class="navbar navbar-inverse navbar-static-top">
    <div class="navbar-inner">
     <div class="container">
    <div class="navbar-inner">
     <div class="container">
-     <a class="brand" href="/">
-      {{title}}
-     </a>
      <ul class="nav">
       <li>
      <ul class="nav">
       <li>
-       <a href="/new">New paste</a>
+       <a class="brand" href="{{baseurl}}">{{title}}</a>
       </li>
       <li>
       </li>
       <li>
-       <a href="/list">List all</a>
+       <a href="new">New paste</a>
       </li>
       </li>
-      {% if identity %}
       <li>
       <li>
-       <a href="/user">{{name}} ({{email}})</a>
+       <a href="list">List all</a>
+      </li>
+      {% if db.adapter %}
+      <li class="nav-collapse">
+       <form class="span4 pull-right navbar-form" action="search" method="get">
+        <input type="text" class="search-query" name="q" placeholder="Search" value="{{query}}"/>
+       </form>
       </li>
       </li>
+      {% endif %}
+     </ul>
+     <ul class="nav pull-right">
+      {% if identity %}
       <li>
       <li>
-       <a href="/auth?logout">Logout</a>
+       <a href="user"><img class="avatar-tiny" src="{{htmlhelper.getIconUrl(email, 20)}}" width="20" height="20" /> {{name}}</a>
       </li>
       {% endif %}
       {% if db.adapter %}
       <li>
       </li>
       {% endif %}
       {% if db.adapter %}
       <li>
-       <form class="navbar-search pull-left" action="/search" method="get">
-        <input type="text" class="search-query" name="q" placeholder="Search" value="{{query}}"/>
-       </form>
+       <button class="btn btn-navbar btn-inverse pull-right" data-toggle="collapse" data-target=".nav-collapse">
+        <span class="icon-bar"></span>
+        <span class="icon-bar"></span>
+        <span class="icon-bar"></span>
+       </button>
+      </li>
+      {% endif %}
+      {% if identity %}
+      <li>
+       <a href="login?logout">Logout</a>
+      </li>
+      {% else %}
+      <li>
+       <a href="login">Login</a>
       </li>
       {% endif %}
      </ul>
       </li>
       {% endif %}
      </ul>
@@ -51,7 +77,7 @@
      {% block content %}{% endblock %}
     </div>
     <div class="span3">
      {% block content %}{% endblock %}
     </div>
     <div class="span3">
-     <div style="height: 1em"></div>
+     <div class="content-padding-fix"></div>
      {% block sidebar %}{% endblock %}
     </div>
    </div>
      {% block sidebar %}{% endblock %}
     </div>
    </div>
@@ -61,8 +87,7 @@
    <a href="//sf.net/p/phorkie/">phorkie</a>,
    the self-hosted, git-based pastebin software is available under the
    <a href="https://sf.net/p/phorkie/">
    <a href="//sf.net/p/phorkie/">phorkie</a>,
    the self-hosted, git-based pastebin software is available under the
    <a href="https://sf.net/p/phorkie/">
-    <acronym title="GNU Affero General Public License">AGPL</acronym></a>.
+    <abbr title="GNU Affero General Public License">AGPL</abbr></a>.
   </div>
   </div>
-
  </body>
 </html>
  </body>
 </html>