From 7a54df08baba78ccd0f46e72c3d52080138604db Mon Sep 17 00:00:00 2001
From: Eric Giang
Date: Mon, 15 Nov 2021 18:54:38 -0500
Subject: [PATCH 1/2] [Task]: Add software application as an asset type
---
.../schemas/external/ontario_theme_dataset.json | 7 +++++++
.../schemas/internal/ontario_theme_dataset.json | 7 +++++++
2 files changed, 14 insertions(+)
diff --git a/ckanext/ontario_theme/schemas/external/ontario_theme_dataset.json b/ckanext/ontario_theme/schemas/external/ontario_theme_dataset.json
index 54c258095..9e5ae1aba 100644
--- a/ckanext/ontario_theme/schemas/external/ontario_theme_dataset.json
+++ b/ckanext/ontario_theme/schemas/external/ontario_theme_dataset.json
@@ -73,6 +73,13 @@
"en": "Algorithm",
"fr": "Restreintes"
}
+ },
+ {
+ "value": "software_application",
+ "label": {
+ "en": "Software Application",
+ "fr": "Application logicielle"
+ }
}
]
},
diff --git a/ckanext/ontario_theme/schemas/internal/ontario_theme_dataset.json b/ckanext/ontario_theme/schemas/internal/ontario_theme_dataset.json
index a88d943ba..fdaf06be7 100644
--- a/ckanext/ontario_theme/schemas/internal/ontario_theme_dataset.json
+++ b/ckanext/ontario_theme/schemas/internal/ontario_theme_dataset.json
@@ -90,6 +90,13 @@
"en": "Algorithm",
"fr": "Restreintes"
}
+ },
+ {
+ "value": "software_application",
+ "label": {
+ "en": "Software Application",
+ "fr": "Application logicielle"
+ }
}
]
},
From f1ed5b2b09bbc5c31e3557c0a40cb5b40ad7213b Mon Sep 17 00:00:00 2001
From: eric-giang
Date: Wed, 8 Dec 2021 16:49:43 -0500
Subject: [PATCH 2/2] [Task]: Add software application as an asset type,
identifier to UI and same-schema type
---
.../fanstatic/external/ontario_theme.css | 27 +++++++++++++++++--
.../fanstatic/internal/labels.less | 8 +++++-
.../fanstatic/internal/ontario_theme.css | 27 +++++++++++++++++--
.../fr/LC_MESSAGES/ckanext-ontario_theme.po | 14 ++++++++++
.../external/ontario_theme_dataset.json | 2 +-
.../internal/ontario_theme_dataset.json | 2 +-
.../templates/internal/package/read.html | 7 +++++
.../internal/snippets/package_item.html | 4 ++-
8 files changed, 83 insertions(+), 8 deletions(-)
diff --git a/ckanext/ontario_theme/fanstatic/external/ontario_theme.css b/ckanext/ontario_theme/fanstatic/external/ontario_theme.css
index 8a2b8d3c3..5d60e0073 100644
--- a/ckanext/ontario_theme/fanstatic/external/ontario_theme.css
+++ b/ckanext/ontario_theme/fanstatic/external/ontario_theme.css
@@ -67,6 +67,18 @@
margin-left: -7px;
color: #1080A6;
}
+.new-alert.alert-software_application::before {
+ content: "\f121";
+ margin-left: -7px;
+ color: #7B725C;
+}
+.new-alert.alert-short {
+ padding-left: 160px;
+}
+.new-alert.alert-short::before {
+ font-size: 90px;
+ line-height: 73px;
+}
.new-alert.alert-huge {
padding-left: 160px;
}
@@ -106,11 +118,16 @@
.new-alert.alert-restricted {
background-color: #fad2d2;
}
-.new-alert.alert-contact {
+.new-alert.alert-contact-algorithm {
background: #E2F0F4;
border-color: #1080A6;
padding: 0.9375rem 2rem 0.9375rem 0.9375rem;
}
+.new-alert.alert-contact-software_application {
+ background: #EBE7DB;
+ border-color: #7B725C;
+ padding: 0.9375rem 2rem 0.9375rem 0.9375rem;
+}
.new-alert.alert-clear {
margin-bottom: 30px;
}
@@ -576,12 +593,18 @@ div.card p {
.label-english_and_french {
background-color: #e6fad2;
}
-.label-info {
+.label-algorithm-info {
color: #4d4d4d;
border: solid 1px #1080A6;
border-left: solid 5px #1080A6;
background-color: #E2F0F4;
}
+.label-software-application-info {
+ color: #4d4d4d;
+ border: solid 1px #7B725C;
+ border-left: solid 5px #7B725C;
+ background-color: #EBE7DB;
+}
.label-default {
background-color: #FCAF17;
color: #fff;
diff --git a/ckanext/ontario_theme/fanstatic/internal/labels.less b/ckanext/ontario_theme/fanstatic/internal/labels.less
index 97fef4ff1..3e486b41f 100644
--- a/ckanext/ontario_theme/fanstatic/internal/labels.less
+++ b/ckanext/ontario_theme/fanstatic/internal/labels.less
@@ -115,12 +115,18 @@
.label-english_and_french {
background-color: #e6fad2;
}
-.label-info {
+.label-algorithm-info {
color: #4d4d4d;
border: solid 1px #1080A6;
border-left: solid 5px #1080A6;
background-color: #E2F0F4;
}
+.label-software-application-info {
+ color: #4d4d4d;
+ border: solid 1px #5F8129;
+ border-left: solid 5px #5F8129;
+ background-color: #8DC63F;
+}
.label-default {
background-color: @secondary-colour;
color: #fff;
diff --git a/ckanext/ontario_theme/fanstatic/internal/ontario_theme.css b/ckanext/ontario_theme/fanstatic/internal/ontario_theme.css
index fbc1b4c57..4c998b9f1 100644
--- a/ckanext/ontario_theme/fanstatic/internal/ontario_theme.css
+++ b/ckanext/ontario_theme/fanstatic/internal/ontario_theme.css
@@ -67,6 +67,18 @@
margin-left: -7px;
color: #1080A6;
}
+.new-alert.alert-software_application::before {
+ content: "\f121";
+ margin-left: -7px;
+ color: #7B725C;
+}
+.new-alert.alert-short {
+ padding-left: 160px;
+}
+.new-alert.alert-short::before {
+ font-size: 90px;
+ line-height: 73px;
+}
.new-alert.alert-huge {
padding-left: 160px;
}
@@ -106,11 +118,16 @@
.new-alert.alert-restricted {
background-color: #fad2d2;
}
-.new-alert.alert-contact {
+.new-alert.alert-algorithm {
background: #E2F0F4;
border-color: #1080A6;
padding: 0.9375rem 2rem 0.9375rem 0.9375rem;
}
+.new-alert.alert-software_application {
+ background: #EBE7DB;
+ border-color: #7B725C;
+ padding: 0.9375rem 2rem 0.9375rem 0.9375rem;
+}
.new-alert.alert-clear {
margin-bottom: 30px;
}
@@ -576,12 +593,18 @@ div.card p {
.label-english_and_french {
background-color: #e6fad2;
}
-.label-info {
+.label-algorithm-info {
color: #4d4d4d;
border: solid 1px #1080A6;
border-left: solid 5px #1080A6;
background-color: #E2F0F4;
}
+.label-software-application-info {
+ color: #4d4d4d;
+ border: solid 1px #7B725C;
+ border-left: solid 5px #7B725C;
+ background-color: #EBE7DB;
+}
.label-default {
background-color: #FCAF17;
color: #fff;
diff --git a/ckanext/ontario_theme/i18n/fr/LC_MESSAGES/ckanext-ontario_theme.po b/ckanext/ontario_theme/i18n/fr/LC_MESSAGES/ckanext-ontario_theme.po
index a17a25b4d..322153676 100644
--- a/ckanext/ontario_theme/i18n/fr/LC_MESSAGES/ckanext-ontario_theme.po
+++ b/ckanext/ontario_theme/i18n/fr/LC_MESSAGES/ckanext-ontario_theme.po
@@ -2647,10 +2647,24 @@ msgid ""
msgstr "Cet enregistrement décrit un algorithme ou actif d’intelligence artificielle. Il ne s’agit pas d’un jeu de données. Apprenez-en plus ici sur les mesures prises par le gouvernement de l’Ontario pour ajouter à notre catalogue des éléments autres que des données à des fins de transparence et de responsabilité accrues."
+#: ckanext/ontario_theme/templates/internal/package/read.html:16
+msgid "Software Application"
+msgstr "Logiciel d’application"
+
+#: ckanext/ontario_theme/templates/internal/package/read.html:18
+msgid ""
+" This record describes a software application asset. It does"
+" not describe a dataset."
+msgstr "Cette fiche décrit un logiciel d’application. Il ne s’agit pas d’un jeu de données."
+
#: ckanext/ontario_theme/templates/internal/snippets/package_item.html:10
msgid "Algorithm/AI"
msgstr "Algorithme/IA"
+#: ckanext/ontario_theme/templates/internal/snippets/package_item.html:10
+msgid "Software Application"
+msgstr "Logiciel d’application"
+
#: ckanext/ontario_theme/templates/internal/snippets/package_item.html:10
msgid "ON Geohub"
msgstr "CarrefourGéo ON"
diff --git a/ckanext/ontario_theme/schemas/external/ontario_theme_dataset.json b/ckanext/ontario_theme/schemas/external/ontario_theme_dataset.json
index 9e5ae1aba..74d9b3f37 100644
--- a/ckanext/ontario_theme/schemas/external/ontario_theme_dataset.json
+++ b/ckanext/ontario_theme/schemas/external/ontario_theme_dataset.json
@@ -78,7 +78,7 @@
"value": "software_application",
"label": {
"en": "Software Application",
- "fr": "Application logicielle"
+ "fr": "Logiciel d’application"
}
}
]
diff --git a/ckanext/ontario_theme/schemas/internal/ontario_theme_dataset.json b/ckanext/ontario_theme/schemas/internal/ontario_theme_dataset.json
index fdaf06be7..baafc708d 100644
--- a/ckanext/ontario_theme/schemas/internal/ontario_theme_dataset.json
+++ b/ckanext/ontario_theme/schemas/internal/ontario_theme_dataset.json
@@ -95,7 +95,7 @@
"value": "software_application",
"label": {
"en": "Software Application",
- "fr": "Application logicielle"
+ "fr": "Logiciel d’application"
}
}
]
diff --git a/ckanext/ontario_theme/templates/internal/package/read.html b/ckanext/ontario_theme/templates/internal/package/read.html
index 0a509694c..36d2abdcd 100644
--- a/ckanext/ontario_theme/templates/internal/package/read.html
+++ b/ckanext/ontario_theme/templates/internal/package/read.html
@@ -10,6 +10,13 @@
This record describes an algorithm or artificial intelligence asset. It does not describe a dataset. Learn more here about how the Government of Ontario is working to grow our catalogue beyond data for greater transparency and accountability.
{% endtrans %}
+
+ {% elif pkg.get("asset_type") == "software_application" %}
+
+
{% trans %}Software Application{% endtrans %}
+
+ {% trans %}This record describes a software application asset. It does not describe a dataset.{% endtrans %}
+
{% endif %}
{{ super() }}
diff --git a/ckanext/ontario_theme/templates/internal/snippets/package_item.html b/ckanext/ontario_theme/templates/internal/snippets/package_item.html
index f6d5c4658..9558ddf5c 100644
--- a/ckanext/ontario_theme/templates/internal/snippets/package_item.html
+++ b/ckanext/ontario_theme/templates/internal/snippets/package_item.html
@@ -17,7 +17,9 @@
{% block heading_title %}
{{ h.link_to(h.truncate(h.get_translated(package, 'title'), truncate_title), h.url_for(package.type + '_read', controller='package', action='read', id=package.name)) }}
{% if package.get("asset_type") == "algorithm" %}
-
{% trans %}Algorithm/AI{% endtrans %}
+ {% trans %}Algorithm/AI{% endtrans %}
+ {% elif package.get("asset_type") == "software_application" %}
+ {% trans %}Software Application{% endtrans %}
{% endif %}
{% if package['harvester'] == 'ontario-data-catalogue' %}
{% trans %}ON External{% endtrans %}