diff --git a/src/app/constants.py b/src/app/constants.py
new file mode 100644
index 00000000..8d914366
--- /dev/null
+++ b/src/app/constants.py
@@ -0,0 +1,51 @@
+from django.utils.safestring import mark_safe
+
+# License submission form help text
+
+FULL_NAME_HELP_TEXT = mark_safe('\u2022 The full name may omit certain word, such as \'the,\' for alphabetical sorting purposes.
'
+ '\u2022 No commas in full name of license or exception.
'
+ '\u2022 The word \'version\' is not spelled out; \'v\' or nothing is used to indicate license version (for space reasons)
'
+ '\u2022 For version, use lower case v and no period or space between v and the number.
'
+ '\u2022 No abbreviations are included (in parenthesis) after the full name.')
+
+SHORT_IDENTIFIER_HELP_TEXT = mark_safe('\u2022 Short identifier to be used to identify a license or exception match to licenses or exceptions in the context of an SPDX file, a source file, or elsewhere.
'
+ '\u2022 Short identifiers consist of ASCII letters (A-Za-z), digits (0-9), full stops (.) and hyphen or minus signs (-)
'
+ '\u2022 Short identifiers consist of an abbreviation based on a common short name or acronym for the license or exception.
'
+ '\u2022 Where applicable, the abbreviation will be followed by a dash and then the version number, in X.Y format.
'
+ '\u2022 Where applicable, and if possible, the short identifier should be harmonized with other well-known open source naming sources (i.e., OSI, Fedora, etc.)
'
+ '\u2022 Short identifiers should be as short in length as possible while staying consistent with all other naming criteria.')
+
+SOURCE_URL_HELP_TEXT = mark_safe('\u2022 Include URL for the official text of the license or exception.
'
+ '\u2022 If the license is OSI approved, also include URL for OSI license page.
'
+ '\u2022 Include another URL that has text version of license, if neither of the first two options are available.
'
+ '\u2022 Note that the source URL may refer to an original URL for the license which is no longer active. We don\'t remove inactive URLs. New or best available URLs may be added.
'
+ '\u2022 Link to the license or exception in its native language is used where specified (e.g. French for CeCILL). Link to English version where multiple, equivalent official translations (e.g. EUPL)')
+
+LICENSE_HEADER_INFO_HELP_TEXT = mark_safe('\u2022 Should only include text intended to be put in the header of source files or other files as specified in the license or license appendix when specifically delineated.
'
+ '\u2022 Indicate if there is any variation in the header (i.e. for files developed by a contributor versus when applying license to original work)
'
+ '\u2022 Do not include NOTICE info intended for a separate notice file.
'
+ '\u2022 Leave this field blank if there is no standard header as specifically defined in the license.')
+
+COMMENTS_INFO_HELP_TEXT = mark_safe('\u2022 Provide a short explanation regarding the need for this license or exception to be included on the SPDX License List.
'
+ '\u2022 Identify at least one program that uses it or any other related information.')
+
+LICENSE_TEXT_HELP_TEXT = mark_safe('Full license of the license text.')
+
+
+# License namespace submission form help text
+
+LIC_NS_SUB_FULLNAME_HELP_TEXT = mark_safe('\u2022 The full name of the license namespace submitter.')
+
+LIC_NS_NSINFO_HELP_TEXT = mark_safe('\u2022 License namespace in dns-style request or a free-format.')
+
+LIC_NS_NSID_HELP_TEXT = mark_safe('\u2022 License namespace short identifier.')
+
+LIC_NS_URL_INFO_HELP_TEXT = mark_safe('\u2022 Include URL for the official text of the license namespace.')
+
+LIC_NS_LIC_LIST_URL_HELP_TEXT = mark_safe('\u2022 Include URL for the official text of the license list namespace.')
+
+LIC_NS_GH_REPO_URL_HELP_TEXT = mark_safe('\u2022 Include URL for the official github page of the license namespace.')
+
+LIC_NS_ORG_HELP_TEXT = mark_safe('\u2022 Select organisation of the license namespace.')
+
+LIC_NS_DESC_HELP_TEXT = mark_safe('Description of the license namespace')
diff --git a/src/app/forms.py b/src/app/forms.py
index ad790a0b..be7e8777 100644
--- a/src/app/forms.py
+++ b/src/app/forms.py
@@ -19,6 +19,13 @@
from app.models import UserID, LicenseNamespace, OrganisationName
from app.widgets import RelatedFieldWidgetCanAdd
+from .constants import (FULL_NAME_HELP_TEXT, SHORT_IDENTIFIER_HELP_TEXT,
+ SOURCE_URL_HELP_TEXT, LICENSE_HEADER_INFO_HELP_TEXT,
+ COMMENTS_INFO_HELP_TEXT, LICENSE_TEXT_HELP_TEXT,
+ LIC_NS_SUB_FULLNAME_HELP_TEXT, LIC_NS_NSINFO_HELP_TEXT,
+ LIC_NS_NSID_HELP_TEXT, LIC_NS_URL_INFO_HELP_TEXT,
+ LIC_NS_LIC_LIST_URL_HELP_TEXT, LIC_NS_GH_REPO_URL_HELP_TEXT,
+ LIC_NS_ORG_HELP_TEXT, LIC_NS_DESC_HELP_TEXT)
OSI_CHOICES = (
(0, "-"),
@@ -76,13 +83,13 @@ def __init__(self, *args, **kwargs):
self.fields["userEmail"] = forms.EmailField(label='Email', initial=self.email)
licenseAuthorName = forms.CharField(label="License Author name", max_length=100, required=False)
- fullname = forms.CharField(label="Fullname", max_length=70)
- shortIdentifier = forms.CharField(label='Short identifier', max_length=25)
- sourceUrl = forms.CharField(label='Source / URL', required=False)
+ fullname = forms.CharField(label="Fullname", max_length=70, help_text=FULL_NAME_HELP_TEXT)
+ shortIdentifier = forms.CharField(label='Short identifier', max_length=25, help_text=SHORT_IDENTIFIER_HELP_TEXT)
+ sourceUrl = forms.CharField(label='Source / URL', required=False, help_text=SOURCE_URL_HELP_TEXT)
osiApproved = forms.CharField(label="OSI Status", widget=forms.Select(choices=OSI_CHOICES))
- comments = forms.CharField(label='Comments', required=False, widget=forms.Textarea(attrs={'rows': 4, 'cols': 40}))
- licenseHeader = forms.CharField(label='Standard License Header', widget=forms.Textarea(attrs={'rows': 3, 'cols': 40}), required=False)
- text = forms.CharField(label='Text', widget=forms.Textarea(attrs={'rows': 4, 'cols': 40}))
+ comments = forms.CharField(label='Comments', required=False, widget=forms.Textarea(attrs={'rows': 4, 'cols': 40}), help_text=COMMENTS_INFO_HELP_TEXT)
+ licenseHeader = forms.CharField(label='Standard License Header', widget=forms.Textarea(attrs={'rows': 3, 'cols': 40}), required=False, help_text=LICENSE_HEADER_INFO_HELP_TEXT)
+ text = forms.CharField(label='Text', widget=forms.Textarea(attrs={'rows': 4, 'cols': 40}), help_text=LICENSE_TEXT_HELP_TEXT)
class LicenseNamespaceRequestForm(forms.ModelForm):
@@ -93,16 +100,24 @@ def __init__(self, *args, **kwargs):
self.email = ""
super(LicenseNamespaceRequestForm, self).__init__(*args, **kwargs)
self.fields['shortIdentifier'].required = False
+ self.fields['shortIdentifier'].help_text = LIC_NS_NSID_HELP_TEXT
+ self.fields['namespace'].help_text = LIC_NS_NSINFO_HELP_TEXT
+ self.fields['fullname'].help_text = LIC_NS_SUB_FULLNAME_HELP_TEXT
self.fields['url'].required = True
+ self.fields['url'].help_text = LIC_NS_URL_INFO_HELP_TEXT
+ self.fields['description'].help_text = LIC_NS_DESC_HELP_TEXT
self.fields['license_list_url'].required = False
+ self.fields['license_list_url'].help_text = LIC_NS_LIC_LIST_URL_HELP_TEXT
self.fields['github_repo_url'].required = False
+ self.fields['github_repo_url'].help_text = LIC_NS_GH_REPO_URL_HELP_TEXT
self.fields['organisation'].required = False
self.fields["userEmail"] = forms.EmailField(label='Email', initial=self.email)
organisation = forms.ModelChoiceField(
required=False,
queryset=OrganisationName.objects.all(),
- widget=RelatedFieldWidgetCanAdd(OrganisationName))
+ widget=RelatedFieldWidgetCanAdd(OrganisationName),
+ help_text=LIC_NS_ORG_HELP_TEXT)
class Meta:
model = LicenseNamespace
diff --git a/src/app/static/css/starter-template.css b/src/app/static/css/starter-template.css
index 2012baf5..10be3c6a 100644
--- a/src/app/static/css/starter-template.css
+++ b/src/app/static/css/starter-template.css
@@ -18,3 +18,8 @@ input[type="checkbox"]{
margin-left: 0px !important;
margin-top: -3px !important;
}
+
+.popover-content {
+ overflow-x: auto;
+ max-height: 380px;
+}
diff --git a/src/app/static/js/editor/codemirror.js b/src/app/static/js/editor/codemirror.js
index 5f645466..5c7e9326 100644
--- a/src/app/static/js/editor/codemirror.js
+++ b/src/app/static/js/editor/codemirror.js
@@ -9531,10 +9531,10 @@ TextareaInput.prototype.needsContentAttribute = false
function fromTextArea(textarea, options) {
options = options ? copyObj(options) : {}
- options.value = textarea.value
- if (!options.tabindex && textarea.tabIndex)
+ options.value = textarea ? textarea.value : ""
+ if (!options.tabindex && textarea && textarea.tabIndex)
{ options.tabindex = textarea.tabIndex }
- if (!options.placeholder && textarea.placeholder)
+ if (!options.placeholder && textarea && textarea.placeholder)
{ options.placeholder = textarea.placeholder }
// Set autofocus to true if this textarea is focused, or if it has
// autofocus and no other element is focused.
@@ -9547,7 +9547,7 @@ function fromTextArea(textarea, options) {
function save() {textarea.value = cm.getValue()}
var realSubmit
- if (textarea.form) {
+ if (textarea && textarea.form) {
on(textarea.form, "submit", save)
// Deplorable hack to make the submit method do the right thing.
if (!options.leaveSubmitMethodAlone) {
@@ -9580,8 +9580,10 @@ function fromTextArea(textarea, options) {
}
}
- textarea.style.display = "none"
- var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },
+ if(textarea) {
+ textarea.style.display = "none"
+ }
+ var cm = CodeMirror(function (node) { return textarea ? textarea.parentNode.insertBefore(node, textarea.nextSibling) : ""; },
options)
return cm
}
@@ -9682,4 +9684,4 @@ CodeMirror.version = "5.38.0"
return CodeMirror;
-})));
\ No newline at end of file
+})));
diff --git a/src/app/templates/app/submit_new_license.html b/src/app/templates/app/submit_new_license.html
index b29d1bc4..86c1792d 100644
--- a/src/app/templates/app/submit_new_license.html
+++ b/src/app/templates/app/submit_new_license.html
@@ -68,7 +68,7 @@