0

I'm rendering a list of choices using this formula:

generic object: DADict
question: |
  (!!!) What is your desired outcome for your property?
fields:
  - "Destroy current property": x.assets['destroy_current_property']
    datatype: radio
    code: property_choices
    help: (!!!) To do
    default: x.assets.destroy_current_property
  - "Donate future property": x.assets['donate_future_property']
    datatype: radio
    code: property_choices
    help: (!!!) To do
    default: x.assets.donate_future_property

The choices from the code seem to be working fine, so I'm not going to get into that. The issue I'm having is that I also have a set of autoterms like this:

auto terms:
  ...
  - property: |
      prŏp′ər-tē
      <br><br>
      /ˈaset/
      <br><br>
      noun
      <br><br>
      plural noun: properties
      <br><br>
      1. Something owned; a possession.
      <br><br>
      2. A piece of real estate.
      <br><br>
      3. Something tangible or intangible to which its owner has legal title.

The auto terms work fine in most places. What's happening here, though, is that the entire "Donate current property" and "donate future property" are being assigned the class daterm. So the relevant part of the HTML looks like this:

<a tabindex="0" class="daterm" data-container="body" data-toggle="popover" data-placement="bottom" data-content="(!!!) To do" data-original-title="" title="">

Destroy current property

...

</a>

And I think it should (or at least I'd like it to) look more like this:

<a tabindex="0" data-container="body" data-toggle="popover" data-placement="bottom" data-content="(!!!) To do" data-original-title="" title="">

Destroy current <span class="daterm">property</span>

...

</a>

Is there something I can do so that the entire option / choice text is not selected as an autoterm, and only the one auto-text word is selected (i.e. perhaps this is user error)?

NotAnAmbiTurner
  • 2,553
  • 2
  • 21
  • 44

1 Answers1

1

I tried to reproduce the issue with this interview:

mandatory: True
question: |
  (!!!) What is your desired outcome for your property?
fields:
  - "Destroy current property": bar
    datatype: radio
    code: property_choices
    help: (!!!) To do
  - "Donate future property": foo
    datatype: radio
    code: property_choices
    help: (!!!) To do
---
auto terms:
  property: |
    prŏp′ər-tē
    <br><br>
    /ˈaset/
    <br><br>
    noun
    <br><br>
    plural noun: properties
    <br><br>
    1. Something owned; a possession.
    <br><br>
    2. A piece of real estate.
    <br><br>
    3. Something tangible or intangible to which its owner has legal title.
---
code: |
  property_choices = ['Car', 'House', 'Plane']

In the resulting HTML, however, only the word "property" has the class daterm.

screenshot

So I am not sure why the daterm encompasses the whole label, unless maybe you are using an old version of docassemble from a time when the help associated with a field would highlight the whole field label as a popover with green text. If that is the case, the help feature and the auto terms will be incompatible.

In general I don't recommend using auto terms; using terms and explicitly indicating where you want the terms to be highlighted avoids the problems that can happen when terms overlap.

In any case, the way that terms and auto terms work, the popover link is only going to encompass the term itself, not text around it.

Jonathan Pyle
  • 340
  • 1
  • 4