From: James Moger Date: Thu, 17 Nov 2011 03:33:18 +0000 (-0500) Subject: Metric object now implements comparable. Adjust gravatar css. X-Git-Tag: v0.8.0~95 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e19d3da3cdb4e3d0524e3a3ffc6a2cfa8876e927;p=gitblit.git Metric object now implements comparable. Adjust gravatar css. --- diff --git a/resources/bootstrap.gb.css b/resources/bootstrap.gb.css index 1eae63de..06c46709 100644 --- a/resources/bootstrap.gb.css +++ b/resources/bootstrap.gb.css @@ -170,6 +170,13 @@ img.overview { border:1px solid #CCCCCC; } +img.gravatar { + background-color: #ffffff; + border: 1px solid #ddd; + border-radius: 5px; + padding: 2px; +} + div.header, div.commitHeader, table.repositories th { background-color:#e0e0e0; background-repeat:repeat-x; diff --git a/src/com/gitblit/models/Metric.java b/src/com/gitblit/models/Metric.java index e7c49a45..2845c527 100644 --- a/src/com/gitblit/models/Metric.java +++ b/src/com/gitblit/models/Metric.java @@ -24,7 +24,7 @@ import java.io.Serializable; * @author James Moger * */ -public class Metric implements Serializable { +public class Metric implements Serializable, Comparable { private static final long serialVersionUID = 1L; @@ -36,4 +36,15 @@ public class Metric implements Serializable { public Metric(String name) { this.name = name; } + + @Override + public int compareTo(Metric o) { + if (count > o.count) { + return -1; + } + if (count < o.count) { + return 1; + } + return 0; + } } \ No newline at end of file diff --git a/src/com/gitblit/wicket/GravatarImage.java b/src/com/gitblit/wicket/GravatarImage.java index ff26fc09..88c97c93 100644 --- a/src/com/gitblit/wicket/GravatarImage.java +++ b/src/com/gitblit/wicket/GravatarImage.java @@ -50,6 +50,7 @@ public class GravatarImage extends WebComponent { String url = MessageFormat.format("http://www.gravatar.com/avatar/{0}?s={1,number,0}&d=identicon", authorhash, width); add(new AttributeModifier("src", true, new Model(url))); setVisible(GitBlit.getBoolean(Keys.web.allowGravatar, true)); + WicketUtils.setCssClass(this, "gravatar"); } @Override