<ul class="nav pull-right">
{% if identity %}
<li>
- <a href="user">{{name}}</a>
+ <a href="user"><img class="avatar-tiny" src="{{htmlhelper.getIconUrl(email, 20)}}" width="20" height="20" /> {{name}}</a>
</li>
{% endif %}
{% if db.adapter %}
{% endfor %}
{% endspaceless %}
<a class="hash" href="{{repo.getLink('revision', commit.hash)}}">{{commit.hash|slice(0, 6)}}</a>
- <img src="{{commit.getIconUrl}}" alt="{{commit.committerName}}" title="{{commit.committerName}}" width="20"/>
+ <img class="avatar-tiny" src="{{commit.getIconUrl}}" alt="{{commit.committerName}}" title="{{commit.committerName}}" width="20" height="20"/>
<span class="nobr" title="{{commit.committerTime|date('c')}}">
<span class="indent visible-tablet"></span>
{{dh.get(commit.committerTime)}}
{% set owner = repo.getOwner %}
<div class="well well-small vcard">
<img src="{{htmlhelper.getIconUrl(owner.email, 48)}}" alt="{{owner.name}}"
- width="48" height="48" class="photo"
- style="float: left; padding-right: 1ex;"/>
+ width="48" height="48" class="photo avatar-small pull-left"
+ style="margin-right: 1em;" />
<span class="fn">{{owner.name}}</span>
<br/><span class="muted">owner</span>
<span class="clearfix"/>
-</div>
\ No newline at end of file
+</div>
<h3>User profile</h3>
<dl>
<dt>OpenID</dt>
- <dd><code>{{ identity }}</code>
+ <dd><code>{{ identity }}</code></dd>
<dt>Name</dt>
<dd><code>{{ name }}</code></dd>
<dt>Email</dt>
<dd><code>{{ email }}</code></dd>
+
+ <dt>Avatar image</dt>
+ <dd><img class="avatar-large" src="{{htmlhelper.getIconUrl(email, 92)}}"></dd>
</dl>
<p>
You may change this data with your OpenID provider.
+ The avatar image is loaded from <a href="http://libravatar.org/">libravatar.org</a>,
+ or perhaps from your own avatar server.
</p>
{% endblock %}
.nobr {
white-space:nowrap;
}
+
+.avatar-large {
+ border-radius: 5px;
+}
+.avatar-small {
+ border-radius: 3px;
+}
+.avatar-tiny {
+ border-radius: 2px;
+}
$vars['email'] = $_SESSION['email'];
}
$vars['db'] = new Database();
+ if (!isset($vars['htmlhelper'])) {
+ $vars['htmlhelper'] = new HtmlHelper();
+ }
$template = $GLOBALS['twig']->loadTemplate($tplname . '.htm');
echo $template->render($vars);