Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose an asset router #13

Closed
cescoffier opened this issue Nov 23, 2013 · 3 comments
Closed

Expose an asset router #13

cescoffier opened this issue Nov 23, 2013 · 3 comments
Labels
Milestone

Comments

@cescoffier
Copy link
Member

The router will ease the computation of "src" and "link" in templates

@cescoffier cescoffier added this to the 0.4.0 milestone Jun 23, 2014
@cescoffier
Copy link
Member Author

This feature is already provided by the +routes+ object.

@cescoffier
Copy link
Member Author

My fault, no it's not completely true.

@cescoffier cescoffier modified the milestones: 0.7, 0.4.0, 0.6 Jun 23, 2014
@jenf11 jenf11 modified the milestones: 0.7, 0.6 Jun 27, 2014
cescoffier added a commit that referenced this issue Jul 1, 2014
cescoffier added a commit that referenced this issue Jul 1, 2014
cescoffier added a commit that referenced this issue Jul 1, 2014
cescoffier added a commit that referenced this issue Jul 1, 2014
/assets/ return the asset list page.

Signed-off-by: Clement Escoffier <[email protected]>
cescoffier added a commit that referenced this issue Jul 1, 2014
Signed-off-by: Clement Escoffier <[email protected]>
cescoffier added a commit that referenced this issue Jul 1, 2014
Signed-off-by: Clement Escoffier <[email protected]>
cescoffier added a commit that referenced this issue Jul 1, 2014
Signed-off-by: Clement Escoffier <[email protected]>
cescoffier added a commit that referenced this issue Jul 1, 2014
@cescoffier
Copy link
Member Author

Fixed.

Two features were implemented:

  1. /assets provide a list of all available assets including the assets included in webjars.
  2. an asset method was added to the route object injected in thymeleaf template. So you can write:
<link th:href="${#routes.asset('css/bootstrap.min.css')}" rel="stylesheet"/>
<link th:href="${#routes.asset('css/bootstrap-theme.min.css')}" rel="stylesheet"/>
<script th:src="${#routes.asset('jquery.js')}"></script>
<script th:src="${#routes.asset('js/bootstrap.min.js')}"></script>

It computes the final URL.

cescoffier added a commit that referenced this issue Jul 2, 2014
cescoffier added a commit that referenced this issue Jul 2, 2014
Signed-off-by: Clement Escoffier <[email protected]>
@cescoffier cescoffier modified the milestones: 0.6.1, 0.7 Jul 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants