From: Marek Stępniowski Date: Fri, 7 Aug 2009 11:28:31 +0000 (+0200) Subject: - Dodanie przycisku obejmującego zaznaczony tekst tagiem (testowo). X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/b3154a4f81c3a077d8e14ecc5a6826adb60f0548 - Dodanie przycisku obejmującego zaznaczony tekst tagiem (testowo). - Dodanie możliwości ustalenia autora i wpisania opisu zmian przy zapisywaniu pliku. --- diff --git a/apps/explorer/forms.py b/apps/explorer/forms.py index 2d1c99a2..fd460ac1 100644 --- a/apps/explorer/forms.py +++ b/apps/explorer/forms.py @@ -5,6 +5,8 @@ from explorer import models class BookForm(forms.Form): text = forms.CharField(widget=forms.Textarea) + commit_message = forms.CharField() + user = forms.CharField() class ImageFoldersForm(forms.Form): diff --git a/apps/explorer/views.py b/apps/explorer/views.py index b8d00cf7..4a78e019 100644 --- a/apps/explorer/views.py +++ b/apps/explorer/views.py @@ -22,7 +22,7 @@ def file_xml(request, path): form = forms.BookForm(request.POST) if form.is_valid(): repo.add_file(path, form.cleaned_data['text']) - repo.commit() + repo.commit(message=form.cleaned_data['commit_message'], user=form.cleaned_data['user']) return HttpResponseRedirect(request.get_full_path()) else: form = forms.BookForm() diff --git a/project/templates/explorer/file_xml.html b/project/templates/explorer/file_xml.html index 3f50659c..66e128de 100644 --- a/project/templates/explorer/file_xml.html +++ b/project/templates/explorer/file_xml.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block extrahead %} - + {% endblock extrahead %} @@ -59,7 +65,8 @@
+ Rodział {{ form.text }} -

+

Użytkownik: {{ form.user }} Opis zmian: {{ form.commit_message }}

{% endblock maincontent %}