diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 49d184a..507d345 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,6 +1,7 @@ # Guideline for Issues -- At first, See [FAQ](https://github.com/gitbucket/gitbucket/wiki/FAQ) and check issues whether there is a same question or request in the past. +- At first, see [Wiki](https://github.com/gitbucket/gitbucket/wiki) and check issues whether there is a same question or request in the past. - If you can't find same question and report, send it to [gitter room](https://gitter.im/gitbucket/gitbucket) before raising an issue. -- We can also support in Japaneses other than English at [gitter room for Japanese](https://gitter.im/gitbucket/gitbucket_ja). +- We can also support in Japanese other than English at [gitter room for Japanese](https://gitter.im/gitbucket/gitbucket_ja). - Write an issue in English. At least, write subject in English. +- The highest priority of GitBucket is the ease of installation and API compatibility with GitHub, so your feature request might be rejected if they go against those principles. diff --git a/README.md b/README.md index b9222ea..feadf3a 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,35 @@ GitBucket [![Gitter chat](https://badges.gitter.im/gitbucket/gitbucket.png)](https://gitter.im/gitbucket/gitbucket) [![Build Status](https://travis-ci.org/gitbucket/gitbucket.svg?branch=master)](https://travis-ci.org/gitbucket/gitbucket) ========= -GitBucket is a Git platform powered by Scala offering: +GitBucket is a Git web platform powered by Scala offering: + - Easy installation +- Intuitive UI - High extensibility by plugins - API compatibility with GitHub +You can try an [online demo](https://gitbucket.herokuapp.com/) *(ID: root / Pass: root)* of GitBucket, and also get the latest information at [GitBucket News](https://gitbucket.github.io/gitbucket-news/). + Features -------- -The current version of GitBucket provides a basic features below: +The current version of GitBucket provides many features such as: -- Public / Private Git repository (http and ssh access) +- Public / Private Git repositories (with http/https and ssh access) - GitLFS support -- Repository viewer includes online file editor -- Issues, Pull request and Wiki for repositories -- Activity timeline and email notification +- Repository viewer including an online file editor +- Issues, Pull Requests and Wiki for repositories +- Activity timeline and email notifications - Account and group management with LDAP integration -- Plug-in system +- a Plug-in system If you want to try the development version of GitBucket, see the [Developer's Guide](https://github.com/gitbucket/gitbucket/blob/master/doc/how_to_run.md). Installation -------- -GitBucket requires **Java8**. You have to install it if it is not already installed. +GitBucket requires **Java8**. You have to install it, if it is not already installed. 1. Download the latest **gitbucket.war** from [the releases page](https://github.com/gitbucket/gitbucket/releases) and run it by `java -jar gitbucket.war`. -2. Go to `http://[hostname]:8080/` and log in with **root** / **root**. +2. Go to `http://[hostname]:8080/` and log in with ID: **root** / Pass: **root**. You can specify following options: @@ -45,24 +49,30 @@ Plugins -------- -GitBucket has a plug-in system to allow extensions to GitBucket. We provide some official plug-ins: +GitBucket has a plug-in system that allows extra functionality. Officially the following plug-ins are provided: - [gitbucket-gist-plugin](https://github.com/gitbucket/gitbucket-gist-plugin) - [gitbucket-emoji-plugin](https://github.com/gitbucket/gitbucket-emoji-plugin) +- [gitbucket-pages-plugin](https://github.com/gitbucket/gitbucket-pages-plugin) You can find more plugins made by the community at [GitBucket community plugins](http://gitbucket-plugins.github.io/). Support -------- -- If you have any questions about GitBucket, send it to the [gitter room](https://gitter.im/gitbucket/gitbucket) before opening an issue. -- Make sure check whether there is the same question or request in the past. -- When raise a new issue, write at least the subject in **English**. -- We can also provide support in Japanese at [gitter room for Japanese](https://gitter.im/gitbucket/gitbucket_ja). -- The first priority of GitBucket is easy installation and API compatibility with GitHub, so we might reject if your request is against it. +- If you have any questions about GitBucket, see [Wiki](https://github.com/gitbucket/gitbucket/wiki) and check issues whether there is a same question or request in the past. +- If you can't find same question and report, send it to [gitter room](https://gitter.im/gitbucket/gitbucket) before raising an issue. +- We can also provide support in Japanese other than English at [gitter room for Japanese](https://gitter.im/gitbucket/gitbucket_ja). +- Write an issue in English. At least, write subject in English. +- The highest priority of GitBucket is the ease of installation and API compatibility with GitHub, so your feature request might be rejected if they go against those principles. Release Notes ------------- +### 4.12 - 30 Apr 2017 +- [Gist plug-in](https://github.com/gitbucket/gitbucket-gist-plugin) provides JavaScript to embed snippet +- Dropdown menu filter in the branch comparing page +- Caution for the embedded H2 database + ### 4.11 - 1 Apr 2017 - Deploy keys support - Auto generate avatar images diff --git a/build.sbt b/build.sbt index 869ec54..f7efb43 100644 --- a/build.sbt +++ b/build.sbt @@ -1,6 +1,6 @@ val Organization = "io.github.gitbucket" val Name = "gitbucket" -val GitBucketVersion = "4.11.0" +val GitBucketVersion = "4.12.0" val ScalatraVersion = "2.5.0" val JettyVersion = "9.4.3.v20170317" @@ -10,7 +10,7 @@ organization := Organization name := Name version := GitBucketVersion -scalaVersion := "2.12.1" +scalaVersion := "2.12.2" // dependency settings resolvers ++= Seq( @@ -60,7 +60,7 @@ ) // Compiler settings -scalacOptions := Seq("-deprecation", "-language:postfixOps") +scalacOptions := Seq("-deprecation", "-language:postfixOps", "-opt:l:method") javacOptions in compile ++= Seq("-target", "8", "-source", "8") javaOptions in Jetty += "-Dlogback.configurationFile=/logback-dev.xml" diff --git a/doc/how_to_run.md b/doc/how_to_run.md index 77c1f5d..9db0789 100644 --- a/doc/how_to_run.md +++ b/doc/how_to_run.md @@ -1,18 +1,24 @@ How to run from the source tree ======== +Install [sbt](http://www.scala-sbt.org/index.html) at first. + +``` +$ brew install sbt +``` + Run for Development -------- -If you want to test GitBucket, input following command at the root directory of the source tree. +If you want to test GitBucket, type the following command in the root directory of the source tree. ``` $ sbt ~jetty:start ``` -Then access to `http://localhost:8080/` by your browser. The default administrator account is `root` and password is `root`. +Then access `http://localhost:8080/` in your browser. The default administrator account is `root` and password is `root`. -Source code modification is detected and reloaded automatically. You can modify logging configuration by editing `src/main/resources/logback-dev.xml`. +Source code modifications are detected and a reloaded happens automatically. You can modify the logging configuration by editing `src/main/resources/logback-dev.xml`. Build war file -------- @@ -25,7 +31,7 @@ `gitbucket_2.12-x.x.x.war` is generated into `target/scala-2.12`. -To build executable war file, run +To build an executable war file, run ``` $ sbt executable @@ -35,8 +41,8 @@ Run tests spec --------- -To run the full serie of tests, run the following command: +To run the full series of tests, run the following command: ``` -sbt test +$ sbt test ``` diff --git a/doc/notification.md b/doc/notification.md index 90a88bb..f9fb1e0 100644 --- a/doc/notification.md +++ b/doc/notification.md @@ -1,7 +1,7 @@ Notification Email ======== -GitBucket sends email to target users by enabling the notification email by an administrator. +GitBucket can send email notification to users if this feature is enabled by an administrator. The timing of the notification are as follows: @@ -20,4 +20,4 @@ * collaborators * participants -However, the operation in person is excluded from the target. +However, the person performing the operation is excluded from the notification. diff --git a/doc/release.md b/doc/release.md index 682dc88..d417cb7 100644 --- a/doc/release.md +++ b/doc/release.md @@ -34,8 +34,6 @@ Generate release files -------- -Note: Release operation requires [Ant](http://ant.apache.org/) and [Maven](https://maven.apache.org/). - ### Make release war file Run `sbt executable`. The release war file and fingerprint are generated into `target/executable/gitbucket.war`. @@ -52,4 +50,12 @@ $ sbt publish-signed ``` -Then operate release sequence at https://oss.sonatype.org/. +Then logged-in https://oss.sonatype.org/ and delete following files from the staging repository: + +- gitbucket_2.12-x.x.x.war +- gitbucket_2.12-x.x.x.war.asc +- gitbucket_2.12-x.x.x.war.asc.md5 +- gitbucket_2.12-x.x.x.war.asc.sha1 +- gitbucket_2.12-x.x.x.war.md5 + +At last, close and release the repository. diff --git a/src/main/java/JettyLauncher.java b/src/main/java/JettyLauncher.java index bae7ae1..01245c2 100644 --- a/src/main/java/JettyLauncher.java +++ b/src/main/java/JettyLauncher.java @@ -1,4 +1,9 @@ +import org.eclipse.jetty.server.ConnectionFactory; +import org.eclipse.jetty.server.Connector; +import org.eclipse.jetty.server.Handler; +import org.eclipse.jetty.server.HttpConnectionFactory; import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.server.handler.StatisticsHandler; import org.eclipse.jetty.webapp.WebAppContext; import java.io.File; @@ -8,6 +13,8 @@ public class JettyLauncher { public static void main(String[] args) throws Exception { + System.setProperty("java.awt.headless", "true"); + String host = null; int port = 8080; InetSocketAddress address = null; @@ -60,6 +67,15 @@ // connector.setPort(port); // server.addConnector(connector); + // Disabling Server header + for (Connector connector : server.getConnectors()) { + for (ConnectionFactory factory : connector.getConnectionFactories()) { + if (factory instanceof HttpConnectionFactory) { + ((HttpConnectionFactory) factory).getHttpConfiguration().setSendServerVersion(false); + } + } + } + WebAppContext context = new WebAppContext(); File tmpDir; @@ -91,7 +107,9 @@ context.setInitParameter("org.scalatra.ForceHttps", "true"); } - server.setHandler(context); + Handler handler = addStatisticsHandler(context); + + server.setHandler(handler); server.setStopAtShutdown(true); server.setStopTimeout(7_000); server.start(); @@ -120,4 +138,12 @@ } dir.delete(); } + + private static Handler addStatisticsHandler(Handler handler) { + // The graceful shutdown is implemented via the statistics handler. + // See the following: https://bugs.eclipse.org/bugs/show_bug.cgi?id=420142 + final StatisticsHandler statisticsHandler = new StatisticsHandler(); + statisticsHandler.setHandler(handler); + return statisticsHandler; + } } diff --git a/src/main/scala/gitbucket/core/GitBucketCoreModule.scala b/src/main/scala/gitbucket/core/GitBucketCoreModule.scala index dd8665d..b33a909 100644 --- a/src/main/scala/gitbucket/core/GitBucketCoreModule.scala +++ b/src/main/scala/gitbucket/core/GitBucketCoreModule.scala @@ -31,5 +31,6 @@ new Version("4.10.0"), new Version("4.11.0", new LiquibaseMigration("update/gitbucket-core_4.11.xml") - ) + ), + new Version("4.12.0") ) diff --git a/src/main/scala/gitbucket/core/api/ApiRepository.scala b/src/main/scala/gitbucket/core/api/ApiRepository.scala index 9c7377c..a6c5bd5 100644 --- a/src/main/scala/gitbucket/core/api/ApiRepository.scala +++ b/src/main/scala/gitbucket/core/api/ApiRepository.scala @@ -37,7 +37,7 @@ name = repository.repositoryName, full_name = s"${repository.userName}/${repository.repositoryName}", description = repository.description.getOrElse(""), - watchers = 0, + watchers = watchers, forks = forkedCount, `private` = repository.isPrivate, default_branch = repository.defaultBranch, diff --git a/src/main/scala/gitbucket/core/controller/IndexController.scala b/src/main/scala/gitbucket/core/controller/IndexController.scala index 9d0316f..524f26f 100644 --- a/src/main/scala/gitbucket/core/controller/IndexController.scala +++ b/src/main/scala/gitbucket/core/controller/IndexController.scala @@ -26,13 +26,13 @@ "password" -> trim(label("Password", text(required))) )(SignInForm.apply) - val searchForm = mapping( - "query" -> trim(text(required)), - "owner" -> trim(text(required)), - "repository" -> trim(text(required)) - )(SearchForm.apply) - - case class SearchForm(query: String, owner: String, repository: String) +// val searchForm = mapping( +// "query" -> trim(text(required)), +// "owner" -> trim(text(required)), +// "repository" -> trim(text(required)) +// )(SearchForm.apply) +// +// case class SearchForm(query: String, owner: String, repository: String) get("/"){ @@ -163,7 +163,7 @@ get("/search"){ val query = params.getOrElse("query", "").trim.toLowerCase - val visibleRepositories = getVisibleRepositories(context.loginAccount, None) + val visibleRepositories = getVisibleRepositories(context.loginAccount, repositoryUserName = None, withoutPhysicalInfo = true) val repositories = visibleRepositories.filter { repository => repository.name.toLowerCase.indexOf(query) >= 0 || repository.owner.toLowerCase.indexOf(query) >= 0 } diff --git a/src/main/scala/gitbucket/core/controller/RepositorySettingsController.scala b/src/main/scala/gitbucket/core/controller/RepositorySettingsController.scala index c6f580f..4fc7974 100644 --- a/src/main/scala/gitbucket/core/controller/RepositorySettingsController.scala +++ b/src/main/scala/gitbucket/core/controller/RepositorySettingsController.scala @@ -40,7 +40,7 @@ ) val optionsForm = mapping( - "repositoryName" -> trim(label("Repository Name" , text(required, maxlength(100), identifier, renameRepositoryName))), + "repositoryName" -> trim(label("Repository Name" , text(required, maxlength(100), repository, renameRepositoryName))), "description" -> trim(label("Description" , optional(text()))), "isPrivate" -> trim(label("Repository Type" , boolean())), "issuesOption" -> trim(label("Issues Option" , text(required, featureOption))), @@ -139,6 +139,12 @@ FileUtils.moveDirectory(dir, getLfsDir(repository.owner, form.repositoryName)) } } + // Move attached directory + defining(getAttachedDir(repository.owner, repository.name)){ dir => + if(dir.isDirectory) { + FileUtils.moveDirectory(dir, getAttachedDir(repository.owner, form.repositoryName)) + } + } // Delete parent directory FileUtil.deleteDirectoryIfEmpty(getRepositoryFilesDir(repository.owner, repository.name)) @@ -352,6 +358,12 @@ FileUtils.moveDirectory(dir, getLfsDir(form.newOwner, repository.name)) } } + // Move attached directory + defining(getAttachedDir(repository.owner, repository.name)){ dir => + if(dir.isDirectory) { + FileUtils.moveDirectory(dir, getAttachedDir(form.newOwner, repository.name)) + } + } // Delere parent directory FileUtil.deleteDirectoryIfEmpty(getRepositoryFilesDir(repository.owner, repository.name)) diff --git a/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala b/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala index 23eb612..6fc90d7 100644 --- a/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala +++ b/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala @@ -670,12 +670,13 @@ private def archiveRepository(name: String, suffix: String, repository: RepositoryService.RepositoryInfo): Unit = { val revision = name.stripSuffix(suffix) - - val filename = repository.name + "-" + - (if(revision.length == 40) revision.substring(0, 10) else revision).replace('/', '-') + suffix - + using(Git.open(getRepositoryDir(repository.owner, repository.name))){ git => - val revCommit = JGitUtil.getRevCommitFromId(git, git.getRepository.resolve(revision)) + val oid = git.getRepository.resolve(revision) + val revCommit = JGitUtil.getRevCommitFromId(git, oid) + val sha1 = oid.getName() + val repositorySuffix = (if(sha1.startsWith(revision)) sha1 else revision).replace('/','-') + val filename = repository.name + "-" + repositorySuffix + suffix contentType = "application/octet-stream" response.setHeader("Content-Disposition", s"attachment; filename=${filename}") @@ -683,6 +684,7 @@ git.archive .setFormat(suffix.tail) + .setPrefix(repository.name + "-" + repositorySuffix + "/") .setTree(revCommit) .setOutputStream(response.getOutputStream) .call() diff --git a/src/main/scala/gitbucket/core/model/Milestone.scala b/src/main/scala/gitbucket/core/model/Milestone.scala index 81c4f2b..491fefd 100644 --- a/src/main/scala/gitbucket/core/model/Milestone.scala +++ b/src/main/scala/gitbucket/core/model/Milestone.scala @@ -9,10 +9,10 @@ class Milestones(tag: Tag) extends Table[Milestone](tag, "MILESTONE") with MilestoneTemplate { override val milestoneId = column[Int]("MILESTONE_ID", O AutoInc) val title = column[String]("TITLE") - val description = column[String]("DESCRIPTION") - val dueDate = column[java.util.Date]("DUE_DATE") - val closedDate = column[java.util.Date]("CLOSED_DATE") - def * = (userName, repositoryName, milestoneId, title, description.?, dueDate.?, closedDate.?) <> (Milestone.tupled, Milestone.unapply) + val description = column[Option[String]]("DESCRIPTION") + val dueDate = column[Option[java.util.Date]]("DUE_DATE") + val closedDate = column[Option[java.util.Date]]("CLOSED_DATE") + def * = (userName, repositoryName, milestoneId, title, description, dueDate, closedDate) <> (Milestone.tupled, Milestone.unapply) def byPrimaryKey(owner: String, repository: String, milestoneId: Int) = byMilestone(owner, repository, milestoneId) def byPrimaryKey(userName: Rep[String], repositoryName: Rep[String], milestoneId: Rep[Int]) = byMilestone(userName, repositoryName, milestoneId) diff --git a/src/main/scala/gitbucket/core/service/MilestonesService.scala b/src/main/scala/gitbucket/core/service/MilestonesService.scala index 1e95856..276aa7c 100644 --- a/src/main/scala/gitbucket/core/service/MilestonesService.scala +++ b/src/main/scala/gitbucket/core/service/MilestonesService.scala @@ -21,7 +21,7 @@ def updateMilestone(milestone: Milestone)(implicit s: Session): Unit = Milestones .filter (t => t.byPrimaryKey(milestone.userName, milestone.repositoryName, milestone.milestoneId)) - .map (t => (t.title, t.description.?, t.dueDate.?, t.closedDate.?)) + .map (t => (t.title, t.description, t.dueDate, t.closedDate)) .update (milestone.title, milestone.description, milestone.dueDate, milestone.closedDate) def openMilestone(milestone: Milestone)(implicit s: Session): Unit = diff --git a/src/main/scala/gitbucket/core/service/RepositoryService.scala b/src/main/scala/gitbucket/core/service/RepositoryService.scala index 3640f1c..3580833 100644 --- a/src/main/scala/gitbucket/core/service/RepositoryService.scala +++ b/src/main/scala/gitbucket/core/service/RepositoryService.scala @@ -262,11 +262,19 @@ JGitUtil.getRepositoryInfo(repository.userName, repository.repositoryName) }, repository, - getForkedCount( - repository.originUserName.getOrElse(repository.userName), - repository.originRepositoryName.getOrElse(repository.repositoryName) - ), - getRepositoryManagers(repository.userName)) + if(withoutPhysicalInfo){ + -1 + } else { + getForkedCount( + repository.originUserName.getOrElse(repository.userName), + repository.originRepositoryName.getOrElse(repository.repositoryName) + ) + }, + if(withoutPhysicalInfo){ + Nil + } else { + getRepositoryManagers(repository.userName) + }) } } @@ -300,7 +308,7 @@ case None => Repositories filter(_.isPrivate === false.bind) }).filter { t => repositoryUserName.map { userName => t.userName === userName.bind } getOrElse LiteralColumn(true) - }.sortBy(_.lastActivityDate desc).list.map{ repository => + }.sortBy(_.lastActivityDate desc).list.map { repository => new RepositoryInfo( if(withoutPhysicalInfo){ new JGitUtil.RepositoryInfo(repository.userName, repository.repositoryName) @@ -308,11 +316,19 @@ JGitUtil.getRepositoryInfo(repository.userName, repository.repositoryName) }, repository, - getForkedCount( - repository.originUserName.getOrElse(repository.userName), - repository.originRepositoryName.getOrElse(repository.repositoryName) - ), - getRepositoryManagers(repository.userName)) + if(withoutPhysicalInfo){ + -1 + } else { + getForkedCount( + repository.originUserName.getOrElse(repository.userName), + repository.originRepositoryName.getOrElse(repository.repositoryName) + ) + }, + if(withoutPhysicalInfo) { + Nil + } else { + getRepositoryManagers(repository.userName) + }) } } diff --git a/src/main/scala/gitbucket/core/servlet/GitAuthenticationFilter.scala b/src/main/scala/gitbucket/core/servlet/GitAuthenticationFilter.scala index 7e0ba97..2947fde 100644 --- a/src/main/scala/gitbucket/core/servlet/GitAuthenticationFilter.scala +++ b/src/main/scala/gitbucket/core/servlet/GitAuthenticationFilter.scala @@ -51,21 +51,21 @@ private def pluginRepository(request: HttpServletRequest, response: HttpServletResponse, chain: FilterChain, settings: SystemSettings, isUpdating: Boolean, filter: GitRepositoryFilter): Unit = { - implicit val r = request + Database() withSession { implicit session => + val account = for { + auth <- Option(request.getHeader("Authorization")) + Array(username, password) = AuthUtil.decodeAuthHeader(auth).split(":", 2) + account <- authenticate(settings, username, password) + } yield { + request.setAttribute(Keys.Request.UserName, account.userName) + account + } - val account = for { - auth <- Option(request.getHeader("Authorization")) - Array(username, password) = AuthUtil.decodeAuthHeader(auth).split(":", 2) - account <- authenticate(settings, username, password) - } yield { - request.setAttribute(Keys.Request.UserName, account.userName) - account - } - - if(filter.filter(request.gitRepositoryPath, account.map(_.userName), settings, isUpdating)){ - chain.doFilter(request, response) - } else { - AuthUtil.requireAuth(response) + if (filter.filter(request.gitRepositoryPath, account.map(_.userName), settings, isUpdating)) { + chain.doFilter(request, response) + } else { + AuthUtil.requireAuth(response) + } } } diff --git a/src/main/twirl/gitbucket/core/admin/system.scala.html b/src/main/twirl/gitbucket/core/admin/system.scala.html index c78ad6d..4234243 100644 --- a/src/main/twirl/gitbucket/core/admin/system.scala.html +++ b/src/main/twirl/gitbucket/core/admin/system.scala.html @@ -1,4 +1,5 @@ @(info: Option[Any])(implicit context: gitbucket.core.controller.Context) +@import gitbucket.core.util.DatabaseConfig @gitbucket.core.html.main("System settings"){ @gitbucket.core.admin.html.menu("system"){ @gitbucket.core.helper.html.information(info) @@ -20,7 +21,17 @@ DATABASE_URL - @gitbucket.core.util.DatabaseConfig.url + @if(DatabaseConfig.url.startsWith("jdbc:h2:")) { + +

