summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Green <martin.speleo@gmail.com>2022-06-27 00:34:08 +0100
committerMartin Green <martin.speleo@gmail.com>2022-06-27 00:34:08 +0100
commit82fe3504936987ca4d44f21e4c7b0c6aeb256761 (patch)
tree0b032bbe2a6949a22a24ecdc896e0c286086958d
parent47d166203304f971ed2fb7a5deccdd9352778570 (diff)
downloadtroggle-82fe3504936987ca4d44f21e4c7b0c6aeb256761.tar.gz
troggle-82fe3504936987ca4d44f21e4c7b0c6aeb256761.tar.bz2
troggle-82fe3504936987ca4d44f21e4c7b0c6aeb256761.zip
Added HTMLarea widget to the edit entrance form
-rw-r--r--core/forms.py30
-rw-r--r--templates/editentrance.html4
2 files changed, 22 insertions, 12 deletions
diff --git a/core/forms.py b/core/forms.py
index 19a3b1b..f3df10a 100644
--- a/core/forms.py
+++ b/core/forms.py
@@ -68,18 +68,28 @@ class EntranceForm(ModelForm):
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'}))
- 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=TinyMCE(attrs={'cols': 80, 'rows': 10}))
- map_description = forms.CharField(required = False, widget=forms.Textarea(attrs={'rows':3}))
- location_description = forms.CharField(required = False, widget=forms.Textarea(attrs={'rows':3}))
- approach = forms.CharField(required = False, widget=forms.Textarea(attrs={'rows':3}))
- underground_description = forms.CharField(required = False, widget=forms.Textarea(attrs={'rows':3}))
- photo = forms.CharField(required = False, widget=forms.Textarea(attrs={'rows':2}))
- marking_comment = forms.CharField(required = False, widget=forms.Textarea(attrs={'rows':2}))
- findability_description = forms.CharField(required = False, widget=forms.Textarea(attrs={'rows':2}))
- other_description = forms.CharField(required = False, widget=forms.Textarea(attrs={'rows':2}))
- bearings = forms.CharField(required = False, widget=forms.Textarea(attrs={'rows':2}))
+ map_description = forms.CharField(required = False, widget=HTMLarea(
+ attrs={"height":"80%", "rows":20, 'placeholder': "Enter page content (using HTML)"}))
+ location_description = forms.CharField(required = False, widget=HTMLarea(
+ attrs={"height":"80%", "rows":20, 'placeholder': "Enter page content (using HTML)"}))
+ approach = forms.CharField(required = False, widget=HTMLarea(
+ attrs={"height":"80%", "rows":20, 'placeholder': "Enter page content (using HTML)"}))
+ underground_description = forms.CharField(required = False, widget=HTMLarea(
+ attrs={"height":"80%", "rows":20, 'placeholder': "Enter page content (using HTML)"}))
+ 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)
tag_station = forms.CharField(required=False)
exact_station = forms.CharField(required=False)
diff --git a/templates/editentrance.html b/templates/editentrance.html
index 48a6ba5..83273ff 100644
--- a/templates/editentrance.html
+++ b/templates/editentrance.html
@@ -2,11 +2,11 @@
{% block title %}Edit Entrance{% endblock %}
{% block extraheaders %}
-
-<!--<script src="{{ settings.TINY_MCE_MEDIA_URL }}tiny_mce.js" type="text/javascript"></script>-->
+{% include 'html_editor_scripts_css.html' %}
{% endblock %}
{% block content %}
<h1>Edit Entrance - at cave {{cave.official_name|safe}} - {{cave.kataster_number}}</h1>
+{% include 'html_editor_pop_ups.html' %}
<h2>{{message}}</h2>
<p>{{entletter}}
<form action="" method="post">{% csrf_token %}