diff --git a/.tx/config b/.tx/config new file mode 100644 index 0000000..769ad2d --- /dev/null +++ b/.tx/config @@ -0,0 +1,8 @@ +[main] +host = https://www.transifex.com + +[sixodp.ckanext-rating] +file_filter = i18n//LC_MESSAGES/ckanext-rating.po +source_file = i18n/ckanext-rating.pot +source_lang = en +type = PO \ No newline at end of file diff --git a/ckanext/rating/public/css/rating.css b/ckanext/rating/public/css/rating.css index fe3a57f..7071808 100644 --- a/ckanext/rating/public/css/rating.css +++ b/ckanext/rating/public/css/rating.css @@ -1,3 +1,15 @@ +.rating { + margin: 20px 0; +} + +.rating-container { + margin-bottom: 20px; +} + +.rating-star { + font-size: 1.5em; +} + a.rating-star-hover, a.rating-star-hover:hover { color: #a38729; diff --git a/ckanext/rating/templates/package/snippets/info.html b/ckanext/rating/templates/package/snippets/info.html index 73fe9c6..fd15140 100644 --- a/ckanext/rating/templates/package/snippets/info.html +++ b/ckanext/rating/templates/package/snippets/info.html @@ -18,17 +18,25 @@ Example:

{{ h.dataset_display_name(pkg) }}

{% endblock %} {% block rating %} -

- {% snippet "rating/stars_inactive.html", package=pkg %} -

- {% endblock %} - {% block user_rating %} - {{ _('Your rating') }} -

- {%- snippet "rating/stars.html", package=pkg -%} - {%- snippet "rating/rating_description.html", rating=h.get_user_rating(pkg.id) -%} -

