From ccab3a2abf1f4c3b61e6955afa50b03efdcc707c Mon Sep 17 00:00:00 2001 From: James Moger Date: Sat, 4 Feb 2012 00:28:37 -0500 Subject: [PATCH] Indicate WORKING COPY on repository pages (issue 49) --- docs/04_releases.mkd | 1 + src/com/gitblit/wicket/GitBlitWebApp.properties | 4 +++- src/com/gitblit/wicket/pages/RepositoryPage.html | 3 +++ src/com/gitblit/wicket/pages/RepositoryPage.java | 7 +++++++ src/com/gitblit/wicket/panels/RepositoriesPanel.java | 2 +- 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/04_releases.mkd b/docs/04_releases.mkd index 32769762..e1dcb400 100644 --- a/docs/04_releases.mkd +++ b/docs/04_releases.mkd @@ -13,6 +13,7 @@ - On the Repositories page show a bang *!* character in the color swatch of a repository with a working copy (issue 49) Push requests to these repositories will be rejected. +- On all non-bare Repository pages show *WORKING COPY* in the upper right corner (issue 49) - New setting to prevent display/serving non-bare repositories **New:** *git.onlyAccessBareRepositories = false* - Allow relinking HEAD to a branch or a tag (Github/plm) diff --git a/src/com/gitblit/wicket/GitBlitWebApp.properties b/src/com/gitblit/wicket/GitBlitWebApp.properties index 1a8513a5..b5cd5150 100644 --- a/src/com/gitblit/wicket/GitBlitWebApp.properties +++ b/src/com/gitblit/wicket/GitBlitWebApp.properties @@ -210,4 +210,6 @@ gb.accessPermissionsForTeamDescription = set team members and grant access to sp gb.federationRepositoryDescription = share this repository with other Gitblit servers gb.hookScriptsDescription = run Groovy scripts on pushes to this Gitblit server gb.reset = reset -gb.pages = pages \ No newline at end of file +gb.pages = pages +gb.workingCopy = WORKING COPY +gb.workingCopyWarning = this repository has a working copy and can not receive pushes \ No newline at end of file diff --git a/src/com/gitblit/wicket/pages/RepositoryPage.html b/src/com/gitblit/wicket/pages/RepositoryPage.html index c60275ab..d69c7f90 100644 --- a/src/com/gitblit/wicket/pages/RepositoryPage.html +++ b/src/com/gitblit/wicket/pages/RepositoryPage.html @@ -37,6 +37,9 @@ diff --git a/src/com/gitblit/wicket/pages/RepositoryPage.java b/src/com/gitblit/wicket/pages/RepositoryPage.java index 5f544012..77918ea4 100644 --- a/src/com/gitblit/wicket/pages/RepositoryPage.java +++ b/src/com/gitblit/wicket/pages/RepositoryPage.java @@ -153,6 +153,13 @@ public abstract class RepositoryPage extends BasePage { add(new LinkPanel("repositoryName", null, StringUtils.stripDotGit(repositoryName), SummaryPage.class, WicketUtils.newRepositoryParameter(repositoryName))); add(new Label("pageName", pageName)); + if (getRepositoryModel().isBare) { + add(new Label("workingCopy").setVisible(false)); + } else { + Label lbl = new Label("workingCopy", getString("gb.workingCopy")); + WicketUtils.setHtmlTooltip(lbl, getString("gb.workingCopyWarning")); + add(lbl); + } super.setupPage(repositoryName, pageName); } diff --git a/src/com/gitblit/wicket/panels/RepositoriesPanel.java b/src/com/gitblit/wicket/panels/RepositoriesPanel.java index 4dcdab48..ee6e1191 100644 --- a/src/com/gitblit/wicket/panels/RepositoriesPanel.java +++ b/src/com/gitblit/wicket/panels/RepositoriesPanel.java @@ -155,7 +155,7 @@ public class RepositoriesPanel extends BasePanel { swatch = new Label("repositorySwatch", " ").setEscapeModelStrings(false); } else { swatch = new Label("repositorySwatch", "!"); - WicketUtils.setHtmlTooltip(swatch, "This repository has a working copy and can not receive pushes"); + WicketUtils.setHtmlTooltip(swatch, getString("gb.workingCopyWarning")); } WicketUtils.setCssBackground(swatch, entry.toString()); row.add(swatch); -- 2.39.5