git.cweiske.de
/
phorkie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bc5dc89
)
Implement #37: Add avatar to navbar and profile page.
author
Fredrik Nygren
<frny@valteo.net>
Tue, 20 Aug 2013 19:55:31 +0000
(21:55 +0200)
committer
Christian Weiske
<cweiske@cweiske.de>
Tue, 20 Aug 2013 19:55:31 +0000
(21:55 +0200)
data/templates/base.htm
patch
|
blob
|
history
data/templates/display-sidebar-history.htm
patch
|
blob
|
history
data/templates/display-sidebar-owner.htm
patch
|
blob
|
history
data/templates/user.htm
patch
|
blob
|
history
www/css/phorkie.css
patch
|
blob
|
history
www/www-header.php
patch
|
blob
|
history
diff --git
a/data/templates/base.htm
b/data/templates/base.htm
index 1dcf0fce760f1f6929d80b1867fdbb2e7ac913cb..75f9d180b5fc58f79a7760f39ae7f8cc2c6d01aa 100644
(file)
--- a/
data/templates/base.htm
+++ b/
data/templates/base.htm
@@
-45,7
+45,7
@@
<ul class="nav pull-right">
{% if identity %}
<li>
<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 %}
</li>
{% endif %}
{% if db.adapter %}
diff --git
a/data/templates/display-sidebar-history.htm
b/data/templates/display-sidebar-history.htm
index 6dda7e0f0ae5b3fb86aff66396f398c300b30d62..0e99b2fd96a41e0231f57a9b5ba9cfd6a9a615ba 100644
(file)
--- a/
data/templates/display-sidebar-history.htm
+++ b/
data/templates/display-sidebar-history.htm
@@
-9,7
+9,7
@@
{% endfor %}
{% endspaceless %}
<a class="hash" href="{{repo.getLink('revision', commit.hash)}}">{{commit.hash|slice(0, 6)}}</a>
{% 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)}}
<span class="nobr" title="{{commit.committerTime|date('c')}}">
<span class="indent visible-tablet"></span>
{{dh.get(commit.committerTime)}}
diff --git
a/data/templates/display-sidebar-owner.htm
b/data/templates/display-sidebar-owner.htm
index f84a5fa7280747b8288ea677a43af1c2bedab3a1..032488d84c7eb2ef4ee3b0824ea7c5d0f8a77462 100644
(file)
--- a/
data/templates/display-sidebar-owner.htm
+++ b/
data/templates/display-sidebar-owner.htm
@@
-1,9
+1,9
@@
{% set owner = repo.getOwner %}
<div class="well well-small vcard">
<img src="{{htmlhelper.getIconUrl(owner.email, 48)}}" alt="{{owner.name}}"
{% 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"/>
<span class="fn">{{owner.name}}</span>
<br/><span class="muted">owner</span>
<span class="clearfix"/>
-</div>
\ No newline at end of file
+</div>
diff --git
a/data/templates/user.htm
b/data/templates/user.htm
index ab55b5966f0f926f82862cc56fd9b35a48e29e2b..0856a6d67d4a9dc7cd20e3e77fc1267fc761c970 100644
(file)
--- a/
data/templates/user.htm
+++ b/
data/templates/user.htm
@@
-10,16
+10,21
@@
<h3>User profile</h3>
<dl>
<dt>OpenID</dt>
<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>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.
</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 %}
</p>
{% endblock %}
diff --git
a/www/css/phorkie.css
b/www/css/phorkie.css
index 29e7d854c1b0dc46d0fd3d9cb88631551d4fa8a2..f752de70548d067e092b6644aa6652a9641df9c4 100644
(file)
--- a/
www/css/phorkie.css
+++ b/
www/css/phorkie.css
@@
-166,3
+166,13
@@
form label.inline {
.nobr {
white-space:nowrap;
}
.nobr {
white-space:nowrap;
}
+
+.avatar-large {
+ border-radius: 5px;
+}
+.avatar-small {
+ border-radius: 3px;
+}
+.avatar-tiny {
+ border-radius: 2px;
+}
diff --git
a/www/www-header.php
b/www/www-header.php
index 1888839746f7f7e5b3e2eb509da0f792d47bfded..1d59b1c4feb7447628bd0e3f278946b62b090225 100644
(file)
--- a/
www/www-header.php
+++ b/
www/www-header.php
@@
-98,6
+98,9
@@
function render($tplname, $vars = array())
$vars['email'] = $_SESSION['email'];
}
$vars['db'] = new Database();
$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);
$template = $GLOBALS['twig']->loadTemplate($tplname . '.htm');
echo $template->render($vars);