Skip to content

Commit

Permalink
apply styling
Browse files Browse the repository at this point in the history
  • Loading branch information
A-Souhei committed Oct 10, 2024
1 parent aa71cde commit 7800698
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
3 changes: 3 additions & 0 deletions ckanext/zarr/assets/css/zarr.css
Original file line number Diff line number Diff line change
Expand Up @@ -361,3 +361,6 @@
margin-right: 5px;
}

.dataset-content > h2.dataset-heading > span.badge:not(:first-of-type) {
margin-left: 5px !important;
}
2 changes: 1 addition & 1 deletion ckanext/zarr/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def get_dataset_resource_type_groups(id, dataset_type='dataset'):
choices = field['choices']
if choices:
return [
choice['label']
{'label':choice['label'], 'value':choice['value']}
for choice in choices
if choice['value'] in groups
]
Expand Down
6 changes: 3 additions & 3 deletions ckanext/zarr/templates/package/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ <h1 class="headline">{% link_for pkg.title, named_route=pkg.type ~ '.read', id=p
{{ _('Private') }}
</span>
{% endif %}
{% set resource_type_labels = h.get_dataset_resource_type_groups(pkg.id) %}
{% for label in resource_type_labels %}
<span class="badge">{{ label }}</span>
{% set resource_types = h.get_dataset_resource_type_groups(pkg.id) %}
{% for type in resource_types %}
<span class="badge resource-type-{{ type['value'] }}">{{ _(type['label']) }}</span>
{% endfor %}
<div class="description">
{%- set notes = h.render_markdown(h.get_translated(pkg, 'notes')) -%}
Expand Down
17 changes: 17 additions & 0 deletions ckanext/zarr/templates/snippets/package_item.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% ckan_extends %}


{% block heading %}
<h2 class="dataset-heading">
<a href="{{ dataset_url }}" title="{{ title }}">
{{title|truncate(80)}}
</a>
{% set resource_types = h.get_dataset_resource_type_groups(package.id) %}
{% for type in resource_types %}
<span class="badge resource-type-{{ type['value'] }}">{{ _(type['label']) }}</span>
{% endfor %}
</h2>
<div class="modified">
{{_('Modified')}} {{ h.time_ago_from_timestamp(package.metadata_modified) }}, {{ h.get_last_modifier(package.id) }}
</div>
{% endblock %}

0 comments on commit 7800698

Please sign in to comment.