mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-15 18:05:50 +01:00
Merge branch 'master' into feature/plugin-hotdeploy
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
val Organization = "io.github.gitbucket"
|
val Organization = "io.github.gitbucket"
|
||||||
val Name = "gitbucket"
|
val Name = "gitbucket"
|
||||||
val GitBucketVersion = "4.14.1"
|
val GitBucketVersion = "4.15.0-SNAPSHOT"
|
||||||
val ScalatraVersion = "2.5.0"
|
val ScalatraVersion = "2.5.0"
|
||||||
val JettyVersion = "9.3.19.v20170502"
|
val JettyVersion = "9.3.19.v20170502"
|
||||||
|
|
||||||
@@ -21,8 +21,8 @@ resolvers ++= Seq(
|
|||||||
"amateras-snapshot" at "http://amateras.sourceforge.jp/mvn-snapshot/"
|
"amateras-snapshot" at "http://amateras.sourceforge.jp/mvn-snapshot/"
|
||||||
)
|
)
|
||||||
libraryDependencies ++= Seq(
|
libraryDependencies ++= Seq(
|
||||||
"org.eclipse.jgit" % "org.eclipse.jgit.http.server" % "4.7.0.201704051617-r",
|
"org.eclipse.jgit" % "org.eclipse.jgit.http.server" % "4.8.0.201706111038-r",
|
||||||
"org.eclipse.jgit" % "org.eclipse.jgit.archive" % "4.7.0.201704051617-r",
|
"org.eclipse.jgit" % "org.eclipse.jgit.archive" % "4.8.0.201706111038-r",
|
||||||
"org.scalatra" %% "scalatra" % ScalatraVersion,
|
"org.scalatra" %% "scalatra" % ScalatraVersion,
|
||||||
"org.scalatra" %% "scalatra-json" % ScalatraVersion,
|
"org.scalatra" %% "scalatra-json" % ScalatraVersion,
|
||||||
"org.json4s" %% "json4s-jackson" % "3.5.1",
|
"org.json4s" %% "json4s-jackson" % "3.5.1",
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class JettyLauncher {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "--max_file_size":
|
case "--max_file_size":
|
||||||
System.setProperty("gitbucket.maxFileSize", dim[2]);
|
System.setProperty("gitbucket.maxFileSize", dim[1]);
|
||||||
break;
|
break;
|
||||||
case "--gitbucket.home":
|
case "--gitbucket.home":
|
||||||
System.setProperty("gitbucket.home", dim[1]);
|
System.setProperty("gitbucket.home", dim[1]);
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ trait RepositorySettingsControllerBase extends ControllerBase {
|
|||||||
get("/:owner/:repository/settings/branches")(ownerOnly { repository =>
|
get("/:owner/:repository/settings/branches")(ownerOnly { repository =>
|
||||||
val protecteions = getProtectedBranchList(repository.owner, repository.name)
|
val protecteions = getProtectedBranchList(repository.owner, repository.name)
|
||||||
html.branches(repository, protecteions, flash.get("info"))
|
html.branches(repository, protecteions, flash.get("info"))
|
||||||
});
|
})
|
||||||
|
|
||||||
/** Update default branch */
|
/** Update default branch */
|
||||||
post("/:owner/:repository/settings/update_default_branch", defaultBranchForm)(ownerOnly { (form, repository) =>
|
post("/:owner/:repository/settings/update_default_branch", defaultBranchForm)(ownerOnly { (form, repository) =>
|
||||||
|
|||||||
@@ -121,6 +121,16 @@ abstract class Plugin {
|
|||||||
*/
|
*/
|
||||||
def pullRequestHooks(registry: PluginRegistry, context: ServletContext, settings: SystemSettings): Seq[PullRequestHook] = Nil
|
def pullRequestHooks(registry: PluginRegistry, context: ServletContext, settings: SystemSettings): Seq[PullRequestHook] = Nil
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override to add repository headers.
|
||||||
|
*/
|
||||||
|
val repositoryHeaders: Seq[(RepositoryInfo, Context) => Option[Html]] = Nil
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override to add repository headers.
|
||||||
|
*/
|
||||||
|
def repositoryHeaders(registry: PluginRegistry, context: ServletContext, settings: SystemSettings): Seq[(RepositoryInfo, Context) => Option[Html]] = Nil
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override to add global menus.
|
* Override to add global menus.
|
||||||
*/
|
*/
|
||||||
@@ -266,6 +276,9 @@ abstract class Plugin {
|
|||||||
(pullRequestHooks ++ pullRequestHooks(registry, context, settings)).foreach { pullRequestHook =>
|
(pullRequestHooks ++ pullRequestHooks(registry, context, settings)).foreach { pullRequestHook =>
|
||||||
registry.addPullRequestHook(pullRequestHook)
|
registry.addPullRequestHook(pullRequestHook)
|
||||||
}
|
}
|
||||||
|
(repositoryHeaders ++ repositoryHeaders(registry, context, settings)).foreach { repositoryHeader =>
|
||||||
|
registry.addRepositoryHeader(repositoryHeader)
|
||||||
|
}
|
||||||
(globalMenus ++ globalMenus(registry, context, settings)).foreach { globalMenu =>
|
(globalMenus ++ globalMenus(registry, context, settings)).foreach { globalMenu =>
|
||||||
registry.addGlobalMenu(globalMenu)
|
registry.addGlobalMenu(globalMenu)
|
||||||
}
|
}
|
||||||
@@ -287,8 +300,8 @@ abstract class Plugin {
|
|||||||
(dashboardTabs ++ dashboardTabs(registry, context, settings)).foreach { dashboardTab =>
|
(dashboardTabs ++ dashboardTabs(registry, context, settings)).foreach { dashboardTab =>
|
||||||
registry.addDashboardTab(dashboardTab)
|
registry.addDashboardTab(dashboardTab)
|
||||||
}
|
}
|
||||||
(issueSidebars ++ issueSidebars(registry, context, settings)).foreach { issueSidebar =>
|
(issueSidebars ++ issueSidebars(registry, context, settings)).foreach { issueSidebarComponent =>
|
||||||
registry.addIssueSidebar(issueSidebar)
|
registry.addIssueSidebar(issueSidebarComponent)
|
||||||
}
|
}
|
||||||
(assetsMappings ++ assetsMappings(registry, context, settings)).foreach { assetMapping =>
|
(assetsMappings ++ assetsMappings(registry, context, settings)).foreach { assetMapping =>
|
||||||
registry.addAssetsMapping((assetMapping._1, assetMapping._2, getClass.getClassLoader))
|
registry.addAssetsMapping((assetMapping._1, assetMapping._2, getClass.getClassLoader))
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ class PluginRegistry {
|
|||||||
private val pullRequestHooks = new ListBuffer[PullRequestHook]
|
private val pullRequestHooks = new ListBuffer[PullRequestHook]
|
||||||
pullRequestHooks += new gitbucket.core.util.Notifier.PullRequestHook()
|
pullRequestHooks += new gitbucket.core.util.Notifier.PullRequestHook()
|
||||||
|
|
||||||
|
private val repositoryHeaders = new ListBuffer[(RepositoryInfo, Context) => Option[Html]]
|
||||||
private val globalMenus = new ListBuffer[(Context) => Option[Link]]
|
private val globalMenus = new ListBuffer[(Context) => Option[Link]]
|
||||||
private val repositoryMenus = new ListBuffer[(RepositoryInfo, Context) => Option[Link]]
|
private val repositoryMenus = new ListBuffer[(RepositoryInfo, Context) => Option[Link]]
|
||||||
private val repositorySettingTabs = new ListBuffer[(RepositoryInfo, Context) => Option[Link]]
|
private val repositorySettingTabs = new ListBuffer[(RepositoryInfo, Context) => Option[Link]]
|
||||||
@@ -132,6 +133,10 @@ class PluginRegistry {
|
|||||||
|
|
||||||
def getPullRequestHooks: Seq[PullRequestHook] = pullRequestHooks.toSeq
|
def getPullRequestHooks: Seq[PullRequestHook] = pullRequestHooks.toSeq
|
||||||
|
|
||||||
|
def addRepositoryHeader(repositoryHeader: (RepositoryInfo, Context) => Option[Html]): Unit = repositoryHeaders += repositoryHeader
|
||||||
|
|
||||||
|
def getRepositoryHeaders: Seq[(RepositoryInfo, Context) => Option[Html]] = repositoryHeaders.toSeq
|
||||||
|
|
||||||
def addGlobalMenu(globalMenu: (Context) => Option[Link]): Unit = globalMenus += globalMenu
|
def addGlobalMenu(globalMenu: (Context) => Option[Link]): Unit = globalMenus += globalMenu
|
||||||
|
|
||||||
def getGlobalMenus: Seq[(Context) => Option[Link]] = globalMenus.toSeq
|
def getGlobalMenus: Seq[(Context) => Option[Link]] = globalMenus.toSeq
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
} else {
|
} else {
|
||||||
<li><form class="sidebar-form"><input type="text" id="filter-box" class="form-control input-sm" placeholder="Find repository"/></form></li>
|
<li><form class="sidebar-form"><input type="text" id="filter-box" class="form-control input-sm" placeholder="Find repository"/></form></li>
|
||||||
@userRepositories.zipWithIndex.map { case (repository, i) =>
|
@userRepositories.zipWithIndex.map { case (repository, i) =>
|
||||||
<li class="menu-item-hover">
|
<li class="repo-link menu-item-hover">
|
||||||
@if(repository.owner == context.loginAccount.get.userName){
|
@if(repository.owner == context.loginAccount.get.userName){
|
||||||
<a href="@helpers.url(repository)">@gitbucket.core.helper.html.repositoryicon(repository, false) <span class="strong">@repository.name</span></a>
|
<a href="@helpers.url(repository)">@gitbucket.core.helper.html.repositoryicon(repository, false) <span class="strong">@repository.name</span></a>
|
||||||
} else {
|
} else {
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
} else {
|
} else {
|
||||||
<li><form class="sidebar-form"><input type="text" id="filter-box" class="form-control input-sm" placeholder="Find repository"/></form></li>
|
<li><form class="sidebar-form"><input type="text" id="filter-box" class="form-control input-sm" placeholder="Find repository"/></form></li>
|
||||||
@recentRepositories.zipWithIndex.map { case (repository, i) =>
|
@recentRepositories.zipWithIndex.map { case (repository, i) =>
|
||||||
<li class="menu-item-hover">
|
<li class="repo-link menu-item-hover">
|
||||||
<a href="@helpers.url(repository)">@gitbucket.core.helper.html.repositoryicon(repository, false) <span>@repository.owner/<span class="strong">@repository.name</span></span></a>
|
<a href="@helpers.url(repository)">@gitbucket.core.helper.html.repositoryicon(repository, false) <span>@repository.owner/<span class="strong">@repository.name</span></span></a>
|
||||||
</li>
|
</li>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,8 +148,8 @@
|
|||||||
<input type="hidden" name="assignedUserName" value=""/>
|
<input type="hidden" name="assignedUserName" value=""/>
|
||||||
}
|
}
|
||||||
@issue.map { issue =>
|
@issue.map { issue =>
|
||||||
@gitbucket.core.plugin.PluginRegistry().getIssueSidebars.map { sidebar =>
|
@gitbucket.core.plugin.PluginRegistry().getIssueSidebars.map { sidebarComponent =>
|
||||||
@sidebar(issue, repository, context)
|
@sidebarComponent(issue, repository, context)
|
||||||
}
|
}
|
||||||
<hr/>
|
<hr/>
|
||||||
<div style="margin-bottom: 14px;">
|
<div style="margin-bottom: 14px;">
|
||||||
|
|||||||
@@ -74,6 +74,11 @@
|
|||||||
@gitbucket.core.helper.html.information(info)
|
@gitbucket.core.helper.html.information(info)
|
||||||
@gitbucket.core.helper.html.error(error)
|
@gitbucket.core.helper.html.error(error)
|
||||||
<div class="head">
|
<div class="head">
|
||||||
|
<div class="pull-right">
|
||||||
|
@gitbucket.core.plugin.PluginRegistry().getRepositoryHeaders.map { repositoryHeaderComponent =>
|
||||||
|
@repositoryHeaderComponent(repository, context)
|
||||||
|
}
|
||||||
|
</div>
|
||||||
@gitbucket.core.helper.html.repositoryicon(repository, true)
|
@gitbucket.core.helper.html.repositoryicon(repository, true)
|
||||||
<a href="@helpers.url(repository.owner)">@repository.owner</a> / <a href="@helpers.url(repository)" class="strong">@repository.name</a>
|
<a href="@helpers.url(repository.owner)">@repository.owner</a> / <a href="@helpers.url(repository)" class="strong">@repository.name</a>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user