mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 05:25:50 +01:00
Refactor for views.
- Replace urls with helpers.url and helpers.assets - Move google-code-prettify to main.scala.html - Move some CSS styles to gitbucket.css
This commit is contained in:
@@ -26,6 +26,22 @@ object helpers {
|
||||
Html(Markdown.toHtml(value, repository, enableWikiLink, enableCommitLink, enableIssueLink))
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the url to the repository.
|
||||
*/
|
||||
def url(repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context): String =
|
||||
"%s/%s/%s".format(context.path, repository.owner, repository.name)
|
||||
|
||||
/**
|
||||
* Generates the url to the account page.
|
||||
*/
|
||||
def url(userName: String)(implicit context: app.Context): String = "%s/%s".format(context.path, userName)
|
||||
|
||||
/**
|
||||
* Returns the url to the root of assets.
|
||||
*/
|
||||
def assets(implicit context: app.Context): String = "%s/assets".format(context.path)
|
||||
|
||||
/**
|
||||
* Converts issue id and commit id to link.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user