diff --git a/ckanext/odsh/assets/odsh.css b/ckanext/odsh/assets/odsh.css index b0b55aeb07582e69bc147b52a748a460559903bf..405b4a3a2ffedcebc829f8043b6c5d2b67c36e73 100644 --- a/ckanext/odsh/assets/odsh.css +++ b/ckanext/odsh/assets/odsh.css @@ -1711,19 +1711,6 @@ body { text-decoration: none } -.resource-title p:first-of-type { - font-size: 12px; - letter-spacing: 0.12px; - padding-top: 12px; - margin-bottom: 0; -} - -.resource-title p { - font-size: 12px; - letter-spacing: 0.12px; - padding-top: 0; -} - .resource-title-container { display: flex; justify-content: space-between; @@ -1735,13 +1722,12 @@ body { background-color: var(--odsh-color-sh-blue) !important; } -.resource-description-container { - margin-top: 8px; -} - -.resource-description-container .description { - line-height: 1.3; - color: black; +.resource-description { + width: 100%; + font-size: 12px; + letter-spacing: 0.12px; + padding-top: 12px; + margin-bottom: 0; } .is-table-row .resource-details-left { diff --git a/ckanext/odsh/templates/package/snippets/resource_item.html b/ckanext/odsh/templates/package/snippets/resource_item.html index aa68b3f3413469047988edd25fa79aca3c6d7396..de74bf62b25e26653f9c339d9218177aeb5fd95a 100644 --- a/ckanext/odsh/templates/package/snippets/resource_item.html +++ b/ckanext/odsh/templates/package/snippets/resource_item.html @@ -12,36 +12,45 @@ <div class="resource-title-container"> <div class="resource-title" title="{{ rtitle }}"> {% if res.name %} - <a href="{{ download }}" title="{{ res.name or res.description }}"> - {{ h.resource_display_name(res) | truncate(50) }} - </a> - {% endif %} - {% if resource_size %} - <p>{{ _('File size') }}: {{ resource_size }}</p> - {% endif %} - {% set number_of_pages = res.get('number_of_pages') %} - {% if number_of_pages%} - <p>{{ _('Number of pages') }}: {{ number_of_pages }}</p> + <a href="{{ download }}" title="{{ res.name }}"> + {{ h.resource_display_name(res) | truncate(50) }} + </a> {% endif %} + {% block resource_item_description %} + <div class="resource-description"> + {% if res.description %} + <p class="description"> + {{ h.markdown_extract(res.description, extract_length=80) }} + </p> + {% endif %} + {% if resource_size %} + <p>{{ _('File size') }}: {{ resource_size }}</p> + {% endif %} + {% set number_of_pages = res.get('number_of_pages') %} + {% if number_of_pages%} + <p>{{ _('Number of pages') }}: {{ number_of_pages }}</p> + {% endif %} + </div> + {% endblock %} </div> <div class="resource-icons"> {% block resource_item_explore_links %} - <a href="{{ download }}" aria-label="{{ _('download file') }}"> - <div aria-hidden="true" class="icon icon-download"></div> - </a> - {% if can_edit %} - <a href="{{ h.url_for('resource.edit', id=pkg.name, resource_id=res.id) }}"> - <div class="icon icon-edit"></div> - </a> - {% endif %} + <a href="{{ download }}" aria-label="{{ _('download file') }}"> + <div aria-hidden="true" class="icon icon-download"></div> + </a> + {% if can_edit %} + <a href="{{ h.url_for('resource.edit', id=pkg.name, resource_id=res.id) }}"> + <div class="icon icon-edit"></div> + </a> + {% endif %} {% endblock %} </div> {% if res_format %} - <a href="{{ download }}"> - <div class="badge badge-default dataformat-label resource-dataformat-label" property="dc:format" - data-format="{{ res.format.lower() or 'data' }}" style='font-size:{{150/(res_format|length)}}px'>{{ res_format - }}</div> - </a> + <a href="{{ download }}"> + <div class="badge badge-default dataformat-label resource-dataformat-label" property="dc:format" + data-format="{{ res.format.lower() or 'data' }}" style='font-size:{{150/(res_format|length)}}px'>{{ res_format + }}</div> + </a> {% endif %} </div> </li>