+
+ {% block general_rating %} + {{ _('Rating') }} +
+ {% snippet "rating/stars_inactive.html", package=pkg %} +
+ {% endblock %} + {% block user_rating %} + {{ _('Your rating') }} +
+ {%- snippet "rating/stars.html", package=pkg -%} + + {%- snippet "rating/rating_description.html", rating=h.get_user_rating(pkg.id) -%} + +
+ {% endblock %} +
{% endblock %} + {% block nums %}
diff --git a/ckanext/rating/templates/rating/stars.html b/ckanext/rating/templates/rating/stars.html index 122f7b1..7383c2b 100644 --- a/ckanext/rating/templates/rating/stars.html +++ b/ckanext/rating/templates/rating/stars.html @@ -15,10 +15,10 @@ package - The package for which the rating belongs to {%- for index in range(stars|int) -%} - + {%- endfor -%} {%- for index in range(stars|int, 5) -%} - + {%- endfor -%} diff --git a/ckanext/rating/templates/rating/stars_inactive.html b/ckanext/rating/templates/rating/stars_inactive.html index ff4ebc4..b14ffe6 100644 --- a/ckanext/rating/templates/rating/stars_inactive.html +++ b/ckanext/rating/templates/rating/stars_inactive.html @@ -12,11 +12,13 @@ stars - The number of stars to be displayed. {%- for index in range(stars|int) -%} - + {%- endfor -%} {%- for index in range(stars|int, 5) -%} - + {%- endfor -%} -{{ ratings_count }} {{ _('rating') if ratings_count == 1 else _('ratings') }} \ No newline at end of file + + {{ ratings_count }} {{ _('rating') if ratings_count == 1 else _('ratings') }} + \ No newline at end of file diff --git a/i18n/ckanext-rating.pot b/i18n/ckanext-rating.pot new file mode 100644 index 0000000..b3360bf --- /dev/null +++ b/i18n/ckanext-rating.pot @@ -0,0 +1,120 @@ +# Translations template for ckanext-rating. +# Copyright (C) 2016 ORGANIZATION +# This file is distributed under the same license as the ckanext-rating project. +# FIRST AUTHOR , 2016. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: ckanext-rating 0.0.1\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2016-11-22 11:39+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.3.4\n" + +#: ckanext/rating/logic/action.py:29 +msgid "You must supply a package id or name (parameter \"package\")." +msgstr "" + +#: ckanext/rating/logic/action.py:32 +msgid "You must supply a rating (parameter \"rating\")." +msgstr "" + +#: ckanext/rating/logic/action.py:37 +msgid "Rating must be an integer value." +msgstr "" + +#: ckanext/rating/logic/action.py:41 +#, python-format +msgid "Rating must be between %i and %i." +msgstr "" + +#: ckanext/rating/logic/action.py:44 +msgid "Not found" +msgstr "" + +#: ckanext/rating/logic/action.py:59 +msgid "You must supply a package id (parameter \"package_id\")." +msgstr "" + +#: ckanext/rating/templates/package/snippets/info.html:26 +#: ckanext/rating/templates/showcase/snippets/showcase_info.html:17 +msgid "Your rating" +msgstr "" + +#: ckanext/rating/templates/package/snippets/info.html:35 +msgid "Followers" +msgstr "" + +#: ckanext/rating/templates/rating/rating_description.html:10 +msgid "no rating given" +msgstr "" + +#: ckanext/rating/templates/rating/rating_description.html:12 +msgid "bad" +msgstr "" + +#: ckanext/rating/templates/rating/rating_description.html:14 +msgid "passable" +msgstr "" + +#: ckanext/rating/templates/rating/rating_description.html:16 +msgid "ok" +msgstr "" + +#: ckanext/rating/templates/rating/rating_description.html:18 +msgid "good" +msgstr "" + +#: ckanext/rating/templates/rating/rating_description.html:20 +msgid "excellent" +msgstr "" + +#: ckanext/rating/templates/rating/stars_inactive.html:22 +msgid "rating" +msgstr "" + +#: ckanext/rating/templates/rating/stars_inactive.html:22 +msgid "ratings" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_info.html:8 +msgid "Submitted by" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_info.html:26 +msgid "Launch website" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:19 +msgid "This showcase has no description" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:24 +msgid "{num} Dataset" +msgid_plural "{num} Datasets" +msgstr[0] "" +msgstr[1] "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:26 +msgid "0 Datasets" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:30 +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:31 +msgid "View {showcase_title}" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:35 +msgid "Remove" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:35 +msgid "Remove dataset from this showcase" +msgstr "" + diff --git a/i18n/en_GB/LC_MESSAGES/ckanext-rating.po b/i18n/en_GB/LC_MESSAGES/ckanext-rating.po new file mode 100644 index 0000000..2f7d942 --- /dev/null +++ b/i18n/en_GB/LC_MESSAGES/ckanext-rating.po @@ -0,0 +1,120 @@ +# Translations template for ckanext-rating. +# Copyright (C) 2016 ORGANIZATION +# This file is distributed under the same license as the ckanext-rating project. +# FIRST AUTHOR , 2016. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: ckanext-rating 0.0.1\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2016-11-22 11:39+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Language-Team: English (United Kingdom) (https://www.transifex.com/6aika-dataportal/teams/68018/en_GB/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.3.4\n" +"Language: en_GB\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: ckanext/rating/logic/action.py:29 +msgid "You must supply a package id or name (parameter \"package\")." +msgstr "" + +#: ckanext/rating/logic/action.py:32 +msgid "You must supply a rating (parameter \"rating\")." +msgstr "" + +#: ckanext/rating/logic/action.py:37 +msgid "Rating must be an integer value." +msgstr "" + +#: ckanext/rating/logic/action.py:41 +#, python-format +msgid "Rating must be between %i and %i." +msgstr "" + +#: ckanext/rating/logic/action.py:44 +msgid "Not found" +msgstr "" + +#: ckanext/rating/logic/action.py:59 +msgid "You must supply a package id (parameter \"package_id\")." +msgstr "" + +#: ckanext/rating/templates/package/snippets/info.html:26 +#: ckanext/rating/templates/showcase/snippets/showcase_info.html:17 +msgid "Your rating" +msgstr "" + +#: ckanext/rating/templates/package/snippets/info.html:35 +msgid "Followers" +msgstr "" + +#: ckanext/rating/templates/rating/rating_description.html:10 +msgid "no rating given" +msgstr "" + +#: ckanext/rating/templates/rating/rating_description.html:12 +msgid "bad" +msgstr "" + +#: ckanext/rating/templates/rating/rating_description.html:14 +msgid "passable" +msgstr "" + +#: ckanext/rating/templates/rating/rating_description.html:16 +msgid "ok" +msgstr "" + +#: ckanext/rating/templates/rating/rating_description.html:18 +msgid "good" +msgstr "" + +#: ckanext/rating/templates/rating/rating_description.html:20 +msgid "excellent" +msgstr "" + +#: ckanext/rating/templates/rating/stars_inactive.html:22 +msgid "rating" +msgstr "" + +#: ckanext/rating/templates/rating/stars_inactive.html:22 +msgid "ratings" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_info.html:8 +msgid "Submitted by" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_info.html:26 +msgid "Launch website" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:19 +msgid "This showcase has no description" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:24 +msgid "{num} Dataset" +msgid_plural "{num} Datasets" +msgstr[0] "" +msgstr[1] "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:26 +msgid "0 Datasets" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:30 +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:31 +msgid "View {showcase_title}" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:35 +msgid "Remove" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:35 +msgid "Remove dataset from this showcase" +msgstr "" diff --git a/i18n/fi/LC_MESSAGES/ckanext-rating.po b/i18n/fi/LC_MESSAGES/ckanext-rating.po new file mode 100644 index 0000000..f569141 --- /dev/null +++ b/i18n/fi/LC_MESSAGES/ckanext-rating.po @@ -0,0 +1,121 @@ +# Translations template for ckanext-rating. +# Copyright (C) 2016 ORGANIZATION +# This file is distributed under the same license as the ckanext-rating project. +# FIRST AUTHOR , 2016. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: ckanext-rating 0.0.1\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2016-11-22 11:39+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Mikko Nieminen , 2016\n" +"Language-Team: Finnish (https://www.transifex.com/6aika-dataportal/teams/68018/fi/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.3.4\n" +"Language: fi\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: ckanext/rating/logic/action.py:29 +msgid "You must supply a package id or name (parameter \"package\")." +msgstr "" + +#: ckanext/rating/logic/action.py:32 +msgid "You must supply a rating (parameter \"rating\")." +msgstr "" + +#: ckanext/rating/logic/action.py:37 +msgid "Rating must be an integer value." +msgstr "" + +#: ckanext/rating/logic/action.py:41 +#, python-format +msgid "Rating must be between %i and %i." +msgstr "" + +#: ckanext/rating/logic/action.py:44 +msgid "Not found" +msgstr "" + +#: ckanext/rating/logic/action.py:59 +msgid "You must supply a package id (parameter \"package_id\")." +msgstr "" + +#: ckanext/rating/templates/package/snippets/info.html:26 +#: ckanext/rating/templates/showcase/snippets/showcase_info.html:17 +msgid "Your rating" +msgstr "Antamasi arvosana" + +#: ckanext/rating/templates/package/snippets/info.html:35 +msgid "Followers" +msgstr "" + +#: ckanext/rating/templates/rating/rating_description.html:10 +msgid "no rating given" +msgstr "arvostelua ei annettu" + +#: ckanext/rating/templates/rating/rating_description.html:12 +msgid "bad" +msgstr "huono" + +#: ckanext/rating/templates/rating/rating_description.html:14 +msgid "passable" +msgstr "välttävä" + +#: ckanext/rating/templates/rating/rating_description.html:16 +msgid "ok" +msgstr "ok" + +#: ckanext/rating/templates/rating/rating_description.html:18 +msgid "good" +msgstr "hyvä" + +#: ckanext/rating/templates/rating/rating_description.html:20 +msgid "excellent" +msgstr "loistava" + +#: ckanext/rating/templates/rating/stars_inactive.html:22 +msgid "rating" +msgstr "arvostelu" + +#: ckanext/rating/templates/rating/stars_inactive.html:22 +msgid "ratings" +msgstr "arvostelua" + +#: ckanext/rating/templates/showcase/snippets/showcase_info.html:8 +msgid "Submitted by" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_info.html:26 +msgid "Launch website" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:19 +msgid "This showcase has no description" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:24 +msgid "{num} Dataset" +msgid_plural "{num} Datasets" +msgstr[0] "" +msgstr[1] "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:26 +msgid "0 Datasets" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:30 +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:31 +msgid "View {showcase_title}" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:35 +msgid "Remove" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:35 +msgid "Remove dataset from this showcase" +msgstr "" diff --git a/i18n/sv/LC_MESSAGES/ckanext-rating.po b/i18n/sv/LC_MESSAGES/ckanext-rating.po new file mode 100644 index 0000000..c2122aa --- /dev/null +++ b/i18n/sv/LC_MESSAGES/ckanext-rating.po @@ -0,0 +1,120 @@ +# Translations template for ckanext-rating. +# Copyright (C) 2016 ORGANIZATION +# This file is distributed under the same license as the ckanext-rating project. +# FIRST AUTHOR , 2016. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: ckanext-rating 0.0.1\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2016-11-22 11:39+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Language-Team: Swedish (https://www.transifex.com/6aika-dataportal/teams/68018/sv/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.3.4\n" +"Language: sv\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: ckanext/rating/logic/action.py:29 +msgid "You must supply a package id or name (parameter \"package\")." +msgstr "" + +#: ckanext/rating/logic/action.py:32 +msgid "You must supply a rating (parameter \"rating\")." +msgstr "" + +#: ckanext/rating/logic/action.py:37 +msgid "Rating must be an integer value." +msgstr "" + +#: ckanext/rating/logic/action.py:41 +#, python-format +msgid "Rating must be between %i and %i." +msgstr "" + +#: ckanext/rating/logic/action.py:44 +msgid "Not found" +msgstr "" + +#: ckanext/rating/logic/action.py:59 +msgid "You must supply a package id (parameter \"package_id\")." +msgstr "" + +#: ckanext/rating/templates/package/snippets/info.html:26 +#: ckanext/rating/templates/showcase/snippets/showcase_info.html:17 +msgid "Your rating" +msgstr "" + +#: ckanext/rating/templates/package/snippets/info.html:35 +msgid "Followers" +msgstr "" + +#: ckanext/rating/templates/rating/rating_description.html:10 +msgid "no rating given" +msgstr "" + +#: ckanext/rating/templates/rating/rating_description.html:12 +msgid "bad" +msgstr "" + +#: ckanext/rating/templates/rating/rating_description.html:14 +msgid "passable" +msgstr "" + +#: ckanext/rating/templates/rating/rating_description.html:16 +msgid "ok" +msgstr "" + +#: ckanext/rating/templates/rating/rating_description.html:18 +msgid "good" +msgstr "" + +#: ckanext/rating/templates/rating/rating_description.html:20 +msgid "excellent" +msgstr "" + +#: ckanext/rating/templates/rating/stars_inactive.html:22 +msgid "rating" +msgstr "" + +#: ckanext/rating/templates/rating/stars_inactive.html:22 +msgid "ratings" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_info.html:8 +msgid "Submitted by" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_info.html:26 +msgid "Launch website" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:19 +msgid "This showcase has no description" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:24 +msgid "{num} Dataset" +msgid_plural "{num} Datasets" +msgstr[0] "" +msgstr[1] "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:26 +msgid "0 Datasets" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:30 +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:31 +msgid "View {showcase_title}" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:35 +msgid "Remove" +msgstr "" + +#: ckanext/rating/templates/showcase/snippets/showcase_item.html:35 +msgid "Remove dataset from this showcase" +msgstr "" diff --git a/setup.py b/setup.py index bfd063d..83b2335 100644 --- a/setup.py +++ b/setup.py @@ -83,5 +83,13 @@ setup( [paste.paster_command] rating=ckanext.rating.commands:RatingCommand - ''' + ''', + + message_extractors={ + 'ckanext': [ + ('**.py', 'python', None), + ('**.js', 'javascript', None), + ('**/templates/**.html', 'ckan', None), + ], + } )