@gitbucket.core.util.DatabaseConfig.url

+

+ Your GitBucket is running on embedded H2 database. + Recommend to configure to use external database if you would like to use GitBucket for important purpose. +

+ + }else{ + @gitbucket.core.util.DatabaseConfig.url + } diff --git a/src/main/twirl/gitbucket/core/dashboard/sidebar.scala.html b/src/main/twirl/gitbucket/core/dashboard/sidebar.scala.html index faf5d5a..ec18663 100644 --- a/src/main/twirl/gitbucket/core/dashboard/sidebar.scala.html +++ b/src/main/twirl/gitbucket/core/dashboard/sidebar.scala.html @@ -49,10 +49,7 @@ $('#filter-box').keyup(function(){ var inputVal = $('#filter-box').val(); $.each($('li.repo-link a'), function(index, elem) { - console.log(inputVal); - console.log(elem.text.trim()); - console.log(elem.text.trim().lastIndexOf(inputVal, 0)); - if (!inputVal || !elem.text.trim() || elem.text.trim().indexOf(inputVal) >= 0) { + if ( !inputVal || !elem.text.trim() || elem.text.trim().toLowerCase().indexOf(inputVal.toLowerCase()) >= 0 ) { $(elem).parent().show(); } else { $(elem).parent().hide(); diff --git a/src/main/twirl/gitbucket/core/helper/branchcontrol.scala.html b/src/main/twirl/gitbucket/core/helper/branchcontrol.scala.html index 09e3feb..38a5d93 100644 --- a/src/main/twirl/gitbucket/core/helper/branchcontrol.scala.html +++ b/src/main/twirl/gitbucket/core/helper/branchcontrol.scala.html @@ -31,7 +31,7 @@ $('#branch-control-input').keyup(function() { var inputVal = $('#branch-control-input').val(); $.each($('#branch-control-input').parent().parent().find('a'), function(index, elem) { - if (!inputVal || !elem.text.trim() || elem.text.trim().lastIndexOf(inputVal, 0) >= 0) { + if (!inputVal || !elem.text.trim() || elem.text.trim().toLowerCase().indexOf(inputVal.toLowerCase()) >= 0) { $(elem).parent().show(); } else { $(elem).parent().hide(); diff --git a/src/main/twirl/gitbucket/core/helper/dropdown.scala.html b/src/main/twirl/gitbucket/core/helper/dropdown.scala.html index 2becc79..a98c53c 100644 --- a/src/main/twirl/gitbucket/core/helper/dropdown.scala.html +++ b/src/main/twirl/gitbucket/core/helper/dropdown.scala.html @@ -32,7 +32,7 @@ $('#@{filter}-input').keyup(function() { var inputVal = $('#@{filter}-input').val(); $.each($('#@{filter}-input').parent().parent().find('a'), function(index, elem) { - if (!inputVal || !elem.text.trim() || elem.text.trim().lastIndexOf(inputVal, 0) >= 0) { + if ( !inputVal || !elem.text.trim() || elem.text.trim().toLowerCase().indexOf(inputVal.toLowerCase()) >=0 ) { $(elem).parent().show(); } else { $(elem).parent().hide(); diff --git a/src/main/twirl/gitbucket/core/pulls/compare.scala.html b/src/main/twirl/gitbucket/core/pulls/compare.scala.html index d390c17..17a399a 100644 --- a/src/main/twirl/gitbucket/core/pulls/compare.scala.html +++ b/src/main/twirl/gitbucket/core/pulls/compare.scala.html @@ -221,3 +221,27 @@ } }); + + diff --git a/src/main/webapp/assets/common/css/gitbucket.css b/src/main/webapp/assets/common/css/gitbucket.css index c2b225d..337b989 100644 --- a/src/main/webapp/assets/common/css/gitbucket.css +++ b/src/main/webapp/assets/common/css/gitbucket.css @@ -342,6 +342,8 @@ ul.dropdown-menu { padding: 2px 0; + overflow: auto; + max-height: 100vh; } ul.dropdown-menu li { @@ -556,6 +558,7 @@ background-color: transparent; padding: 2px; margin: 0px; + white-space: pre-wrap; } #repository-url {