Skip to content

Commit

Permalink
Merge pull request ckan#8690 from qld-gov-au/github-8682-humanize-gro…
Browse files Browse the repository at this point in the history
…up-type

apply 'humanize_entity_type' to the submit button on dataset group lists
  • Loading branch information
wardi authored Feb 27, 2025
2 parents 0b1c980 + e371a2f commit 79cf85c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions changes/8682.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Apply 'humanize_entity_type' helper consistently across the group listing page
8 changes: 5 additions & 3 deletions ckan/lib/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,8 @@ def humanize_entity_type(entity_type: str, object_type: str,
Possible purposes(depends on `entity_type` and change over time)::
`add link`: "Add [object]" button on search pages
`breadcrumb`: "Home / [object]s / New" section in breadcrums
`add association link`: "Add to [object]" button on dataset pages
`breadcrumb`: "Home / [object]s / New" section in breadcrumbs
`content tab`: "[object]s | Groups | Activity" tab on details page
`create label`: "Home / ... / Create [object]" part of breadcrumb
`create title`: "Create [object] - CKAN" section of page title
Expand All @@ -1051,10 +1052,10 @@ def humanize_entity_type(entity_type: str, object_type: str,
`my label`: "My [object]s" tab in dashboard
`name placeholder`: "<[object]>" section of URL preview on object form
`no any objects`: No objects created yet
`no associated label`: no gorups for dataset
`no associated label`: no groups for dataset
`no description`: object has no description
`no label`: package with no organization
`page title`: "Title - [objec]s - CKAN" section of page title
`page title`: "Title - [object]s - CKAN" section of page title
`save label`: "Save [object]" button
`search placeholder`: "Search [object]s..." placeholder
`update label`: "Update [object]" button
Expand All @@ -1075,6 +1076,7 @@ def humanize_entity_type(entity_type: str, object_type: str,
u'Humanize %s of type %s for %s', entity_type, object_type, purpose)
templates = {
u'add link': _(u"Add {object_type}"),
u'add association link': _(u"Add to {object_type}"),
u'breadcrumb': _(u"{object_type}s"),
u'content tab': _(u"{object_type}s"),
u'create label': _(u"Create {object_type}"),
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/package/group_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h2 class="hide-heading">{{ h.humanize_entity_type('group', default_group_type,
<option value="{{ option[0] }}"> {{ option[1] }}</option>
{% endfor %}
</select>
<button type="submit" class="btn btn-primary" aria-label="{{ _('Associate this group with this dataset') }}">{{ _('Add to group') }}</button>
<button type="submit" class="btn btn-primary" aria-label="{{ _('Associate this group with this dataset') }}">{{ h.humanize_entity_type('group', default_group_type, 'add association link') or _('Add to group') }}</button>
</form>
{% endif %}

Expand Down

0 comments on commit 79cf85c

Please sign in to comment.