Mike-Heneghan / ALISS

ALISS (A Local Information System for Scotland) is a service to help you find help and support close to you when you need it most.
https://aliss.org
0 stars 0 forks source link

Tooltips to help guide user when creating organisations or services #43

Closed digitalWestie closed 5 years ago

digitalWestie commented 5 years ago

(i) icon beside field names with description.

Mike-Heneghan commented 5 years ago

Example of tool tip in the project.

screenshot 2019-02-28 at 15 17 36
Mike-Heneghan commented 5 years ago

Organisation Search tooltip example:

screenshot 2019-02-28 at 15 19 35
        <span data-tooltip aria-haspopup="true" class="has-tip right" data-disable-hover="false" tabindex="2" title="If you are a member of an organisation you can claim representation and gain edit rights over its entry on ALISS.">
                          <i class="fa fa-question-circle" aria-hidden="true"></i>
                        </span>
Mike-Heneghan commented 5 years ago

Doc entry on adding help_text: https://docs.djangoproject.com/en/1.11/topics/forms/modelforms/#overriding-the-default-fields

Mike-Heneghan commented 5 years ago

Seems more sensible to have the help_text defined in the model form as it pertains to the model form and avoids adding verbose text to the model which is already complex.

import from django.utils.translation import ugettext_lazy as _

    help_texts = {
            'description': _('Helpful test for a description'),
        }
Mike-Heneghan commented 5 years ago

Organisation To Do List:

Mike-Heneghan commented 5 years ago

Services to Do List:

Mike-Heneghan commented 5 years ago

As the tooltip.html is now spread between multiselect_field.html and field.html maybe it should be abstracted out into it's own partial?

Mike-Heneghan commented 5 years ago

In trying to implement the tooltip on the organisation logo field inadvertently created it with a different style.

screenshot 2019-03-01 at 14 08 51

It seems that where the tool tip (?) icon has been implemented elsewhere it's being the larger grey or red version. So for consistentency will update the Logo (?) in organisations.

Definitely starting to feel like the knowledge is being spread to multiple places in the app so updating in thre future could be problematic.

Mike-Heneghan commented 5 years ago

Unfortunately the logo-select class in the css is interfereing with the styling of the field label and tooltip.

<div class="f-row logo-select">
  <label for="id_logo">
    Logo
    {% if form.logo.help_text %}
    <span data-tooltip aria-haspopup="true" class="has-tip right" data-disable-hover="false" tabindex="2" title="{{form.logo.help_text}}">
      <i class="fa fa-question-circle" aria-hidden="true"></i>
    </span>
    {% endif %}
  </label><br/>
screenshot 2019-03-01 at 14 41 34

vs.

<div class="f-row">
    <label for="id_logo">
      Logo
      {% if form.logo.help_text %}
      <span data-tooltip aria-haspopup="true" class="has-tip right" data-disable-hover="false" tabindex="2" title="{{form.logo.help_text}}">
        <i class="fa fa-question-circle" aria-hidden="true"></i>
      </span>
      {% endif %}
    </label><br/>
screenshot 2019-03-01 at 14 37 42
Mike-Heneghan commented 5 years ago

Tried sorting this although it's becoming a bit of a palava for something which in many ways doesn't need an explanation or could be achieved through a more direct (not as good a practive approac like inline styling?).