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

star vs eye #2192

Merged
merged 6 commits into from Jun 12, 2019
Merged

star vs eye #2192

Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -5,6 +5,8 @@
- Archive dataset feature [#2172](https://github.com/opendatateam/udata/pull/2172)
- Refactor breadcrum includes [#2173](https://github.com/opendatateam/udata/pull/2173)
- Better dependencies management [#2182](https://github.com/opendatateam/udata/pull/2182) and [#2172/install.pip](https://github.com/opendatateam/udata/pull/2172/files#diff-d7b45472f3465d62f857d14cf59ea8a2)
- Reduce following to staring [#2192](https://github.com/opendatateam/udata/pull/2192/files)
- Simplify display of spatial coverage in search results [#2192](https://github.com/opendatateam/udata/pull/2192/files)
- Add cache for organization and topic display pages [#2194](https://github.com/opendatateam/udata/pull/2194)

## 1.6.11 (2019-05-29)
@@ -53,7 +53,7 @@ export default {
return classes;
},
icon() {
return this.following ? 'fa-eye-slash': 'fa-eye';
return this.following ? 'fa-star': 'fa-star-o';
},
label() {
return this.following ? this._('Unfollow') : this._('Follow');
@@ -97,18 +97,9 @@ ul.search-results {
position: absolute;
bottom: 16px;

li {
margin-left: -5px;
}

.btn {
color: @color;
text-transform: none;

.fa {
background: none !important;
color: #bababa;
}
.fa {
background: none !important;
color: #bababa;
}

&:after {
@@ -177,7 +177,7 @@ <h4>{{ _('Add a resource') }}</h4>
</button>
</div>
<div class="btn-group btn-group-sm">
{{ follow_btn(dataset, ['fa-star-o', 'fa-star']) }}
{{ follow_btn(dataset) }}
</div>
<div class="btn-group btn-group-sm">
{{ share_btn(dataset.title) }}
@@ -32,87 +32,43 @@ <h4 class="result-title ellipsis">{{ dataset.full_title }}</h4>

{# Temporal coverage #}
{% if dataset.temporal_coverage %}
<li>
<a class="btn btn-xs" v-tooltip tooltip-placement="top"

This comment has been minimized.

Copy link
@abulte

abulte Jun 11, 2019

Member

U no like tooltips?

title="{{ _('Temporal coverage') }}">
<span class="fa fa-calendar fa-fw"></span>
{{ dataset.temporal_coverage|daterange }}
</a>
<li title="{{ _('Temporal coverage') }}">
<span class="fa fa-calendar fa-fw"></span>
{{ dataset.temporal_coverage|daterange }}
</li>
{% endif %}

{# Periodicity #}
{% if dataset.frequency %}
<li>
<a class="btn btn-xs" v-tooltip tooltip-placement="top"
title="{{ _('Frequency') }}">
<span class="fa fa-clock-o fa-fw"></span>
{{ dataset.frequency_label }}
</a>
<li title="{{ _('Frequency') }}">
<span class="fa fa-clock-o fa-fw"></span>
{{ dataset.frequency_label }}
</li>
{% endif %}

{# Spatial coverage #}
{% if dataset.spatial.zones %}
{# Avoid listing too many territories otherwise it breaks design. #}
{% if dataset.spatial.zones|length > 3 %}
<li>
<a class="btn btn-xs" v-tooltip tooltip-placement="top"
title="{{ _('Spatial coverage') }}">
<span class="fa fa-map-marker fa-fw"></span>
{{ dataset.spatial.top_label }}
</a>
</li>
{% else %}
{% for territory in dataset.spatial.zones %}
<li>
{% if territory.handled_zone %}
<a class="btn btn-xs" v-tooltip tooltip-placement="top"
href="{{ territory.url }}" title="{{ _('Spatial coverage') }}">
{% set logo=territory.logo_url(external=True) %}
{% if logo %}
<img src="{{ logo }}" alt="{{ territory.name }}" class="float-left" width="11px" />
{% else %}
<span class="fa fa-map-marker fa-fw"></span>
{% endif %}
{{ territory.name }}
</a>
{% else %}
<a class="btn btn-xs" v-tooltip tooltip-placement="top"
title="{{ _('Spatial coverage') }}">
<span class="fa fa-map-marker fa-fw"></span>
{{ dataset.spatial.top_label }}
</a>
{% endif %}
</li>
{% endfor %}
{% endif %}
<li title="{{ _('Spatial coverage') }}">
This conversation was marked as resolved by taniki

This comment has been minimized.

Copy link
@abulte

abulte Jun 11, 2019

Member

Quite a bit of change here, put it in CHANGELOG I guess.

<span class="fa fa-map-marker fa-fw"></span>
{{ dataset.spatial.top_label }}
</li>
{% endif %}

{% if dataset.spatial.granularity %}
<li>
<a class="btn btn-xs" v-tooltip tooltip-placement="top"
title="{{ _('Territorial coverage granularity') }}">
<span class="fa fa-bullseye fa-fw"></span>
{{ dataset.spatial.granularity_label }}
</a>
<li title="{{ _('Territorial coverage granularity') }}">
<span class="fa fa-bullseye fa-fw"></span>
{{ dataset.spatial.granularity_label }}
</li>
{% endif %}

<li>
<a class="btn btn-xs" v-tooltip tooltip-placement="top"
title="{{ _('Reuse number') }}">
<span class="{{ ficon('fa-recycle') }} fa-fw"></span>
{{ dataset.metrics.reuses or 0 }}
</a>
<li title="{{ _('Reuse number') }}">
<span class="{{ ficon('fa-recycle') }} fa-fw"></span>
{{ dataset.metrics.reuses or 0 }}
</li>

<li>
<a class="btn btn-xs" v-tooltip tooltip-placement="top"
title="{{ _('Number of followers') }}">
<span class="{{ ficon('fa-star') }} fa-fw"></span>
{{ dataset.metrics.followers or 0 }}
</a>
<li title="{{ _('Number of followers') }}">
<span class="{{ ficon('fa-star') }} fa-fw"></span>
{{ dataset.metrics.followers or 0 }}
</li>

</ul>
@@ -16,38 +16,26 @@ <h4 class="result-title ellipsis">{{ organization.name }}</h4>
</div>
<ul class="list-inline result-infos">
{% if organization.metrics.datasets %}
<li>
<a class="btn btn-xs" v-tooltip tooltip-placement="top"
title="{{ _('Number of datasets') }}">
<span class="fa fa-cubes fa-fw"></span>
{{ ngettext('%(num)d dataset', '%(num)d datasets', organization.metrics.datasets or 0) }}
</a>
<li title="{{ _('Number of datasets') }}">
<span class="fa fa-cubes fa-fw"></span>
{{ ngettext('%(num)d dataset', '%(num)d datasets', organization.metrics.datasets or 0) }}
</li>
{% endif %}
{% if organization.metrics.reuses %}
<li>
<a class="btn btn-xs" v-tooltip tooltip-placement="top"
title="{{ _('Number of reuses by the organization') }}">
<span class="{{ ficon('fa-recycle') }} fa-fw"></span>
{{ ngettext('%(num)d reuse', '%(num)d reuses', organization.metrics.reuses or 0) }}
</a>
<li title="{{ _('Number of reuses by the organization') }}">
<span class="{{ ficon('fa-recycle') }} fa-fw"></span>
{{ ngettext('%(num)d reuse', '%(num)d reuses', organization.metrics.reuses or 0) }}
</li>
{% endif %}
{% if organization.metrics.followers %}
<li>
<a class="btn btn-xs" v-tooltip tooltip-placement="top"
title="{{ _('Number of followers') }}">
<span class="{{ ficon('fa-star') }} fa-fw"></span>
{{ ngettext('%(num)d follower', '%(num)d followers', organization.metrics.followers or 0) }}
</a>
<li title="{{ _('Number of followers') }}">
<span class="{{ ficon('fa-star') }} fa-fw"></span>
{{ ngettext('%(num)d follower', '%(num)d followers', organization.metrics.followers or 0) }}
</li>
{% endif %}
<li>
<a class="btn btn-xs" v-tooltip tooltip-placement="top"
title="{{ _('Number of members') }}">
<span class="fa fa-users fa-fw"></span>
{{ ngettext('%(num)d members', '%(num)d members', organization.members|length) }}
</a>
<li title="{{ _('Number of members') }}">
<span class="fa fa-users fa-fw"></span>
{{ ngettext('%(num)d members', '%(num)d members', organization.members|length) }}
</li>
</ul>
</a>
@@ -13,26 +13,17 @@ <h4 class="result-title ellipsis">{{ reuse.title }}</h4>
</div>
</div>
<ul class="list-inline result-infos">
<li>
<a class="btn btn-xs" v-tooltip tooltip-placement="top"
title="{{ _('Type') }}">
<span class="fa fa-file fa-fw"></span>
{{ reuse.type_label }}
</a>
<li title="{{ _('Type') }}">
<span class="fa fa-file fa-fw"></span>
{{ reuse.type_label }}
</li>
<li>
<a class="btn btn-xs" v-tooltip tooltip-placement="top"
title="{{ _('Number of dataset') }}">
<span class="fa fa-cubes fa-fw"></span>
{{ ngettext('%(num)d dataset', '%(num)d datasets', reuse.datasets|length) }}
</a>
<li title="{{ _('Number of dataset') }}">
<span class="fa fa-cubes fa-fw"></span>
{{ ngettext('%(num)d dataset', '%(num)d datasets', reuse.datasets|length) }}
</li>
<li>
<a class="btn btn-xs" v-tooltip tooltip-placement="top"
title="{{ _('Number of followers') }}">
<span class="fa fa-star fa-fw"></span>
{{ ngettext('%(num)d follower', '%(num)d followers', reuse.metrics.followers or 0) }}
</a>
<li title="{{ _('Number of followers') }}">
<span class="fa fa-star fa-fw"></span>
{{ ngettext('%(num)d follower', '%(num)d followers', reuse.metrics.followers or 0) }}
</li>
</ul>
</a>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.