Brett Smith - 13 months ago 2019-09-30 15:20:24
brettcsmith@brettcsmith.org
proposals.forms: Link to one consistent Markdown cheat sheet. I like this one best because it's most brief, visual, and clearly under a free license (CC BY-SA 4.0).
1 file changed with 19 insertions and 10 deletions:
↑ Collapse Diff ↑
...
 
@@ -3,6 +3,7 @@ from symposion.proposals.forms import ProposalMixIn
3 3
 

	
4 4
 
from .models import ConferenceSpeaker, TalkProposal
5 5
 

	
6
 
_MARKDOWN_CHEATSHEET_URL = 'https://www.markdownguide.org/cheat-sheet'
6 7
 

	
7 8
 
class ConferenceSpeakerForm(forms.ModelForm):
8 9
 

	
...
 
@@ -21,6 +22,16 @@ class ConferenceSpeakerForm(forms.ModelForm):
21 22
 
    def __init__(self, *a, **k):
22 23
 
        super(ConferenceSpeakerForm, self).__init__(*a, **k)
23 24
 
        self.fields['code_of_conduct'].required = True
25
 
        for field in ('biography', 'experience'):
26
 
            self.fields[field].help_text = self.fields[field].help_text.replace(
27
 
                'http://warpedvisions.org/projects/markdown-cheat-sheet/',
28
 
                _MARKDOWN_CHEATSHEET_URL,
29
 
            ).replace(
30
 
                # Fix a typo in Symposion model help text:
31
 
                # <https://github.com/pinax/symposion/blob/8cb001b16946e2d98e8e45b59c2b506e51b52937/symposion/speakers/models.py#L28-L29>
32
 
                "{}target=".format(_MARKDOWN_CHEATSHEET_URL),
33
 
                "{}' target=".format(_MARKDOWN_CHEATSHEET_URL),
34
 
            )
24 35
 

	
25 36
 

	
26 37
 

	
...
 
@@ -30,16 +41,14 @@ class ProposalForm(forms.ModelForm, ProposalMixIn):
30 41
 
        super(ProposalForm, self).__init__(*a, **k)
31 42
 
        self.description_required()
32 43
 
        self.abstract_required()
33
 
        self.fields["additional_notes"].help_text = ("Anything else "
34
 
            "you'd like the program committee to know when making their "
35
 
            "selection. This is not made public. "
36
 
            "Edit using "
37
 
            "<a href='http://daringfireball.net/projects/markdown/basics' "
38
 
            "target='_blank'>Markdown</a>.")
39
 
        self.fields["abstract"].help_text = ("Detailed abstract. Will "
40
 
            "be made public if your proposal is accepted. Edit "
41
 
            "using <a href='http://daringfireball.net/projects/markdown/basics' "
42
 
            "target='_blank'>Markdown</a>.")
44
 
        self.fields["additional_notes"].help_text = """
45
 
Anything else you'd like the program committee to know when making their
46
 
selection. This is not made public. Edit using
47
 
<a href='{}' target='_blank'>Markdown</a>.""".format(_MARKDOWN_CHEATSHEET_URL)
48
 
        self.fields["abstract"].help_text = """
49
 
Detailed abstract. Will be made public if your proposal is accepted.
50
 
Edit using
51
 
<a href='{}' target='_blank'>Markdown</a>.""".format(_MARKDOWN_CHEATSHEET_URL)
43 52
 

	
44 53
 
        for field in ("description", "abstract", "additional_notes"):
45 54
 
            self.fields[field].help_text += (" Please do not include "
0 comments (0 inline, 0 general)