From: Dan Brook Date: Wed, 13 Jul 2011 17:27:42 +0000 (+0100) Subject: Provide option to disable gravatars. X-Git-Tag: 0.003005~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FGitalist.git;a=commitdiff_plain;h=225bd36dbf284adf49ae0bffe0fc482f228c0011;hp=1db46055207797b4a4efdefb926471a5441da1cd Provide option to disable gravatars. Apparently this is of concern to folk who fear their stuff being leaked in browser referer headers. Fair enough. Also centralized gravatar template bits while I was at it for simplicity's sake. --- diff --git a/lib/Gitalist.pm b/lib/Gitalist.pm index 28e79ae..7ca047d 100644 --- a/lib/Gitalist.pm +++ b/lib/Gitalist.pm @@ -217,6 +217,15 @@ C<.psgi> found under C: The Gitalist config is loaded with L and the available config options are: +=over + +=item no_gravatars + +If true don't display gravatars. May be desirable if you are worried about +leaking repo names via the browser referer headers. + +=back + =head2 Model::CollectionOfRepos =over diff --git a/root/fragment/ref/commit.tt2 b/root/fragment/ref/commit.tt2 index 29cae88..c213aea 100755 --- a/root/fragment/ref/commit.tt2 +++ b/root/fragment/ref/commit.tt2 @@ -16,14 +16,14 @@

[% Commit.comment | html %]

[% INCLUDE '_refs.tt2' object = commit %] - [% Commit.author.name | html %] + [% INCLUDE 'inc/gravatar.tt2' email = Commit.author.email %][% Commit.author.name | html %] Author [% time_since(Commit.committed_time) %] - [% Commit.committer.name %] + [% INCLUDE 'inc/gravatar.tt2' email = Commit.committer.email %][% Commit.committer.name %] Committer diff --git a/root/fragment/repository/shortlog.tt2 b/root/fragment/repository/shortlog.tt2 index 4394d76..e6d5598 100755 --- a/root/fragment/repository/shortlog.tt2 +++ b/root/fragment/repository/shortlog.tt2 @@ -28,7 +28,7 @@ END; -%]

[% INCLUDE '_refs.tt2' object = line %] - [% line.author.name | html %] + [% INCLUDE 'inc/gravatar.tt2' email = line.author.email %][% line.author.name | html %] commit commitdiff diff --git a/root/inc/gravatar.tt2 b/root/inc/gravatar.tt2 new file mode 100644 index 0000000..973f7e7 --- /dev/null +++ b/root/inc/gravatar.tt2 @@ -0,0 +1 @@ +[% UNLESS c.config.no_gravatars %][% END -%] diff --git a/root/ref/diff_fancy.tt2 b/root/ref/diff_fancy.tt2 index 312c097..6d084ab 100755 --- a/root/ref/diff_fancy.tt2 +++ b/root/ref/diff_fancy.tt2 @@ -13,7 +13,7 @@ [% INCLUDE 'inc/chroma_hash.tt2' sha1 = Commit.sha1.substr(0, 7) %] [% time_since(Commit.authored_time) %] [% short_cmt(Commit.comment) | html %] - [% Commit.author.name | html %] + [% INCLUDE 'inc/gravatar.tt2' email = Commit.committer.email %][% Commit.author.name | html %] diff --git a/root/repository/search.tt2 b/root/repository/search.tt2 index b3f2327..5e4d446 100755 --- a/root/repository/search.tt2 +++ b/root/repository/search.tt2 @@ -29,7 +29,7 @@ No results found for [% c.req.param('text') | html %]. c.req.param('text'), '' _ c.req.param('text') _ '' ); %] - [% result.author.name | html %] + [% INCLUDE 'inc/gravatar.tt2' email = result.author.email %][% result.author.name | html %] commit commitdiff diff --git a/root/static/css/core.css b/root/static/css/core.css index 85543fd..cca79a3 100755 --- a/root/static/css/core.css +++ b/root/static/css/core.css @@ -421,6 +421,11 @@ table.listing thead { padding:9px 5px 9px 10px; } +.listing .gravatar { + float: left; + padding-right: 10px; +} + /* puts the repo description on one line which gets truncated if the repo name is too long