From b6341159bd233c4c7f47a51972b6112af6e57e2b Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Wed, 8 Jul 2020 08:56:45 +1200 Subject: [PATCH 1/6] [DQL-211] Theme check for reporting plugin enabled - Added helper function to check if `data_qld_reporting` plugin is enabled just in case `data-qld-theme` extension is deployed without adding `data_qld_reporting` to `ckan.plugins` in the `ini` file --- ckanext/data_qld_theme/plugin.py | 5 +++++ ckanext/data_qld_theme/templates/user/dashboard.html | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ckanext/data_qld_theme/plugin.py b/ckanext/data_qld_theme/plugin.py index d5e54807..54893717 100644 --- a/ckanext/data_qld_theme/plugin.py +++ b/ckanext/data_qld_theme/plugin.py @@ -36,6 +36,10 @@ def get_comment_notification_recipients_enabled(): return config.get('ckan.comments.follow_mute_enabled', False) +def is_reporting_enabled(): + return 'data_qld_reporting' in config.get('ckan.plugins', '') + + def is_request_for_resource(): """ Searching for a url path for /dataset/ and /resource/ @@ -147,4 +151,5 @@ def get_helpers(self): 'comment_notification_recipients_enabled': get_comment_notification_recipients_enabled, 'populate_revision': populate_revision, 'unreplied_comments_x_days': unreplied_comments_x_days, + 'is_reporting_enabled': is_reporting_enabled } diff --git a/ckanext/data_qld_theme/templates/user/dashboard.html b/ckanext/data_qld_theme/templates/user/dashboard.html index a28ced7d..8095495d 100644 --- a/ckanext/data_qld_theme/templates/user/dashboard.html +++ b/ckanext/data_qld_theme/templates/user/dashboard.html @@ -10,7 +10,7 @@ {{ h.build_nav_icon('dashboard.datasets', _('My Datasets')) }} {{ h.build_nav_icon('dashboard.organizations', _('My Organizations')) }} {{ h.build_nav_icon('dashboard.groups', _('My Groups')) }} - {% if h.check_access('has_user_permission_for_some_org', {'permission': 'create_dataset'}) %} + {% if h.is_reporting_enabled() and h.check_access('has_user_permission_for_some_org', {'permission': 'create_dataset'}) %} {{ h.build_nav_icon('dashboard.reports', _('My Reports')) }} {% endif %} From 8feac8fb324a39c378872b8f73a7922de5d3554f Mon Sep 17 00:00:00 2001 From: MarkCalvert <37602611+MarkCalvert@users.noreply.github.com> Date: Thu, 9 Jul 2020 16:49:09 -0600 Subject: [PATCH 2/6] Removed logic to exclude 'openness' report name. (#11) This report name is changed using a language file, so will not exist. Refactored qa templates into snippets folder Co-authored-by: Mark Calvert --- .../templates/qa/openness_stars.html | 11 +------ .../templates/qa/openness_stars_brief.html | 11 +------ .../qa/snippets/data_usability_rating.html | 10 ++++++ .../templates/qa/{ => snippets}/stars.html | 0 .../qa/{ => snippets}/stars_explained.html | 0 .../templates/report/index.html | 33 +++++++++---------- 6 files changed, 27 insertions(+), 38 deletions(-) create mode 100644 ckanext/data_qld_theme/templates/qa/snippets/data_usability_rating.html rename ckanext/data_qld_theme/templates/qa/{ => snippets}/stars.html (100%) rename ckanext/data_qld_theme/templates/qa/{ => snippets}/stars_explained.html (100%) diff --git a/ckanext/data_qld_theme/templates/qa/openness_stars.html b/ckanext/data_qld_theme/templates/qa/openness_stars.html index 632e24ee..8f7b88c6 100644 --- a/ckanext/data_qld_theme/templates/qa/openness_stars.html +++ b/ckanext/data_qld_theme/templates/qa/openness_stars.html @@ -18,13 +18,4 @@ "updated": "2015-11-19T16:54:49.480393", #} -
- {% if openness_score != None %} - - {{ _('Data usability rating') }} - : {% snippet "qa/stars.html", stars=openness_score %}
- {% snippet "qa/stars_explained.html", openness_score=openness_score %}
- {% else %} - {{ _('No data usability rating information yet.') }} - {% endif %} -
+{% snippet 'qa/snippets/data_usability_rating.html', openness_score=openness_score%} diff --git a/ckanext/data_qld_theme/templates/qa/openness_stars_brief.html b/ckanext/data_qld_theme/templates/qa/openness_stars_brief.html index a10f1bd0..6955d56d 100644 --- a/ckanext/data_qld_theme/templates/qa/openness_stars_brief.html +++ b/ckanext/data_qld_theme/templates/qa/openness_stars_brief.html @@ -18,13 +18,4 @@ "updated": "2015-11-19T16:54:49.480393", #} -
- {% if openness_score != None %} - - {{ _('Data usability rating') }} - : {% snippet "qa/stars.html", stars=openness_score %}
- {% snippet "qa/stars_explained.html", openness_score=openness_score %}
- {% else %} - {{ _('No data usability rating information yet.') }} - {% endif %} -
+{% snippet 'qa/snippets/data_usability_rating.html', openness_score=openness_score%} diff --git a/ckanext/data_qld_theme/templates/qa/snippets/data_usability_rating.html b/ckanext/data_qld_theme/templates/qa/snippets/data_usability_rating.html new file mode 100644 index 00000000..e812115b --- /dev/null +++ b/ckanext/data_qld_theme/templates/qa/snippets/data_usability_rating.html @@ -0,0 +1,10 @@ +
+ {% if openness_score != None %} + + {{ _('Data usability rating') }} + : {% snippet "qa/snippets/stars.html", stars=openness_score %}
+ {% snippet "qa/snippets/stars_explained.html", openness_score=openness_score %}
+ {% else %} + {{ _('No data usability rating information yet.') }} + {% endif %} +
diff --git a/ckanext/data_qld_theme/templates/qa/stars.html b/ckanext/data_qld_theme/templates/qa/snippets/stars.html similarity index 100% rename from ckanext/data_qld_theme/templates/qa/stars.html rename to ckanext/data_qld_theme/templates/qa/snippets/stars.html diff --git a/ckanext/data_qld_theme/templates/qa/stars_explained.html b/ckanext/data_qld_theme/templates/qa/snippets/stars_explained.html similarity index 100% rename from ckanext/data_qld_theme/templates/qa/stars_explained.html rename to ckanext/data_qld_theme/templates/qa/snippets/stars_explained.html diff --git a/ckanext/data_qld_theme/templates/report/index.html b/ckanext/data_qld_theme/templates/report/index.html index f0b064e7..e03b69fd 100644 --- a/ckanext/data_qld_theme/templates/report/index.html +++ b/ckanext/data_qld_theme/templates/report/index.html @@ -11,27 +11,24 @@
{% for report in reports %} - - {% if report.name != 'openness' %} - {% if loop.index0%4==0 %}
{% endif %} - {% if loop.index0%3==0 %}
{% endif %} - {% if loop.index0%2==0 %}
{% endif %} - From 1ea50cfbcf6f895184119a93b8033fa597203950 Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Thu, 30 Jul 2020 15:32:08 +1200 Subject: [PATCH 3/6] [DQL2-62] Hide "Follow comments" button if no comments. --- .../data_qld_theme/templates/package/comment_list.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ckanext/data_qld_theme/templates/package/comment_list.html b/ckanext/data_qld_theme/templates/package/comment_list.html index 63ec670f..a70dab10 100644 --- a/ckanext/data_qld_theme/templates/package/comment_list.html +++ b/ckanext/data_qld_theme/templates/package/comment_list.html @@ -54,6 +54,11 @@

Reply to comment:

{% endmacro %} {% macro comment_thread(thread, content_type, depth=0) %} + + {% if thread.comments | length > 0 and notification_actions_enabled %} + {% snippet "snippets/content_item_notification_actions.html", following=following_content_item, content_type=content_type, thread_id=thread.id %} + {% endif %} + {% for comment in thread.comments %}
{% set user_can_manage = h.user_can_manage_comments(content_type, pkg_id) %} @@ -150,10 +155,6 @@

{{ comment.subject }}

{{ _('Comments') }}

-{% if notification_actions_enabled %} - {% snippet "snippets/content_item_notification_actions.html", following=following_content_item, content_type=content_type, thread_id=thread.id %} -{% endif %} -
{{ comment_thread(thread, content_type) }}
From 85c9ded6af0bfefaf432f5e01de38c48b4dc904a Mon Sep 17 00:00:00 2001 From: Mark Calvert Date: Thu, 30 Jul 2020 11:51:44 -0600 Subject: [PATCH 4/6] Updated tick svg files which are smaller in size and dimensions Added missing properties to snippet 'data_usability_rating.html' --- ckanext/data_qld_theme/public/tick_green.svg | 4080 +---------------- ckanext/data_qld_theme/public/tick_grey.svg | 2273 +-------- .../templates/qa/openness_stars.html | 2 +- .../templates/qa/openness_stars_brief.html | 2 +- 4 files changed, 62 insertions(+), 6295 deletions(-) diff --git a/ckanext/data_qld_theme/public/tick_green.svg b/ckanext/data_qld_theme/public/tick_green.svg index ba199ed0..8b01f9cf 100644 --- a/ckanext/data_qld_theme/public/tick_green.svg +++ b/ckanext/data_qld_theme/public/tick_green.svg @@ -1,4047 +1,41 @@ - +CXBIWXMAAC4jAAAuIwF4pT92AAAHB0lEQVRIx72XaWwV1xXHfzPzdm/4Gds4BmMMGMdgMFtIDSWs +DVm6hEVtUympqqYRJY3orqTiQxtV+QBf0oi0UvshEVQpSVBQ3RZViiGBY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F1Irth9Dth +FNP4yLbUV9sP9TKaF4zmBWfeGcDqU39qeTlBACjhxl/i3drnHzstN48FN5GtSl5W+5KbPmqNrLRU +A7V7/LDtZx9p950Ejvb+j4Os57ZPdOCM09sesErsLbGTQx32pJWWStluTwlWuDDW3aVnyv4FFwMi +Ur3mOeEAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjAtMDctMzBUMDk6Mzc6MjYrMDM6MDDa01wEAAAA +JXRFWHRkYXRlOm1vZGlmeQAyMDIwLTA3LTMwVDA5OjM3OjI2KzAzOjAwq47kuAAAAABJRU5ErkJg +gg==" /> diff --git a/ckanext/data_qld_theme/public/tick_grey.svg b/ckanext/data_qld_theme/public/tick_grey.svg index 86e6cfdc..d0c3b432 100644 --- a/ckanext/data_qld_theme/public/tick_grey.svg +++ b/ckanext/data_qld_theme/public/tick_grey.svg @@ -1,2254 +1,27 @@ - +cwAADsQAAA7EAZUrDhsAAAQYSURBVEjHnZJ7bJNlFMZ/39ev7Qrt2l0ZjF1wygaoG9cyJUQxhKlE +SeSqkQCREAmIiSEjEsdgMQJK4gg3HVHiCAIiEFFuggpBubgBQZSGuS1AdmOUrqwd3bfuO/4xNHUr +xu19/jt5z+99znkfZSqJ1GMQRkHFQiOtOLDSgE4GGk3EYMegE43++KnlEUKEGEALGoL/jadWB/ap +9PEoCC34yt/+5KMU21t9xhi0aHhKnl82tVz9trCPGIO64en61tDcxB2la4/dX98HjEoHt2fl/b55 +f0HeyeOrhvgKoJcYBeE2wQ2zd39cMnL65fUrJ99MAwOtt5Cg4vx5cf6SGfZ91TPfX17xoqXRDL3B +KHTSPCTHUyizsvSaxqzNe46ucx6OQejFUCo6N156tKa0co7tbo2fL/7cecG5IhYrMcR0uZH/AQng +XTPxvaKNw5bdQuP02TKa3RqmB73a/eQ6d9sh638Oo3KXju9mv7B8fsqOWlQ8H2wY3zA8BeWfO9rI +yvzBX9VfnRf7vSWiHAkJ4x2gXlmSvHCU7VIVQuu0dSuuzHVck4gp1ObYSQ1bvpx2PLzbbw5HAenc +fS6usdi/1GG+dJ17GIPLDpzfbik36IiQen1U0cC4ipK0VQVZuvf1+xj/chKivdB94sNdM4bqgRru +4GBX9d4/LAsTcBAbIfIZtmidSLpQv7lI3OczB2WQRz6ZpJBD9sFFUrNYCOLhBB62nc4UNAWtm3Dj +ZsLRr0UQZPQ3N1+WtKKhjGMQrvjs2mLxTRACVHGMK+xfkSsJo9NJJ62beI05TGGKVFwSBKHu3dXy +eH1m1oDsXPnsVjjeIEA1h6nklHuiaEvjSCSph8gljydIffIVubOqCyQDD515WsbLkf1COwFqOcRp +fo15VeIPuognnrgeUiYDgoa30L12Y75yrmu5l9/xOZ8tagOa+I1+JLOj9tNYS4LzIVFVFjwImI+q +C/PHLov4cR/9qacSM+kc/7x0nj/R5DWiZktFq/w7h4Tyt4azfyp4xkDoJIidOs6hMJjKBTvn3Suw +eJWHeBFMbly4cOFgkJhO/rB6bDDllxYEG7e4gEEqt3NLj3hKTNs7CWN0UyeC0I5p0oMAOXHgvHnD +frF4woG4Jh8dXKaNgYhWVn/xTGhuV0N3jBBCMKOMjrCmEab52tScYkWnhWqEJHZdLX/MbLU8ZBgL +rbRiQwtFlEOYSBz3473UY/OnhFBI4tSmvSNaM4i6WMGMHQUVMCV137oePHu1OKMptULFM3Pbev/0 +fudsxPSQjX7oqKjoaChjeryh4t2S/uYaNcxK4+wm+1JrlP8RFOLwE8BGACvKiCh22wlWTXe0WfbU +2Md0RN2KiXYMNHQsXZhol1RiXfENgdb+yS4kalY02mjCQMdKACt/Ae92uPetB/GKAAAAJXRFWHRk +YXRlOmNyZWF0ZQAyMDIwLTA3LTMwVDA5OjM5OjA3KzAzOjAwIEhgfgAAACV0RVh0ZGF0ZTptb2Rp +ZnkAMjAyMC0wNy0zMFQwOTozOTowNyswMzowMFEV2MIAAAAASUVORK5CYII=" /> diff --git a/ckanext/data_qld_theme/templates/qa/openness_stars.html b/ckanext/data_qld_theme/templates/qa/openness_stars.html index 8f7b88c6..3746f5c6 100644 --- a/ckanext/data_qld_theme/templates/qa/openness_stars.html +++ b/ckanext/data_qld_theme/templates/qa/openness_stars.html @@ -18,4 +18,4 @@ "updated": "2015-11-19T16:54:49.480393", #} -{% snippet 'qa/snippets/data_usability_rating.html', openness_score=openness_score%} +{% snippet 'qa/snippets/data_usability_rating.html', openness_score=openness_score, openness_score_reason=openness_score_reason, updated=updated %} diff --git a/ckanext/data_qld_theme/templates/qa/openness_stars_brief.html b/ckanext/data_qld_theme/templates/qa/openness_stars_brief.html index 6955d56d..a5172fc8 100644 --- a/ckanext/data_qld_theme/templates/qa/openness_stars_brief.html +++ b/ckanext/data_qld_theme/templates/qa/openness_stars_brief.html @@ -18,4 +18,4 @@ "updated": "2015-11-19T16:54:49.480393", #} -{% snippet 'qa/snippets/data_usability_rating.html', openness_score=openness_score%} +{% snippet 'qa/snippets/data_usability_rating.html', openness_score=openness_score, openness_score_reason=openness_score_reason, updated=updated %} From 341320cc342b42da381587fa3625328e607d8c56 Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Sun, 2 Aug 2020 22:45:28 +1200 Subject: [PATCH 5/6] [DQL2-62] Use Salsa repo until PR merged into qld-gov-au. --- requirements-dev.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 3f6524e6..d5effaa8 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,8 @@ flake8==3.8.3 nose==1.3.7 splinter>=0.13.0 -e git+https://github.com/qld-gov-au/ckanext-datarequests@develop#egg=ckanext-datarequests --e git+https://github.com/qld-gov-au/ckanext-data-qld@develop#egg=ckanext-data_qld +# Revert this to git+https://github.com/qld-gov-au/ckanext-data-qld@develop#egg=ckanext-data_qld once merged +-e git+https://github.com/salsa-nathan/ckanext-data-qld.git@develop#egg=ckanext-data_qld -e git+https://github.com/qld-gov-au/ckan-ex-qgov@develop#egg=ckan-ex-qgov -e git+https://github.com/ckan/ckantoolkit@release-0.0.4#egg=ckantoolkit -e git+https://github.com/ckan/ckanapi@ckanapi-4.3#egg=ckanapi From 8a2e1d5f98e075c321d3dd6cd2ff7a8192ba9a65 Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Tue, 4 Aug 2020 12:51:54 +1200 Subject: [PATCH 6/6] Update requirements-dev.txt --- requirements-dev.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d5effaa8..3f6524e6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,8 +4,7 @@ flake8==3.8.3 nose==1.3.7 splinter>=0.13.0 -e git+https://github.com/qld-gov-au/ckanext-datarequests@develop#egg=ckanext-datarequests -# Revert this to git+https://github.com/qld-gov-au/ckanext-data-qld@develop#egg=ckanext-data_qld once merged --e git+https://github.com/salsa-nathan/ckanext-data-qld.git@develop#egg=ckanext-data_qld +-e git+https://github.com/qld-gov-au/ckanext-data-qld@develop#egg=ckanext-data_qld -e git+https://github.com/qld-gov-au/ckan-ex-qgov@develop#egg=ckan-ex-qgov -e git+https://github.com/ckan/ckantoolkit@release-0.0.4#egg=ckantoolkit -e git+https://github.com/ckan/ckanapi@ckanapi-4.3#egg=ckanapi