--- /dev/null
+{% 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;"/>
+ <span class="fn">{{owner.name}}</span>
+ <br/><span class="muted">owner</span>
+ <span class="clearfix"/>
+</div>
\ No newline at end of file
{% endblock %}
{% block sidebar %}
+ {% include 'display-sidebar-owner.htm' %}
{% include 'display-sidebar-history.htm' %}
{% endblock %}
class HtmlHelper
{
+ public function getIconUrl($email, $size = 32)
+ {
+ if ($email == 'anonymous@phorkie') {
+ return '/phorkie/anonymous.png';
+ }
+
+ $s = new \Services_Libravatar();
+ return $s->url(
+ $email,
+ array(
+ 'size' => $size,
+ 'default' => Tools::fullUrl('/phorkie/anonymous.png')
+ )
+ );
+ }
+
public function getLanguageOptions(File $file = null)
{
$html = '<option value="_auto_">* automatic *</option>';
file_put_contents($this->gitDir . '/description', $description);
}
+ /**
+ * @return array Array with keys "email" and "name"
+ */
+ public function getOwner()
+ {
+ try {
+ $name = $this->getVc()->getCommand('config')
+ ->addArgument('owner.name')->execute();
+ } catch (\VersionControl_Git_Exception $e) {
+ $name = $GLOBALS['phorkie']['auth']['anonymousName'];
+ }
+ try {
+ $email = $this->getVc()->getCommand('config')
+ ->addArgument('owner.email')->execute();
+ } catch (\VersionControl_Git_Exception $e) {
+ $email = $GLOBALS['phorkie']['auth']['anonymousEmail'];
+ }
+
+ return array('name' => trim($name), 'email' => trim($email));
+ }
+
/**
* Get a link to the repository
*
public function getIconUrl()
{
- if ($this->committerEmail == 'anonymous@phorkie') {
- return '/phorkie/anonymous.png';
- }
-
- $s = new \Services_Libravatar();
- return $s->url(
- $this->committerEmail,
- array(
- 'size' => 32,
- 'default' => Tools::fullUrl('/phorkie/anonymous.png')
- )
- );
+ $hh = new HtmlHelper();
+ return $hh->getIconUrl($this->committerEmail);
}
/**
array(
'repo' => $repo,
'dh' => new \Date_HumanDiff(),
+ 'htmlhelper' => new HtmlHelper(),
)
);
?>