Repository: OpenEnergyPlatform/oeplatform

Issue:
Model factsheet - Minor Bugs
I am testing and updating the factsheets and I found some minor bugs and problems in the model fact sheet that needs to be fixed:

- **Software** | External optimizer

When checkbox is _yes_ a text field is displayed. The text is not displayed in the factsheet after submission.
Bug is in _add=model.external_optimizer_yes_text_?
-> Allow multiple entries in form


- **Basic Information** | Link to User Documentation

The URL is broken with an internal URL and {}.
see: https://openenergy-platform.org/factsheets/models/32/
Bug in _code_documentation_ or url check function in _model_snipped.html_ ?

- **Basic Information** vs **General Information**

It's _basic_ in the factsheet but _general_ in the edit.
Please change to **General Information**

- Order of cards

Factsheet: ~~Basic~~ General; Openness; Software; **References**; Coverage; Math; Integration
Edit: General Information; Openness; Software; Coverage; Math; Integration; **References**; Tags

Please harmonise to:
General Information; Openness; Software; Coverage; Math; Integration; References; Tags
-> Move references in models.html to the end

- Expand first card General Information when factsheet is opened

- Cards in edit mode

There are no gaps/ spaces between the cards in edit mode.
Please add spaces to improve readability.




Discussion:

Resolving patch:
diff --git a/modelview/migrations/0058_auto_20210112_1920.py b/modelview/migrations/0058_auto_20210112_1920.py
new file mode 100644
--- /dev/null
+++ b/modelview/migrations/0058_auto_20210112_1920.py
@@ -0,0 +1,29 @@
+# Generated by Django 3.0 on 2021-01-12 18:20
+
+import django.contrib.postgres.fields
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('modelview', '0057_auto_20200916_1502'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='basicfactsheet',
+            name='contact_email',
+            field=django.contrib.postgres.fields.ArrayField(base_field=models.EmailField(max_length=254), help_text='Please provide the mailadress of the contact person.', size=None, verbose_name='Contact (e-mail)'),
+        ),
+        migrations.AlterField(
+            model_name='basicfactsheet',
+            name='external_optimizer_yes_text',
+            field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=1000), default=list, help_text='Which external optimizer(s) can the model apply (e.g. Pyomo)? Please list them.', null=True, size=None, verbose_name='External optimizer'),
+        ),
+        migrations.AlterField(
+            model_name='basicfactsheet',
+            name='user_documentation',
+            field=models.CharField(help_text='Is an user documentation available for the framework? Please insert the link', max_length=500, null=True, verbose_name='Link to User Documentation'),
+        ),
+    ]
diff --git a/modelview/models.py b/modelview/models.py
--- a/modelview/models.py
+++ b/modelview/models.py
@@ -95,8 +95,7 @@ class BasicFactsheet(models.Model):
     )
     framework_yes_text = CharField(max_length=1000, null=True)
 
-    user_documentation = ArrayField(
-        CharField(max_length=200),
+    user_documentation = CharField(max_length=500,
         verbose_name="Link to User Documentation",
         help_text="Is an user documentation available for the framework? Please insert the link",
         null=True,
@@ -245,7 +244,7 @@ class BasicFactsheet(models.Model):
         default=list,
         null=True,
     )
-
+    #TODO: external_optimizer is not used anymore since the form adds a array element, a boolean field is not needed anymore
     external_optimizer = BooleanField(
         default=False,
         verbose_name="External optimizer",
@@ -253,7 +252,11 @@ class BasicFactsheet(models.Model):
         null=False,
     )
     external_optimizer_yes_text = ArrayField(
-        models.CharField(max_length=1000), default=list, null=True
+        models.CharField(max_length=1000), 
+        verbose_name="External optimizer",
+        help_text="Which external optimizer(s) can the model apply (e.g. Pyomo)? Please list them.",
+        default=list,
+        null=True
     )
 
     additional_software = ArrayField(


Test patch: