summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2011-04-25 21:52:38 -0400
committerJames Moger <james.moger@gitblit.com>2011-04-25 21:52:38 -0400
commit1e83907b001a2df3f14a35fc36c47ea8f49155c4 (patch)
treeb810c2069e41088a4e38920e729388882254ef1d /src
parent4910c13d1049a03895972878ff268a10149ad033 (diff)
downloadgitblit-1e83907b001a2df3f14a35fc36c47ea8f49155c4.tar.gz
gitblit-1e83907b001a2df3f14a35fc36c47ea8f49155c4.zip
Sprinkled some icons throughout ui. Centralized icon retrieval.
Diffstat (limited to 'src')
-rw-r--r--src/com/gitblit/GitBlit.java10
-rw-r--r--src/com/gitblit/utils/JGitUtils.java20
-rw-r--r--src/com/gitblit/wicket/GitBlitWebApp.properties6
-rw-r--r--src/com/gitblit/wicket/RepositoryPage.java12
-rw-r--r--src/com/gitblit/wicket/WicketUtils.java34
-rw-r--r--src/com/gitblit/wicket/models/RepositoryModel.java3
-rw-r--r--src/com/gitblit/wicket/pages/EditRepositoryPage.html14
-rw-r--r--src/com/gitblit/wicket/pages/EditRepositoryPage.java17
-rw-r--r--src/com/gitblit/wicket/pages/RepositoriesPage.html8
-rw-r--r--src/com/gitblit/wicket/pages/RepositoriesPage.java34
-rw-r--r--src/com/gitblit/wicket/pages/SummaryPage.java3
-rw-r--r--src/com/gitblit/wicket/pages/TreePage.html1
-rw-r--r--src/com/gitblit/wicket/pages/TreePage.java3
-rw-r--r--src/com/gitblit/wicket/panels/BasePanel.java4
-rw-r--r--src/com/gitblit/wicket/panels/HistoryPanel.java9
-rw-r--r--src/com/gitblit/wicket/panels/LogPanel.java9
-rw-r--r--src/com/gitblit/wicket/panels/PageLinksPanel.html2
-rw-r--r--src/com/gitblit/wicket/panels/PageLinksPanel.java37
-rw-r--r--src/com/gitblit/wicket/panels/RefsPanel.java2
-rw-r--r--src/com/gitblit/wicket/panels/SearchPanel.java9
-rw-r--r--src/com/gitblit/wicket/panels/TagsPanel.java5
-rw-r--r--src/com/gitblit/wicket/resources/book_16x16.pngbin0 -> 542 bytes
-rw-r--r--src/com/gitblit/wicket/resources/bug_16x16.pngbin0 -> 790 bytes
-rw-r--r--src/com/gitblit/wicket/resources/file_16x16.pngbin0 -> 416 bytes
-rw-r--r--src/com/gitblit/wicket/resources/folder_16x16.pngbin0 -> 632 bytes
-rw-r--r--src/com/gitblit/wicket/resources/gitblit.css36
-rw-r--r--src/com/gitblit/wicket/resources/lock_16x16.pngbin0 -> 689 bytes
-rw-r--r--src/com/gitblit/wicket/resources/pixel.pngbin0 -> 178 bytes
28 files changed, 204 insertions, 74 deletions
diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java
index c412b18a..c56b3cbb 100644
--- a/src/com/gitblit/GitBlit.java
+++ b/src/com/gitblit/GitBlit.java
@@ -116,7 +116,7 @@ public class GitBlit implements ServletContextListener {
JGitUtils.setRepositoryOwner(r, repository.owner);
JGitUtils.setRepositoryUseTickets(r, repository.useTickets);
JGitUtils.setRepositoryUseDocs(r, repository.useDocs);
- JGitUtils.setRepositoryUseNamedUsers(r, repository.useNamedUsers);
+ JGitUtils.setRepositoryRestrictedAccess(r, repository.useRestrictedAccess);
}
public List<String> getRepositoryList() {
@@ -130,9 +130,15 @@ public class GitBlit implements ServletContextListener {
Repository r = getRepository(repo);
String description = JGitUtils.getRepositoryDescription(r);
String owner = JGitUtils.getRepositoryOwner(r);
+ String group = JGitUtils.getRepositoryGroup(r);
Date lastchange = JGitUtils.getLastChange(r);
+ RepositoryModel model = new RepositoryModel(repo, description, owner, lastchange);
+ model.group = group;
+ model.useTickets = JGitUtils.getRepositoryUseTickets(r);
+ model.useDocs = JGitUtils.getRepositoryUseDocs(r);
+ model.useRestrictedAccess = JGitUtils.getRepositoryRestrictedAccess(r);
r.close();
- repositories.add(new RepositoryModel(repo, description, owner, lastchange));
+ repositories.add(model);
}
return repositories;
}
diff --git a/src/com/gitblit/utils/JGitUtils.java b/src/com/gitblit/utils/JGitUtils.java
index df7be6bf..eddd3df6 100644
--- a/src/com/gitblit/utils/JGitUtils.java
+++ b/src/com/gitblit/utils/JGitUtils.java
@@ -749,6 +749,14 @@ public class JGitUtils {
setRepositoryConfigString(r, "owner", owner);
}
+ public static String getRepositoryGroup(Repository r) {
+ return getRepositoryConfigString(r, "group");
+ }
+
+ public static void setRepositoryGroup(Repository r, String group) {
+ setRepositoryConfigString(r, "group", group);
+ }
+
public static boolean getRepositoryUseTickets(Repository r) {
return getRepositoryConfigBoolean(r, "useTickets", false);
}
@@ -765,12 +773,12 @@ public class JGitUtils {
setRepositoryConfigBoolean(r, "useDocs", value);
}
- public static boolean getRepositoryUseNamedUsers(Repository r) {
- return getRepositoryConfigBoolean(r, "useNamedUsers", false);
+ public static boolean getRepositoryRestrictedAccess(Repository r) {
+ return getRepositoryConfigBoolean(r, "restrictedAccess", false);
}
- public static void setRepositoryUseNamedUsers(Repository r, boolean value) {
- setRepositoryConfigBoolean(r, "useNamedUsers", value);
+ public static void setRepositoryRestrictedAccess(Repository r, boolean value) {
+ setRepositoryConfigBoolean(r, "restrictedAccess", value);
}
public static String getRepositoryConfigString(Repository r, String field) {
@@ -886,6 +894,10 @@ public class JGitUtils {
metrics.add(0, total);
return metrics;
}
+
+ public static RefModel getDocumentsBranch(Repository r) {
+ return getTicketsBranch(r);
+ }
public static RefModel getTicketsBranch(Repository r) {
RefModel ticgitBranch = null;
diff --git a/src/com/gitblit/wicket/GitBlitWebApp.properties b/src/com/gitblit/wicket/GitBlitWebApp.properties
index cbe1d05a..18b1e789 100644
--- a/src/com/gitblit/wicket/GitBlitWebApp.properties
+++ b/src/com/gitblit/wicket/GitBlitWebApp.properties
@@ -66,4 +66,8 @@ gb.filesRenamed = {0} files renamed
gb.missingUsername = Missing Username
gb.edit = edit
gb.searchTypeTooltip = Select Search Type
-gb.searchTooltip = Search Git:Blit \ No newline at end of file
+gb.searchTooltip = Search Git:Blit
+gb.rename = rename
+gb.delete = delete
+gb.docs = docs
+gb.restrictedAccess = restricted access \ No newline at end of file
diff --git a/src/com/gitblit/wicket/RepositoryPage.java b/src/com/gitblit/wicket/RepositoryPage.java
index 6e034799..30e41a5f 100644
--- a/src/com/gitblit/wicket/RepositoryPage.java
+++ b/src/com/gitblit/wicket/RepositoryPage.java
@@ -140,26 +140,26 @@ public abstract class RepositoryPage extends BasePage {
protected void setPersonSearchTooltip(Component component, String value, SearchType searchType) {
if (searchType.equals(SearchType.AUTHOR)) {
- WicketUtils.setHtmlTitle(component, getString("gb.searchForAuthor") + " " + value);
+ WicketUtils.setHtmlTooltip(component, getString("gb.searchForAuthor") + " " + value);
} else if (searchType.equals(SearchType.COMMITTER)) {
- WicketUtils.setHtmlTitle(component, getString("gb.searchForCommitter") + " " + value);
+ WicketUtils.setHtmlTooltip(component, getString("gb.searchForCommitter") + " " + value);
}
}
protected void setChangeTypeTooltip(Component container, ChangeType type) {
switch (type) {
case ADD:
- WicketUtils.setHtmlTitle(container, getString("gb.addition"));
+ WicketUtils.setHtmlTooltip(container, getString("gb.addition"));
break;
case COPY:
case RENAME:
- WicketUtils.setHtmlTitle(container, getString("gb.rename"));
+ WicketUtils.setHtmlTooltip(container, getString("gb.rename"));
break;
case DELETE:
- WicketUtils.setHtmlTitle(container, getString("gb.deletion"));
+ WicketUtils.setHtmlTooltip(container, getString("gb.deletion"));
break;
case MODIFY:
- WicketUtils.setHtmlTitle(container, getString("gb.modification"));
+ WicketUtils.setHtmlTooltip(container, getString("gb.modification"));
break;
}
}
diff --git a/src/com/gitblit/wicket/WicketUtils.java b/src/com/gitblit/wicket/WicketUtils.java
index 63e6621f..fb8e2967 100644
--- a/src/com/gitblit/wicket/WicketUtils.java
+++ b/src/com/gitblit/wicket/WicketUtils.java
@@ -9,6 +9,8 @@ import org.apache.wicket.Component;
import org.apache.wicket.PageParameters;
import org.apache.wicket.behavior.SimpleAttributeModifier;
import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.image.ContextImage;
+import org.apache.wicket.resource.ContextRelativeResource;
import org.eclipse.jgit.diff.DiffEntry.ChangeType;
import org.eclipse.jgit.lib.Constants;
@@ -28,7 +30,7 @@ public class WicketUtils {
container.add(new SimpleAttributeModifier("style", value));
}
- public static void setHtmlTitle(Component container, String value) {
+ public static void setHtmlTooltip(Component container, String value) {
container.add(new SimpleAttributeModifier("title", value));
}
@@ -77,10 +79,34 @@ public class WicketUtils {
public static Label createAuthorLabel(String wicketId, String author) {
Label label = new Label(wicketId, author);
- WicketUtils.setHtmlTitle(label, author);
+ WicketUtils.setHtmlTooltip(label, author);
return label;
}
+ public static ContextImage newClearPixel(String wicketId) {
+ return newImage(wicketId, "pixel.png");
+ }
+
+ public static ContextImage newBlankImage(String wicketId) {
+ return newImage(wicketId, "blank.png");
+ }
+
+ public static ContextImage newImage(String wicketId, String file) {
+ return newImage(wicketId, file, null);
+ }
+
+ public static ContextImage newImage(String wicketId, String file, String tooltip) {
+ ContextImage img = new ContextImage(wicketId, "/com/gitblit/wicket/resources/" + file);
+ if (!StringUtils.isEmpty(tooltip)) {
+ setHtmlTooltip(img, tooltip);
+ }
+ return img;
+ }
+
+ public static ContextRelativeResource getResource(String file) {
+ return new ContextRelativeResource("/com/gitblit/wicket/resources/" + file);
+ }
+
public static PageParameters newRepositoryParameter(String repositoryName) {
return new PageParameters("r=" + repositoryName);
}
@@ -170,7 +196,7 @@ public class WicketUtils {
}
Label label = new Label(wicketId, dateString);
WicketUtils.setCssClass(label, TimeUtils.timeAgoCss(date));
- WicketUtils.setHtmlTitle(label, title);
+ WicketUtils.setHtmlTooltip(label, title);
return label;
}
@@ -182,7 +208,7 @@ public class WicketUtils {
String dateString = df.format(date);
String title = TimeUtils.timeAgo(date);
Label label = new Label(wicketId, dateString);
- WicketUtils.setHtmlTitle(label, title);
+ WicketUtils.setHtmlTooltip(label, title);
return label;
}
}
diff --git a/src/com/gitblit/wicket/models/RepositoryModel.java b/src/com/gitblit/wicket/models/RepositoryModel.java
index a9410b51..8df38083 100644
--- a/src/com/gitblit/wicket/models/RepositoryModel.java
+++ b/src/com/gitblit/wicket/models/RepositoryModel.java
@@ -9,10 +9,11 @@ public class RepositoryModel implements Serializable {
public String name;
public String description;
public String owner;
+ public String group;
public Date lastChange;
public boolean useTickets;
public boolean useDocs;
- public boolean useNamedUsers;
+ public boolean useRestrictedAccess;
public RepositoryModel(String name, String description, String owner, Date lastchange) {
this.name = name;
diff --git a/src/com/gitblit/wicket/pages/EditRepositoryPage.html b/src/com/gitblit/wicket/pages/EditRepositoryPage.html
index 1e04ed05..f202e918 100644
--- a/src/com/gitblit/wicket/pages/EditRepositoryPage.html
+++ b/src/com/gitblit/wicket/pages/EditRepositoryPage.html
@@ -13,13 +13,13 @@
<form wicket:id="editForm">
<table class="plain">
<tbody>
- <tr><th>Name</th><td><input type="text" wicket:id="name" size="30" /></td></tr>
- <tr><th>Description</th><td><input type="text" wicket:id="description" size="80" /></td></tr>
- <tr><th>Owner</th><td><input type="text" wicket:id="owner" size="30" /></td></tr>
- <tr><th>Use Git:Blit Tickets</th><td><input type="checkbox" wicket:id="useTickets"/>distributed Git:Blit ticketing</td></tr>
- <tr><th>Use Git:Blit Docs</th><td><input type="checkbox" wicket:id="useDocs"/>distributed Git:Blit documentation</td></tr>
- <tr><th>Named User Access</th><td><input type="checkbox" wicket:id="useNamedUsers"/>not implemented</td></tr>
- <tr><td colspan="2"><input type="submit" value="Submit"/></td></tr>
+ <tr><th>Name</th><td class="edit"><input type="text" wicket:id="name" size="30" tabindex="1" /></td></tr>
+ <tr><th>Description</th><td class="edit"><input type="text" wicket:id="description" size="80" tabindex="2" /></td></tr>
+ <tr><th>Owner</th><td class="edit"><input type="text" wicket:id="owner" size="30" tabindex="3" /></td></tr>
+ <tr><th>Group</th><td class="edit"><input type="text" wicket:id="group" size="30" tabindex="4" /></td></tr>
+ <tr><th>Enable Tickets</th><td class="edit"><input type="checkbox" wicket:id="useTickets" tabindex="5" /> <i>distributed Ticgit ticketing</i></td></tr>
+ <tr><th>Enable Docs</th><td class="edit"><input type="checkbox" wicket:id="useDocs" tabindex="6" /> <i>distributed Markdown documentation</i></td></tr>
+ <tr><td class="edit" colspan="2"><input type="submit" value="Submit" tabindex="7" /></td></tr>
</tbody>
</table>
</form>
diff --git a/src/com/gitblit/wicket/pages/EditRepositoryPage.java b/src/com/gitblit/wicket/pages/EditRepositoryPage.java
index fab3203e..e2905683 100644
--- a/src/com/gitblit/wicket/pages/EditRepositoryPage.java
+++ b/src/com/gitblit/wicket/pages/EditRepositoryPage.java
@@ -7,8 +7,10 @@ import org.apache.wicket.markup.html.form.CheckBox;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.model.CompoundPropertyModel;
+import org.eclipse.jgit.lib.Repository;
import com.gitblit.GitBlit;
+import com.gitblit.utils.JGitUtils;
import com.gitblit.wicket.AdminPage;
import com.gitblit.wicket.BasePage;
import com.gitblit.wicket.WicketUtils;
@@ -30,8 +32,17 @@ public class EditRepositoryPage extends BasePage {
// edit constructor
super(params);
isCreate = false;
- String repositoryName = WicketUtils.getRepositoryName(params);
- setupPage(new RepositoryModel(repositoryName, "", "", new Date()));
+ String name = WicketUtils.getRepositoryName(params);
+ Repository r = GitBlit.self().getRepository(name);
+ String description = JGitUtils.getRepositoryDescription(r);
+ String owner = JGitUtils.getRepositoryOwner(r);
+ String group = JGitUtils.getRepositoryGroup(r);
+ RepositoryModel model = new RepositoryModel(name, description, owner, new Date());
+ model.group = group;
+ model.useTickets = JGitUtils.getRepositoryUseTickets(r);
+ model.useDocs = JGitUtils.getRepositoryUseDocs(r);
+ model.useRestrictedAccess = JGitUtils.getRepositoryRestrictedAccess(r);
+ setupPage(model);
}
protected void setupPage(final RepositoryModel repository) {
@@ -55,9 +66,9 @@ public class EditRepositoryPage extends BasePage {
form.add(new TextField<String>("name").setEnabled(isCreate));
form.add(new TextField<String>("description"));
form.add(new TextField<String>("owner"));
+ form.add(new TextField<String>("group"));
form.add(new CheckBox("useTickets"));
form.add(new CheckBox("useDocs"));
- form.add(new CheckBox("useNamedUsers"));
add(form);
}
diff --git a/src/com/gitblit/wicket/pages/RepositoriesPage.html b/src/com/gitblit/wicket/pages/RepositoriesPage.html
index 24a34464..bb132922 100644
--- a/src/com/gitblit/wicket/pages/RepositoriesPage.html
+++ b/src/com/gitblit/wicket/pages/RepositoriesPage.html
@@ -20,6 +20,7 @@
<th wicket:id="orderByRepository"><wicket:message key="gb.repository">Repository</wicket:message></th>
<th wicket:id="orderByDescription"><wicket:message key="gb.description">Description</wicket:message></th>
<th wicket:id="orderByOwner"><wicket:message key="gb.owner">Owner</wicket:message></th>
+ <th></th>
<th wicket:id="orderByDate"><wicket:message key="gb.lastChange">Last Change</wicket:message></th>
<th></th>
</tr>
@@ -28,8 +29,9 @@
<td><div class="list" wicket:id="repositoryName">[repository name]</div></td>
<td><div class="list" wicket:id="repositoryDescription">[repository description]</div></td>
<td class="author"><span wicket:id="repositoryOwner">[repository owner]</span></td>
+ <td class="icon"><img wicket:id="ticketsIcon" /><img wicket:id="docsIcon" /><img wicket:id="restrictedAccessIcon" /></td>
<td><span wicket:id="repositoryLastChange">[last change]</span></td>
- <td><a wicket:id="repositoryLinks"><wicket:message key="gb.edit">[edit]</wicket:message></a></td>
+ <td class="rightAlign"><span wicket:id="repositoryLinks"></span></td>
</tr>
</tbody>
</table>
@@ -40,6 +42,10 @@
<a wicket:id="newRepository"><wicket:message key="gb.newRepository"></wicket:message></a> | <a wicket:id="newUser"><wicket:message key="gb.newUser"></wicket:message></a>
</div>
</wicket:fragment>
+
+ <wicket:fragment wicket:id="repositoryAdminLinks">
+ <span class="link"><a wicket:id="editRepository"><wicket:message key="gb.edit">[edit]</wicket:message></a> | <a wicket:id="renameRepository"><wicket:message key="gb.rename">[rename]</wicket:message></a> | <a wicket:id="deleteRepository"><wicket:message key="gb.delete">[delete]</wicket:message></a></span>
+ </wicket:fragment>
</wicket:extend>
</body>
</html> \ No newline at end of file
diff --git a/src/com/gitblit/wicket/pages/RepositoriesPage.java b/src/com/gitblit/wicket/pages/RepositoriesPage.java
index 4aba988f..a7ec963a 100644
--- a/src/com/gitblit/wicket/pages/RepositoriesPage.java
+++ b/src/com/gitblit/wicket/pages/RepositoriesPage.java
@@ -48,7 +48,7 @@ public class RepositoriesPage extends BasePage {
} else {
showAdmin = GitBlit.self().settings().getBoolean(Keys.web.allowAdministration, false);
}
-
+
Fragment adminLinks = new Fragment("adminPanel", "adminLinks", this);
adminLinks.add(new BookmarkablePageLink<Void>("newRepository", EditRepositoryPage.class));
adminLinks.add(new BookmarkablePageLink<Void>("newUser", RepositoriesPage.class));
@@ -60,7 +60,7 @@ public class RepositoriesPage extends BasePage {
if (messageSource.equalsIgnoreCase("gitblit")) {
// Read default welcome message
try {
- ContextRelativeResource res = new ContextRelativeResource("/com/gitblit/wicket/resources/welcome.mkd");
+ ContextRelativeResource res = WicketUtils.getResource("welcome.mkd");
InputStream is = res.getResourceStream().getInputStream();
InputStreamReader reader = new InputStreamReader(is);
StringWriter writer = new StringWriter();
@@ -112,6 +112,25 @@ public class RepositoriesPage extends BasePage {
PageParameters pp = WicketUtils.newRepositoryParameter(entry.name);
item.add(new LinkPanel("repositoryName", "list", entry.name, SummaryPage.class, pp));
item.add(new LinkPanel("repositoryDescription", "list", entry.description, SummaryPage.class, pp));
+
+ if (entry.useTickets) {
+ item.add(WicketUtils.newImage("ticketsIcon", "bug_16x16.png", getString("gb.tickets")));
+ } else {
+ item.add(WicketUtils.newClearPixel("ticketsIcon"));
+ }
+
+ if (entry.useDocs) {
+ item.add(WicketUtils.newImage("docsIcon", "book_16x16.png", getString("gb.docs")));
+ } else {
+ item.add(WicketUtils.newClearPixel("docsIcon"));
+ }
+
+ if (entry.useRestrictedAccess) {
+ item.add(WicketUtils.newImage("restrictedAccessIcon", "lock_16x16.png", getString("gb.restrictedAccess")));
+ } else {
+ item.add(WicketUtils.newClearPixel("restrictedAccessIcon"));
+ }
+
item.add(new Label("repositoryOwner", entry.owner));
String lastChange = TimeUtils.timeAgo(entry.lastChange);
@@ -119,8 +138,15 @@ public class RepositoriesPage extends BasePage {
item.add(lastChangeLabel);
WicketUtils.setCssClass(lastChangeLabel, TimeUtils.timeAgoCss(entry.lastChange));
- item.add(new BookmarkablePageLink<Void>("repositoryLinks", EditRepositoryPage.class, WicketUtils.newRepositoryParameter(entry.name)).setVisible(showAdmin));
-
+ if (showAdmin) {
+ Fragment repositoryLinks = new Fragment("repositoryLinks", "repositoryAdminLinks", this);
+ repositoryLinks.add(new BookmarkablePageLink<Void>("editRepository", EditRepositoryPage.class, WicketUtils.newRepositoryParameter(entry.name)));
+ repositoryLinks.add(new BookmarkablePageLink<Void>("renameRepository", EditRepositoryPage.class, WicketUtils.newRepositoryParameter(entry.name)).setEnabled(false));
+ repositoryLinks.add(new BookmarkablePageLink<Void>("deleteRepository", EditRepositoryPage.class, WicketUtils.newRepositoryParameter(entry.name)).setEnabled(false));
+ item.add(repositoryLinks);
+ } else {
+ item.add(new Label("repositoryLinks"));
+ }
WicketUtils.setAlternatingBackground(item, counter);
counter++;
}
diff --git a/src/com/gitblit/wicket/pages/SummaryPage.java b/src/com/gitblit/wicket/pages/SummaryPage.java
index 3d4a6ef8..0c4c5953 100644
--- a/src/com/gitblit/wicket/pages/SummaryPage.java
+++ b/src/com/gitblit/wicket/pages/SummaryPage.java
@@ -7,7 +7,6 @@ import java.util.List;
import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.image.ContextImage;
import org.eclipse.jgit.lib.Repository;
import org.wicketstuff.googlecharts.AbstractChartData;
import org.wicketstuff.googlecharts.Chart;
@@ -100,7 +99,7 @@ public class SummaryPage extends RepositoryPage {
add(new Chart("commitsChart", provider));
} else {
- add(new ContextImage("commitsChart", "blank.png"));
+ add(WicketUtils.newBlankImage("commitsChart"));
}
}
diff --git a/src/com/gitblit/wicket/pages/TreePage.html b/src/com/gitblit/wicket/pages/TreePage.html
index f72792fc..f180c9d3 100644
--- a/src/com/gitblit/wicket/pages/TreePage.html
+++ b/src/com/gitblit/wicket/pages/TreePage.html
@@ -24,6 +24,7 @@
<!-- changed paths -->
<table style="width:100%" class="pretty">
<tr wicket:id="changedPath">
+ <td class="icon"><img wicket:id="pathIcon" /></td>
<td><span wicket:id="pathName"></span></td>
<td class="size"><span wicket:id="pathSize">[path size]</span></td>
<td class="mode"><span wicket:id="pathPermissions">[path permissions]</span></td>
diff --git a/src/com/gitblit/wicket/pages/TreePage.java b/src/com/gitblit/wicket/pages/TreePage.java
index e29ba421..9022d444 100644
--- a/src/com/gitblit/wicket/pages/TreePage.java
+++ b/src/com/gitblit/wicket/pages/TreePage.java
@@ -57,12 +57,14 @@ public class TreePage extends RepositoryPage {
item.add(new Label("pathPermissions", JGitUtils.getPermissionsFromMode(entry.mode)));
if (entry.isParentPath) {
// parent .. path
+ item.add(WicketUtils.newBlankImage("pathIcon"));
item.add(new Label("pathSize", ""));
item.add(new LinkPanel("pathName", null, entry.name, TreePage.class, newPathParameter(entry.path)));
item.add(new Label("pathLinks", ""));
} else {
if (entry.isTree()) {
// folder/tree link
+ item.add(WicketUtils.newImage("pathIcon", "folder_16x16.png"));
item.add(new Label("pathSize", ""));
item.add(new LinkPanel("pathName", null, entry.name, TreePage.class, newPathParameter(entry.path)));
@@ -73,6 +75,7 @@ public class TreePage extends RepositoryPage {
item.add(links);
} else {
// blob link
+ item.add(WicketUtils.newImage("pathIcon", "file_16x16.png"));
item.add(new Label("pathSize", byteFormat.format(entry.size)));
item.add(new LinkPanel("pathName", "list", entry.name, BlobPage.class, newPathParameter(entry.path)));
diff --git a/src/com/gitblit/wicket/panels/BasePanel.java b/src/com/gitblit/wicket/panels/BasePanel.java
index 8a168ab4..43cd1263 100644
--- a/src/com/gitblit/wicket/panels/BasePanel.java
+++ b/src/com/gitblit/wicket/panels/BasePanel.java
@@ -25,9 +25,9 @@ public abstract class BasePanel extends Panel {
protected void setPersonSearchTooltip(Component component, String value, SearchType searchType) {
if (searchType.equals(SearchType.AUTHOR)) {
- WicketUtils.setHtmlTitle(component, getString("gb.searchForAuthor") + " " + value);
+ WicketUtils.setHtmlTooltip(component, getString("gb.searchForAuthor") + " " + value);
} else if (searchType.equals(SearchType.COMMITTER)) {
- WicketUtils.setHtmlTitle(component, getString("gb.searchForCommitter") + " " + value);
+ WicketUtils.setHtmlTooltip(component, getString("gb.searchForCommitter") + " " + value);
}
}
}
diff --git a/src/com/gitblit/wicket/panels/HistoryPanel.java b/src/com/gitblit/wicket/panels/HistoryPanel.java
index f8592133..234e00ba 100644
--- a/src/com/gitblit/wicket/panels/HistoryPanel.java
+++ b/src/com/gitblit/wicket/panels/HistoryPanel.java
@@ -5,7 +5,6 @@ import java.util.List;
import java.util.Map;
import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.image.ContextImage;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.markup.repeater.Item;
@@ -43,7 +42,7 @@ public class HistoryPanel extends BasePanel {
public HistoryPanel(String wicketId, final String repositoryName, final String objectId, final String path, Repository r, int limit, int pageOffset) {
super(wicketId);
boolean pageResults = limit <= 0;
- int itemsPerPage = GitBlit.self().settings().getInteger(Keys.web.logPageCommitCount, 50);
+ int itemsPerPage = GitBlit.self().settings().getInteger(Keys.web.itemsPerPage, 50);
if (itemsPerPage <= 1) {
itemsPerPage = 50;
}
@@ -107,16 +106,16 @@ public class HistoryPanel extends BasePanel {
// merge icon
if (entry.getParentCount() > 1) {
- item.add(new ContextImage("commitIcon", "/com/gitblit/wicket/resources/commit_merge_16x16.png"));
+ item.add(WicketUtils.newImage("commitIcon", "commit_merge_16x16.png"));
} else {
- item.add(new ContextImage("commitIcon", "/com/gitblit/wicket/resources/blank.png"));
+ item.add(WicketUtils.newBlankImage("commitIcon"));
}
String shortMessage = entry.getShortMessage();
String trimmedMessage = StringUtils.trimShortLog(shortMessage);
LinkPanel shortlog = new LinkPanel("commitShortMessage", "list subject", trimmedMessage, CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName()));
if (!shortMessage.equals(trimmedMessage)) {
- WicketUtils.setHtmlTitle(shortlog, shortMessage);
+ WicketUtils.setHtmlTooltip(shortlog, shortMessage);
}
item.add(shortlog);
diff --git a/src/com/gitblit/wicket/panels/LogPanel.java b/src/com/gitblit/wicket/panels/LogPanel.java
index 8895dbcb..23afc377 100644
--- a/src/com/gitblit/wicket/panels/LogPanel.java
+++ b/src/com/gitblit/wicket/panels/LogPanel.java
@@ -5,7 +5,6 @@ import java.util.List;
import java.util.Map;
import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.image.ContextImage;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.markup.repeater.data.DataView;
@@ -38,7 +37,7 @@ public class LogPanel extends BasePanel {
public LogPanel(String wicketId, final String repositoryName, final String objectId, Repository r, int limit, int pageOffset) {
super(wicketId);
boolean pageResults = limit <= 0;
- int itemsPerPage = GitBlit.self().settings().getInteger(Keys.web.logPageCommitCount, 50);
+ int itemsPerPage = GitBlit.self().settings().getInteger(Keys.web.itemsPerPage, 50);
if (itemsPerPage <= 1) {
itemsPerPage = 50;
}
@@ -87,9 +86,9 @@ public class LogPanel extends BasePanel {
// merge icon
if (entry.getParentCount() > 1) {
- item.add(new ContextImage("commitIcon", "/com/gitblit/wicket/resources/commit_merge_16x16.png"));
+ item.add(WicketUtils.newImage("commitIcon", "commit_merge_16x16.png"));
} else {
- item.add(new ContextImage("commitIcon", "/com/gitblit/wicket/resources/blank.png"));
+ item.add(WicketUtils.newBlankImage("commitIcon"));
}
// short message
@@ -97,7 +96,7 @@ public class LogPanel extends BasePanel {
String trimmedMessage = StringUtils.trimShortLog(shortMessage);
LinkPanel shortlog = new LinkPanel("commitShortMessage", "list subject", trimmedMessage, CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName()));
if (!shortMessage.equals(trimmedMessage)) {
- WicketUtils.setHtmlTitle(shortlog, shortMessage);
+ WicketUtils.setHtmlTooltip(shortlog, shortMessage);
}
item.add(shortlog);
diff --git a/src/com/gitblit/wicket/panels/PageLinksPanel.html b/src/com/gitblit/wicket/panels/PageLinksPanel.html
index c467779a..7cad29f0 100644
--- a/src/com/gitblit/wicket/panels/PageLinksPanel.html
+++ b/src/com/gitblit/wicket/panels/PageLinksPanel.html
@@ -9,7 +9,7 @@
<form wicket:id="searchForm">
<div class="search">
<select wicket:id="searchType"/>
- <input type="text" id="searchBox" wicket:id="searchBox" value=""/>
+ <input type="text" id="searchBox" wicket:id="searchBox" size="25" value=""/>
</div>
</form>
diff --git a/src/com/gitblit/wicket/panels/PageLinksPanel.java b/src/com/gitblit/wicket/panels/PageLinksPanel.java
index deb0f6d2..c2bae8fe 100644
--- a/src/com/gitblit/wicket/panels/PageLinksPanel.java
+++ b/src/com/gitblit/wicket/panels/PageLinksPanel.java
@@ -1,6 +1,5 @@
package com.gitblit.wicket.panels;
-import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@@ -63,16 +62,20 @@ public class PageLinksPanel extends Panel {
add(new BookmarkablePageLink<Void>("tags", TagsPage.class, WicketUtils.newRepositoryParameter(repositoryName)));
add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils.newRepositoryParameter(repositoryName)));
- // Get the repository tickets setting
- boolean checkTicgit = GitBlit.self().settings().getBoolean(Keys.tickets.global, false);
- checkTicgit |= GitBlit.self().settings().getBoolean(MessageFormat.format(Keys.tickets._ROOT + ".{0}", repositoryName), false);
-
- // Add dynamic repository extras
List<String> extras = new ArrayList<String>();
- if (checkTicgit && JGitUtils.getTicketsBranch(r) != null) {
+
+ // Get the repository tickets setting
+ boolean checkTickets = JGitUtils.getRepositoryUseTickets(r);
+ if (checkTickets && JGitUtils.getTicketsBranch(r) != null) {
extras.add("tickets");
}
+ // Get the repository docs setting
+ boolean checkDocs = JGitUtils.getRepositoryUseDocs(r);
+ if (checkDocs && JGitUtils.getDocumentsBranch(r) != null) {
+ extras.add("docs");
+ }
+
ListDataProvider<String> extrasDp = new ListDataProvider<String>(extras);
DataView<String> extrasView = new DataView<String>("extra", extrasDp) {
private static final long serialVersionUID = 1L;
@@ -81,7 +84,10 @@ public class PageLinksPanel extends Panel {
String extra = item.getModelObject();
if (extra.equals("tickets")) {
item.add(new Label("extraSeparator", " | "));
- item.add(new LinkPanel("extraLink", null, "tickets", TicketsPage.class, WicketUtils.newRepositoryParameter(repositoryName)));
+ item.add(new LinkPanel("extraLink", null, getString("gb.tickets"), TicketsPage.class, WicketUtils.newRepositoryParameter(repositoryName)));
+ } else if (extra.equals("docs")) {
+ item.add(new Label("extraSeparator", " | "));
+ item.add(new LinkPanel("extraLink", null, getString("gb.docs"), TicketsPage.class, WicketUtils.newRepositoryParameter(repositoryName)));
}
}
};
@@ -110,7 +116,7 @@ public class PageLinksPanel extends Panel {
private final String repositoryName;
private final IModel<String> searchBoxModel = new Model<String>("");
-
+
private final IModel<SearchType> searchTypeModel = new Model<SearchType>(SearchType.COMMIT);
public SearchForm(String id, String repositoryName) {
@@ -118,11 +124,11 @@ public class PageLinksPanel extends Panel {
this.repositoryName = repositoryName;
DropDownChoice<SearchType> searchType = new DropDownChoice<SearchType>("searchType", Arrays.asList(SearchType.values()));
searchType.setModel(searchTypeModel);
- WicketUtils.setHtmlTitle(searchType, getString("gb.searchTypeTooltip"));
- add(searchType);
+ WicketUtils.setHtmlTooltip(searchType, getString("gb.searchTypeTooltip"));
+ add(searchType.setVisible(GitBlit.self().settings().getBoolean(Keys.web.showSearchTypeSelection, false)));
TextField<String> searchBox = new TextField<String>("searchBox", searchBoxModel);
add(searchBox);
- WicketUtils.setHtmlTitle(searchBox, getString("gb.searchTooltip"));
+ WicketUtils.setHtmlTooltip(searchBox, getString("gb.searchTooltip"));
WicketUtils.setInputPlaceholder(searchBox, getString("gb.search"));
}
@@ -130,6 +136,13 @@ public class PageLinksPanel extends Panel {
public void onSubmit() {
SearchType searchType = searchTypeModel.getObject();
String searchString = searchBoxModel.getObject();
+ for (SearchType type : SearchType.values()) {
+ if (searchString.toLowerCase().startsWith(type.name().toLowerCase() + ":")) {
+ searchType = type;
+ searchString = searchString.substring(type.name().toLowerCase().length() + 1).trim();
+ break;
+ }
+ }
setResponsePage(SearchPage.class, WicketUtils.newSearchParameter(repositoryName, null, searchString, searchType));
}
}
diff --git a/src/com/gitblit/wicket/panels/RefsPanel.java b/src/com/gitblit/wicket/panels/RefsPanel.java
index b84d9df8..e8d8c7f3 100644
--- a/src/com/gitblit/wicket/panels/RefsPanel.java
+++ b/src/com/gitblit/wicket/panels/RefsPanel.java
@@ -57,7 +57,7 @@ public class RefsPanel extends Panel {
c = new LinkPanel("refName", null, entry, CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry));
WicketUtils.setCssClass(c, "otherRef");
}
- WicketUtils.setHtmlTitle(c, entry);
+ WicketUtils.setHtmlTooltip(c, entry);
item.add(c);
}
};
diff --git a/src/com/gitblit/wicket/panels/SearchPanel.java b/src/com/gitblit/wicket/panels/SearchPanel.java
index c7e038d3..7a877324 100644
--- a/src/com/gitblit/wicket/panels/SearchPanel.java
+++ b/src/com/gitblit/wicket/panels/SearchPanel.java
@@ -4,7 +4,6 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
-import org.apache.wicket.markup.html.image.ContextImage;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.markup.repeater.data.DataView;
@@ -34,7 +33,7 @@ public class SearchPanel extends BasePanel {
public SearchPanel(String wicketId, final String repositoryName, final String objectId, final String value, SearchType searchType, Repository r, int limit, int pageOffset) {
super(wicketId);
boolean pageResults = limit <= 0;
- int itemsPerPage = GitBlit.self().settings().getInteger(Keys.web.logPageCommitCount, 50);
+ int itemsPerPage = GitBlit.self().settings().getInteger(Keys.web.itemsPerPage, 50);
if (itemsPerPage <= 1) {
itemsPerPage = 50;
}
@@ -77,9 +76,9 @@ public class SearchPanel extends BasePanel {
// merge icon
if (entry.getParentCount() > 1) {
- item.add(new ContextImage("commitIcon", "/com/gitblit/wicket/resources/commit_merge_16x16.png"));
+ item.add(WicketUtils.newImage("commitIcon", "commit_merge_16x16.png"));
} else {
- item.add(new ContextImage("commitIcon", "/com/gitblit/wicket/resources/blank.png"));
+ item.add(WicketUtils.newBlankImage("commitIcon"));
}
String shortMessage = entry.getShortMessage();
@@ -87,7 +86,7 @@ public class SearchPanel extends BasePanel {
// TODO highlight matches
LinkPanel shortlog = new LinkPanel("commitShortMessage", "list subject", trimmedMessage, CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName()));
if (!shortMessage.equals(trimmedMessage)) {
- WicketUtils.setHtmlTitle(shortlog, shortMessage);
+ WicketUtils.setHtmlTooltip(shortlog, shortMessage);
}
item.add(shortlog);
diff --git a/src/com/gitblit/wicket/panels/TagsPanel.java b/src/com/gitblit/wicket/panels/TagsPanel.java
index 40871b1f..e55b672e 100644
--- a/src/com/gitblit/wicket/panels/TagsPanel.java
+++ b/src/com/gitblit/wicket/panels/TagsPanel.java
@@ -3,7 +3,6 @@ package com.gitblit.wicket.panels;
import java.util.List;
import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.image.ContextImage;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.markup.repeater.Item;
@@ -54,9 +53,9 @@ public class TagsPanel extends BasePanel {
// tag icon
if (entry.isAnnotatedTag()) {
- item.add(new ContextImage("tagIcon", "/com/gitblit/wicket/resources/tag_16x16.png"));
+ item.add(WicketUtils.newImage("tagIcon", "tag_16x16.png"));
} else {
- item.add(new ContextImage("tagIcon", "/com/gitblit/wicket/resources/blank.png"));
+ item.add(WicketUtils.newBlankImage("tagIcon"));
}
item.add(new LinkPanel("tagName", "list name", entry.getDisplayName(), CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getCommitId().getName())));
diff --git a/src/com/gitblit/wicket/resources/book_16x16.png b/src/com/gitblit/wicket/resources/book_16x16.png
new file mode 100644
index 00000000..e48ff95e
--- /dev/null
+++ b/src/com/gitblit/wicket/resources/book_16x16.png
Binary files differ
diff --git a/src/com/gitblit/wicket/resources/bug_16x16.png b/src/com/gitblit/wicket/resources/bug_16x16.png
new file mode 100644
index 00000000..c7299fd7
--- /dev/null
+++ b/src/com/gitblit/wicket/resources/bug_16x16.png
Binary files differ
diff --git a/src/com/gitblit/wicket/resources/file_16x16.png b/src/com/gitblit/wicket/resources/file_16x16.png
new file mode 100644
index 00000000..eda44886
--- /dev/null
+++ b/src/com/gitblit/wicket/resources/file_16x16.png
Binary files differ
diff --git a/src/com/gitblit/wicket/resources/folder_16x16.png b/src/com/gitblit/wicket/resources/folder_16x16.png
new file mode 100644
index 00000000..f1ed9abe
--- /dev/null
+++ b/src/com/gitblit/wicket/resources/folder_16x16.png
Binary files differ
diff --git a/src/com/gitblit/wicket/resources/gitblit.css b/src/com/gitblit/wicket/resources/gitblit.css
index 12c43ed4..3200381b 100644
--- a/src/com/gitblit/wicket/resources/gitblit.css
+++ b/src/com/gitblit/wicket/resources/gitblit.css
@@ -172,15 +172,20 @@ div.search {
color:yellow;
text-align:right;
float:right;
- padding:4px 4px 3px 3px;
+ padding:4px 4px 3px 3px;
+ border-left: 1px solid #8080f0;
+ margin: 0px;
+ height: 23px;
}
div.search input {
+ vertical-align: top;
background: url(/com/gitblit/wicket/resources/search-icon.png) no-repeat 4px center;
color: #ddd;
background-color: #000070;
border: 1px solid transparent;
- padding: 0px 2px 2px 22px;
+ padding: 2px 2px 2px 22px;
+ margin: 0px;
}
div.search input:hover, div.search input:focus {
@@ -380,6 +385,7 @@ div.commitLegend {
float: right;
padding: 0.4em;
vertical-align:top;
+ margin: 0px;
}
div.commitLegend span {
@@ -424,6 +430,21 @@ table.plain {
padding: 8px;
}
+table.plain td.edit {
+ padding: 3px;
+}
+
+table.plain td.edit input {
+ margin: 0px;
+ outline: 1px solid transparent;
+ border: 1px solid #ccc;
+ padding-left:5px;
+}
+
+table.plain td.edit input:focus, table.plain td.edit input:hover{
+ border: 1px solid orange;
+}
+
table.pretty, table.repositories, table.comments {
margin-bottom:5px;
border-spacing: 0px;
@@ -436,8 +457,8 @@ table.pretty, table.comments, table.repositories {
}
table.pretty td.icon {
- padding: 0px;
- width: 20px;
+ padding: 0px 0px 0px 2px;
+ width: 18px;
}
table.pretty td.icon img {
@@ -456,11 +477,16 @@ table.comments td {
table.repositories th {
background-color:#D2C3AF;
padding: 4px;
+ border-top: 1px solid #808080;
border-bottom: 1px solid #808080;
}
table.repositories td {
- padding: 4px;
+ padding: 2px;
+}
+
+table.repositories td.icon img {
+ vertical-align: top;
}
table.repositories th a {
diff --git a/src/com/gitblit/wicket/resources/lock_16x16.png b/src/com/gitblit/wicket/resources/lock_16x16.png
new file mode 100644
index 00000000..ddf83d95
--- /dev/null
+++ b/src/com/gitblit/wicket/resources/lock_16x16.png
Binary files differ
diff --git a/src/com/gitblit/wicket/resources/pixel.png b/src/com/gitblit/wicket/resources/pixel.png
new file mode 100644
index 00000000..4d5f6df1
--- /dev/null
+++ b/src/com/gitblit/wicket/resources/pixel.png
Binary files differ