diff --git a/build.sbt b/build.sbt index 569e462..8768568 100644 --- a/build.sbt +++ b/build.sbt @@ -1,6 +1,6 @@ val Organization = "io.github.gitbucket" val Name = "gitbucket" -val GitBucketVersion = "4.14.1" +val GitBucketVersion = "4.15.0-SNAPSHOT" val ScalatraVersion = "2.5.0" val JettyVersion = "9.3.19.v20170502" @@ -21,8 +21,8 @@ "amateras-snapshot" at "http://amateras.sourceforge.jp/mvn-snapshot/" ) libraryDependencies ++= Seq( - "org.eclipse.jgit" % "org.eclipse.jgit.http.server" % "4.7.0.201704051617-r", - "org.eclipse.jgit" % "org.eclipse.jgit.archive" % "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.8.0.201706111038-r", "org.scalatra" %% "scalatra" % ScalatraVersion, "org.scalatra" %% "scalatra-json" % ScalatraVersion, "org.json4s" %% "json4s-jackson" % "3.5.1", diff --git a/src/main/java/JettyLauncher.java b/src/main/java/JettyLauncher.java index 94525fd..849ed3c 100644 --- a/src/main/java/JettyLauncher.java +++ b/src/main/java/JettyLauncher.java @@ -40,7 +40,7 @@ } break; case "--max_file_size": - System.setProperty("gitbucket.maxFileSize", dim[2]); + System.setProperty("gitbucket.maxFileSize", dim[1]); break; case "--gitbucket.home": System.setProperty("gitbucket.home", dim[1]); diff --git a/src/main/scala/gitbucket/core/controller/RepositorySettingsController.scala b/src/main/scala/gitbucket/core/controller/RepositorySettingsController.scala index 4ef39e3..8d003f5 100644 --- a/src/main/scala/gitbucket/core/controller/RepositorySettingsController.scala +++ b/src/main/scala/gitbucket/core/controller/RepositorySettingsController.scala @@ -150,7 +150,7 @@ get("/:owner/:repository/settings/branches")(ownerOnly { repository => val protecteions = getProtectedBranchList(repository.owner, repository.name) html.branches(repository, protecteions, flash.get("info")) - }); + }) /** Update default branch */ post("/:owner/:repository/settings/update_default_branch", defaultBranchForm)(ownerOnly { (form, repository) => diff --git a/src/main/scala/gitbucket/core/plugin/Plugin.scala b/src/main/scala/gitbucket/core/plugin/Plugin.scala index c2a5ecb..7f135e5 100644 --- a/src/main/scala/gitbucket/core/plugin/Plugin.scala +++ b/src/main/scala/gitbucket/core/plugin/Plugin.scala @@ -122,6 +122,16 @@ 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. */ val globalMenus: Seq[(Context) => Option[Link]] = Nil @@ -266,6 +276,9 @@ (pullRequestHooks ++ pullRequestHooks(registry, context, settings)).foreach { pullRequestHook => registry.addPullRequestHook(pullRequestHook) } + (repositoryHeaders ++ repositoryHeaders(registry, context, settings)).foreach { repositoryHeader => + registry.addRepositoryHeader(repositoryHeader) + } (globalMenus ++ globalMenus(registry, context, settings)).foreach { globalMenu => registry.addGlobalMenu(globalMenu) } @@ -287,8 +300,8 @@ (dashboardTabs ++ dashboardTabs(registry, context, settings)).foreach { dashboardTab => registry.addDashboardTab(dashboardTab) } - (issueSidebars ++ issueSidebars(registry, context, settings)).foreach { issueSidebar => - registry.addIssueSidebar(issueSidebar) + (issueSidebars ++ issueSidebars(registry, context, settings)).foreach { issueSidebarComponent => + registry.addIssueSidebar(issueSidebarComponent) } (assetsMappings ++ assetsMappings(registry, context, settings)).foreach { assetMapping => registry.addAssetsMapping((assetMapping._1, assetMapping._2, getClass.getClassLoader)) diff --git a/src/main/scala/gitbucket/core/plugin/PluginRegistory.scala b/src/main/scala/gitbucket/core/plugin/PluginRegistory.scala index 715bd91..b0f2749 100644 --- a/src/main/scala/gitbucket/core/plugin/PluginRegistory.scala +++ b/src/main/scala/gitbucket/core/plugin/PluginRegistory.scala @@ -48,6 +48,7 @@ private val pullRequestHooks = new ListBuffer[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 repositoryMenus = new ListBuffer[(RepositoryInfo, Context) => Option[Link]] private val repositorySettingTabs = new ListBuffer[(RepositoryInfo, Context) => Option[Link]] @@ -132,6 +133,10 @@ 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 getGlobalMenus: Seq[(Context) => Option[Link]] = globalMenus.toSeq diff --git a/src/main/twirl/gitbucket/core/dashboard/sidebar.scala.html b/src/main/twirl/gitbucket/core/dashboard/sidebar.scala.html index 600ea73..9f59a2f 100644 --- a/src/main/twirl/gitbucket/core/dashboard/sidebar.scala.html +++ b/src/main/twirl/gitbucket/core/dashboard/sidebar.scala.html @@ -14,7 +14,7 @@ } else {
  • @userRepositories.zipWithIndex.map { case (repository, i) => -
  • @recentRepositories.zipWithIndex.map { case (repository, i) => - } diff --git a/src/main/twirl/gitbucket/core/issues/issueinfo.scala.html b/src/main/twirl/gitbucket/core/issues/issueinfo.scala.html index 4b0fb88..cbd732d 100644 --- a/src/main/twirl/gitbucket/core/issues/issueinfo.scala.html +++ b/src/main/twirl/gitbucket/core/issues/issueinfo.scala.html @@ -148,8 +148,8 @@ } @issue.map { issue => - @gitbucket.core.plugin.PluginRegistry().getIssueSidebars.map { sidebar => - @sidebar(issue, repository, context) + @gitbucket.core.plugin.PluginRegistry().getIssueSidebars.map { sidebarComponent => + @sidebarComponent(issue, repository, context) }
    diff --git a/src/main/twirl/gitbucket/core/menu.scala.html b/src/main/twirl/gitbucket/core/menu.scala.html index c6f5f70..3106881 100644 --- a/src/main/twirl/gitbucket/core/menu.scala.html +++ b/src/main/twirl/gitbucket/core/menu.scala.html @@ -74,6 +74,11 @@ @gitbucket.core.helper.html.information(info) @gitbucket.core.helper.html.error(error)
    +
    + @gitbucket.core.plugin.PluginRegistry().getRepositoryHeaders.map { repositoryHeaderComponent => + @repositoryHeaderComponent(repository, context) + } +
    @gitbucket.core.helper.html.repositoryicon(repository, true) @repository.owner / @repository.name