Repository: DDMAL/CantusDB

Issue:
Admin Area: Chant Create: required fields are only partially marked
Now that it's impossible to create a chant/sequence without a source, we should update the admin area to reflect this change. Notice that all required fields are indicated by bold text, and _almost_ all required fields are indicated by an asterisk:
![Screenshot 2023-09-13 at 7 34 54 PM](https://github.com/DDMAL/CantusDB/assets/58090591/3e409f51-abab-4708-9111-4ea661cff65d)

Suggested solution: remove all the asterisks, and let the boldface communicate that required fields are required.
Acceptable solution: add an asterisk to the source field.

If we decide to remove asterisks, we should also check other pages in the admin area to make sure everything is consistent.


Discussion:

Resolving patch:
diff --git a/django/cantusdb_project/main_app/forms.py b/django/cantusdb_project/main_app/forms.py
--- a/django/cantusdb_project/main_app/forms.py
+++ b/django/cantusdb_project/main_app/forms.py
@@ -20,8 +20,6 @@
     VolpianoAreaWidget,
     SelectWidget,
     CheckboxWidget,
-    AdminTextAreaWidget,
-    AdminTextInputWidget,
 )
 from django.contrib.auth import get_user_model
 from django.db.models import Q
@@ -637,7 +635,7 @@ class Meta:
         model = Century
         fields = "__all__"
 
-    name = forms.CharField(required=True, widget=AdminTextInputWidget)
+    name = forms.CharField(required=True, widget=TextInputWidget)
 
 
 class AdminChantForm(forms.ModelForm):
@@ -655,7 +653,7 @@ class Meta:
 
     manuscript_full_text_std_spelling = forms.CharField(
         required=True,
-        widget=AdminTextAreaWidget,
+        widget=TextAreaWidget,
         help_text="Manuscript full text with standardized spelling. Enter the words "
         "according to the manuscript but normalize their spellings following "
         "Classical Latin forms. Use upper-case letters for proper nouns, "
@@ -665,13 +663,13 @@ class Meta:
 
     folio = forms.CharField(
         required=True,
-        widget=AdminTextInputWidget,
+        widget=TextInputWidget,
         help_text="Binding order",
     )
 
     c_sequence = forms.CharField(
         required=True,
-        widget=AdminTextInputWidget,
+        widget=TextInputWidget,
         help_text="Each folio starts with '1'.",
         label="Sequence",
     )
@@ -702,7 +700,7 @@ class Meta:
         model = Feast
         fields = "__all__"
 
-    name = forms.CharField(required=True, widget=AdminTextInputWidget)
+    name = forms.CharField(required=True, widget=TextInputWidget)
 
 
 class AdminGenreForm(forms.ModelForm):
@@ -710,8 +708,8 @@ class Meta:
         model = Genre
         fields = "__all__"
 
-    name = forms.CharField(required=True, widget=AdminTextInputWidget)
-    description = forms.CharField(required=True, widget=AdminTextAreaWidget)
+    name = forms.CharField(required=True, widget=TextInputWidget)
+    description = forms.CharField(required=True, widget=TextAreaWidget)
 
 
 class AdminNotationForm(forms.ModelForm):
@@ -719,7 +717,7 @@ class Meta:
         model = Notation
         fields = "__all__"
 
-    name = forms.CharField(required=True, widget=AdminTextInputWidget)
+    name = forms.CharField(required=True, widget=TextInputWidget)
     name.widget.attrs.update({"style": "width: 400px;"})
 
 
@@ -728,8 +726,8 @@ class Meta:
         model = Office
         fields = "__all__"
 
-    name = forms.CharField(required=True, widget=AdminTextInputWidget)
-    description = forms.CharField(required=True, widget=AdminTextAreaWidget)
+    name = forms.CharField(required=True, widget=TextInputWidget)
+    description = forms.CharField(required=True, widget=TextAreaWidget)
 
 
 class AdminProvenanceForm(forms.ModelForm):
@@ -737,7 +735,7 @@ class Meta:
         model = Provenance
         fields = "__all__"
 
-    name = forms.CharField(required=True, widget=AdminTextInputWidget)
+    name = forms.CharField(required=True, widget=TextInputWidget)
 
 
 class AdminRismSiglumForm(forms.ModelForm):
@@ -745,7 +743,7 @@ class Meta:
         model = RismSiglum
         fields = "__all__"
 
-    name = forms.CharField(required=True, widget=AdminTextInputWidget)
+    name = forms.CharField(required=True, widget=TextInputWidget)
 
 
 class AdminSegmentForm(forms.ModelForm):
@@ -753,7 +751,7 @@ class Meta:
         model = Segment
         fields = "__all__"
 
-    name = forms.CharField(required=True, widget=AdminTextInputWidget)
+    name = forms.CharField(required=True, widget=TextInputWidget)
     name.widget.attrs.update({"style": "width: 400px;"})
 
 
@@ -798,14 +796,14 @@ class Meta:
 
     title = forms.CharField(
         required=True,
-        widget=AdminTextInputWidget,
+        widget=TextInputWidget,
         help_text="Full Manuscript Identification (City, Archive, Shelf-mark)",
     )
     title.widget.attrs.update({"style": "width: 610px;"})
 
     siglum = forms.CharField(
         required=True,
-        widget=AdminTextInputWidget,
+        widget=TextInputWidget,
         help_text="RISM-style siglum + Shelf-mark (e.g. GB-Ob 202).",
     )
 
@@ -892,7 +890,7 @@ class Meta:
 
     email = forms.CharField(
         required=True,
-        widget=AdminTextInputWidget,
+        widget=TextInputWidget,
     )
     email.widget.attrs.update({"style": "width: 300px;"})
 
diff --git a/django/cantusdb_project/main_app/widgets.py b/django/cantusdb_project/main_app/widgets.py
--- a/django/cantusdb_project/main_app/widgets.py
+++ b/django/cantusdb_project/main_app/widgets.py
@@ -43,20 +43,3 @@ def __init__(self):
 
 class CheckboxWidget(CheckboxInput):
     pass
-
-
-class AdminTextAreaWidget(Textarea):
-    def __init__(self):
-        self.attrs = {"class": "form-control", "rows": 10, "cols": 75}
-
-    def render(self, name, value, attrs=None, renderer=None):
-        return super().render(name, value, attrs=self.attrs) + mark_safe(
-            '<span style="color: red; font-weight: bold;"> &nbsp;* </span>'
-        )
-
-
-class AdminTextInputWidget(TextInputWidget):
-    def render(self, name, value, attrs=None, renderer=None):
-        return super().render(name, value) + mark_safe(
-            '<span style="color: red; font-weight: bold;"> &nbsp;* </span>'
-        )


Test patch: