summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/wicket/panels
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2011-04-14 19:44:47 -0400
committerJames Moger <james.moger@gitblit.com>2011-04-14 19:44:47 -0400
commit155bf78e3377910d29b2c912f58c0f496cb428e8 (patch)
treebe65a3b6276499c914f3a3f0994dfde9956f4dc9 /src/com/gitblit/wicket/panels
parentfc948cacef9c9b8c0a1e84cbc082ca67cd5f68d9 (diff)
downloadgitblit-155bf78e3377910d29b2c912f58c0f496cb428e8.tar.gz
gitblit-155bf78e3377910d29b2c912f58c0f496cb428e8.zip
Generate Keys class from gitblit.properties as part of build process.
Diffstat (limited to 'src/com/gitblit/wicket/panels')
-rw-r--r--src/com/gitblit/wicket/panels/BasePanel.java3
-rw-r--r--src/com/gitblit/wicket/panels/BranchesPanel.java8
-rw-r--r--src/com/gitblit/wicket/panels/LogPanel.java5
-rw-r--r--src/com/gitblit/wicket/panels/PageLinksPanel.java4
-rw-r--r--src/com/gitblit/wicket/panels/RefsPanel.java6
5 files changed, 14 insertions, 12 deletions
diff --git a/src/com/gitblit/wicket/panels/BasePanel.java b/src/com/gitblit/wicket/panels/BasePanel.java
index f81dfa9f..cdfc050c 100644
--- a/src/com/gitblit/wicket/panels/BasePanel.java
+++ b/src/com/gitblit/wicket/panels/BasePanel.java
@@ -4,6 +4,7 @@ import java.util.TimeZone;
import org.apache.wicket.markup.html.panel.Panel;
+import com.gitblit.Keys;
import com.gitblit.StoredSettings;
import com.gitblit.wicket.GitBlitWebSession;
@@ -16,6 +17,6 @@ public abstract class BasePanel extends Panel {
}
protected TimeZone getTimeZone() {
- return StoredSettings.getBoolean("useClientTimezone", false) ? GitBlitWebSession.get().getTimezone() : TimeZone.getDefault();
+ return StoredSettings.getBoolean(Keys.web_useClientTimezone, false) ? GitBlitWebSession.get().getTimezone() : TimeZone.getDefault();
}
}
diff --git a/src/com/gitblit/wicket/panels/BranchesPanel.java b/src/com/gitblit/wicket/panels/BranchesPanel.java
index 1c68b6f9..8ac78e4c 100644
--- a/src/com/gitblit/wicket/panels/BranchesPanel.java
+++ b/src/com/gitblit/wicket/panels/BranchesPanel.java
@@ -48,7 +48,7 @@ public class BranchesPanel extends BasePanel {
// show repository summary page link
add(new LinkPanel("branches", "title", repositoryName, SummaryPage.class, WicketUtils.newRepositoryParameter(repositoryName)));
}
-
+
ListDataProvider<RefModel> branchesDp = new ListDataProvider<RefModel>(branches);
DataView<RefModel> branchesView = new DataView<RefModel>("branch", branchesDp) {
private static final long serialVersionUID = 1L;
@@ -60,11 +60,11 @@ public class BranchesPanel extends BasePanel {
item.add(WicketUtils.createDateLabel("branchDate", entry.getDate(), getTimeZone()));
item.add(new LinkPanel("branchName", "list name", WicketUtils.trimString(entry.getDisplayName(), 28), LogPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));
-
+
// only show branch type on the branches page
boolean remote = entry.getName().startsWith(Constants.R_REMOTES);
- item.add(new Label("branchType", remote ? getString("gb.remote"):getString("gb.local")).setVisible(maxCount <= 0));
-
+ 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(repositoryName, entry.getName())));
item.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));
diff --git a/src/com/gitblit/wicket/panels/LogPanel.java b/src/com/gitblit/wicket/panels/LogPanel.java
index 8ef1e3e7..504bdd3a 100644
--- a/src/com/gitblit/wicket/panels/LogPanel.java
+++ b/src/com/gitblit/wicket/panels/LogPanel.java
@@ -14,12 +14,13 @@ import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
+import com.gitblit.Keys;
import com.gitblit.StoredSettings;
import com.gitblit.utils.JGitUtils;
import com.gitblit.wicket.LinkPanel;
import com.gitblit.wicket.WicketUtils;
-import com.gitblit.wicket.pages.CommitPage;
import com.gitblit.wicket.pages.CommitDiffPage;
+import com.gitblit.wicket.pages.CommitPage;
import com.gitblit.wicket.pages.LogPage;
import com.gitblit.wicket.pages.SummaryPage;
import com.gitblit.wicket.pages.TreePage;
@@ -31,7 +32,7 @@ public class LogPanel extends BasePanel {
public LogPanel(String wicketId, final String repositoryName, String objectId, Repository r, int limit, int pageOffset) {
super(wicketId);
boolean pageResults = limit <= 0;
- int itemsPerPage = StoredSettings.getInteger("logPageCommitCount", 50);
+ int itemsPerPage = StoredSettings.getInteger(Keys.web_logPageCommitCount, 50);
if (itemsPerPage <= 1) {
itemsPerPage = 50;
}
diff --git a/src/com/gitblit/wicket/panels/PageLinksPanel.java b/src/com/gitblit/wicket/panels/PageLinksPanel.java
index e2f9401d..252b49a4 100644
--- a/src/com/gitblit/wicket/panels/PageLinksPanel.java
+++ b/src/com/gitblit/wicket/panels/PageLinksPanel.java
@@ -57,7 +57,7 @@ public class PageLinksPanel extends Panel {
// Get the repository ticgit setting
boolean checkTicgit = StoredSettings.getBoolean("ticgit.global", false);
checkTicgit |= StoredSettings.getBoolean(MessageFormat.format("ticgit.{0}", repositoryName), false);
-
+
// Add dynamic repository extras
List<String> extras = new ArrayList<String>();
if (checkTicgit && JGitUtils.getTicGitBranch(r) != null) {
@@ -84,7 +84,7 @@ public class PageLinksPanel extends Panel {
String key = knownPages.get(wicketId);
String linkName = getString(key);
if (linkName.equals(pageName)) {
- Component c = get(wicketId);
+ Component c = get(wicketId);
if (c != null) {
c.setEnabled(false);
}
diff --git a/src/com/gitblit/wicket/panels/RefsPanel.java b/src/com/gitblit/wicket/panels/RefsPanel.java
index 9f928912..b84d9df8 100644
--- a/src/com/gitblit/wicket/panels/RefsPanel.java
+++ b/src/com/gitblit/wicket/panels/RefsPanel.java
@@ -20,7 +20,6 @@ import com.gitblit.wicket.pages.CommitPage;
import com.gitblit.wicket.pages.LogPage;
import com.gitblit.wicket.pages.TagPage;
-
public class RefsPanel extends Panel {
private static final long serialVersionUID = 1L;
@@ -32,11 +31,12 @@ public class RefsPanel extends Panel {
refNames = new ArrayList<String>();
}
Collections.sort(refNames);
-// refNames.remove(Constants.HEAD);
-
+ // refNames.remove(Constants.HEAD);
+
ListDataProvider<String> refsDp = new ListDataProvider<String>(refNames);
DataView<String> refsView = new DataView<String>("ref", refsDp) {
private static final long serialVersionUID = 1L;
+
public void populateItem(final Item<String> item) {
String entry = item.getModelObject();
Component c = null;