mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-13 08:55:50 +01:00
(refs #1491)Note helper.assets as deprecated.
Use assets(path: String)(implicit context: Context) instead. It adds the hash value which is generated from bootstrap timestamp to the resource url automatically.
This commit is contained in:
@@ -75,18 +75,18 @@ object helpers extends AvatarImageProvider with LinkConverter with RequestCache
|
|||||||
def date(date: Date): String = new SimpleDateFormat("yyyy-MM-dd").format(date)
|
def date(date: Date): String = new SimpleDateFormat("yyyy-MM-dd").format(date)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Format java.util.Date to "yyyyMMDDHHmmss" (for url hash ex. /some/path.css?19800101010203
|
* Format java.util.Date to "yyyyMMDDHHmmss" (for url hash ex. /some/path.css?19800101010203
|
||||||
*/
|
*/
|
||||||
def hashDate(date: Date): String = new SimpleDateFormat("yyyyMMddHHmmss").format(date)
|
def hashDate(date: Date): String = new SimpleDateFormat("yyyyMMddHHmmss").format(date)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* java.util.Date of boot timestamp.
|
* java.util.Date of boot timestamp.
|
||||||
*/
|
*/
|
||||||
val bootDate: Date = new Date()
|
val bootDate: Date = new Date()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hashDate of bootDate for /assets, /plugin-assets
|
* hashDate of bootDate for /assets, /plugin-assets
|
||||||
*/
|
*/
|
||||||
def hashQuery: String = hashDate(bootDate)
|
def hashQuery: String = hashDate(bootDate)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -224,6 +224,7 @@ object helpers extends AvatarImageProvider with LinkConverter with RequestCache
|
|||||||
/**
|
/**
|
||||||
* Returns the url to the root of assets.
|
* Returns the url to the root of assets.
|
||||||
*/
|
*/
|
||||||
|
@deprecated("Use assets(path: String)(implicit context: Context) instead.", "4.11.0")
|
||||||
def assets(implicit context: Context): String = s"${context.path}/assets"
|
def assets(implicit context: Context): String = s"${context.path}/assets"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
@import gitbucket.core.view.helpers
|
@import gitbucket.core.view.helpers
|
||||||
@gitbucket.core.account.html.main(account, groupNames, "activity"){
|
@gitbucket.core.account.html.main(account, groupNames, "activity"){
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<a href="@context.path/@{account.userName}.atom"><img src="@{helpers.assets}/common/images/feed.png" alt="activities"></a>
|
<a href="@context.path/@{account.userName}.atom"><img src="@helpers.assets("/common/images/feed.png")" alt="activities"></a>
|
||||||
</div>
|
</div>
|
||||||
@gitbucket.core.helper.html.activities(activities)
|
@gitbucket.core.helper.html.activities(activities)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user