]> source.dussan.org Git - gitblit.git/commitdiff
Short commit ids in log and history take two (issue 168)
authorJames Moger <james.moger@gitblit.com>
Wed, 28 Nov 2012 22:07:52 +0000 (17:07 -0500)
committerJames Moger <james.moger@gitblit.com>
Wed, 28 Nov 2012 22:07:52 +0000 (17:07 -0500)
src/com/gitblit/Constants.java
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 8a3ec9891860bfb0637cfcf9e40f8094fadc88ad..cd6b07096a34cb5f5d21f96b87469b04020d9397 100644 (file)
@@ -76,7 +76,7 @@ public class Constants {
        \r
        public static final String ENCODING = "UTF-8";\r
        \r
-       public static final int LEN_SHORTLOG = 80;\r
+       public static final int LEN_SHORTLOG = 78;\r
        \r
        public static final int LEN_SHORTLOG_REFS = 60;\r
        \r
index 2fe6f050e62fe165093e9618e6883c39bda8ceb9..fed0807694157a2c34ddf4876f194feaba0cb438 100644 (file)
@@ -19,8 +19,8 @@
                        <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 hidden-tablet"><span class="link" wicket:id="hashLabel">[hash label]</span><span wicket:id="hashLink">[hash link]</span></td>\r
                        <td class="hidden-phone rightAlign">\r
                                <span wicket:id="historyLinks">[history links]</span>\r
                                </td>\r
        <!--  tree links -->\r
        <wicket:fragment wicket:id="treeLinks">\r
                <span class="link">\r
-                       <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a> | <a wicket:id="commitdiff"><wicket:message key="gb.commitdiff"></wicket:message></a>\r
+                       <a wicket:id="commitdiff"><wicket:message key="gb.commitdiff"></wicket:message></a>\r
                </span>\r
        </wicket:fragment>\r
        \r
        <!-- blob links -->\r
        <wicket:fragment wicket:id="blobLinks">\r
                <span class="link">\r
-                       <a wicket:id="view"><wicket:message key="gb.view"></wicket:message></a> | <a wicket:id="commitdiff"><wicket:message key="gb.commitdiff"></wicket:message></a> | <a wicket:id="difftocurrent"><wicket:message key="gb.difftocurrent"></wicket:message></a>\r
+                       <a wicket:id="commitdiff"><wicket:message key="gb.commitdiff"></wicket:message></a> | <a wicket:id="difftocurrent"><wicket:message key="gb.difftocurrent"></wicket:message></a>\r
                </span> \r
        </wicket:fragment>\r
        \r
index 95ed3b4b4d3c752a38686fac575263f2058719bb..152bbae6c46a6ba86f7eb5cb5ee60b3b4a55ed41 100644 (file)
@@ -47,8 +47,8 @@ import com.gitblit.wicket.pages.BlobDiffPage;
 import com.gitblit.wicket.pages.BlobPage;\r
 import com.gitblit.wicket.pages.CommitDiffPage;\r
 import com.gitblit.wicket.pages.CommitPage;\r
-import com.gitblit.wicket.pages.HistoryPage;\r
 import com.gitblit.wicket.pages.GitSearchPage;\r
+import com.gitblit.wicket.pages.HistoryPage;\r
 import com.gitblit.wicket.pages.TreePage;\r
 \r
 public class HistoryPanel extends BasePanel {\r
@@ -141,14 +141,6 @@ 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
@@ -174,16 +166,30 @@ public class HistoryPanel extends BasePanel {
                                item.add(new RefsPanel("commitRefs", repositoryName, entry, allRefs));\r
 \r
                                if (isTree) {\r
+                                       // tree\r
+                                       item.add(new Label("hashLabel", getString("gb.tree") + "@"));\r
+                                       LinkPanel commitHash = new LinkPanel("hashLink", null, entry.getName().substring(0, hashLen),\r
+                                                       TreePage.class, WicketUtils.newObjectParameter(\r
+                                                                       repositoryName, entry.getName()));\r
+                                       WicketUtils.setCssClass(commitHash, "sha1");\r
+                                       WicketUtils.setHtmlTooltip(commitHash, entry.getName());                                        \r
+                                       item.add(commitHash);\r
+                                       \r
                                        Fragment links = new Fragment("historyLinks", "treeLinks", this);\r
-                                       links.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils\r
-                                                       .newObjectParameter(repositoryName, entry.getName())));\r
                                        links.add(new BookmarkablePageLink<Void>("commitdiff", CommitDiffPage.class,\r
                                                        WicketUtils.newObjectParameter(repositoryName, entry.getName())));\r
                                        item.add(links);\r
-                               } else {\r
+                               } else {                                        \r
+                                       // commit\r
+                                       item.add(new Label("hashLabel", getString("gb.blob") + "@"));\r
+                                       LinkPanel commitHash = new LinkPanel("hashLink", null, entry.getName().substring(0, hashLen),\r
+                                                       BlobPage.class, WicketUtils.newPathParameter(\r
+                                                                       repositoryName, entry.getName(), path));\r
+                                       WicketUtils.setCssClass(commitHash, "sha1");\r
+                                       WicketUtils.setHtmlTooltip(commitHash, entry.getName());\r
+                                       item.add(commitHash);\r
+                                       \r
                                        Fragment links = new Fragment("historyLinks", "blobLinks", this);\r
-                                       links.add(new BookmarkablePageLink<Void>("view", BlobPage.class, WicketUtils\r
-                                                       .newPathParameter(repositoryName, entry.getName(), path)));\r
                                        links.add(new BookmarkablePageLink<Void>("commitdiff", CommitDiffPage.class,\r
                                                        WicketUtils.newObjectParameter(repositoryName, entry.getName())));\r
                                        links.add(new BookmarkablePageLink<Void>("difftocurrent", BlobDiffPage.class,\r
index f6c2327e3fb3fc1d62b27d9d3324ef4b32757800..d0770a359a89f40b2e19bcb8ce464e25e30c6bb3 100644 (file)
                        <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"><span wicket:id="hashLink">[hash link]</span></td>\r
                        <td class="hidden-phone hidden-tablet rightAlign">\r
                                <span class="link">\r
-                                               <a wicket:id="view"><wicket:message key="gb.view"></wicket:message></a> | <a wicket:id="diff"><wicket:message key="gb.diff"></wicket:message></a> | <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a>\r
+                                               <a wicket:id="diff"><wicket:message key="gb.diff"></wicket:message></a> | <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a>\r
                                        </span>\r
                                </td>\r
                        </tr>\r
index 6d06e7b852899a1682ed3676a897b9201e9a8110..0686dee6a9fdead3d9f9b611ad06d911332af62d 100644 (file)
@@ -102,14 +102,6 @@ public class LogPanel 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
@@ -135,8 +127,14 @@ public class LogPanel extends BasePanel {
 \r
                                item.add(new RefsPanel("commitRefs", repositoryName, entry, allRefs));\r
 \r
-                               item.add(new BookmarkablePageLink<Void>("view", CommitPage.class, WicketUtils\r
-                                               .newObjectParameter(repositoryName, entry.getName())));\r
+                               // commit hash link\r
+                               LinkPanel commitHash = new LinkPanel("hashLink", 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
                                item.add(new BookmarkablePageLink<Void>("diff", CommitDiffPage.class, WicketUtils\r
                                                .newObjectParameter(repositoryName, entry.getName())).setEnabled(entry\r
                                                .getParentCount() > 0));\r