From 92a2008df12e2e5089794b2c5c199ab8e32b52ea Mon Sep 17 00:00:00 2001 From: Jari Voutilainen Date: Tue, 31 Jan 2017 12:21:26 +0200 Subject: [PATCH] fix url routes to use url_for instead of hard coded --- ckanext/rating/templates/rating/snippets/stars.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ckanext/rating/templates/rating/snippets/stars.html b/ckanext/rating/templates/rating/snippets/stars.html index fc5ef62..076ac8a 100644 --- a/ckanext/rating/templates/rating/snippets/stars.html +++ b/ckanext/rating/templates/rating/snippets/stars.html @@ -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) %} {%- for index in range(stars|int) -%} - + {%- endfor -%} {%- for index in range(stars|int, 5) -%} - + {%- endfor -%}