<classpathentry kind="lib" path="ext/wicket-1.4.17.jar"/>\r
<classpathentry kind="lib" path="ext/wicket-auth-roles-1.4.17.jar"/>\r
<classpathentry kind="lib" path="ext/wicket-extensions-1.4.17.jar"/>\r
- <classpathentry kind="lib" path="lib/jgit-0.11.3.jar"/>\r
- <classpathentry kind="lib" path="lib/jgit-http-0.11.3.jar"/>\r
<classpathentry kind="lib" path="ext/markdownpapers-core-1.0.0.jar"/>\r
<classpathentry kind="lib" path="ext/googlecharts-1.4.17.jar"/>\r
+ <classpathentry kind="lib" path="lib/jgit-0.12-stable.jar"/>\r
+ <classpathentry kind="lib" path="lib/jgit-http-0.12-stable.jar"/>\r
<classpathentry kind="output" path="bin"/>\r
</classpath>\r
\r
# This is the message display above the repositories table.\r
# This can point to a file with Markdown content.\r
-# specifying "gitblit" uses the internal welcome message.\r
+# Specifying "gitblit" uses the internal welcome message.\r
web.repositoriesMessage = gitblit\r
\r
# Use the client timezone when formatting dates.\r
# Choose the diff presentation style: gitblt, gitweb, or plain\r
web.diffStyle = gitblit\r
\r
+# Control if email addresses are shown in web ui\r
+web.showEmailAddresses = true\r
+\r
# Generates a line graph of repository activity over time on the Summary page.\r
# This is a real-time graph so generation may be expensive. \r
web.generateActivityGraph = true\r
import javax.servlet.ServletContextEvent;\r
import javax.servlet.ServletContextListener;\r
import javax.servlet.http.Cookie;\r
-import javax.servlet.http.HttpServletRequest;\r
\r
-import org.apache.wicket.Request;\r
import org.apache.wicket.protocol.http.WebResponse;\r
-import org.apache.wicket.protocol.http.servlet.ServletWebRequest;\r
import org.eclipse.jgit.errors.RepositoryNotFoundException;\r
-import org.eclipse.jgit.http.server.resolver.FileResolver;\r
-import org.eclipse.jgit.http.server.resolver.ServiceNotEnabledException;\r
import org.eclipse.jgit.lib.Repository;\r
+import org.eclipse.jgit.transport.resolver.FileResolver;\r
+import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException;\r
import org.slf4j.Logger;\r
import org.slf4j.LoggerFactory;\r
\r
\r
private final Logger logger = LoggerFactory.getLogger(GitBlit.class);\r
\r
- private FileResolver repositoryResolver;\r
+ private FileResolver<Void> repositoryResolver;\r
\r
private File repositories;\r
\r
response.addCookie(userCookie);\r
}\r
\r
+ public void editRepository(RepositoryModel repository, boolean isCreate) {\r
+ Repository r = null;\r
+ if (isCreate) {\r
+ // create repository\r
+ logger.info("create repository " + repository.name);\r
+ r = JGitUtils.createRepository(repositories, repository.name, true);\r
+ } else {\r
+ // load repository\r
+ logger.info("edit repository " + repository.name);\r
+ try {\r
+ r = repositoryResolver.open(null, repository.name);\r
+ } catch (RepositoryNotFoundException e) {\r
+ logger.error("Repository not found", e);\r
+ } catch (ServiceNotEnabledException e) {\r
+ logger.error("Service not enabled", e);\r
+ }\r
+ } \r
+ \r
+ // update settings\r
+ JGitUtils.setRepositoryDescription(r, repository.description);\r
+ JGitUtils.setRepositoryOwner(r, repository.owner);\r
+ JGitUtils.setRepositoryUseTickets(r, repository.useTickets);\r
+ JGitUtils.setRepositoryUseDocs(r, repository.useDocs);\r
+ JGitUtils.setRepositoryUseNamedUsers(r, repository.useNamedUsers);\r
+ }\r
+\r
public List<String> getRepositoryList() {\r
return JGitUtils.getRepositoryList(repositories, exportAll, storedSettings.getBoolean(Keys.git.nestedRepositories, true));\r
}\r
\r
- public List<RepositoryModel> getRepositories(Request request) {\r
+ public List<RepositoryModel> getRepositories() {\r
List<String> list = getRepositoryList();\r
- ServletWebRequest servletWebRequest = (ServletWebRequest) request;\r
- HttpServletRequest req = servletWebRequest.getHttpServletRequest();\r
-\r
List<RepositoryModel> repositories = new ArrayList<RepositoryModel>();\r
for (String repo : list) {\r
- Repository r = getRepository(req, repo);\r
+ Repository r = getRepository(repo);\r
String description = JGitUtils.getRepositoryDescription(r);\r
String owner = JGitUtils.getRepositoryOwner(r);\r
Date lastchange = JGitUtils.getLastChange(r);\r
return repositories;\r
}\r
\r
- public Repository getRepository(HttpServletRequest req, String repositoryName) {\r
+ public Repository getRepository(String repositoryName) {\r
Repository r = null;\r
try {\r
- r = repositoryResolver.open(req, repositoryName);\r
+ r = repositoryResolver.open(null, repositoryName);\r
} catch (RepositoryNotFoundException e) {\r
r = null;\r
logger.error("Failed to find repository " + repositoryName);\r
WebXmlSettings webxmlSettings = new WebXmlSettings(contextEvent.getServletContext());\r
setupContext(webxmlSettings);\r
} else {\r
- logger.info("GitBlit context already setup by " + storedSettings.toString()); \r
+ logger.info("GitBlit context already setup by " + storedSettings.toString());\r
}\r
}\r
\r
import java.io.File;\r
import java.io.IOException;\r
import java.io.InputStream;\r
-import java.io.RandomAccessFile;\r
import java.text.DateFormat;\r
import java.text.ParseException;\r
import java.text.SimpleDateFormat;\r
import java.util.Set;\r
import java.util.concurrent.atomic.AtomicInteger;\r
\r
+import org.eclipse.jgit.api.Git;\r
import org.eclipse.jgit.diff.DiffEntry;\r
+import org.eclipse.jgit.diff.DiffEntry.ChangeType;\r
import org.eclipse.jgit.diff.DiffFormatter;\r
import org.eclipse.jgit.diff.RawTextComparator;\r
-import org.eclipse.jgit.diff.DiffEntry.ChangeType;\r
import org.eclipse.jgit.errors.ConfigInvalidException;\r
import org.eclipse.jgit.errors.IncorrectObjectTypeException;\r
import org.eclipse.jgit.errors.MissingObjectException;\r
public static final String R_NOTES_COMMITS = R_NOTES + "commits";\r
\r
private final static Logger LOGGER = LoggerFactory.getLogger(JGitUtils.class);\r
+ \r
+ public static Repository createRepository(File repositoriesFolder, String name, boolean bare) {\r
+ Git git = Git.init().setDirectory(new File(repositoriesFolder, name)).setBare(bare).call();\r
+ return git.getRepository();\r
+ }\r
\r
public static List<String> getRepositoryList(File repositoriesFolder, boolean exportAll, boolean readNested) {\r
List<String> list = new ArrayList<String>();\r
for (File file : folder.listFiles()) {\r
if (file.isDirectory() && !file.getName().equalsIgnoreCase(Constants.DOT_GIT)) {\r
// if this is a git repository add it to the list\r
+ //\r
+ // first look for standard folder/.git structure\r
File gitFolder = new File(file, Constants.DOT_GIT);\r
boolean isGitRepository = gitFolder.exists() && gitFolder.isDirectory();\r
+ \r
+ // then look for folder.git/HEAD\r
+ if (!isGitRepository) {\r
+ if (file.getName().endsWith(Constants.DOT_GIT_EXT) && new File(file, Constants.HEAD).exists()) {\r
+ gitFolder = file;\r
+ isGitRepository = true;\r
+ }\r
+ }\r
boolean exportRepository = isGitRepository && (exportAll || new File(gitFolder, "git-daemon-export-ok").exists());\r
\r
if (exportRepository) {\r
public static Date getFirstChange(Repository r, String branch) {\r
try {\r
RevCommit commit = getFirstCommit(r, branch);\r
+ if (commit == null) {\r
+ // fresh repository\r
+ return new Date(r.getDirectory().lastModified()); \r
+ }\r
return getCommitDate(commit);\r
} catch (Throwable t) {\r
LOGGER.error("Failed to determine first change", t);\r
return null;\r
}\r
\r
- public static Date getLastChange(Repository r) {\r
+ public static Date getLastChange(Repository r) { \r
RevCommit commit = getCommit(r, Constants.HEAD);\r
+ if (commit == null) {\r
+ // fresh repository\r
+ return new Date(r.getDirectory().lastModified()); \r
+ }\r
return getCommitDate(commit);\r
}\r
\r
\r
public static List<PathModel> getFilesInPath(Repository r, String basePath, RevCommit commit) {\r
List<PathModel> list = new ArrayList<PathModel>();\r
+ if (commit == null) {\r
+ return list;\r
+ }\r
final TreeWalk walk = new TreeWalk(r);\r
try {\r
walk.addTree(commit.getTree());\r
}\r
\r
public static String getRepositoryDescription(Repository r) {\r
- File dir = r.getDirectory();\r
- if (dir.exists()) {\r
- File description = new File(dir, "description");\r
- if (description.exists() && description.length() > 0) {\r
- RandomAccessFile raf = null;\r
- try {\r
- raf = new RandomAccessFile(description, "r");\r
- byte[] buffer = new byte[(int) description.length()];\r
- raf.readFully(buffer);\r
- return new String(buffer);\r
- } catch (Throwable t) {\r
- } finally {\r
- try {\r
- raf.close();\r
- } catch (Throwable t) {\r
- }\r
- }\r
- }\r
- }\r
- return "";\r
+ return getRepositoryConfigString(r, "description");\r
+ }\r
+ \r
+ public static void setRepositoryDescription(Repository r, String value) {\r
+ setRepositoryConfigString(r, "description", value);\r
}\r
\r
public static String getRepositoryOwner(Repository r) {\r
+ return getRepositoryConfigString(r, "owner");\r
+ }\r
+ \r
+ public static void setRepositoryOwner(Repository r, String owner) {\r
+ setRepositoryConfigString(r, "owner", owner);\r
+ }\r
+ \r
+ public static boolean getRepositoryUseTickets(Repository r) {\r
+ return getRepositoryConfigBoolean(r, "useTickets", false);\r
+ }\r
+ \r
+ public static void setRepositoryUseTickets(Repository r, boolean value) {\r
+ setRepositoryConfigBoolean(r, "useTickets", value);\r
+ }\r
+ \r
+ public static boolean getRepositoryUseDocs(Repository r) {\r
+ return getRepositoryConfigBoolean(r, "useDocs", false);\r
+ }\r
+ \r
+ public static void setRepositoryUseDocs(Repository r, boolean value) {\r
+ setRepositoryConfigBoolean(r, "useDocs", value);\r
+ }\r
+ \r
+ public static boolean getRepositoryUseNamedUsers(Repository r) {\r
+ return getRepositoryConfigBoolean(r, "useNamedUsers", false);\r
+ }\r
+ \r
+ public static void setRepositoryUseNamedUsers(Repository r, boolean value) {\r
+ setRepositoryConfigBoolean(r, "useNamedUsers", value);\r
+ } \r
+ \r
+ public static String getRepositoryConfigString(Repository r, String field) {\r
StoredConfig c = readConfig(r);\r
if (c == null) {\r
return "";\r
}\r
- String o = c.getString("gitweb", null, "owner");\r
+ String o = c.getString("gitblit", null, field);\r
return o == null ? "" : o;\r
}\r
+ \r
+ public static void setRepositoryConfigString(Repository r, String field, String value) {\r
+ StoredConfig c = readConfig(r);\r
+ if (c == null) {\r
+ throw new RuntimeException("Can't find stored config for " + r);\r
+ }\r
+ c.setString("gitblit", null, field, value);\r
+ try {\r
+ c.save();\r
+ } catch (IOException e) {\r
+ LOGGER.error("Failed to save repository config field " + field, e);\r
+ }\r
+ }\r
+ \r
+ public static boolean getRepositoryConfigBoolean(Repository r, String field, boolean defaultValue) {\r
+ StoredConfig c = readConfig(r);\r
+ if (c == null) {\r
+ return defaultValue;\r
+ }\r
+ return c.getBoolean("gitblit", null, field, defaultValue); \r
+ }\r
+ \r
+ public static void setRepositoryConfigBoolean(Repository r, String field, boolean value) {\r
+ StoredConfig c = readConfig(r);\r
+ if (c == null) {\r
+ throw new RuntimeException("Can't find stored config for " + r);\r
+ }\r
+ c.setBoolean("gitblit", null, field, value);\r
+ try {\r
+ c.save();\r
+ } catch (IOException e) {\r
+ LOGGER.error("Failed to save repository config field " + field, e);\r
+ } \r
+ }\r
\r
private static StoredConfig readConfig(Repository r) {\r
StoredConfig c = r.getConfig();\r
gb.filesModified = {0} files modified\r
gb.filesDeleted = {0} files deleted\r
gb.filesCopied = {0} files copied\r
-gb.filesRenamed = {0} files renamed
\ No newline at end of file
+gb.filesRenamed = {0} files renamed\r
+gb.missingUsername = Missing Username\r
+gb.edit = edit
\ No newline at end of file
import java.util.List;\r
import java.util.Map;\r
\r
-import javax.servlet.http.HttpServletRequest;\r
-\r
import org.apache.wicket.Component;\r
import org.apache.wicket.PageParameters;\r
import org.apache.wicket.markup.html.basic.Label;\r
import org.apache.wicket.markup.html.panel.Fragment;\r
-import org.apache.wicket.protocol.http.servlet.ServletWebRequest;\r
import org.eclipse.jgit.diff.DiffEntry.ChangeType;\r
import org.eclipse.jgit.lib.PersonIdent;\r
import org.eclipse.jgit.lib.Repository;\r
import com.gitblit.GitBlit;\r
import com.gitblit.Keys;\r
import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.utils.StringUtils;\r
import com.gitblit.utils.JGitUtils.SearchType;\r
+import com.gitblit.utils.StringUtils;\r
import com.gitblit.wicket.pages.RepositoriesPage;\r
import com.gitblit.wicket.pages.SearchPage;\r
import com.gitblit.wicket.panels.PageLinksPanel;\r
\r
protected Repository getRepository() {\r
if (r == null) {\r
- ServletWebRequest servletWebRequest = (ServletWebRequest) getRequest();\r
- HttpServletRequest req = servletWebRequest.getHttpServletRequest();\r
- req.getServerName();\r
-\r
- Repository r = GitBlit.self().getRepository(req, repositoryName);\r
+ Repository r = GitBlit.self().getRepository(repositoryName);\r
if (r == null) {\r
error("Can not load repository " + repositoryName);\r
redirectToInterceptPage(new RepositoriesPage());\r
\r
\r
protected Component createPersonPanel(String wicketId, PersonIdent identity, SearchType searchType) {\r
- if (StringUtils.isEmpty(identity.getName()) || StringUtils.isEmpty(identity.getEmailAddress())) {\r
+ boolean showEmail = GitBlit.self().settings().getBoolean(Keys.web.showEmailAddresses, false);\r
+ if (!showEmail || StringUtils.isEmpty(identity.getName()) || StringUtils.isEmpty(identity.getEmailAddress())) {\r
String value = identity.getName();\r
if (StringUtils.isEmpty(value)) {\r
- value = identity.getEmailAddress();\r
+ if (showEmail) {\r
+ value = identity.getEmailAddress();\r
+ } else {\r
+ value = getString("gb.missingUsername");\r
+ }\r
}\r
Fragment partial = new Fragment(wicketId, "partialPersonIdent", this);\r
LinkPanel link = new LinkPanel("personName", "list", value, SearchPage.class, WicketUtils.newSearchParameter(repositoryName, objectId, value, searchType));\r
public class RepositoryModel implements Serializable {\r
\r
private static final long serialVersionUID = 1L;\r
- public final String name;\r
- public final String description;\r
- public final String owner;\r
- public final Date lastChange;\r
+ public String name;\r
+ public String description;\r
+ public String owner;\r
+ public Date lastChange;\r
+ public boolean useTickets;\r
+ public boolean useDocs;\r
+ public boolean useNamedUsers;\r
\r
public RepositoryModel(String name, String description, String owner, Date lastchange) {\r
this.name = name;\r
import com.gitblit.GitBlit;\r
import com.gitblit.Keys;\r
import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.utils.StringUtils;\r
import com.gitblit.utils.JGitUtils.DiffOutputType;\r
+import com.gitblit.utils.StringUtils;\r
import com.gitblit.wicket.LinkPanel;\r
import com.gitblit.wicket.RepositoryPage;\r
import com.gitblit.wicket.WicketUtils;\r
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" \r
+ xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd" \r
+ xml:lang="en" \r
+ lang="en"> \r
+\r
+<body>\r
+<wicket:extend>\r
+ <!-- Push content down to preserve header image -->\r
+ <div style="padding-top:20px"></div>\r
+ \r
+ <!-- Repository Table -->\r
+ <form wicket:id="editForm">\r
+ <table class="plain">\r
+ <tbody>\r
+ <tr><th>Name</th><td><input type="text" wicket:id="name" size="30" /></td></tr>\r
+ <tr><th>Description</th><td><input type="text" wicket:id="description" size="80" /></td></tr>\r
+ <tr><th>Owner</th><td><input type="text" wicket:id="owner" size="30" /></td></tr>\r
+ <tr><th>Use Git:Blit Tickets</th><td><input type="checkbox" wicket:id="useTickets"/>distributed Git:Blit ticketing</td></tr>\r
+ <tr><th>Use Git:Blit Docs</th><td><input type="checkbox" wicket:id="useDocs"/>distributed Git:Blit documentation</td></tr>\r
+ <tr><th>Named User Access</th><td><input type="checkbox" wicket:id="useNamedUsers"/>not implemented</td></tr>\r
+ <tr><td colspan="2"><input type="submit" value="Submit"/></td></tr>\r
+ </tbody>\r
+ </table>\r
+ </form> \r
+</wicket:extend>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+package com.gitblit.wicket.pages;\r
+\r
+import java.util.Date;\r
+\r
+import org.apache.wicket.PageParameters;\r
+import org.apache.wicket.markup.html.form.CheckBox;\r
+import org.apache.wicket.markup.html.form.Form;\r
+import org.apache.wicket.markup.html.form.TextField;\r
+import org.apache.wicket.model.CompoundPropertyModel;\r
+\r
+import com.gitblit.GitBlit;\r
+import com.gitblit.wicket.AdminPage;\r
+import com.gitblit.wicket.BasePage;\r
+import com.gitblit.wicket.WicketUtils;\r
+import com.gitblit.wicket.models.RepositoryModel;\r
+\r
+@AdminPage\r
+public class EditRepositoryPage extends BasePage {\r
+\r
+ private final boolean isCreate;\r
+\r
+ public EditRepositoryPage() {\r
+ // create constructor\r
+ super();\r
+ isCreate = true;\r
+ setupPage(new RepositoryModel("", "", "", new Date()));\r
+ }\r
+\r
+ public EditRepositoryPage(PageParameters params) {\r
+ // edit constructor\r
+ super(params);\r
+ isCreate = false;\r
+ String repositoryName = WicketUtils.getRepositoryName(params);\r
+ setupPage(new RepositoryModel(repositoryName, "", "", new Date()));\r
+ }\r
+\r
+ protected void setupPage(final RepositoryModel repository) {\r
+ if (isCreate) {\r
+ super.setupPage("", getString("gb.newRepository"));\r
+ } else {\r
+ super.setupPage("", getString("gb.edit"));\r
+ }\r
+ CompoundPropertyModel<RepositoryModel> model = new CompoundPropertyModel<RepositoryModel>(repository);\r
+ Form<RepositoryModel> form = new Form<RepositoryModel>("editForm", model) {\r
+\r
+ private static final long serialVersionUID = 1L;\r
+\r
+ @Override\r
+ protected void onSubmit() {\r
+ GitBlit.self().editRepository(repository, isCreate);\r
+ setRedirect(true);\r
+ setResponsePage(RepositoriesPage.class);\r
+ }\r
+ };\r
+ form.add(new TextField<String>("name").setEnabled(isCreate));\r
+ form.add(new TextField<String>("description"));\r
+ form.add(new TextField<String>("owner"));\r
+ form.add(new CheckBox("useTickets"));\r
+ form.add(new CheckBox("useDocs"));\r
+ form.add(new CheckBox("useNamedUsers"));\r
+\r
+ add(form);\r
+ }\r
+}\r
package com.gitblit.wicket.pages;\r
\r
-import javax.servlet.http.HttpServletRequest;\r
-\r
import org.apache.wicket.PageParameters;\r
import org.apache.wicket.markup.html.WebPage;\r
import org.apache.wicket.markup.html.basic.Label;\r
-import org.apache.wicket.protocol.http.servlet.ServletWebRequest;\r
import org.eclipse.jgit.lib.Repository;\r
import org.eclipse.jgit.revwalk.RevCommit;\r
\r
final String objectId = WicketUtils.getObject(params);\r
final String blobPath = WicketUtils.getPath(params);\r
\r
- ServletWebRequest servletWebRequest = (ServletWebRequest) getRequest();\r
- HttpServletRequest req = servletWebRequest.getHttpServletRequest();\r
- req.getServerName();\r
-\r
- Repository r = GitBlit.self().getRepository(req, repositoryName);\r
+ Repository r = GitBlit.self().getRepository(repositoryName);\r
if (r == null) {\r
error("Can not load repository " + repositoryName);\r
redirectToInterceptPage(new RepositoriesPage());\r
import java.util.HashMap;\r
import java.util.Map;\r
\r
-import javax.servlet.http.HttpServletRequest;\r
-\r
import org.apache.wicket.Component;\r
import org.apache.wicket.PageParameters;\r
import org.apache.wicket.markup.html.WebPage;\r
import org.apache.wicket.markup.html.basic.Label;\r
-import org.apache.wicket.protocol.http.servlet.ServletWebRequest;\r
import org.eclipse.jgit.lib.Repository;\r
import org.eclipse.jgit.revwalk.RevCommit;\r
\r
final String objectId = WicketUtils.getObject(params);\r
final String blobPath = WicketUtils.getPath(params);\r
\r
- ServletWebRequest servletWebRequest = (ServletWebRequest) getRequest();\r
- HttpServletRequest req = servletWebRequest.getHttpServletRequest();\r
- req.getServerName();\r
-\r
- Repository r = GitBlit.self().getRepository(req, repositoryName);\r
+ Repository r = GitBlit.self().getRepository(repositoryName);\r
if (r == null) {\r
error("Can not load repository " + repositoryName);\r
redirectToInterceptPage(new RepositoriesPage());\r
<th wicket:id="orderByDescription"><wicket:message key="gb.description">Description</wicket:message></th>\r
<th wicket:id="orderByOwner"><wicket:message key="gb.owner">Owner</wicket:message></th>\r
<th wicket:id="orderByDate"><wicket:message key="gb.lastChange">Last Change</wicket:message></th>\r
+ <th></th>\r
</tr>\r
<tbody>\r
<tr wicket:id="repository">\r
<td><div class="list" wicket:id="repositoryDescription">[repository description]</div></td>\r
<td class="author"><span wicket:id="repositoryOwner">[repository owner]</span></td>\r
<td><span wicket:id="repositoryLastChange">[last change]</span></td>\r
+ <td><a wicket:id="repositoryLinks"><wicket:message key="gb.edit">[edit]</wicket:message></a></td>\r
</tr>\r
</tbody>\r
</table>\r
super();\r
setupPage("", "");\r
\r
- boolean showAdmin = false;\r
+ final boolean showAdmin;\r
if (GitBlit.self().settings().getBoolean(Keys.web.authenticateAdminPages, true)) {\r
boolean allowAdmin = GitBlit.self().settings().getBoolean(Keys.web.allowAdministration, false);\r
showAdmin = allowAdmin && GitBlitWebSession.get().canAdmin();\r
} else {\r
showAdmin = GitBlit.self().settings().getBoolean(Keys.web.allowAdministration, false);\r
}\r
-\r
+ \r
Fragment adminLinks = new Fragment("adminPanel", "adminLinks", this);\r
- adminLinks.add(new BookmarkablePageLink<Void>("newRepository", RepositoriesPage.class));\r
+ adminLinks.add(new BookmarkablePageLink<Void>("newRepository", EditRepositoryPage.class));\r
adminLinks.add(new BookmarkablePageLink<Void>("newUser", RepositoriesPage.class));\r
add(adminLinks.setVisible(showAdmin));\r
\r
}\r
add(repositoriesMessage);\r
\r
- List<RepositoryModel> rows = GitBlit.self().getRepositories(getRequest());\r
+ List<RepositoryModel> rows = GitBlit.self().getRepositories();\r
DataProvider dp = new DataProvider(rows);\r
DataView<RepositoryModel> dataView = new DataView<RepositoryModel>("repository", dp) {\r
private static final long serialVersionUID = 1L;\r
item.add(lastChangeLabel);\r
WicketUtils.setCssClass(lastChangeLabel, TimeUtils.timeAgoCss(entry.lastChange));\r
\r
+ item.add(new BookmarkablePageLink<Void>("repositoryLinks", EditRepositoryPage.class, WicketUtils.newRepositoryParameter(entry.name)).setVisible(showAdmin));\r
+ \r
WicketUtils.setAlternatingBackground(item, counter);\r
counter++;\r
}\r
import org.apache.wicket.markup.html.basic.Label;\r
import org.apache.wicket.markup.html.image.ContextImage;\r
import org.eclipse.jgit.lib.Repository;\r
-\r
import org.wicketstuff.googlecharts.AbstractChartData;\r
import org.wicketstuff.googlecharts.Chart;\r
import org.wicketstuff.googlecharts.ChartAxis;\r
import org.wicketstuff.googlecharts.LineStyle;\r
import org.wicketstuff.googlecharts.MarkerType;\r
import org.wicketstuff.googlecharts.ShapeMarker;\r
+\r
import com.gitblit.GitBlit;\r
import com.gitblit.Keys;\r
import com.gitblit.utils.JGitUtils;\r
}\r
\r
private void insertActivityGraph(List<Metric> metrics) {\r
- if (GitBlit.self().settings().getBoolean(Keys.web.generateActivityGraph, true)) {\r
+ if (metrics.size() > 0 && GitBlit.self().settings().getBoolean(Keys.web.generateActivityGraph, true)) {\r
IChartData data = getChartData(metrics);\r
\r
ChartProvider provider = new ChartProvider(new Dimension(400, 100), ChartType.LINE, data);\r
provider.addAxis(commitAxis);\r
\r
provider.setLineStyles(new LineStyle[] {new LineStyle(2, 4, 0), new LineStyle(0, 4, 1)}); \r
- provider.addShapeMarker(new ShapeMarker(MarkerType.DIAMOND, Color.BLUE, 1, -1, 5));\r
+ provider.addShapeMarker(new ShapeMarker(MarkerType.CIRCLE, Color.BLUE, 1, -1, 5));\r
\r
add(new Chart("commitsChart", provider));\r
} else {\r
List<PathModel> paths = JGitUtils.getFilesInPath(r, path, commit);\r
\r
// tree page links\r
- add(new BookmarkablePageLink<Void>("historyLink", HistoryPage.class, WicketUtils.newPathParameter(repositoryName, commit.getName(), path)));\r
+ add(new BookmarkablePageLink<Void>("historyLink", HistoryPage.class, WicketUtils.newPathParameter(repositoryName, objectId, path)));\r
add(new BookmarkablePageLink<Void>("headLink", TreePage.class, WicketUtils.newPathParameter(repositoryName, Constants.HEAD, path)));\r
\r
- add(new LinkPanel("shortlog", "title", commit.getShortMessage(), CommitPage.class, newCommitParameter()));\r
+ add(new LinkPanel("shortlog", "title", commit == null ? "" : commit.getShortMessage(), CommitPage.class, newCommitParameter()));\r
\r
// breadcrumbs\r
add(new PathBreadcrumbsPanel("breadcrumbs", repositoryName, path, objectId));\r
<tbody>\r
<tr wicket:id="commit">\r
<td class="date"><span wicket:id="commitDate">[commit date]</span></td>\r
- <td><img wicket:id="commitIcon" /></td>\r
+ <td class="icon"><img wicket:id="commitIcon" /></td>\r
<td class="author"><span wicket:id="commitAuthor">[commit author]</span></td>\r
<td><div class="references" wicket:id="commitRefs">[commit refs]</div><span wicket:id="commitShortMessage">[commit short message]</span></td>\r
<td class="rightAlign">\r
if (pageResults) {\r
// history page\r
// show commit page link\r
- add(new LinkPanel("header", "title", commit.getShortMessage(), CommitPage.class, WicketUtils.newObjectParameter(repositoryName, commit.getName())));\r
+ add(new LinkPanel("header", "title", commit == null ? "" : commit.getShortMessage(), CommitPage.class, WicketUtils.newObjectParameter(repositoryName, objectId)));\r
} else {\r
// summary page\r
// show history page link\r
LinkPanel authorLink = new LinkPanel("commitAuthor", "list", author, SearchPage.class, WicketUtils.newSearchParameter(repositoryName, objectId, author, SearchType.AUTHOR));\r
setPersonSearchTooltip(authorLink, author, SearchType.AUTHOR);\r
item.add(authorLink);\r
- \r
+\r
// merge icon\r
if (entry.getParentCount() > 1) {\r
item.add(new ContextImage("commitIcon", "/com/gitblit/wicket/resources/commit_merge_16x16.png"));\r
<tr wicket:id="commit">\r
<td class="date"><span wicket:id="commitDate">[commit date]</span></td>\r
<td class="author"><span wicket:id="commitAuthor">[commit author]</span></td>\r
- <td><img wicket:id="commitIcon" /></td>\r
+ <td class="icon"><img wicket:id="commitIcon" /></td>\r
<td><div class="references" wicket:id="commitRefs">[commit refs]</div><span wicket:id="commitShortMessage">[commit short message]</span></td>\r
<td class="rightAlign">\r
<span class="link">\r
<tr wicket:id="commit">\r
<td class="date"><span wicket:id="commitDate">[commit date]</span></td>\r
<td class="author"><span wicket:id="commitAuthor">[commit author]</span></td>\r
- <td><img wicket:id="commitIcon" /></td>\r
+ <td class="icon"><img wicket:id="commitIcon" /></td>\r
<td><div class="references" wicket:id="commitRefs">[commit refs]</div><span wicket:id="commitShortMessage">[commit short message]</span></td>\r
<td class="rightAlign">\r
<span class="link">\r
import com.gitblit.GitBlit;\r
import com.gitblit.Keys;\r
import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.utils.StringUtils;\r
import com.gitblit.utils.JGitUtils.SearchType;\r
+import com.gitblit.utils.StringUtils;\r
import com.gitblit.wicket.LinkPanel;\r
import com.gitblit.wicket.WicketUtils;\r
import com.gitblit.wicket.pages.CommitDiffPage;\r
<table class="pretty">\r
<tbody>\r
<tr wicket:id="tag">\r
- <td class="date"><span wicket:id="tagDate">[tag date]</span></td>\r
+ <td class="date"><span wicket:id="tagDate">[tag date]</span></td> \r
<td><b><span wicket:id="tagName">[tag name]</span></b></td>\r
+ <td class="icon"><img wicket:id="tagIcon" /></td>\r
<td><span wicket:id="tagDescription">[tag description]</span></td>\r
<td class="rightAlign">\r
<span wicket:id="tagLinks"></span>\r
import java.util.List;\r
\r
import org.apache.wicket.markup.html.basic.Label;\r
+import org.apache.wicket.markup.html.image.ContextImage;\r
import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
import org.apache.wicket.markup.html.panel.Fragment;\r
import org.apache.wicket.markup.repeater.Item;\r
\r
item.add(WicketUtils.createDateLabel("tagDate", entry.getDate(), getTimeZone()));\r
\r
+ // tag icon\r
+ if (entry.isAnnotatedTag()) {\r
+ item.add(new ContextImage("tagIcon", "/com/gitblit/wicket/resources/tag_16x16.png"));\r
+ } else {\r
+ item.add(new ContextImage("tagIcon", "/com/gitblit/wicket/resources/blank.png"));\r
+ }\r
+ \r
item.add(new LinkPanel("tagName", "list name", entry.getDisplayName(), CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getCommitId().getName())));\r
String message;\r
if (maxCount > 0) {\r
\r
div.bug_open, span.bug_open {\r
padding: 2px;\r
- background-color: #800000;\r
+ background-color: #803333;\r
color: white; \r
text-align: center;\r
}\r
\r
div.bug_resolved, span.bug_resolved {\r
padding: 2px;\r
- background-color: #008000;\r
+ background-color: #408040;\r
color: white;\r
text-align: center;\r
}\r
table.pretty, table.comments, table.repositories {\r
width:100%;\r
}\r
+\r
+table.pretty td.icon {\r
+ padding: 0px;\r
+ width: 20px;\r
+}\r
+\r
+table.pretty td.icon img {\r
+ vertical-align: top;\r
+}\r
+\r
table.pretty td {\r
padding: 2px 4px;\r
}\r