]> source.dussan.org Git - gitblit.git/commitdiff
Added short commit id column to log and history tables (issue 168)
authorJames Moger <james.moger@gitblit.com>
Tue, 27 Nov 2012 22:13:03 +0000 (17:13 -0500)
committerJames Moger <james.moger@gitblit.com>
Tue, 27 Nov 2012 22:13:03 +0000 (17:13 -0500)
docs/04_releases.mkd
src/com/gitblit/wicket/panels/HistoryPanel.html
src/com/gitblit/wicket/panels/HistoryPanel.java
src/com/gitblit/wicket/panels/LogPanel.html
src/com/gitblit/wicket/panels/LogPanel.java

index b9fa3d38d6f813081cfa385a3554965ba7645967..cb4a51a21bf0255c16130693e340d224dedc9063 100644 (file)
@@ -70,6 +70,7 @@ This is extreme and should be considered carefully since it affects every https
 \r
 #### changes\r
 \r
+- Added short commit id column to log and history tables (issue 168)\r
 - Teams can now specify the *admin*, *create*, and *fork* roles to simplify user administration\r
 - Use https Gravatar urls to avoid browser complaints\r
 - Added frm to default pretty print extensions (issue 156)\r
index d81d948b7fff666974ee61795ed3db900bec6e80..2fe6f050e62fe165093e9618e6883c39bda8ceb9 100644 (file)
@@ -19,6 +19,7 @@
                        <td class="date"><span wicket:id="commitDate">[commit date]</span></td>\r
                        <td class="icon"><img wicket:id="commitIcon" /></td>\r
                        <td class="hidden-phone author"><span wicket:id="commitAuthor">[commit author]</span></td>\r
+                       <td class="hidden-phone hidden-tablet"><span wicket:id="commitHash">[commit hash]</span></td>\r
                        <td class="message"><table class="nestedTable"><tr><td><span style="vertical-align:middle;" wicket:id="commitShortMessage">[commit short message]</span></td><td><div style="text-align:right;" wicket:id="commitRefs">[commit refs]</div></td></tr></table></td>\r
                        <td class="hidden-phone rightAlign">\r
                                <span wicket:id="historyLinks">[history links]</span>\r
index dee5c25c1aca7d52c83a727c48b0bcb419e521ec..838f103e5ed2fb1aa9bd7eb692df63ae8c85d379 100644 (file)
@@ -118,6 +118,7 @@ public class HistoryPanel extends BasePanel {
                // breadcrumbs\r
                add(new PathBreadcrumbsPanel("breadcrumbs", repositoryName, path, objectId));\r
 \r
+               final int hashLen = GitBlit.getInteger(Keys.web.shortCommitIdLength, 6);\r
                ListDataProvider<RevCommit> dp = new ListDataProvider<RevCommit>(commits);\r
                DataView<RevCommit> logView = new DataView<RevCommit>("commit", dp) {\r
                        private static final long serialVersionUID = 1L;\r
@@ -138,6 +139,14 @@ public class HistoryPanel extends BasePanel {
                                setPersonSearchTooltip(authorLink, author, Constants.SearchType.AUTHOR);\r
                                item.add(authorLink);\r
 \r
+                               // commit hash link\r
+                               LinkPanel commitHash = new LinkPanel("commitHash", null, entry.getName().substring(0, hashLen),\r
+                                               CommitPage.class, WicketUtils.newObjectParameter(\r
+                                                               repositoryName, entry.getName()));\r
+                               WicketUtils.setCssClass(commitHash, "sha1");\r
+                               WicketUtils.setHtmlTooltip(commitHash, entry.getName());\r
+                               item.add(commitHash);\r
+                               \r
                                // merge icon\r
                                if (entry.getParentCount() > 1) {\r
                                        item.add(WicketUtils.newImage("commitIcon", "commit_merge_16x16.png"));\r
index c5ae71cbf727de969d8557e6f013ca471f9239f5..f6c2327e3fb3fc1d62b27d9d3324ef4b32757800 100644 (file)
@@ -14,6 +14,7 @@
                        <tr wicket:id="commit">\r
                        <td class="date" style="width:6em;"><span wicket:id="commitDate">[commit date]</span></td>\r
                        <td class="hidden-phone author"><span wicket:id="commitAuthor">[commit author]</span></td>\r
+                       <td class="hidden-phone hidden-tablet"><span wicket:id="commitHash">[commit hash]</span></td>\r
                        <td class="hidden-phone icon"><img wicket:id="commitIcon" /></td>\r
                        <td class="message"><table class="nestedTable"><tr><td><span style="vertical-align:middle;" wicket:id="commitShortMessage">[commit short message]</span></td><td><div style="text-align:right;" wicket:id="commitRefs">[commit refs]</div></td></tr></table></td>\r
                        <td class="hidden-phone hidden-tablet rightAlign">\r
index a31c3dfaa1f532c91352c04f2421c447b4da4a95..6d06e7b852899a1682ed3676a897b9201e9a8110 100644 (file)
@@ -82,6 +82,7 @@ public class LogPanel extends BasePanel {
                                        WicketUtils.newRepositoryParameter(repositoryName)));\r
                }\r
 \r
+               final int hashLen = GitBlit.getInteger(Keys.web.shortCommitIdLength, 6);\r
                ListDataProvider<RevCommit> dp = new ListDataProvider<RevCommit>(commits);\r
                DataView<RevCommit> logView = new DataView<RevCommit>("commit", dp) {\r
                        private static final long serialVersionUID = 1L;\r
@@ -100,6 +101,14 @@ public class LogPanel extends BasePanel {
                                                                objectId, author, Constants.SearchType.AUTHOR));\r
                                setPersonSearchTooltip(authorLink, author, Constants.SearchType.AUTHOR);\r
                                item.add(authorLink);\r
+                               \r
+                               // commit hash link\r
+                               LinkPanel commitHash = new LinkPanel("commitHash", null, entry.getName().substring(0, hashLen),\r
+                                               CommitPage.class, WicketUtils.newObjectParameter(\r
+                                                               repositoryName, entry.getName()));\r
+                               WicketUtils.setCssClass(commitHash, "sha1");\r
+                               WicketUtils.setHtmlTooltip(commitHash, entry.getName());\r
+                               item.add(commitHash);\r
 \r
                                // merge icon\r
                                if (entry.getParentCount() > 1) {\r