SACGF / variantgrid

VariantGrid public repo
Other
23 stars 2 forks source link

Analysis Node Edtors - tooltips on elements #135

Open davmlaw opened 3 years ago

davmlaw commented 3 years ago

Apparently you can do it via forms:

class ExampleSettingForm(ModelForm):
    def __init__(self, *args, **kwargs):
        super(ExampleSettingForm, self).__init__(*args, **kwargs)
        self.fields['example_field'].widget.attrs['class'] = 'css_class' 
    class Meta:
        model = Example
        help_texts = {
                'example_field': ('Here is some help'),
        }

Motivated by question asking what DamageNode "allow null" means - allows for when damage calculation wasn't performed, as only on dbNSFP - ie "all potential non-synonymous single-nucleotide variants"

James says you can add css class hover-detail to tell if something has a tooltip

TheMadBug commented 3 years ago

You might want to take the opportunity to Crispy up the forms (as in make them bootstrap). Trying to find the few examples where I did that on teh django side

    search_and_classify_form = SearchAndClassifyForm(initial=initial)
    search_and_classify_form.fields['search'].label = "HGVS / dbSNP / VCF coordinate"
    helper = form_helper_horizontal()
    helper.layout = Layout(
        FieldWithButtons(Field('search', placeholder=""), Submit(name="action", value="Go"))
    )
    search_and_classify_form.helper = helper