[mb-commits] branch, beta, updated. Merge remote-tracking branch 'freso/MBS-5620' into beta MBS-5620: Use 54px im...

MusicBrainz Git Server <[email protected]>
Newsgroups gmane.comp.audio.musicbrainz.cvs
Message-ID <E1TfWYP-00033G-Cs@wiley>
The branch, beta has been updated
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=d67e1a09c0c4f1a52fe488a22b37946dc36970d2 (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=eef0a2ed3873203adc9c3c979b4f6119f88657bd (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=8d7b78e8b913f00e171ffea0eb7a11d9b6350ec1 (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=f383b93bf0e5251a51706d96de1b91e318e30cc6 (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=07983e7c2172f5bd722e7c8a3f1422b152ff6786 (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=1f7aff8bf47351aaf354af41bee2bf4211904b3f (commit)
      from  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=c74933d025bc9053d60e511f96d8103ca63dd865 (commit)

Summary of changes:
 root/components/common-macros.tt |    8 +++++---
 root/user/profile/layout.tt      |    2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d67e1a09c0c4f1a52fe488a22b37946dc36970d2
Merge: c74933d eef0a2e
Author: warp <[email protected]>
Date:   Mon Dec 3 14:59:09 2012 +0100

    Merge remote-tracking branch 'freso/MBS-5620' into beta
    
    * freso/MBS-5620:
      MBS-5620: Use 54px image on profile pages.
      MBS-5620: Fix ampersand encoding in gravatar URLs.
      MBS-5620: Made it actually work.
      MBS-5620: Implementing size option for Gravatar macro.
      MBS-5620: Add "&s=12" to Gravatar URLs.
    
    Conflicts:
    	root/components/common-macros.tt

diff --cc root/components/common-macros.tt
index 0385e11,5634aad..7bb1c98
--- a/root/components/common-macros.tt
+++ b/root/components/common-macros.tt
@@@ -402,13 -402,15 +402,15 @@@ END -%
      action = action || 'profile';
      link = c.uri_for_action("/user/$action", [ editor.name ]);
      text = text == '' ? html_escape(editor.name) : text;
+     size = size.defined ? size : 12;
      '<a href="' _ link _ '">';
      IF editor.preferences.show_gravatar;
-       '<img src="' _ gravatar(editor.email) _ '" class="gravatar" />';
+       image_url = gravatar(editor.email) _ '&amp;s=' _ size;
      ELSE;
-       '<img src="//gravatar.com/avatar/placeholder?d=mm" class="gravatar" />';
+       image_url = '//gravatar.com/avatar/placeholder?d=mm&amp;s=' _ size;
      END;
+     '<img src="' _ image_url _ '" class="gravatar" />' ;
 -    text;
 +    '<bdi>' _ text _ '</bdi>';
      '</a>';
  END -%]
  

commit eef0a2ed3873203adc9c3c979b4f6119f88657bd
Author: Frederik "Freso" S. Olesen <[email protected]>
Date:   Thu Nov 29 01:22:26 2012 +0100

    MBS-5620: Use 54px image on profile pages.
    
    Load 54px images from Gravatar instead of the 80px ones, to lessen
    bandwidth etc. loading a bit more.
    
    See also:
    http://chatlogs.musicbrainz.org/musicbrainz-devel/2012/2012-11/2012-11-29.html#T00-13-02-901437

diff --git a/root/user/profile/layout.tt b/root/user/profile/layout.tt
index cfa1d13..604e6e9 100644
--- a/root/user/profile/layout.tt
+++ b/root/user/profile/layout.tt
@@ -5,7 +5,7 @@
         : l("Editor “{user}”", { user => html_escape(user.name) })
     -%]
 
-    <h1>[% l("{user}", { user => link_editor(user, undef, '', 80) }) %]</h1>
+    <h1>[% l("{user}", { user => link_editor(user, undef, '', 54) }) %]</h1>
 
 [% MACRO generic_link(url, text) BLOCK %]<a href="[% url %]">[% text %]</a>[% END %]
 

commit 8d7b78e8b913f00e171ffea0eb7a11d9b6350ec1
Author: Frederik "Freso" S. Olesen <[email protected]>
Date:   Wed Nov 28 23:09:44 2012 +0000

    MBS-5620: Fix ampersand encoding in gravatar URLs.

diff --git a/root/components/common-macros.tt b/root/components/common-macros.tt
index 76c0d6b..5634aad 100644
--- a/root/components/common-macros.tt
+++ b/root/components/common-macros.tt
@@ -405,9 +405,9 @@ END -%]
     size = size.defined ? size : 12;
     '<a href="' _ link _ '">';
     IF editor.preferences.show_gravatar;
-      image_url = gravatar(editor.email) _ '&s=' _ size;
+      image_url = gravatar(editor.email) _ '&amp;s=' _ size;
     ELSE;
-      image_url = '//gravatar.com/avatar/placeholder?d=mm&s=' _ size;
+      image_url = '//gravatar.com/avatar/placeholder?d=mm&amp;s=' _ size;
     END;
     '<img src="' _ image_url _ '" class="gravatar" />' ;
     text;

commit f383b93bf0e5251a51706d96de1b91e318e30cc6
Author: Frederik "Freso" S. Olesen <[email protected]>
Date:   Wed Nov 28 21:30:06 2012 +0000

    MBS-5620: Made it actually work.
    
    Reverted a lot of code, as there was a simpler way to do things.
    Still needs more testing, but at least works now.

diff --git a/lib/MusicBrainz/Server/Filters.pm b/lib/MusicBrainz/Server/Filters.pm
index bd4f574..ba8f1da 100644
--- a/lib/MusicBrainz/Server/Filters.pm
+++ b/lib/MusicBrainz/Server/Filters.pm
@@ -218,9 +218,7 @@ sub locale
 
 sub gravatar {
     my $email = shift;
-    my $size = shift;
-    my $url_size = $size == 'small' ? '&s=12' : '';
-    return sprintf '//gravatar.com/avatar/%s?d=mm%s', md5_hex(lc(trim($email))), $url_size;
+    return sprintf '//gravatar.com/avatar/%s?d=mm', md5_hex(lc(trim($email)));
 }
 
 sub _amazon_https {
diff --git a/root/components/common-macros.tt b/root/components/common-macros.tt
index 6e010d1..76c0d6b 100644
--- a/root/components/common-macros.tt
+++ b/root/components/common-macros.tt
@@ -398,18 +398,18 @@ END -%]
 
 [%- MACRO gravatar(email) FILTER gravatar; email; END -%]
 
-[%- MACRO link_editor(editor, action, text) BLOCK;
+[%- MACRO link_editor(editor, action, text, size) BLOCK;
     action = action || 'profile';
     link = c.uri_for_action("/user/$action", [ editor.name ]);
     text = text == '' ? html_escape(editor.name) : text;
-    size = size == '' ? 'small' : size;
-    url_size = size == 'small' ? '&s=12' : '';
+    size = size.defined ? size : 12;
     '<a href="' _ link _ '">';
     IF editor.preferences.show_gravatar;
-      '<img src="' _ gravatar(editor.email, size) _ '" class="gravatar" />';
+      image_url = gravatar(editor.email) _ '&s=' _ size;
     ELSE;
-      '<img src="//gravatar.com/avatar/placeholder?d=mm' _ url_size _ '" class="gravatar" />';
+      image_url = '//gravatar.com/avatar/placeholder?d=mm&s=' _ size;
     END;
+    '<img src="' _ image_url _ '" class="gravatar" />' ;
     text;
     '</a>';
 END -%]
diff --git a/root/user/profile/layout.tt b/root/user/profile/layout.tt
index 9a893de..cfa1d13 100644
--- a/root/user/profile/layout.tt
+++ b/root/user/profile/layout.tt
@@ -5,7 +5,7 @@
         : l("Editor “{user}”", { user => html_escape(user.name) })
     -%]
 
-    <h1>[% l("{user}", { user => link_editor(user, undef, '', 'default') }) %]</h1>
+    <h1>[% l("{user}", { user => link_editor(user, undef, '', 80) }) %]</h1>
 
 [% MACRO generic_link(url, text) BLOCK %]<a href="[% url %]">[% text %]</a>[% END %]
 

commit 07983e7c2172f5bd722e7c8a3f1422b152ff6786
Author: Frederik "Freso" S. Olesen <[email protected]>
Date:   Wed Nov 28 21:31:04 2012 +0100

    MBS-5620: Implementing size option for Gravatar macro.
    
    Or an attempt at it anyway.

diff --git a/lib/MusicBrainz/Server/Filters.pm b/lib/MusicBrainz/Server/Filters.pm
index 0de82fc..bd4f574 100644
--- a/lib/MusicBrainz/Server/Filters.pm
+++ b/lib/MusicBrainz/Server/Filters.pm
@@ -218,7 +218,9 @@ sub locale
 
 sub gravatar {
     my $email = shift;
-    return sprintf '//gravatar.com/avatar/%s?d=mm&s=12', md5_hex(lc(trim($email)));
+    my $size = shift;
+    my $url_size = $size == 'small' ? '&s=12' : '';
+    return sprintf '//gravatar.com/avatar/%s?d=mm%s', md5_hex(lc(trim($email))), $url_size;
 }
 
 sub _amazon_https {
diff --git a/root/components/common-macros.tt b/root/components/common-macros.tt
index c34b56f..6e010d1 100644
--- a/root/components/common-macros.tt
+++ b/root/components/common-macros.tt
@@ -402,11 +402,13 @@ END -%]
     action = action || 'profile';
     link = c.uri_for_action("/user/$action", [ editor.name ]);
     text = text == '' ? html_escape(editor.name) : text;
+    size = size == '' ? 'small' : size;
+    url_size = size == 'small' ? '&s=12' : '';
     '<a href="' _ link _ '">';
     IF editor.preferences.show_gravatar;
-      '<img src="' _ gravatar(editor.email) _ '" class="gravatar" />';
+      '<img src="' _ gravatar(editor.email, size) _ '" class="gravatar" />';
     ELSE;
-      '<img src="//gravatar.com/avatar/placeholder?d=mm&s=12" class="gravatar" />';
+      '<img src="//gravatar.com/avatar/placeholder?d=mm' _ url_size _ '" class="gravatar" />';
     END;
     text;
     '</a>';
diff --git a/root/user/profile/layout.tt b/root/user/profile/layout.tt
index da0f66a..9a893de 100644
--- a/root/user/profile/layout.tt
+++ b/root/user/profile/layout.tt
@@ -5,7 +5,7 @@
         : l("Editor “{user}”", { user => html_escape(user.name) })
     -%]
 
-    <h1>[% l("{user}", { user => link_entity(user) }) %]</h1>
+    <h1>[% l("{user}", { user => link_editor(user, undef, '', 'default') }) %]</h1>
 
 [% MACRO generic_link(url, text) BLOCK %]<a href="[% url %]">[% text %]</a>[% END %]
 

commit 1f7aff8bf47351aaf354af41bee2bf4211904b3f
Author: Frederik "Freso" S. Olesen <[email protected]>
Date:   Wed Nov 28 20:57:49 2012 +0100

    MBS-5620: Add "&s=12" to Gravatar URLs.
    
    Needs testing though as I believe we won't want to use the small
    icons everywhere.

diff --git a/lib/MusicBrainz/Server/Filters.pm b/lib/MusicBrainz/Server/Filters.pm
index ba8f1da..0de82fc 100644
--- a/lib/MusicBrainz/Server/Filters.pm
+++ b/lib/MusicBrainz/Server/Filters.pm
@@ -218,7 +218,7 @@ sub locale
 
 sub gravatar {
     my $email = shift;
-    return sprintf '//gravatar.com/avatar/%s?d=mm', md5_hex(lc(trim($email)));
+    return sprintf '//gravatar.com/avatar/%s?d=mm&s=12', md5_hex(lc(trim($email)));
 }
 
 sub _amazon_https {
diff --git a/root/components/common-macros.tt b/root/components/common-macros.tt
index e9d15fb..c34b56f 100644
--- a/root/components/common-macros.tt
+++ b/root/components/common-macros.tt
@@ -406,7 +406,7 @@ END -%]
     IF editor.preferences.show_gravatar;
       '<img src="' _ gravatar(editor.email) _ '" class="gravatar" />';
     ELSE;
-      '<img src="//gravatar.com/avatar/placeholder?d=mm" class="gravatar" />';
+      '<img src="//gravatar.com/avatar/placeholder?d=mm&s=12" class="gravatar" />';
     END;
     text;
     '</a>';

-----------------------------------------------------------------------


hooks/post-receive
-- 
mb_server

_______________________________________________
MusicBrainz-commits mailing list
[email protected]
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-commits
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.