diff --git a/src/genlab_bestilling/migrations/0020_sample_is_prioritised.py b/src/genlab_bestilling/migrations/0020_sample_is_prioritised.py index 3c431782..c9208b96 100644 --- a/src/genlab_bestilling/migrations/0020_sample_is_prioritised.py +++ b/src/genlab_bestilling/migrations/0020_sample_is_prioritised.py @@ -1,4 +1,4 @@ -# Generated by Django 5.2.3 on 2025-07-07 06:40 +# Generated by Django 5.2.3 on 2025-07-07 09:53 from django.db import migrations, models diff --git a/src/genlab_bestilling/migrations/0022_sample_internal_note.py b/src/genlab_bestilling/migrations/0022_sample_internal_note.py new file mode 100644 index 00000000..48249fe7 --- /dev/null +++ b/src/genlab_bestilling/migrations/0022_sample_internal_note.py @@ -0,0 +1,17 @@ +# Generated by Django 5.2.3 on 2025-07-07 13:25 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("genlab_bestilling", "0021_order_is_prioritized_order_is_seen"), + ] + + operations = [ + migrations.AddField( + model_name="sample", + name="internal_note", + field=models.TextField(blank=True, null=True), + ), + ] diff --git a/src/genlab_bestilling/models.py b/src/genlab_bestilling/models.py index cf094cc1..cbc645f0 100644 --- a/src/genlab_bestilling/models.py +++ b/src/genlab_bestilling/models.py @@ -634,6 +634,9 @@ class Sample(models.Model): species = models.ForeignKey(f"{an}.Species", on_delete=models.PROTECT) year = models.IntegerField() notes = models.TextField(null=True, blank=True) + + # "Merknad" in the Excel sheet. + internal_note = models.TextField(null=True, blank=True) pop_id = models.CharField(max_length=150, null=True, blank=True) location = models.ForeignKey( f"{an}.Location", on_delete=models.PROTECT, null=True, blank=True diff --git a/src/staff/tables.py b/src/staff/tables.py index 43066242..2f7f42a0 100644 --- a/src/staff/tables.py +++ b/src/staff/tables.py @@ -235,9 +235,14 @@ class CustomSampleTable(tables.Table): default=False, ) + internal_note = tables.TemplateColumn( + template_name="staff/note_input_column.html", orderable=False + ) + class Meta: model = Sample - fields = ["checked", "genlab_id"] + list(base_fields) + fields = ["checked", "genlab_id", "internal_note"] + list(base_fields) + sequence = ["checked", "genlab_id"] + list(base_fields) + ["internal_note"] return CustomSampleTable diff --git a/src/staff/templates/staff/note_input_column.html b/src/staff/templates/staff/note_input_column.html new file mode 100644 index 00000000..c98206c3 --- /dev/null +++ b/src/staff/templates/staff/note_input_column.html @@ -0,0 +1,7 @@ + diff --git a/src/staff/templates/staff/sample_lab.html b/src/staff/templates/staff/sample_lab.html index 6994df77..84752049 100644 --- a/src/staff/templates/staff/sample_lab.html +++ b/src/staff/templates/staff/sample_lab.html @@ -24,17 +24,37 @@