Skip to content

Commit 24d28a1

Browse files
committed
fixed bug when redirect.
1 parent b515167 commit 24d28a1

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name := "gitbucket-groupsmenu-plugin"
22
organization := "io.github.gitbucket"
3-
version := "1.0.0"
3+
version := "1.0.1"
44
scalaVersion := "2.11.8"
55

66
libraryDependencies ++= Seq(

src/main/scala/Plugin.scala

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Plugin extends gitbucket.core.plugin.Plugin {
1313
override val pluginId: String = "groupsmenu"
1414
override val pluginName: String = "Groups in global menu Plugin"
1515
override val description: String = "Show groups link in global menu bar"
16-
override val versions: List[Version] = List(new Version("1.0.0"))
16+
override val versions: List[Version] = List(new Version("1.0.0"), new Version("1.0.1"))
1717

1818
override val controllers = Seq(
1919
"/*" -> new GroupsMenuController()
@@ -28,12 +28,17 @@ class Plugin extends gitbucket.core.plugin.Plugin {
2828
override def javaScripts(registry: PluginRegistry, context: ServletContext, settings: SystemSettings): Seq[(String, String)] = {
2929
val path = settings.baseUrl.getOrElse(context.getContextPath)
3030
Seq(
31-
".*" -> s"""
31+
".*/(?!signin)[^/]*" -> s"""
3232
|</script>
3333
|<script>var basePath = "$path";</script>
3434
|<script src="$path/plugin-assets/groupsmenu/main.js"></script>
3535
|<script>
36-
""".stripMargin
36+
""".stripMargin,
37+
".*/signin[^/]*" -> s"""
38+
|$$(document).ready(function () {
39+
| $$('ul.navbar-nav a:contains("Groups")').closest('li').remove();
40+
|});
41+
""".stripMargin
3742
)
3843
}
3944
}

0 commit comments

Comments
 (0)