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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion js/components/buttons/follow.vue
Expand Up @@ -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');
Expand Down
15 changes: 3 additions & 12 deletions less/udata/search.less
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion udata/templates/dataset/display.html
Expand Up @@ -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) }}
Expand Down
82 changes: 19 additions & 63 deletions udata/templates/dataset/search-result.html
Expand Up @@ -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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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') }}">
taniki marked this conversation as resolved.
Show resolved Hide resolved
<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>
Expand Down
36 changes: 12 additions & 24 deletions udata/templates/organization/search-result.html
Expand Up @@ -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>
Expand Down
27 changes: 9 additions & 18 deletions udata/templates/reuse/search-result.html
Expand Up @@ -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>
Expand Down