Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Task]: Add Software Application as an asset type, identifier to UI and same-schema #202

Open
wants to merge 2 commits into
base: ckan_2.8
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions ckanext/ontario_theme/fanstatic/external/ontario_theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 7 additions & 1 deletion ckanext/ontario_theme/fanstatic/internal/labels.less
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
27 changes: 25 additions & 2 deletions ckanext/ontario_theme/fanstatic/internal/ontario_theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down
14 changes: 14 additions & 0 deletions ckanext/ontario_theme/i18n/fr/LC_MESSAGES/ckanext-ontario_theme.po
Original file line number Diff line number Diff line change
Expand Up @@ -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. <a href=\"/fr/group/about/artificial-intelligence-"
"and-algorithms\">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.</a>"

#: 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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@
"en": "Algorithm",
"fr": "Restreintes"
}
},
{
"value": "software_application",
"label": {
"en": "Software Application",
"fr": "Logiciel d’application"
}
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@
"en": "Algorithm",
"fr": "Restreintes"
}
},
{
"value": "software_application",
"label": {
"en": "Software Application",
"fr": "Logiciel d’application"
}
}
]
},
Expand Down
7 changes: 7 additions & 0 deletions ckanext/ontario_theme/templates/internal/package/read.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
This record describes an algorithm or artificial intelligence asset. It does not describe a dataset. <a href="/group/about/artificial-intelligence-and-algorithms">Learn more here about how the Government of Ontario is working to grow our catalogue beyond data for greater transparency and accountability.</a>
{% endtrans %}
</p>
</div>
{% elif pkg.get("asset_type") == "software_application" %}
<div class="new-alert alert-info alert-software_application alert-short alert-clear">
<strong>{% trans %}Software Application{% endtrans %}</strong>
<p>
{% trans %}This record describes a software application asset. It does not describe a dataset.{% endtrans %}
</p>
</div>
{% endif %}
{{ super() }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ <h3 class="dataset-heading">
{% 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" %}
<div class="label label-info">{% trans %}Algorithm/AI{% endtrans %}</div>
<div class="label label-algorithm-info">{% trans %}Algorithm/AI{% endtrans %}</div>
{% elif package.get("asset_type") == "software_application" %}
<div class="label label-software-application-info">{% trans %}Software Application{% endtrans %}</div>
{% endif %}
{% if package['harvester'] == 'ontario-data-catalogue' %}
<div class="badge badge-harvest pull-right" data-harvest={{package['harvester']}}>{% trans %}ON External{% endtrans %}</div>
Expand Down