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

Restore help tooltips #284

Open
2 tasks
etj opened this issue Apr 8, 2022 · 2 comments
Open
2 tasks

Restore help tooltips #284

etj opened this issue Apr 8, 2022 · 2 comments
Assignees
Labels

Comments

@etj
Copy link
Member

etj commented Apr 8, 2022

When editing a dataset, there's a space between every upper input and the lower label
image

that is a badly rendered <span> info tooltip:

image

By replacing the proper fa fa-info-circle in place of the old icon-info-sign I get this:
image

  • The info icon should be placed close to the relevant input label
  • When hovering, the tooltip should be displayed
@etj
Copy link
Member Author

etj commented Apr 8, 2022

Macro help_block -->

{% macro help_block(content) %}
{% if content %}
<span class="inline-block" data-module="dcatapit-help">
<i class="icon-info-sign size-12" title="{{ content }}"></i>
</span>
{% endif %}
{% endmacro %}

The macro is only called within the same file.

Related js should be at

ckan.module('dcatapit-help', function($){
var help = {
initialize: function(){
$.proxyAll(this, /_on/);
$(this.el.find('i')).tooltip();
}
}
return $.extend({}, help);
});

@etj
Copy link
Member Author

etj commented Apr 8, 2022

I guess that most of the macro code has been taken from an older version of CKAN.
See
https://github.com/ckan/ckan/blob/ckan-2.9.5/ckan/templates/macros/form.html#L338-L345

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants