-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[update][l]: dataset and homepage updates
- Loading branch information
1 parent
0e1b085
commit a59b0c2
Showing
10 changed files
with
162 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,3 +146,5 @@ $activityColorDelete: #B95252; | |
|
||
// Navigation | ||
$zindex-navbar: 1; | ||
|
||
$dark-overlay-color: rgba(0, 0, 0, 0.04); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,33 @@ | ||
{% ckan_extends %} | ||
{% block primary_content_inner %} | ||
|
||
{% block package_notes %} | ||
{% set licensed=['notspecified','other-at','other-closed','other-nc'] %} | ||
{% if pkg.license_id and pkg.license_id in licensed %} | ||
<div class="access-request-container"> | ||
<a class="btn btn-primary" href="{{ h.url_for('ubdc.access_request') }}" title="{{ _('Form') }}"> | ||
<i class="fa fa-key"></i> | ||
{{ _("Request data") }} | ||
</a> | ||
</div> | ||
{% endif %} | ||
|
||
{% block package_notes %} | ||
{% set licensed=['notspecified','other-at','other-closed','other-nc'] %} | ||
{% if pkg.license_id and pkg.license_id in licensed %} | ||
<div class="access-request-container"> | ||
<a class="btn btn-primary" href="{{ h.url_for('ubdc.access_request') }}" title="{{ _('Form') }}"> | ||
<i class="fa fa-key"></i> | ||
{{ _("Request data") }} | ||
</a> | ||
</div> | ||
{% endif %} | ||
{% block package_resources %} | ||
{% snippet "package/snippets/resources_list.html", pkg=pkg, resources=pkg.resources, is_activity_archive=is_activity_archive %} | ||
{% endblock %} | ||
|
||
{% if pkg.notes %} | ||
<div class="notes embedded-content"> | ||
{{ h.render_markdown(h.get_translated(pkg, 'notes')) }} | ||
</div> | ||
{% endif %} | ||
{% endblock %} | ||
{% if pkg.notes %} | ||
<div class="notes embedded-content"> | ||
{{ h.render_markdown(h.get_translated(pkg, 'notes')) }} | ||
</div> | ||
{% endif %} | ||
{% endblock %} | ||
{% block package_tags %} | ||
{% snippet "package/snippets/tags.html", tags=pkg.tags %} | ||
{% endblock %} | ||
|
||
{% block package_additional_info %} | ||
|
||
{{ super ()}} | ||
{% endblock %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,85 @@ | ||
{% ckan_extends %} | ||
{# | ||
Displays a single of dataset. | ||
|
||
package - A package to display. | ||
item_class - The class name to use on the list item. | ||
hide_resources - If true hides the resources (default: false). | ||
banner - If true displays a popular banner (default: false). | ||
truncate - The length to trucate the description to (default: 180) | ||
truncate_title - The length to truncate the title to (default: 80). | ||
|
||
Example: | ||
|
||
{% snippet 'snippets/package_item.html', package=c.datasets[0] %} | ||
|
||
#} | ||
{% set truncate = truncate or 180 %} | ||
{% set truncate_title = truncate_title or 80 %} | ||
{% set title = package.title or package.name %} | ||
{% set notes = h.markdown_extract(package.notes, extract_length=truncate) %} | ||
{% set ga_tag_id = ['ga-dataset-', package.name] | join('') %} | ||
|
||
{% set ga_tag_id = ['ga-dataset-', package.name] | join('') %} | ||
|
||
{% block package_item %} | ||
<li class="{{ item_class or "dataset-item" }}"> | ||
{% block content %} | ||
<a href="{{ h.url_for('%s.read' % package.type, id=package.name ) }}" title="{{ title }}"> | ||
|
||
{% block heading_title %} | ||
{{ h.link_to(h.truncate(title, truncate_title), h.url_for('%s.read' % package.type, id=package.name ), id=ga_tag_id) }} | ||
{% endblock %} | ||
|
||
|
||
{% block resources_inner %} | ||
{% for resource in h.dict_list_reduce(package.resources, 'format') %} | ||
<li> | ||
<span id={{ga_tag_id}} class="label label-default" data-format="{{ resource.lower() }}">{{ resource }}</span> | ||
</li> | ||
{% endfor %} | ||
{% endblock %} | ||
<div class="dataset-content"> | ||
{% block heading %} | ||
<h2 class="dataset-heading"> | ||
{% block heading_private %} | ||
{% if package.private %} | ||
<span class="dataset-private label label-inverse"> | ||
<i class="fa fa-lock"></i> | ||
{{ _('Private') }} | ||
</span> | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block heading_title %} | ||
{{ h.truncate(title, truncate_title) }} | ||
{% endblock %} | ||
{% block heading_meta %} | ||
{% if package.get('state', '').startswith('draft') %} | ||
<span class="label label-info">{{ _('Draft') }}</span> | ||
{% elif package.get('state', '').startswith('deleted') %} | ||
<span class="label label-danger">{{ _('Deleted') }}</span> | ||
{% endif %} | ||
{{ h.popular('recent views', package.tracking_summary.recent, min=10) if package.tracking_summary }} | ||
{% endblock %} | ||
</h2> | ||
|
||
{% endblock %} | ||
{% block banner %} | ||
{% if banner %} | ||
<span class="banner">{{ _('Popular') }}</span> | ||
{% endif %} | ||
{% endblock %} | ||
{% block notes %} | ||
{% if notes %} | ||
<div>{{ notes|urlize }}</div> | ||
{% else %} | ||
<p class="empty">{{ _("This dataset has no description") }}</p> | ||
{% endif %} | ||
{% endblock %} | ||
</div> | ||
{% block resources %} | ||
{% if package.resources and not hide_resources %} | ||
{% block resources_outer %} | ||
<ul class="dataset-resources list-unstyled"> | ||
{% block resources_inner %} | ||
{% for resource in h.dict_list_reduce(package.resources, 'format') %} | ||
<li> | ||
<span id={{ga_tag_id}} class="label label-default" data-format="{{ resource.lower() }}">{{ resource }}</span> | ||
</li> | ||
{% endfor %} | ||
{% endblock %} | ||
</ul> | ||
{% endblock %} | ||
{% endif %} | ||
{% endblock %} | ||
</a> | ||
{% endblock %} | ||
</li> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters