summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/wicket/panels
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2012-09-07 22:06:15 -0400
committerJames Moger <james.moger@gitblit.com>2012-09-07 22:06:15 -0400
commit13a3f5bc3e2d25fc76850f86070dc34efe60d77a (patch)
tree9cb0c3915fae0d673843eaa5b18a6758116e45e4 /src/com/gitblit/wicket/panels
parentf4c326e2b6167b2eda1135b6d332ebce7a583dd9 (diff)
downloadgitblit-13a3f5bc3e2d25fc76850f86070dc34efe60d77a.tar.gz
gitblit-13a3f5bc3e2d25fc76850f86070dc34efe60d77a.zip
Draft project pages, project metadata, and RSS feeds
This is an in-progress feature to offer an interface for grouped repositories. This may help installations with large numbers of repositories stay organized. It also will be part of a future, more advanced security model.
Diffstat (limited to 'src/com/gitblit/wicket/panels')
-rw-r--r--src/com/gitblit/wicket/panels/RepositoriesPanel.html5
-rw-r--r--src/com/gitblit/wicket/panels/RepositoriesPanel.java20
-rw-r--r--src/com/gitblit/wicket/panels/RepositoryUrlPanel.html9
-rw-r--r--src/com/gitblit/wicket/panels/RepositoryUrlPanel.java3
4 files changed, 26 insertions, 11 deletions
diff --git a/src/com/gitblit/wicket/panels/RepositoriesPanel.html b/src/com/gitblit/wicket/panels/RepositoriesPanel.html
index 99bedc63..5da43e00 100644
--- a/src/com/gitblit/wicket/panels/RepositoriesPanel.html
+++ b/src/com/gitblit/wicket/panels/RepositoriesPanel.html
@@ -71,7 +71,8 @@
</wicket:fragment>
<wicket:fragment wicket:id="groupRepositoryRow">
- <td colspan="7"><span wicket:id="groupName">[group name]</span></td>
+ <td colspan="1"><span wicket:id="groupName">[group name]</span></td>
+ <td colspan="6"><span class="hidden-phone" style="font-weight:normal;color:#666;" wicket:id="groupDescription">[description]</span></td>
</wicket:fragment>
<wicket:fragment wicket:id="repositoryRow">
@@ -84,7 +85,7 @@
<td class="rightAlign">
<span class="hidden-phone">
<span wicket:id="repositoryLinks"></span>
- <a style="text-decoration: none;" wicket:id="syndication">
+ <a style="text-decoration: none;" wicket:id="syndication" wicket:message="title:gb.feed">
<img style="border:0px;vertical-align:middle;" src="feed_16x16.png"></img>
</a>
</span>
diff --git a/src/com/gitblit/wicket/panels/RepositoriesPanel.java b/src/com/gitblit/wicket/panels/RepositoriesPanel.java
index 8c8e1e5e..a113e006 100644
--- a/src/com/gitblit/wicket/panels/RepositoriesPanel.java
+++ b/src/com/gitblit/wicket/panels/RepositoriesPanel.java
@@ -46,6 +46,7 @@ import com.gitblit.Constants.AccessRestrictionType;
import com.gitblit.GitBlit;
import com.gitblit.Keys;
import com.gitblit.SyndicationServlet;
+import com.gitblit.models.ProjectModel;
import com.gitblit.models.RepositoryModel;
import com.gitblit.models.UserModel;
import com.gitblit.utils.StringUtils;
@@ -54,6 +55,7 @@ import com.gitblit.wicket.WicketUtils;
import com.gitblit.wicket.pages.BasePage;
import com.gitblit.wicket.pages.EditRepositoryPage;
import com.gitblit.wicket.pages.EmptyRepositoryPage;
+import com.gitblit.wicket.pages.ProjectPage;
import com.gitblit.wicket.pages.RepositoriesPage;
import com.gitblit.wicket.pages.SummaryPage;
@@ -112,10 +114,20 @@ public class RepositoriesPanel extends BasePanel {
roots.add(0, rootPath);
groups.put(rootPath, rootRepositories);
}
+
+ Map<String, ProjectModel> projects = new HashMap<String, ProjectModel>();
+ for (ProjectModel project : GitBlit.self().getProjectModels(user)) {
+ projects.put(project.name, project);
+ }
List<RepositoryModel> groupedModels = new ArrayList<RepositoryModel>();
for (String root : roots) {
List<RepositoryModel> subModels = groups.get(root);
- groupedModels.add(new GroupRepositoryModel(root, subModels.size()));
+ GroupRepositoryModel group = new GroupRepositoryModel(root, subModels.size());
+ if (projects.containsKey(root)) {
+ group.title = projects.get(root).title;
+ group.description = projects.get(root).description;
+ }
+ groupedModels.add(group);
Collections.sort(subModels);
groupedModels.addAll(subModels);
}
@@ -144,7 +156,8 @@ public class RepositoriesPanel extends BasePanel {
currGroupName = entry.name;
Fragment row = new Fragment("rowContent", "groupRepositoryRow", this);
item.add(row);
- row.add(new Label("groupName", entry.toString()));
+ row.add(new LinkPanel("groupName", null, entry.toString(), ProjectPage.class, WicketUtils.newProjectParameter(entry.name)));
+ row.add(new Label("groupDescription", entry.description == null ? "":entry.description));
WicketUtils.setCssClass(item, "group");
// reset counter so that first row is light background
counter = 0;
@@ -326,6 +339,7 @@ public class RepositoriesPanel extends BasePanel {
private static final long serialVersionUID = 1L;
int count;
+ String title;
GroupRepositoryModel(String name, int count) {
super(name, "", "", new Date(0));
@@ -334,7 +348,7 @@ public class RepositoriesPanel extends BasePanel {
@Override
public String toString() {
- return name + " (" + count + ")";
+ return StringUtils.isEmpty(title) ? name : title + " (" + count + ")";
}
}
diff --git a/src/com/gitblit/wicket/panels/RepositoryUrlPanel.html b/src/com/gitblit/wicket/panels/RepositoryUrlPanel.html
index 32f79de4..d7c76f13 100644
--- a/src/com/gitblit/wicket/panels/RepositoryUrlPanel.html
+++ b/src/com/gitblit/wicket/panels/RepositoryUrlPanel.html
@@ -9,20 +9,21 @@
<!-- Plain JavaScript manual copy & paste -->
<wicket:fragment wicket:id="jsPanel">
- <span class="btn" style="padding:0px 3px 0px 3px;vertical-align:middle;">
- <img wicket:id="copyIcon" style="padding-top:1px;"></img>
+ <span style="vertical-align:baseline;">
+ <img wicket:id="copyIcon" wicket:message="title:gb.copyToClipboard"></img>
</span>
</wicket:fragment>
<!-- flash-based button-press copy & paste -->
<wicket:fragment wicket:id="clippyPanel">
- <object style="padding:0px 2px;vertical-align:middle;"
+ <object wicket:message="title:gb.copyToClipboard" style="vertical-align:middle;"
wicket:id="clippy"
- width="110"
+ width="14"
height="14"
bgcolor="#ffffff"
quality="high"
wmode="transparent"
+ scale="noscale"
allowScriptAccess="always"></object>
</wicket:fragment>
</wicket:panel>
diff --git a/src/com/gitblit/wicket/panels/RepositoryUrlPanel.java b/src/com/gitblit/wicket/panels/RepositoryUrlPanel.java
index a98e40ab..58df028b 100644
--- a/src/com/gitblit/wicket/panels/RepositoryUrlPanel.java
+++ b/src/com/gitblit/wicket/panels/RepositoryUrlPanel.java
@@ -42,8 +42,7 @@ public class RepositoryUrlPanel extends BasePanel {
} else {
// javascript: manual copy & paste with modal browser prompt dialog
Fragment fragment = new Fragment("copyFunction", "jsPanel", this);
- ContextImage img = WicketUtils.newImage("copyIcon", "clipboard_13x13.png");
- WicketUtils.setHtmlTooltip(img, "Manual Copy to Clipboard");
+ ContextImage img = WicketUtils.newImage("copyIcon", "clippy.png");
img.add(new JavascriptTextPrompt("onclick", "Copy to Clipboard (Ctrl+C, Enter)", url));
fragment.add(img);
add(fragment);