Skip to content

Commit

Permalink
#909 - Add header to annotation descriptions page
Browse files Browse the repository at this point in the history
  • Loading branch information
davmlaw committed Sep 29, 2023
1 parent 5de6d53 commit 93c5461
Show file tree
Hide file tree
Showing 3 changed files with 166 additions and 17 deletions.
133 changes: 133 additions & 0 deletions snpdb/migrations/0104_alter_settingsoverride_columns_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Generated by Django 4.1.4 on 2023-09-29 04:31

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):
dependencies = [
("snpdb", "0103_alter_lab_options_alter_organization_options"),
]

operations = [
migrations.AlterField(
model_name="settingsoverride",
name="columns",
field=models.ForeignKey(
blank=True,
help_text="Initial custom columns when creating analysis",
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="snpdb.customcolumnscollection",
),
),
migrations.AlterField(
model_name="settingsoverride",
name="default_genome_build",
field=models.ForeignKey(
blank=True,
help_text="Used for search (jump if 1 result for this build) and populating defaults everywhere",
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="snpdb.genomebuild",
),
),
migrations.AlterField(
model_name="settingsoverride",
name="default_sort_by_column",
field=models.ForeignKey(
blank=True,
help_text="Initial sort by column for analysis variant grid",
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="snpdb.customcolumn",
),
),
migrations.AlterField(
model_name="settingsoverride",
name="email_discordance_updates",
field=models.BooleanField(
blank=True, help_text="Opt into discordance email updates", null=True
),
),
migrations.AlterField(
model_name="settingsoverride",
name="email_weekly_updates",
field=models.BooleanField(
blank=True, help_text="Opt in to email list", null=True
),
),
migrations.AlterField(
model_name="settingsoverride",
name="igv_port",
field=models.IntegerField(
blank=True,
help_text="Port to connect to IGV on your machine",
null=True,
),
),
migrations.AlterField(
model_name="settingsoverride",
name="import_messages",
field=models.BooleanField(
blank=True,
help_text="Get internal notification (message icon top left) when imports done (eg VCF finished processing and annotating)",
null=True,
),
),
migrations.AlterField(
model_name="settingsoverride",
name="node_debug_tab",
field=models.BooleanField(
blank=True,
help_text="If true, an extra tab appears in analysis node editor, with details about node settings + SQL query.",
null=True,
),
),
migrations.AlterField(
model_name="settingsoverride",
name="tag_colors",
field=models.ForeignKey(
blank=True,
help_text="Custom tag colors used in analyis and variant grids",
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="snpdb.tagcolorscollection",
),
),
migrations.AlterField(
model_name="settingsoverride",
name="timezone",
field=models.TextField(
blank=True,
help_text="Time/date used in classification download",
null=True,
),
),
migrations.AlterField(
model_name="settingsoverride",
name="tool_tips",
field=models.BooleanField(
blank=True, help_text="Show/hide help popups on mouse hover", null=True
),
),
migrations.AlterField(
model_name="settingsoverride",
name="variant_link_in_analysis_opens_new_tab",
field=models.BooleanField(
help_text="Whether left click by default opens up variant details in new window. Default is open where node editor is. You can always open in new window via right click then new window",
null=True,
),
),
migrations.AlterField(
model_name="usersettingsoverride",
name="default_lab",
field=models.ForeignKey(
blank=True,
help_text="Lab used for creating classifications (you can belong to more than 1 lab)",
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="snpdb.lab",
),
),
]
39 changes: 26 additions & 13 deletions snpdb/models/models_user_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,30 @@ class SettingsOverride(models.Model):
Where the later levels override if they are non-null """
objects = InheritanceManager()

email_weekly_updates = models.BooleanField(null=True, blank=True)
email_discordance_updates = models.BooleanField(null=True, blank=True)
columns = models.ForeignKey(CustomColumnsCollection, on_delete=SET_NULL, null=True, blank=True)
default_sort_by_column = models.ForeignKey(CustomColumn, on_delete=SET_NULL, null=True, blank=True)
tag_colors = models.ForeignKey(TagColorsCollection, on_delete=SET_NULL, null=True, blank=True)
variant_link_in_analysis_opens_new_tab = models.BooleanField(null=True)
tool_tips = models.BooleanField(null=True, blank=True)
node_debug_tab = models.BooleanField(null=True, blank=True)
import_messages = models.BooleanField(null=True, blank=True) # Get a message once import is done
igv_port = models.IntegerField(null=True, blank=True)
default_genome_build = models.ForeignKey(GenomeBuild, on_delete=SET_NULL, null=True, blank=True)
timezone = models.TextField(null=True, blank=True)
email_weekly_updates = models.BooleanField(null=True, blank=True,
help_text="Opt in to email list")
email_discordance_updates = models.BooleanField(null=True, blank=True,
help_text="Opt into discordance email updates")
columns = models.ForeignKey(CustomColumnsCollection, on_delete=SET_NULL, null=True, blank=True,
help_text="Initial custom columns when creating analysis")
default_sort_by_column = models.ForeignKey(CustomColumn, on_delete=SET_NULL, null=True, blank=True,
help_text="Initial sort by column for analysis variant grid")
tag_colors = models.ForeignKey(TagColorsCollection, on_delete=SET_NULL, null=True, blank=True,
help_text="Custom tag colors used in analyis and variant grids")
variant_link_in_analysis_opens_new_tab = models.BooleanField(null=True,
help_text="Whether left click by default opens up variant details in new window. Default is open where node editor is. You can always open in new window via right click then new window")
tool_tips = models.BooleanField(null=True, blank=True,
help_text="Show/hide help popups on mouse hover")
node_debug_tab = models.BooleanField(null=True, blank=True,
help_text="If true, an extra tab appears in analysis node editor, with details about node settings + SQL query.")
import_messages = models.BooleanField(null=True, blank=True,
help_text="Get internal notification (message icon top left) when imports done (eg VCF finished processing and annotating)")
igv_port = models.IntegerField(null=True, blank=True,
help_text="Port to connect to IGV on your machine")
default_genome_build = models.ForeignKey(GenomeBuild, on_delete=SET_NULL, null=True, blank=True,
help_text="Used for search (jump if 1 result for this build) and populating defaults everywhere")
timezone = models.TextField(null=True, blank=True,
help_text="Time/date used in classification download")


class GlobalSettings(SettingsOverride):
Expand Down Expand Up @@ -197,7 +209,8 @@ def __str__(self):
class UserSettingsOverride(SettingsOverride):
user = models.OneToOneField(User, on_delete=CASCADE)
# records created by this user will also be associated to this lab by default
default_lab = models.ForeignKey(Lab, null=True, blank=True, on_delete=SET_NULL)
default_lab = models.ForeignKey(Lab, null=True, blank=True, on_delete=SET_NULL,
help_text="Lab used for creating classifications (you can belong to more than 1 lab)")
# Allows us to store OAuth sub against the user
oauth_sub = models.TextField(null=True, blank=True)

Expand Down
11 changes: 7 additions & 4 deletions snpdb/templates/snpdb/tags/settings_override.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@
{% for field in form %}
<div class="form-group row user-overrides" style="align-items: center">
{{ field.errors }}
<label class="col-12 col-md-3 text-left text-md-right mt-2 mt-md-0">{{ field.label_tag }}</label>
{% if field.help_text %}
<label class="col-12 col-md-3 text-left text-md-right mt-2 mt-md-0 hover-detail" data-help="{{ field.help_text|safe }}">{{ field.label_tag }}</label>
{% else %}
<label class="col-12 col-md-3 text-left text-md-right mt-2 mt-md-0">{{ field.label_tag }}</label>
{% endif %}


<div class="col-6 col-md-4">
{% if override_source %}
{% if override_source|get_item:field.name %}
Expand All @@ -40,9 +46,6 @@
</div>
<div class="col-6 col-md-5">
{% crispy_field field %}
{% if field.help_text %}
<p class="help">{{ field.help_text|safe }}</p>
{% endif %}
</div>
</div>
{% endfor %}
Expand Down

0 comments on commit 93c5461

Please sign in to comment.