diff options
author | James Moger <james.moger@gitblit.com> | 2011-04-04 17:47:07 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2011-04-04 17:47:07 -0400 |
commit | fb01c9c8cc36ac28c895b6b7daad39038f3d17a2 (patch) | |
tree | 71a286e45c838e1f9cfc15f87ae3ce753cb90a9f /src/com/gitblit | |
parent | ff974e0018902550aff538b6abc634252557a77f (diff) | |
download | gitblit-fb01c9c8cc36ac28c895b6b7daad39038f3d17a2.tar.gz gitblit-fb01c9c8cc36ac28c895b6b7daad39038f3d17a2.zip |
Improvements to css and specialized link panels.
Diffstat (limited to 'src/com/gitblit')
21 files changed, 166 insertions, 76 deletions
diff --git a/src/com/gitblit/utils/JGitUtils.java b/src/com/gitblit/utils/JGitUtils.java index 31b56777..16a0e9bc 100644 --- a/src/com/gitblit/utils/JGitUtils.java +++ b/src/com/gitblit/utils/JGitUtils.java @@ -349,7 +349,7 @@ public class JGitUtils { Collections.sort(list);
Collections.reverse(list);
if (maxCount > 0 && list.size() > maxCount) {
- list = list.subList(0, maxCount);
+ list = new ArrayList<RefModel>(list.subList(0, maxCount));
}
} catch (IOException e) {
LOGGER.error("Failed to retrieve " + refs, e);
diff --git a/src/com/gitblit/wicket/pages/BlobPage.java b/src/com/gitblit/wicket/pages/BlobPage.java index cfbfaa40..324a74e2 100644 --- a/src/com/gitblit/wicket/pages/BlobPage.java +++ b/src/com/gitblit/wicket/pages/BlobPage.java @@ -29,7 +29,7 @@ public class BlobPage extends RepositoryPage { // blob page links
add(new Label("historyLink", "history"));
- add(new Label("rawLink", "download"));
+ add(new Label("rawLink", "raw"));
add(new Label("headLink", "HEAD"));
add(new LinkPanel("shortlog", "title", commit.getShortMessage(), CommitPage.class, newCommitParameter()));
diff --git a/src/com/gitblit/wicket/pages/ShortLogPage.html b/src/com/gitblit/wicket/pages/ShortLogPage.html index 5afc6cdb..ffc0a678 100644 --- a/src/com/gitblit/wicket/pages/ShortLogPage.html +++ b/src/com/gitblit/wicket/pages/ShortLogPage.html @@ -15,8 +15,8 @@ <td class="date"><span wicket:id="commitDate"></span></td>
<td class="author"><span wicket:id="commitAuthor"></span></td>
<td><div wicket:id="commitShortMessage"></div></td>
- <td><div wicket:id="commitRefs"></div></td>
- <td><span wicket:id="commitLinks"></span></td>
+ <td class="rightAlign"><div wicket:id="commitRefs"></div></td>
+ <td class="rightAlign"><span wicket:id="commitLinks"></span></td>
</tr>
</tbody>
</table>
diff --git a/src/com/gitblit/wicket/pages/SummaryPage.html b/src/com/gitblit/wicket/pages/SummaryPage.html index be001432..9ed69293 100644 --- a/src/com/gitblit/wicket/pages/SummaryPage.html +++ b/src/com/gitblit/wicket/pages/SummaryPage.html @@ -10,7 +10,7 @@ <div>
<!-- Repository Activity Chart -->
<div style="width:50%;float:right;">
- <img style="padding-top:8px;" wicket:id="commitsChart" />
+ <img class="activityGraph" wicket:id="commitsChart" />
</div>
<!-- Repository info -->
@@ -32,48 +32,46 @@ <td class="date"><span wicket:id="commitDate"></span></td>
<td class="author"><span wicket:id="commitAuthor"></span></td>
<td><div wicket:id="commitShortMessage"></div></td>
- <td><div wicket:id="commitRefs"></div></td>
- <td><span wicket:id="commitLinks"></span></td>
+ <td class="rightAlign"><div wicket:id="commitRefs"></div></td>
+ <td class="rightAlign"><span wicket:id="commitLinks"></span></td>
</tr>
</tbody>
</table>
<div class="pager" wicket:id="shortlogMore"></div>
- <!-- Open additional graphs body -->
- <div style="width:25%;float:right;">
- </div>
-
- <!-- Open Tags and Heads body -->
- <div style="width:65%">
-
- <!-- tags -->
- <div class="header" wicket:id="tags"></div>
+ <!-- Open Heads Body -->
+ <div style="width:34%;float:right;">
+ <!-- heads -->
+ <div class="header" wicket:id="heads"></div>
<table style="width:100%" class="pretty">
<tbody>
- <tr wicket:id="tag">
- <td class="date"><span wicket:id="tagDate"></span></td>
- <td><b><div wicket:id="tagName"></div></b></td>
- <td><div wicket:id="tagDescription"></div></td>
- <td><span wicket:id="tagLinks"></span></td>
- </tr>
- </tbody>
+ <tr wicket:id="head">
+ <td class="date"><span wicket:id="headDate"></span></td>
+ <td><div wicket:id="headName"></div></td>
+ <td class="rightAlign"><span wicket:id="headLinks"></span></td>
+ </tr>
+ </tbody>
</table>
- <div class="pager" wicket:id="tagsMore"></div>
-
-
- <!-- heads -->
- <div class="header" wicket:id="heads"></div>
- <table style="width:100%" class="pretty">
- <tbody>
- <tr wicket:id="head">
- <td class="date"><span wicket:id="headDate"></span></td>
- <td><div wicket:id="headName"></div></td>
- <td><span wicket:id="headLinks"></span></td>
- </tr>
- </tbody>
- </table>
+ <div class="pager" wicket:id="allHeads"></div>
+ <!-- Close Heads Body -->
+ </div>
- <!-- Close Tags and Heads Body -->
+ <!-- Open Tags body -->
+ <div style="width:65%">
+ <!-- tags -->
+ <div class="header" wicket:id="tags"></div>
+ <table style="width:100%" class="pretty">
+ <tbody>
+ <tr wicket:id="tag">
+ <td class="date"><span wicket:id="tagDate"></span></td>
+ <td><b><div wicket:id="tagName"></div></b></td>
+ <td><div wicket:id="tagDescription"></div></td>
+ <td class="rightAlign"><span wicket:id="tagLinks"></span></td>
+ </tr>
+ </tbody>
+ </table>
+ <div class="pager" wicket:id="allTags"></div>
+ <!-- Close Tags Body -->
</div>
<!-- footer -->
diff --git a/src/com/gitblit/wicket/pages/SummaryPage.java b/src/com/gitblit/wicket/pages/SummaryPage.java index 318e3c95..507ba244 100644 --- a/src/com/gitblit/wicket/pages/SummaryPage.java +++ b/src/com/gitblit/wicket/pages/SummaryPage.java @@ -31,6 +31,7 @@ import com.gitblit.wicket.RepositoryPage; import com.gitblit.wicket.WicketUtils;
import com.gitblit.wicket.models.Metric;
import com.gitblit.wicket.models.RefModel;
+import com.gitblit.wicket.panels.AnnotatedTagLinksPanel;
import com.gitblit.wicket.panels.HeadLinksPanel;
import com.gitblit.wicket.panels.RefsPanel;
import com.gitblit.wicket.panels.ShortLogLinksPanel;
@@ -40,7 +41,20 @@ public class SummaryPage extends RepositoryPage { public SummaryPage(PageParameters params) {
super(params, "summary");
+
+ int numCommitsDef = 20;
+ int numRefsDef = 5;
+
+ int numberCommits = StoredSettings.getInteger("summaryCommitCount", numCommitsDef);
+ if (numberCommits <= 0) {
+ numberCommits = numCommitsDef;
+ }
+ int numberRefs = StoredSettings.getInteger("summaryRefsCount", numRefsDef);
+ if (numberRefs <= 0) {
+ numberRefs = numRefsDef;
+ }
+
Repository r = getRepository();
final Map<ObjectId, List<String>> allRefs = JGitUtils.getAllRefs(r);
@@ -55,12 +69,10 @@ public class SummaryPage extends RepositoryPage { add(new Label("repositoryLastChange", lastchange));
add(new Label("repositoryCloneUrl", cloneurl));
- int summaryCount = 16;
-
// shortlog
add(new LinkPanel("shortlog", "title", "shortlog", ShortLogPage.class, newRepositoryParameter()));
- List<RevCommit> commits = JGitUtils.getRevLog(r, summaryCount);
+ List<RevCommit> commits = JGitUtils.getRevLog(r, numberCommits);
ListDataProvider<RevCommit> dp = new ListDataProvider<RevCommit>(commits);
DataView<RevCommit> shortlogView = new DataView<RevCommit>("commit", dp) {
private static final long serialVersionUID = 1L;
@@ -92,10 +104,14 @@ public class SummaryPage extends RepositoryPage { }
};
add(shortlogView);
- add(new LinkPanel("shortlogMore", "link", "more...", ShortLogPage.class, newRepositoryParameter()));
+ if (commits.size() < numberCommits) {
+ add(new Label("shortlogMore", "").setVisible(false));
+ } else {
+ add(new LinkPanel("shortlogMore", "link", "more...", ShortLogPage.class, newRepositoryParameter()));
+ }
// tags
- List<RefModel> tags = JGitUtils.getTags(r, summaryCount);
+ List<RefModel> tags = JGitUtils.getTags(r, numberRefs);
add(new LinkPanel("tags", "title", "tags", TagsPage.class, newRepositoryParameter()));
ListDataProvider<RefModel> tagsDp = new ListDataProvider<RefModel>(tags);
@@ -111,24 +127,28 @@ public class SummaryPage extends RepositoryPage { item.add(new LinkPanel("tagName", "list name", entry.getDisplayName(), CommitPage.class, newCommitParameter(entry.getCommitId().getName())));
if (entry.getCommitId().equals(entry.getObjectId())) {
- // lightweight tag on commit object
+ // simple tag
item.add(new Label("tagDescription", ""));
+ item.add(new TagLinksPanel("tagLinks", repositoryName, entry));
} else {
- // tag object
+ // annotated tag
item.add(new LinkPanel("tagDescription", "list subject", entry.getShortLog(), TagPage.class, newCommitParameter(entry.getObjectId().getName())));
+ item.add(new AnnotatedTagLinksPanel("tagLinks", repositoryName, entry));
}
- item.add(new TagLinksPanel("tagLinks", repositoryName, entry));
-
setAlternatingBackground(item, counter);
counter++;
}
};
add(tagView);
- add(new LinkPanel("tagsMore", "link", "more...", TagsPage.class, newRepositoryParameter()));
+ if (tags.size() < numberRefs) {
+ add(new Label("allTags", "").setVisible(false));
+ } else {
+ add(new LinkPanel("allTags", "link", "all tags...", TagsPage.class, newRepositoryParameter()));
+ }
// heads
- List<RefModel> heads = JGitUtils.getHeads(r, summaryCount);
+ List<RefModel> heads = JGitUtils.getHeads(r, numberRefs);
add(new LinkPanel("heads", "title", "heads", HeadsPage.class, newRepositoryParameter()));
ListDataProvider<RefModel> headsDp = new ListDataProvider<RefModel>(heads);
@@ -150,7 +170,12 @@ public class SummaryPage extends RepositoryPage { }
};
add(headsView);
-
+ if (heads.size() < numberRefs) {
+ add(new Label("allHeads", "").setVisible(false));
+ } else {
+ add(new LinkPanel("allHeads", "link", "all heads...", HeadsPage.class, newRepositoryParameter()));
+ }
+
// Display an activity line graph
insertActivityGraph(r);
diff --git a/src/com/gitblit/wicket/pages/TagPage.html b/src/com/gitblit/wicket/pages/TagPage.html index 60411858..f86becf9 100644 --- a/src/com/gitblit/wicket/pages/TagPage.html +++ b/src/com/gitblit/wicket/pages/TagPage.html @@ -8,17 +8,17 @@ <div wicket:id="pageLinks"></div>
<!-- summary header -->
- <div class="header" wicket:id="commit"></div>
+ <div style="padding-top: 5px;" class="header" wicket:id="commit"></div>
<!-- commit info -->
- <table>
+ <table class="plain">
<tr><th>object</th><td><span wicket:id="tagId">Message goes here</span></td></tr>
<tr><th>author</th><td><span wicket:id="tagAuthor">Message goes here</span></td></tr>
<tr><th></th><td><span wicket:id="tagDate">Message goes here</span></td></tr>
</table>
<!-- full message -->
- <div class="commit_message" wicket:id="fullMessage"></div>
+ <div style="border-bottom:0px;" class="commit_message" wicket:id="fullMessage"></div>
<!-- footer -->
<div wicket:id="pageFooter"></div>
diff --git a/src/com/gitblit/wicket/pages/TagsPage.html b/src/com/gitblit/wicket/pages/TagsPage.html index a3f7d399..e5899c52 100644 --- a/src/com/gitblit/wicket/pages/TagsPage.html +++ b/src/com/gitblit/wicket/pages/TagsPage.html @@ -8,14 +8,14 @@ <div wicket:id="pageLinks"></div>
<!-- shortlog -->
- <div class="header" wicket:id="summary"></div>
- <table>
+ <div style="margin-top:5px;" class="header" wicket:id="summary"></div>
+ <table class="pretty">
<tbody>
<tr wicket:id="tag">
<td class="date"><span wicket:id="tagDate"></span></td>
<td><b><div wicket:id="tagName"></div></b></td>
<td><div wicket:id="tagDescription"></div></td>
- <td><span wicket:id="tagLinks"></span></td>
+ <td class="rightAlign"><span wicket:id="tagLinks"></span></td>
</tr>
</tbody>
</table>
diff --git a/src/com/gitblit/wicket/pages/TagsPage.java b/src/com/gitblit/wicket/pages/TagsPage.java index 012d712b..5cfd1aff 100644 --- a/src/com/gitblit/wicket/pages/TagsPage.java +++ b/src/com/gitblit/wicket/pages/TagsPage.java @@ -13,6 +13,7 @@ import com.gitblit.utils.JGitUtils; import com.gitblit.wicket.LinkPanel;
import com.gitblit.wicket.RepositoryPage;
import com.gitblit.wicket.models.RefModel;
+import com.gitblit.wicket.panels.AnnotatedTagLinksPanel;
import com.gitblit.wicket.panels.TagLinksPanel;
@@ -39,15 +40,15 @@ public class TagsPage extends RepositoryPage { item.add(new LinkPanel("tagName", "list name", entry.getDisplayName(), CommitPage.class, newCommitParameter(entry.getObjectId().getName())));
if (entry.getCommitId().equals(entry.getObjectId())) {
- // lightweight tag on commit object
+ // simple tag on commit object
item.add(new Label("tagDescription", ""));
+ item.add(new TagLinksPanel("tagLinks", repositoryName, entry));
} else {
- // tag object
+ // annotated tag
item.add(new LinkPanel("tagDescription", "list subject", entry.getShortLog(), TagPage.class, newCommitParameter(entry.getObjectId().getName())));
+ item.add(new AnnotatedTagLinksPanel("tagLinks", repositoryName, entry));
}
- item.add(new TagLinksPanel("tagLinks", repositoryName, entry));
-
setAlternatingBackground(item, counter);
counter++;
}
diff --git a/src/com/gitblit/wicket/pages/TreePage.html b/src/com/gitblit/wicket/pages/TreePage.html index 197ac945..34806bbc 100644 --- a/src/com/gitblit/wicket/pages/TreePage.html +++ b/src/com/gitblit/wicket/pages/TreePage.html @@ -24,7 +24,7 @@ <td><span wicket:id="pathName"></span></td>
<td class="size"><span wicket:id="pathSize"></span></td>
<td class="mode"><span wicket:id="pathPermissions"></span></td>
- <td><span wicket:id="treeLinks"></span></td>
+ <td class="rightAlign"><span wicket:id="treeLinks"></span></td>
</tr>
</table>
diff --git a/src/com/gitblit/wicket/pages/TreePage.java b/src/com/gitblit/wicket/pages/TreePage.java index cce18be2..2ac04b7f 100644 --- a/src/com/gitblit/wicket/pages/TreePage.java +++ b/src/com/gitblit/wicket/pages/TreePage.java @@ -17,6 +17,7 @@ import com.gitblit.wicket.RepositoryPage; import com.gitblit.wicket.WicketUtils;
import com.gitblit.wicket.models.PathModel;
import com.gitblit.wicket.panels.PathBreadcrumbsPanel;
+import com.gitblit.wicket.panels.TreeBlobLinksPanel;
import com.gitblit.wicket.panels.TreeLinksPanel;
@@ -64,12 +65,13 @@ public class TreePage extends RepositoryPage { // folder/tree link
item.add(new Label("pathSize", ""));
item.add(new LinkPanel("pathName", null, entry.name, TreePage.class, newPathParameter(entry.path)));
+ item.add(new TreeLinksPanel("treeLinks", repositoryName, entry));
} else {
// blob link
item.add(new Label("pathSize", byteFormat.format(entry.size)));
item.add(new LinkPanel("pathName", "list", entry.name, BlobPage.class, newPathParameter(entry.path)));
+ item.add(new TreeBlobLinksPanel("treeLinks", repositoryName, entry));
}
- item.add(new TreeLinksPanel("treeLinks", repositoryName, entry));
}
String clazz = counter % 2 == 0 ? "dark" : "light";
WicketUtils.setCssClass(item, clazz);
diff --git a/src/com/gitblit/wicket/panels/AnnotatedTagLinksPanel.html b/src/com/gitblit/wicket/panels/AnnotatedTagLinksPanel.html new file mode 100644 index 00000000..4b1d5997 --- /dev/null +++ b/src/com/gitblit/wicket/panels/AnnotatedTagLinksPanel.html @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
+<wicket:panel>
+ <div class="link">
+ <span wicket:id="tag"></span> | <span wicket:id="commit"></span> | <span wicket:id="shortlog"></span>
+ </div>
+</wicket:panel>
+</html>
\ No newline at end of file diff --git a/src/com/gitblit/wicket/panels/AnnotatedTagLinksPanel.java b/src/com/gitblit/wicket/panels/AnnotatedTagLinksPanel.java new file mode 100644 index 00000000..79c6c635 --- /dev/null +++ b/src/com/gitblit/wicket/panels/AnnotatedTagLinksPanel.java @@ -0,0 +1,23 @@ +package com.gitblit.wicket.panels;
+
+import org.apache.wicket.PageParameters;
+import org.apache.wicket.markup.html.panel.Panel;
+
+import com.gitblit.wicket.LinkPanel;
+import com.gitblit.wicket.models.RefModel;
+import com.gitblit.wicket.pages.CommitPage;
+import com.gitblit.wicket.pages.ShortLogPage;
+import com.gitblit.wicket.pages.TagPage;
+
+
+public class AnnotatedTagLinksPanel extends Panel {
+
+ private static final long serialVersionUID = 1L;
+
+ public AnnotatedTagLinksPanel(String id, String repositoryName, RefModel tag) {
+ super(id);
+ add(new LinkPanel("tag", null, "tag", TagPage.class, new PageParameters("p=" + repositoryName + ",h=" + tag.getObjectId().getName())));
+ add(new LinkPanel("commit", null, "commit", CommitPage.class, new PageParameters("p=" + repositoryName + ",h=" + tag.getCommitId().getName())));
+ add(new LinkPanel("shortlog", null, "shortlog", ShortLogPage.class, new PageParameters("p=" + repositoryName + ",h=" + tag.getName())));
+ }
+}
\ No newline at end of file diff --git a/src/com/gitblit/wicket/panels/PageFooter.html b/src/com/gitblit/wicket/panels/PageFooter.html index 305b6bce..be1971ce 100644 --- a/src/com/gitblit/wicket/panels/PageFooter.html +++ b/src/com/gitblit/wicket/panels/PageFooter.html @@ -3,9 +3,10 @@ <wicket:panel>
<div class="page_footer">
<div style="float:right">
+ <span wicket:id="gbVersion"></span> |
<a title="about git:blit" href="about">About Git:Blit</a>
</div>
<div wicket:id="footerText"></div>
- </div>
+ </div>
</wicket:panel>
</html>
\ No newline at end of file diff --git a/src/com/gitblit/wicket/panels/PageFooter.java b/src/com/gitblit/wicket/panels/PageFooter.java index b727408c..b7440e8c 100644 --- a/src/com/gitblit/wicket/panels/PageFooter.java +++ b/src/com/gitblit/wicket/panels/PageFooter.java @@ -3,6 +3,7 @@ package com.gitblit.wicket.panels; import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Panel;
+import com.gitblit.Constants;
import com.gitblit.StoredSettings;
@@ -17,6 +18,7 @@ public class PageFooter extends Panel { public PageFooter(String id, String description) {
super(id);
add(new Label("footerText", description));
+ add(new Label("gbVersion", "v" + Constants.VERSION));
if (StoredSettings.getBoolean("aggressiveGC", false)) {
System.gc();
}
diff --git a/src/com/gitblit/wicket/panels/PageHeader.html b/src/com/gitblit/wicket/panels/PageHeader.html index 982a897c..827adb40 100644 --- a/src/com/gitblit/wicket/panels/PageHeader.html +++ b/src/com/gitblit/wicket/panels/PageHeader.html @@ -4,7 +4,7 @@ <head>
<title wicket:id="title">Message goes here</title>
<link rel="stylesheet" type="text/css" href="gitblit.css"/>
- <link rel="shortcut icon" href="git-favicon.png" type="image/png" />
+ <link rel="shortcut icon" href="gitblt-favicon.png" type="image/png" />
</head>
<div class="page_header">
diff --git a/src/com/gitblit/wicket/panels/PageLinksPanel.html b/src/com/gitblit/wicket/panels/PageLinksPanel.html index 18e271ea..5a2f8ec7 100644 --- a/src/com/gitblit/wicket/panels/PageLinksPanel.html +++ b/src/com/gitblit/wicket/panels/PageLinksPanel.html @@ -3,7 +3,7 @@ <wicket:panel>
<!-- page nav links -->
<div class="page_nav">
- <span wicket:id="summary"></span> | <span wicket:id="shortlog"></span> | <span wicket:id="commit"></span> | <span wicket:id="commitdiff"></span> | <span wicket:id="tree"></span>
+ <span wicket:id="summary"></span> | <span wicket:id="shortlog"></span> | <span wicket:id="tags"></span> | <span wicket:id="commit"></span> | <span wicket:id="commitdiff"></span> | <span wicket:id="tree"></span>
</div>
</wicket:panel>
</html>
\ No newline at end of file diff --git a/src/com/gitblit/wicket/panels/PageLinksPanel.java b/src/com/gitblit/wicket/panels/PageLinksPanel.java index 7447e760..02491bca 100644 --- a/src/com/gitblit/wicket/panels/PageLinksPanel.java +++ b/src/com/gitblit/wicket/panels/PageLinksPanel.java @@ -8,6 +8,7 @@ import com.gitblit.wicket.LinkPanel; import com.gitblit.wicket.pages.CommitPage;
import com.gitblit.wicket.pages.ShortLogPage;
import com.gitblit.wicket.pages.SummaryPage;
+import com.gitblit.wicket.pages.TagsPage;
import com.gitblit.wicket.pages.TreePage;
@@ -30,6 +31,13 @@ public class PageLinksPanel extends Panel { } else {
add(new LinkPanel("shortlog", null, "shortlog", ShortLogPage.class, new PageParameters("p=" + repositoryName)));
}
+
+ // tags
+ if (pageName.equals("tags")) {
+ add(new Label("tags", pageName));
+ } else {
+ add(new LinkPanel("tags", null, "tags", TagsPage.class, new PageParameters("p=" + repositoryName)));
+ }
// commit
if (pageName.equals("commit")) {
diff --git a/src/com/gitblit/wicket/panels/TreeBlobLinksPanel.html b/src/com/gitblit/wicket/panels/TreeBlobLinksPanel.html new file mode 100644 index 00000000..14a064f1 --- /dev/null +++ b/src/com/gitblit/wicket/panels/TreeBlobLinksPanel.html @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
+<wicket:panel>
+ <div class="link">
+ <span wicket:id="link"></span> | <span wicket:id="raw"></span> | <span wicket:id="history"></span>
+ </div>
+</wicket:panel>
+</html>
\ No newline at end of file diff --git a/src/com/gitblit/wicket/panels/TreeBlobLinksPanel.java b/src/com/gitblit/wicket/panels/TreeBlobLinksPanel.java new file mode 100644 index 00000000..9c7eb58b --- /dev/null +++ b/src/com/gitblit/wicket/panels/TreeBlobLinksPanel.java @@ -0,0 +1,22 @@ +package com.gitblit.wicket.panels;
+
+import org.apache.wicket.PageParameters;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.panel.Panel;
+
+import com.gitblit.wicket.LinkPanel;
+import com.gitblit.wicket.models.PathModel;
+import com.gitblit.wicket.pages.BlobPage;
+
+
+public class TreeBlobLinksPanel extends Panel {
+
+ private static final long serialVersionUID = 1L;
+
+ public TreeBlobLinksPanel(String id, String repositoryName, PathModel path) {
+ super(id);
+ add(new LinkPanel("link", null, "view", BlobPage.class, new PageParameters("p=" + repositoryName + ",h=" + path.commitId + ",f=" + path.path)));
+ add(new Label("raw", "raw"));
+ add(new Label("history", "history"));
+ }
+}
\ No newline at end of file diff --git a/src/com/gitblit/wicket/panels/TreeLinksPanel.html b/src/com/gitblit/wicket/panels/TreeLinksPanel.html index d0c3b7f3..00d8131b 100644 --- a/src/com/gitblit/wicket/panels/TreeLinksPanel.html +++ b/src/com/gitblit/wicket/panels/TreeLinksPanel.html @@ -2,7 +2,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
<wicket:panel>
<div class="link">
- <span wicket:id="link"></span> | <span wicket:id="history"></span> | <span wicket:id="raw"></span>
+ <span wicket:id="link"></span> | <span wicket:id="history"></span>
</div>
</wicket:panel>
</html>
\ No newline at end of file diff --git a/src/com/gitblit/wicket/panels/TreeLinksPanel.java b/src/com/gitblit/wicket/panels/TreeLinksPanel.java index ce918b9e..af4bbb16 100644 --- a/src/com/gitblit/wicket/panels/TreeLinksPanel.java +++ b/src/com/gitblit/wicket/panels/TreeLinksPanel.java @@ -6,7 +6,6 @@ import org.apache.wicket.markup.html.panel.Panel; import com.gitblit.wicket.LinkPanel;
import com.gitblit.wicket.models.PathModel;
-import com.gitblit.wicket.pages.BlobPage;
import com.gitblit.wicket.pages.TreePage;
@@ -16,14 +15,7 @@ public class TreeLinksPanel extends Panel { public TreeLinksPanel(String id, String repositoryName, PathModel path) {
super(id);
- if (path.isTree()) {
- add(new LinkPanel("link", null, "tree", TreePage.class, new PageParameters("p=" + repositoryName + ",h=" + path.commitId + ",f=" + path.path)));
- add(new Label("history", "history"));
- add(new Label("raw", ""));
- } else {
- add(new LinkPanel("link", null, "view", BlobPage.class, new PageParameters("p=" + repositoryName + ",h=" + path.commitId + ",f=" + path.path)));
- add(new Label("history", "history"));
- add(new Label("raw", "download"));
- }
+ add(new LinkPanel("link", null, "tree", TreePage.class, new PageParameters("p=" + repositoryName + ",h=" + path.commitId + ",f=" + path.path)));
+ add(new Label("history", "history"));
}
}
\ No newline at end of file |