Show committer if it differs from author

It is quite useful sometimes to see that someone else (not you) has pushed
commit to remote. This change adds "C committed on D" phrase right after
"A authored on B" if author and committer are not the same person (judging
from email address).
This commit is contained in:
Mike Gelfand
2014-08-02 10:56:55 +03:00
parent 6c99ffee4c
commit 5d3d7517f3
4 changed files with 26 additions and 4 deletions

View File

@@ -18,7 +18,13 @@
<p>{{ commit.body | nl2br }}</p> <p>{{ commit.body | nl2br }}</p>
{% endif %} {% endif %}
<img src="https://gravatar.com/avatar/{{ commit.author.email | lower | md5 }}?s=32" class="pull-left space-right" /> <img src="https://gravatar.com/avatar/{{ commit.author.email | lower | md5 }}?s=32" class="pull-left space-right" />
<span><a href="mailto:{{ commit.author.email }}">{{ commit.author.name }}</a> authored on {{ commit.date | format_date }}<br />Showing {{ commit.changedFiles }} changed files</span> <span>
<a href="mailto:{{ commit.author.email }}">{{ commit.author.name }}</a> authored on {{ commit.date | format_date }}
{% if commit.author.email != commit.commiter.email %}
&bull; <a href="mailto:{{ commit.commiter.email }}">{{ commit.commiter.name }}</a> committed on {{ commit.commiterDate | format_date }}
{% endif %}
<br />Showing {{ commit.changedFiles }} changed files
</span>
</div> </div>
</div> </div>

View File

@@ -13,7 +13,12 @@
<td width="95%"> <td width="95%">
<span class="pull-right"><a class="btn btn-default btn-sm" href="{{ path('commit', {repo: repo, commit: item.hash}) }}"><span class="fa fa-list-alt"></span> View {{ item.shortHash }}</a></span> <span class="pull-right"><a class="btn btn-default btn-sm" href="{{ path('commit', {repo: repo, commit: item.hash}) }}"><span class="fa fa-list-alt"></span> View {{ item.shortHash }}</a></span>
<h4>{{ item.message }}</h4> <h4>{{ item.message }}</h4>
<span><a href="mailto:{{ item.author.email }}">{{ item.author.name }}</a> authored on {{ item.date | format_date }}</span> <span>
<a href="mailto:{{ item.author.email }}">{{ item.author.name }}</a> authored on {{ item.date | format_date }}
{% if item.author.email != item.commiter.email %}
&bull; <a href="mailto:{{ item.commiter.email }}">{{ item.commiter.name }}</a> committed on {{ item.commiterDate | format_date }}
{% endif %}
</span>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}

View File

@@ -17,7 +17,13 @@
<p>{{ commit.body | nl2br }}</p> <p>{{ commit.body | nl2br }}</p>
{% endif %} {% endif %}
<img src="https://gravatar.com/avatar/{{ commit.author.email | lower | md5 }}?s=32" class="pull-left space-right" /> <img src="https://gravatar.com/avatar/{{ commit.author.email | lower | md5 }}?s=32" class="pull-left space-right" />
<span><a href="mailto:{{ commit.author.email }}">{{ commit.author.name }}</a> authored on {{ commit.date | format_date }}<br />Showing {{ commit.changedFiles }} changed files</span> <span>
<a href="mailto:{{ commit.author.email }}">{{ commit.author.name }}</a> authored on {{ commit.date | format_date }}
{% if commit.author.email != commit.commiter.email %}
&bull; <a href="mailto:{{ commit.commiter.email }}">{{ commit.commiter.name }}</a> committed on {{ commit.commiterDate | format_date }}
{% endif %}
<br />Showing {{ commit.changedFiles }} changed files
</span>
</div> </div>
</div> </div>

View File

@@ -13,7 +13,12 @@
<td width="95%"> <td width="95%">
<span class="pull-right"><a class="btn btn-small" href="{{ path('commit', {repo: repo, commit: item.hash}) }}"><i class="icon-list-alt"></i> View {{ item.shortHash }}</a></span> <span class="pull-right"><a class="btn btn-small" href="{{ path('commit', {repo: repo, commit: item.hash}) }}"><i class="icon-list-alt"></i> View {{ item.shortHash }}</a></span>
<h4>{{ item.message }}</h4> <h4>{{ item.message }}</h4>
<span><a href="mailto:{{ item.author.email }}">{{ item.author.name }}</a> authored on {{ item.date | format_date }}</span> <span>
<a href="mailto:{{ item.author.email }}">{{ item.author.name }}</a> authored on {{ item.date | format_date }}
{% if item.author.email != item.commiter.email %}
&bull; <a href="mailto:{{ item.commiter.email }}">{{ item.commiter.name }}</a> committed on {{ item.commiterDate | format_date }}
{% endif %}
</span>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}