Added HTMLarea widget to the edit entrance form

This commit is contained in:
Martin Green 2022-06-27 00:34:08 +01:00
parent 47d1662033
commit 82fe350493
2 changed files with 22 additions and 12 deletions

@ -68,18 +68,28 @@ class EntranceForm(ModelForm):
the other fields are present on the form, but use the default presentaiton style the other fields are present on the form, but use the default presentaiton style
''' '''
name = forms.CharField(required = False, widget=forms.TextInput(attrs={'size': '45'})) name = forms.CharField(required = False, widget=forms.TextInput(attrs={'size': '45'}))
entrance_description = forms.CharField(required = False, widget=forms.Textarea(attrs={'rows':9})) entrance_description = forms.CharField(required = False, widget=HTMLarea(
attrs={"height":"80%", "rows":20, 'placeholder': "Enter page content (using HTML)"}))
explorers = forms.CharField(required = False, widget=forms.TextInput(attrs={'size': '45'})) explorers = forms.CharField(required = False, widget=forms.TextInput(attrs={'size': '45'}))
#explorers = forms.CharField(required = False, widget=TinyMCE(attrs={'cols': 80, 'rows': 10})) #explorers = forms.CharField(required = False, widget=TinyMCE(attrs={'cols': 80, 'rows': 10}))
map_description = forms.CharField(required = False, widget=forms.Textarea(attrs={'rows':3})) map_description = forms.CharField(required = False, widget=HTMLarea(
location_description = forms.CharField(required = False, widget=forms.Textarea(attrs={'rows':3})) attrs={"height":"80%", "rows":20, 'placeholder': "Enter page content (using HTML)"}))
approach = forms.CharField(required = False, widget=forms.Textarea(attrs={'rows':3})) location_description = forms.CharField(required = False, widget=HTMLarea(
underground_description = forms.CharField(required = False, widget=forms.Textarea(attrs={'rows':3})) attrs={"height":"80%", "rows":20, 'placeholder': "Enter page content (using HTML)"}))
photo = forms.CharField(required = False, widget=forms.Textarea(attrs={'rows':2})) approach = forms.CharField(required = False, widget=HTMLarea(
marking_comment = forms.CharField(required = False, widget=forms.Textarea(attrs={'rows':2})) attrs={"height":"80%", "rows":20, 'placeholder': "Enter page content (using HTML)"}))
findability_description = forms.CharField(required = False, widget=forms.Textarea(attrs={'rows':2})) underground_description = forms.CharField(required = False, widget=HTMLarea(
other_description = forms.CharField(required = False, widget=forms.Textarea(attrs={'rows':2})) attrs={"height":"80%", "rows":20, 'placeholder': "Enter page content (using HTML)"}))
bearings = forms.CharField(required = False, widget=forms.Textarea(attrs={'rows':2})) photo = forms.CharField(required = False, widget=HTMLarea(
attrs={"height":"80%", "rows":20, 'placeholder': "Enter page content (using HTML)"}))
marking_comment = forms.CharField(required = False, widget=HTMLarea(
attrs={"height":"80%", "rows":20, 'placeholder': "Enter page content (using HTML)"}))
findability_description = forms.CharField(required = False, widget=HTMLarea(
attrs={"height":"80%", "rows":20, 'placeholder': "Enter page content (using HTML)"}))
other_description = forms.CharField(required = False, widget=HTMLarea(
attrs={"height":"80%", "rows":20, 'placeholder': "Enter page content (using HTML)"}))
bearings = forms.CharField(required = False, widget=HTMLarea(
attrs={"height":"80%", "rows":20, 'placeholder': "Enter page content (using HTML)"}))
other_station = forms.CharField(required=False) other_station = forms.CharField(required=False)
tag_station = forms.CharField(required=False) tag_station = forms.CharField(required=False)
exact_station = forms.CharField(required=False) exact_station = forms.CharField(required=False)

@ -2,11 +2,11 @@
{% block title %}Edit Entrance{% endblock %} {% block title %}Edit Entrance{% endblock %}
{% block extraheaders %} {% block extraheaders %}
{% include 'html_editor_scripts_css.html' %}
<!--<script src="{{ settings.TINY_MCE_MEDIA_URL }}tiny_mce.js" type="text/javascript"></script>-->
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<h1>Edit Entrance - at cave {{cave.official_name|safe}} - {{cave.kataster_number}}</h1> <h1>Edit Entrance - at cave {{cave.official_name|safe}} - {{cave.kataster_number}}</h1>
{% include 'html_editor_pop_ups.html' %}
<h2>{{message}}</h2> <h2>{{message}}</h2>
<p>{{entletter}} <p>{{entletter}}
<form action="" method="post">{% csrf_token %} <form action="" method="post">{% csrf_token %}