fix url routes to use url_for instead of hard coded
This commit is contained in:
parent
5bf068df88
commit
92a2008df1
|
@ -11,14 +11,19 @@ package - The package for which the rating belongs to
|
|||
{% resource "rating_css/rating.css" %}
|
||||
{% resource "rating_js/rating.js" %}
|
||||
|
||||
{% set action = 'submit_package_rating' %}
|
||||
{% if package.type == 'showcase' %}
|
||||
{% set action = 'submit_showcase_rating' %}
|
||||
{% endif %}
|
||||
|
||||
{% set stars = h.get_user_rating(package.id) %}
|
||||
<span class="star-rating{% if stars == 0 %} no-stars{% endif %}">
|
||||
<span class="star-rating-stars">
|
||||
{%- for index in range(stars|int) -%}
|
||||
<a class="icon icon-star rating-star" id="star-{{index}}" href="/rating/{{ package.type }}/{{ package.name }}/{{ index + 1 }}"></a>
|
||||
<a class="icon icon-star rating-star" id="star-{{index}}" href="{{ h.url_for(controller='ckanext.rating.controller:RatingController', action=action, package=package.name, rating=index+1) }}"></a>
|
||||
{%- endfor -%}
|
||||
{%- for index in range(stars|int, 5) -%}
|
||||
<a class="icon icon-star-empty rating-star" href="/rating/{{ package.type }}/{{ package.name }}/{{ index + 1 }}"></a>
|
||||
<a class="icon icon-star-empty rating-star" href="{{ h.url_for(controller='ckanext.rating.controller:RatingController', action=action, package=package.name, rating=index+1) }}"></a>
|
||||
{%- endfor -%}
|
||||
</span>
|
||||
</span>
|
||||
|
|
Loading…
Reference in New Issue