From 1fa5e85b2d208636a6237ef8930f200767165baa Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Tue, 07 Jun 2011 20:55:19 -0400 Subject: [PATCH] Improved metrics page and added metrics links to branches panel. --- src/com/gitblit/wicket/pages/SummaryPage.html | 2 src/com/gitblit/models/RefModel.java | 5 + tests/com/gitblit/tests/MetricUtilsTest.java | 6 src/com/gitblit/wicket/panels/RefsPanel.java | 8 +- src/com/gitblit/wicket/pages/RepositoryPage.java | 3 src/com/gitblit/wicket/resources/gitblit.css | 23 ++++- src/com/gitblit/wicket/pages/MetricsPage.java | 55 +++++-------- src/com/gitblit/wicket/panels/TagsPanel.java | 9 ++ src/com/gitblit/wicket/GitBlitWebApp.properties | 6 + src/com/gitblit/wicket/pages/MetricsPage.html | 26 ++++- src/com/gitblit/wicket/panels/BranchesPanel.java | 33 +++++++- src/com/gitblit/wicket/pages/RepositoryPage.html | 2 src/com/gitblit/utils/MetricUtils.java | 21 ++-- docs/00_index.mkd | 1 src/com/gitblit/wicket/pages/SummaryPage.java | 12 +- src/com/gitblit/wicket/panels/BranchesPanel.html | 20 ++++- 16 files changed, 148 insertions(+), 84 deletions(-) diff --git a/docs/00_index.mkd b/docs/00_index.mkd index 8c8f932..d133163 100644 --- a/docs/00_index.mkd +++ b/docs/00_index.mkd @@ -56,7 +56,6 @@ ### Todo List - Code documentation - Unit testing -- Branch selector on Metrics - Blame - Clone remote repository diff --git a/src/com/gitblit/models/RefModel.java b/src/com/gitblit/models/RefModel.java index 39bf19c..0b65c09 100644 --- a/src/com/gitblit/models/RefModel.java +++ b/src/com/gitblit/models/RefModel.java @@ -127,4 +127,9 @@ public int compareTo(RefModel o) { return getDate().compareTo(o.getDate()); } + + @Override + public String toString() { + return displayName; + } } \ No newline at end of file diff --git a/src/com/gitblit/utils/MetricUtils.java b/src/com/gitblit/utils/MetricUtils.java index d8286e2..492b024 100644 --- a/src/com/gitblit/utils/MetricUtils.java +++ b/src/com/gitblit/utils/MetricUtils.java @@ -39,10 +39,12 @@ private static final Logger LOGGER = LoggerFactory.getLogger(MetricUtils.class); - public static List<Metric> getDateMetrics(Repository r, boolean includeTotal, String format) { + public static List<Metric> getDateMetrics(Repository r, String objectId, boolean includeTotal, String format) { Metric total = new Metric("TOTAL"); final Map<String, Metric> metricMap = new HashMap<String, Metric>(); - + if (StringUtils.isEmpty(objectId)) { + objectId = Constants.HEAD; + } if (JGitUtils.hasCommits(r)) { final List<RefModel> tags = JGitUtils.getTags(r, true, -1); final Map<ObjectId, RefModel> tagMap = new HashMap<ObjectId, RefModel>(); @@ -51,7 +53,7 @@ } try { RevWalk walk = new RevWalk(r); - ObjectId object = r.resolve(Constants.HEAD); + ObjectId object = r.resolve(objectId); RevCommit lastCommit = walk.parseCommit(object); walk.markStart(lastCommit); @@ -62,12 +64,9 @@ int diffDays = (lastCommit.getCommitTime() - firstCommit.getCommitTime()) / (60 * 60 * 24); total.duration = diffDays; - if (diffDays <= 90) { + if (diffDays <= 365) { // Days df = new SimpleDateFormat("yyyy-MM-dd"); - } else if (diffDays > 90 && diffDays < 365) { - // Weeks - df = new SimpleDateFormat("yyyy-MM (w)"); } else { // Months df = new SimpleDateFormat("yyyy-MM"); @@ -108,13 +107,15 @@ return metrics; } - public static List<Metric> getAuthorMetrics(Repository r, boolean byEmail) { + public static List<Metric> getAuthorMetrics(Repository r, String objectId, boolean byEmail) { final Map<String, Metric> metricMap = new HashMap<String, Metric>(); - + if (StringUtils.isEmpty(objectId)) { + objectId = Constants.HEAD; + } if (JGitUtils.hasCommits(r)) { try { RevWalk walk = new RevWalk(r); - ObjectId object = r.resolve(Constants.HEAD); + ObjectId object = r.resolve(objectId); RevCommit lastCommit = walk.parseCommit(object); walk.markStart(lastCommit); diff --git a/src/com/gitblit/wicket/GitBlitWebApp.properties b/src/com/gitblit/wicket/GitBlitWebApp.properties index f64f1e5..d6102db 100644 --- a/src/com/gitblit/wicket/GitBlitWebApp.properties +++ b/src/com/gitblit/wicket/GitBlitWebApp.properties @@ -55,6 +55,7 @@ gb.deletion = deletion gb.rename = rename gb.metrics = metrics +gb.stats = stats gb.markdown = markdown gb.changedFiles = changed files gb.filesAdded = {0} files added @@ -94,4 +95,7 @@ gb.showReadmeDescription = show a \"readme\" markdown file on the summary page gb.nameDescription = use '/' to group repositories. e.g. libraries/mycoollib.git gb.ownerDescription = the owner may edit repository settings -gb.blob = blob \ No newline at end of file +gb.blob = blob +gb.commitActivityTrend = commit activity trend +gb.commitActivityDOW = commit activity by day of week +gb.commitActivityAuthors = primary authors by commit activity \ No newline at end of file diff --git a/src/com/gitblit/wicket/pages/MetricsPage.html b/src/com/gitblit/wicket/pages/MetricsPage.html index d6f23e0..734b9fa 100644 --- a/src/com/gitblit/wicket/pages/MetricsPage.html +++ b/src/com/gitblit/wicket/pages/MetricsPage.html @@ -6,18 +6,30 @@ <body> <wicket:extend> - <h2>Commit Activity</h2> + <div style="padding-top:10px;"> + <!-- branch name --> + <div><span class="metricsTitle" wicket:id="branchTitle"></span></div> + + <!-- placeholder for more info --> + <div style="float:right;width:200px;text-align: left;"> + </div> + + <!-- branch stats --> + <h2><wicket:message key="gb.stats"></wicket:message></h2> + <span wicket:id="branchStats"></span> + + <!-- commit activity trend --> + <h2><wicket:message key="gb.commitActivityTrend"></wicket:message></h2> <div><img wicket:id="commitsChart" /></div> - <h2>Commit Activity by Day of Week</h2> + <!-- commit activity by day of week --> + <h2><wicket:message key="gb.commitActivityDOW"></wicket:message></h2> <div><img wicket:id="dayOfWeekChart" /></div> - <h2>Commit Activity by Time of Day</h2> - <div><img wicket:id="timeOfDayChart" /></div> - - <h2>Most Prolific Authors</h2> + <!-- commit activity by primary authors --> + <h2><wicket:message key="gb.commitActivityAuthors"></wicket:message></h2> <div><img wicket:id="authorsChart" /></div> - + </div> </wicket:extend> </body> </html> \ No newline at end of file diff --git a/src/com/gitblit/wicket/pages/MetricsPage.java b/src/com/gitblit/wicket/pages/MetricsPage.java index c6231e9..9dd10d1 100644 --- a/src/com/gitblit/wicket/pages/MetricsPage.java +++ b/src/com/gitblit/wicket/pages/MetricsPage.java @@ -17,16 +17,16 @@ import java.awt.Color; import java.awt.Dimension; -import java.text.ParseException; +import java.text.MessageFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; import java.util.Comparator; -import java.util.Date; import java.util.List; import org.apache.wicket.PageParameters; +import org.apache.wicket.markup.html.basic.Label; import org.eclipse.jgit.lib.Repository; import org.wicketstuff.googlecharts.Chart; import org.wicketstuff.googlecharts.ChartAxis; @@ -40,17 +40,28 @@ import com.gitblit.models.Metric; import com.gitblit.utils.MetricUtils; +import com.gitblit.utils.TimeUtils; import com.gitblit.wicket.WicketUtils; public class MetricsPage extends RepositoryPage { public MetricsPage(PageParameters params) { - super(params); + super(params); Repository r = getRepository(); - insertLinePlot("commitsChart", MetricUtils.getDateMetrics(r, false, null)); - insertBarPlot("dayOfWeekChart", getDayOfWeekMetrics(r)); - insertLinePlot("timeOfDayChart", getTimeOfDayMetrics(r)); - insertPieChart("authorsChart", getAuthorMetrics(r)); + add(new Label("branchTitle", objectId)); + Metric metricsTotal = null; + List<Metric> metrics = MetricUtils.getDateMetrics(r, objectId, true, null); + metricsTotal = metrics.remove(0); + if (metricsTotal == null) { + add(new Label("branchStats", "")); + } else { + add(new Label("branchStats", MessageFormat.format( + "{0} commits and {1} tags in {2}", metricsTotal.count, metricsTotal.tag, + TimeUtils.duration(metricsTotal.duration)))); + } + insertLinePlot("commitsChart", metrics); + insertBarPlot("dayOfWeekChart", getDayOfWeekMetrics(r, objectId)); + insertPieChart("authorsChart", getAuthorMetrics(r, objectId)); } private void insertLinePlot(String wicketId, List<Metric> metrics) { @@ -118,8 +129,8 @@ } } - private List<Metric> getDayOfWeekMetrics(Repository repository) { - List<Metric> list = MetricUtils.getDateMetrics(repository, false, "E"); + private List<Metric> getDayOfWeekMetrics(Repository repository, String objectId) { + List<Metric> list = MetricUtils.getDateMetrics(repository, objectId, false, "E"); SimpleDateFormat sdf = new SimpleDateFormat("E"); Calendar cal = Calendar.getInstance(); @@ -143,35 +154,15 @@ return sorted; } - private List<Metric> getTimeOfDayMetrics(Repository repository) { - SimpleDateFormat ndf = new SimpleDateFormat("yyyy-MM-dd"); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); - List<Metric> list = MetricUtils.getDateMetrics(repository, false, "yyyy-MM-dd HH:mm"); - Calendar cal = Calendar.getInstance(); - - for (Metric metric : list) { - try { - Date date = sdf.parse(metric.name); - cal.setTime(date); - double y = cal.get(Calendar.HOUR_OF_DAY) + (cal.get(Calendar.MINUTE) / 60d); - metric.duration = (int) (date.getTime() / 60000L); - metric.count = y; - metric.name = ndf.format(date); - } catch (ParseException p) { - } - } - return list; - } - - private List<Metric> getAuthorMetrics(Repository repository) { - List<Metric> authors = MetricUtils.getAuthorMetrics(repository, true); + private List<Metric> getAuthorMetrics(Repository repository, String objectId) { + List<Metric> authors = MetricUtils.getAuthorMetrics(repository, objectId, true); Collections.sort(authors, new Comparator<Metric>() { @Override public int compare(Metric o1, Metric o2) { if (o1.count > o2.count) { return -1; } else if (o1.count < o2.count) { - return 1; + return 1; } return 0; } diff --git a/src/com/gitblit/wicket/pages/RepositoryPage.html b/src/com/gitblit/wicket/pages/RepositoryPage.html index ffb484f..0e0ce47 100644 --- a/src/com/gitblit/wicket/pages/RepositoryPage.html +++ b/src/com/gitblit/wicket/pages/RepositoryPage.html @@ -18,7 +18,7 @@ <!-- page nav links --> <div class="page_nav"> - <a wicket:id="summary"><wicket:message key="gb.summary"></wicket:message></a> | <a wicket:id="log"><wicket:message key="gb.log"></wicket:message></a> | <a wicket:id="branches"><wicket:message key="gb.branches"></wicket:message></a> | <a wicket:id="tags"><wicket:message key="gb.tags"></wicket:message></a> | <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a> | <a wicket:id="metrics"><wicket:message key="gb.metrics"></wicket:message></a> <span wicket:id="extra"><span wicket:id="extraSeparator"></span><span wicket:id="extraLink"></span></span> + <a wicket:id="summary"><wicket:message key="gb.summary"></wicket:message></a> | <a wicket:id="log"><wicket:message key="gb.log"></wicket:message></a> | <a wicket:id="branches"><wicket:message key="gb.branches"></wicket:message></a> | <a wicket:id="tags"><wicket:message key="gb.tags"></wicket:message></a> | <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a> <span wicket:id="extra"><span wicket:id="extraSeparator"></span><span wicket:id="extraLink"></span></span> </div> </div> diff --git a/src/com/gitblit/wicket/pages/RepositoryPage.java b/src/com/gitblit/wicket/pages/RepositoryPage.java index eceda99..3ceb9f5 100644 --- a/src/com/gitblit/wicket/pages/RepositoryPage.java +++ b/src/com/gitblit/wicket/pages/RepositoryPage.java @@ -76,7 +76,6 @@ put("branches", "gb.branches"); put("tags", "gb.tags"); put("tree", "gb.tree"); - put("metrics", "gb.metrics"); put("tickets", "gb.tickets"); put("edit", "gb.edit"); } @@ -104,8 +103,6 @@ add(new BookmarkablePageLink<Void>("tags", TagsPage.class, WicketUtils.newRepositoryParameter(repositoryName))); add(new BookmarkablePageLink<Void>("tree", TreePage.class, - WicketUtils.newRepositoryParameter(repositoryName))); - add(new BookmarkablePageLink<Void>("metrics", MetricsPage.class, WicketUtils.newRepositoryParameter(repositoryName))); // per-repository extra page links diff --git a/src/com/gitblit/wicket/pages/SummaryPage.html b/src/com/gitblit/wicket/pages/SummaryPage.html index 7d5629b..7784a47 100644 --- a/src/com/gitblit/wicket/pages/SummaryPage.html +++ b/src/com/gitblit/wicket/pages/SummaryPage.html @@ -25,7 +25,7 @@ <tr><th><wicket:message key="gb.description">[description]</wicket:message></th><td><span wicket:id="repositoryDescription">[repository description]</span></td></tr> <tr><th><wicket:message key="gb.owner">[owner]</wicket:message></th><td><span wicket:id="repositoryOwner">[repository owner]</span></td></tr> <tr><th><wicket:message key="gb.lastChange">[last change]</wicket:message></th><td><span wicket:id="repositoryLastChange">[repository last change]</span></td></tr> - <tr><th><wicket:message key="gb.metrics">[metrics]</wicket:message></th><td><span wicket:id="repositoryMetrics">[repository metrics]</span></td></tr> + <tr><th><wicket:message key="gb.stats">[stats]</wicket:message></th><td><span wicket:id="branchStats">[branch stats]</span> <span class="link"><a wicket:id="metrics"><wicket:message key="gb.metrics">[metrics]</wicket:message></a></span></td></tr> <tr><th valign="top"><wicket:message key="gb.url">[URL]</wicket:message></th><td><img style="vertical-align: top; padding-right:5px;" wicket:id="accessRestrictionIcon" /><span wicket:id="repositoryCloneUrl">[repository clone url]</span></td></tr> </table> </div> diff --git a/src/com/gitblit/wicket/pages/SummaryPage.java b/src/com/gitblit/wicket/pages/SummaryPage.java index fd21ed6..03b1b1c 100644 --- a/src/com/gitblit/wicket/pages/SummaryPage.java +++ b/src/com/gitblit/wicket/pages/SummaryPage.java @@ -26,6 +26,7 @@ import org.apache.wicket.PageParameters; import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.link.BookmarkablePageLink; import org.apache.wicket.protocol.http.WebRequest; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.revwalk.RevCommit; @@ -77,7 +78,7 @@ List<Metric> metrics = null; Metric metricsTotal = null; if (GitBlit.getBoolean(Keys.web.generateActivityGraph, true)) { - metrics = MetricUtils.getDateMetrics(r, true, null); + metrics = MetricUtils.getDateMetrics(r, null, true, null); metricsTotal = metrics.remove(0); } @@ -88,12 +89,13 @@ add(WicketUtils.createTimestampLabel("repositoryLastChange", JGitUtils.getLastChange(r), getTimeZone())); if (metricsTotal == null) { - add(new Label("repositoryMetrics", "")); + add(new Label("branchStats", "")); } else { - add(new Label("repositoryMetrics", MessageFormat.format( + add(new Label("branchStats", MessageFormat.format( "{0} commits and {1} tags in {2}", metricsTotal.count, metricsTotal.tag, TimeUtils.duration(metricsTotal.duration)))); } + add(new BookmarkablePageLink<Void>("metrics", MetricsPage.class, WicketUtils.newRepositoryParameter(repositoryName))); List<String> repositoryUrls = new ArrayList<String>(); @@ -141,8 +143,8 @@ .setEscapeModelStrings(false)); add(new LogPanel("commitsPanel", repositoryName, null, r, numberCommits, 0)); - add(new TagsPanel("tagsPanel", repositoryName, r, numberRefs)); - add(new BranchesPanel("branchesPanel", getRepositoryModel(), r, numberRefs)); + add(new TagsPanel("tagsPanel", repositoryName, r, numberRefs).hideIfEmpty()); + add(new BranchesPanel("branchesPanel", getRepositoryModel(), r, numberRefs).hideIfEmpty()); if (getRepositoryModel().showReadme) { String htmlText = null; diff --git a/src/com/gitblit/wicket/panels/BranchesPanel.html b/src/com/gitblit/wicket/panels/BranchesPanel.html index 497003a..91c34d2 100644 --- a/src/com/gitblit/wicket/panels/BranchesPanel.html +++ b/src/com/gitblit/wicket/panels/BranchesPanel.html @@ -17,16 +17,28 @@ <td><span wicket:id="branchName">[branch name]</span></td> <td><span wicket:id="branchType">[branch type]</span></td> <td class="rightAlign"> - <span class="link"> - <a wicket:id="log"><wicket:message key="gb.log"></wicket:message></a> | <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a> - </span> + <span wicket:id="branchLinks"></span> </td> </tr> </tbody> </table> <div wicket:id="allBranches">[all branches]</div> - + + <!-- branch page links --> + <wicket:fragment wicket:id="branchPageLinks"> + <span class="link"> + <a wicket:id="log"><wicket:message key="gb.log"></wicket:message></a> | <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a> | <a wicket:id="metrics"><wicket:message key="gb.metrics"></wicket:message></a> + </span> + </wicket:fragment> + + <!-- branch panel links --> + <wicket:fragment wicket:id="branchPanelLinks"> + <span class="link"> + <a wicket:id="log"><wicket:message key="gb.log"></wicket:message></a> | <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a> + </span> + </wicket:fragment> + </wicket:panel> </body> </html> \ No newline at end of file diff --git a/src/com/gitblit/wicket/panels/BranchesPanel.java b/src/com/gitblit/wicket/panels/BranchesPanel.java index 82f8a04..b11c03a 100644 --- a/src/com/gitblit/wicket/panels/BranchesPanel.java +++ b/src/com/gitblit/wicket/panels/BranchesPanel.java @@ -21,6 +21,7 @@ import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.link.BookmarkablePageLink; +import org.apache.wicket.markup.html.panel.Fragment; import org.apache.wicket.markup.repeater.Item; import org.apache.wicket.markup.repeater.data.DataView; import org.apache.wicket.markup.repeater.data.ListDataProvider; @@ -35,12 +36,15 @@ import com.gitblit.wicket.WicketUtils; import com.gitblit.wicket.pages.BranchesPage; import com.gitblit.wicket.pages.LogPage; +import com.gitblit.wicket.pages.MetricsPage; import com.gitblit.wicket.pages.SummaryPage; import com.gitblit.wicket.pages.TreePage; public class BranchesPanel extends BasePanel { private static final long serialVersionUID = 1L; + + private final boolean hasBranches; public BranchesPanel(String wicketId, final RepositoryModel model, Repository r, final int maxCount) { @@ -89,11 +93,23 @@ item.add(new Label("branchType", remote ? getString("gb.remote") : getString("gb.local")).setVisible(maxCount <= 0)); - item.add(new BookmarkablePageLink<Void>("log", LogPage.class, WicketUtils - .newObjectParameter(model.name, entry.getName()))); - item.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils - .newObjectParameter(model.name, entry.getName()))); - + if (maxCount <= 0) { + Fragment fragment = new Fragment("branchLinks", "branchPageLinks", this); + fragment.add(new BookmarkablePageLink<Void>("log", LogPage.class, WicketUtils + .newObjectParameter(model.name, entry.getName()))); + fragment.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils + .newObjectParameter(model.name, entry.getName()))); + fragment.add(new BookmarkablePageLink<Void>("metrics", MetricsPage.class, + WicketUtils.newObjectParameter(model.name, entry.getName()))); + item.add(fragment); + } else { + Fragment fragment = new Fragment("branchLinks", "branchPanelLinks", this); + fragment.add(new BookmarkablePageLink<Void>("log", LogPage.class, WicketUtils + .newObjectParameter(model.name, entry.getName()))); + fragment.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils + .newObjectParameter(model.name, entry.getName()))); + item.add(fragment); + } WicketUtils.setAlternatingBackground(item, counter); counter++; } @@ -105,5 +121,12 @@ add(new LinkPanel("allBranches", "link", new StringResourceModel("gb.allBranches", this, null), BranchesPage.class, WicketUtils.newRepositoryParameter(model.name))); } + // We always have 1 branch + hasBranches = branches.size() > 1; + } + + public BranchesPanel hideIfEmpty() { + setVisible(hasBranches); + return this; } } diff --git a/src/com/gitblit/wicket/panels/RefsPanel.java b/src/com/gitblit/wicket/panels/RefsPanel.java index 8cf137b..f25b53b 100644 --- a/src/com/gitblit/wicket/panels/RefsPanel.java +++ b/src/com/gitblit/wicket/panels/RefsPanel.java @@ -70,19 +70,19 @@ Class<? extends RepositoryPage> linkClass = CommitPage.class; String cssClass = ""; if (name.startsWith(Constants.R_HEADS)) { - // local head + // local branch linkClass = LogPage.class; name = name.substring(Constants.R_HEADS.length()); - cssClass = "headRef"; + cssClass = "localBranch"; } else if (name.equals(Constants.HEAD)) { // local head linkClass = LogPage.class; cssClass = "headRef"; } else if (name.startsWith(Constants.R_REMOTES)) { - // remote head + // remote branch linkClass = LogPage.class; name = name.substring(Constants.R_REMOTES.length()); - cssClass = "remoteRef"; + cssClass = "remoteBranch"; } else if (name.startsWith(Constants.R_TAGS)) { // tag if (entry.isAnnotatedTag()) { diff --git a/src/com/gitblit/wicket/panels/TagsPanel.java b/src/com/gitblit/wicket/panels/TagsPanel.java index f6dd762..4504c51 100644 --- a/src/com/gitblit/wicket/panels/TagsPanel.java +++ b/src/com/gitblit/wicket/panels/TagsPanel.java @@ -44,6 +44,8 @@ public class TagsPanel extends BasePanel { private static final long serialVersionUID = 1L; + + private final boolean hasTags; public TagsPanel(String wicketId, final String repositoryName, Repository r, final int maxCount) { super(wicketId); @@ -162,5 +164,12 @@ add(new LinkPanel("allTags", "link", new StringResourceModel("gb.allTags", this, null), TagsPage.class, WicketUtils.newRepositoryParameter(repositoryName))); } + + hasTags = tags.size() > 0; + } + + public TagsPanel hideIfEmpty() { + setVisible(hasTags); + return this; } } diff --git a/src/com/gitblit/wicket/resources/gitblit.css b/src/com/gitblit/wicket/resources/gitblit.css index 5dd0f16..a0ab10a 100644 --- a/src/com/gitblit/wicket/resources/gitblit.css +++ b/src/com/gitblit/wicket/resources/gitblit.css @@ -708,7 +708,11 @@ width: 13em; } -span .tagRef, span .headRef, span .remoteRef, span .otherRef { +span.metricsTitle { + font-size: 2em; +} + +span .tagRef, span .headRef, span .localBranch, span .remoteBranch, span .otherRef { padding: 0px 3px; margin-right:2px; font-family: sans-serif; @@ -718,26 +722,26 @@ color: black; } -span .tagRef a span, span .headRef a span, span .remoteRef a span, span .otherRef a span { +span .tagRef a span, span .headRef a span, span .localBranch a span, span .remoteBranch a span, span .otherRef a span { font-size: 9px; } -span .tagRef a, span .headRef a, span .remoteRef a, span .otherRef a { +span .tagRef a, span .headRef a, span .localBranch a, span .remoteBranch a, span .otherRef a { text-decoration: none; color: black !important; } -span .tagRef a:hover, span .headRef a:hover, span .remoteRef a:hover, span .otherRef a:hover { +span .tagRef a:hover, span .headRef a:hover, span .localBranch a:hover, span .remoteBranch a:hover, span .otherRef a:hover { color: black !important; text-decoration: underline; } span .otherRef { - background-color: #ffaaff; - border-color: #ff00ee; + background-color: #80ccdd; + border-color: #80aaaa; } -span .remoteRef { +span .remoteBranch { background-color: #cAc2f5; border-color: #6c6cbf; } @@ -748,6 +752,11 @@ } span .headRef { + background-color: #ffaaff; + border-color: #ff00ee; +} + +span .localBranch { background-color: #ccffcc; border-color: #00cc33; } diff --git a/tests/com/gitblit/tests/MetricUtilsTest.java b/tests/com/gitblit/tests/MetricUtilsTest.java index 07cd606..db994b8 100644 --- a/tests/com/gitblit/tests/MetricUtilsTest.java +++ b/tests/com/gitblit/tests/MetricUtilsTest.java @@ -28,15 +28,15 @@ public void testMetrics() throws Exception { Repository repository = GitBlitSuite.getHelloworldRepository(); - List<Metric> metrics = MetricUtils.getDateMetrics(repository, true, null); + List<Metric> metrics = MetricUtils.getDateMetrics(repository, null, true, null); repository.close(); assertTrue("No date metrics found!", metrics.size() > 0); } public void testAuthorMetrics() throws Exception { Repository repository = GitBlitSuite.getHelloworldRepository(); - List<Metric> byEmail = MetricUtils.getAuthorMetrics(repository, true); - List<Metric> byName = MetricUtils.getAuthorMetrics(repository, false); + List<Metric> byEmail = MetricUtils.getAuthorMetrics(repository, null, true); + List<Metric> byName = MetricUtils.getAuthorMetrics(repository, null, false); repository.close(); assertTrue("No author metrics found!", byEmail.size() == 9); assertTrue("No author metrics found!", byName.size() == 8); -- Gitblit v1.9.1