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:
takezoe
2013-06-27 21:19:41 +09:00
parent 3edf195da8
commit 89c0e52c1d
36 changed files with 265 additions and 240 deletions

View File

@@ -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.
*/