Message Bug gelöst
This commit is contained in:
parent
ac3d413739
commit
a90f7e6144
|
|
@ -5,4 +5,4 @@ class MessageForm(forms.Form):
|
|||
def __init__(self, user, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.fields['target_user'] = forms.MultipleChoiceField(required=True, label="Mitarbeiter", choices=[(u.id, u) for u in UserFullName.objects.filter(profile__agency__pk=user.profile.agency.pk).exclude(pk=user.pk)], widget=forms.CheckboxSelectMultiple())
|
||||
self.fields['message_content'] = forms.CharField(required=True, widget=forms.Textarea, label="Mitteilung")
|
||||
self.fields['message_content'] = forms.CharField(required=True, widget=forms.Textarea, label="Mitteilung", max_length="5000")
|
||||
|
|
@ -28,9 +28,10 @@
|
|||
<form method="POST" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{{form|crispy}}
|
||||
<p>Ihrer Mitteilung wird Automatisch eine Anrede und eine Verabscheidung hinzugefügt!</p>
|
||||
<small>Übrige Zeichen: <span id="mewscount">4000</span></small>
|
||||
<p>Ihrer Mitteilung wird eine Anrede und eine Verabscheidung hinzugefügt.</p>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary">Mitteilung verschicken</button>
|
||||
<button type="submit" class="btn btn-primary" id="send_message_btn">Mitteilung verschicken</button>
|
||||
<a href="{% url 'users-dashboard' %}" class="btn">Abbrechen</a>
|
||||
</div>
|
||||
</form>
|
||||
|
|
@ -201,6 +202,21 @@ $(document).ready(function(){
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
var messcount_max = 4500;
|
||||
$( "#id_message_content" ).keyup(function() {
|
||||
newcount = messcount_max - $("#id_message_content").val().length;
|
||||
|
||||
$("#mewscount").html(newcount);
|
||||
|
||||
if(newcount < 0){
|
||||
$("#send_message_btn").prop("disabled", true);
|
||||
}
|
||||
else{
|
||||
$("#send_message_btn").prop("disabled", false);
|
||||
}
|
||||
});
|
||||
|
||||
//VIDEOPLAYER
|
||||
var player;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue