Skip to content

Commit 1baf7b2

Browse files
committed
User assetsMappings extension point
1 parent d6f0695 commit 1baf7b2

File tree

8 files changed

+9
-11
lines changed

8 files changed

+9
-11
lines changed

build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
val Organization = "gitbucket"
22
val ProjectName = "gitbucket-gist-plugin"
3-
val ProjectVersion = "4.2.0"
3+
val ProjectVersion = "4.3.0-SNAPSHOT"
44

55
lazy val root = (project in file(".")).enablePlugins(SbtTwirl)
66

@@ -15,7 +15,7 @@ resolvers ++= Seq(
1515
)
1616

1717
libraryDependencies ++= Seq(
18-
"gitbucket" % "gitbucket-assembly" % "4.2.0" % "provided",
18+
"gitbucket" % "gitbucket-assembly" % "4.3.0-SNAPSHOT" % "provided",
1919
"com.typesafe.play" %% "twirl-compiler" % "1.0.4" % "provided",
2020
"javax.servlet" % "javax.servlet-api" % "3.1.0" % "provided"
2121
)

src/main/twirl/gitbucket/gist/style.scala.html renamed to src/main/resources/gitbucket/gist/assets/style.css

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@()
2-
<style type="text/css">
31
div.head {
42
padding: 15px;
53
}
@@ -18,5 +16,4 @@
1816
background-color: transparent;
1917
border: 1px solid rgba(0, 0, 0, 0.15);
2018
padding-left: 25px;
21-
}
22-
</style>
19+
}

src/main/scala/Plugin.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class Plugin extends gitbucket.core.plugin.Plugin {
5252
override val profileTabs = Seq(
5353
(account: Account, context: Context) => Some(Link("snippets", "Snippets", s"gist/${account.userName}/_profile"))
5454
)
55+
override val assetsMappings = Seq("/gist" -> "/gitbucket/gist/assets")
5556

5657
// override def javaScripts(registry: PluginRegistry, context: ServletContext, settings: SystemSettings): Seq[(String, String)] = {
5758
// // Add Snippet link to the header

src/main/twirl/gitbucket/gist/detail.scala.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
editable: Boolean)(implicit context: gitbucket.core.controller.Context)
88
@import gitbucket.core.view.helpers
99
@gitbucket.core.html.main(if(gist.description.isEmpty) gist.repositoryName else gist.description){
10-
@gitbucket.gist.html.style()
10+
<link href="@context.path/plugin-assets/gist/style.css" rel="stylesheet">
1111
<div class="content-wrapper main-center">
1212
@gitbucket.gist.html.header(gist, forkedCount, editable)
1313
<div class="content body">

src/main/twirl/gitbucket/gist/edit.scala.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
@import gitbucket.gist.model.Mode
44
@import gitbucket.core.view.helpers
55
@gitbucket.core.html.main("Snippets"){
6-
@gitbucket.gist.html.style()
6+
<link href="@context.path/plugin-assets/gist/style.css" rel="stylesheet">
77
<div class="content-wrapper main-center">
88
<div class="head">
99
<div id="error"></div>

src/main/twirl/gitbucket/gist/forks.scala.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
editable: Boolean)(implicit context: gitbucket.core.controller.Context)
66
@import gitbucket.core.view.helpers
77
@gitbucket.core.html.main("Snippets"){
8-
@gitbucket.gist.html.style()
8+
<link href="@context.path/plugin-assets/gist/style.css" rel="stylesheet">
99
<div class="content-wrapper main-center">
1010
@gitbucket.gist.html.header(gist, forkedCount, editable)
1111
<div class="content body">

src/main/twirl/gitbucket/gist/list.scala.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@import gitbucket.gist.model.Mode
66
@import gitbucket.core.view.helpers
77
@gitbucket.core.html.main(gistUser.map(user => s"${user.userName}'s Snippets").getOrElse("Snippets")){
8-
@gitbucket.gist.html.style()
8+
<link href="@context.path/plugin-assets/gist/style.css" rel="stylesheet">
99
<div class="content-wrapper main-center">
1010
<div class="head">
1111
@if(gistUser.isEmpty){

src/main/twirl/gitbucket/gist/revisions.scala.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
@import gitbucket.core.view.helpers
77
@import org.eclipse.jgit.diff.DiffEntry.ChangeType
88
@gitbucket.core.html.main(s"Revisions · ${gist.repositoryName}"){
9-
@gitbucket.gist.html.style()
9+
<link href="@context.path/plugin-assets/gist/style.css" rel="stylesheet">
1010
<div class="content-wrapper main-center">
1111
@gitbucket.gist.html.header(gist, forkedCount, editable)
1212
<div class="content body">

0 commit comments

Comments
 (0)