From b3154a4f81c3a077d8e14ecc5a6826adb60f0548 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20St=C4=99pniowski?= Date: Fri, 7 Aug 2009 13:28:31 +0200 Subject: [PATCH 1/1] =?utf8?q?=20-=20Dodanie=20przycisku=20obejmuj=C4=85ce?= =?utf8?q?go=20zaznaczony=20tekst=20tagiem=20=20(testowo).=20=20?= =?utf8?q?-=20Dodanie=20mo=C5=BCliwo=C5=9Bci=20ustalenia=20autora=20i=20wp?= =?utf8?q?isania=20opisu=20zmian=20przy=20zapisywaniu=20pliku.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- apps/explorer/forms.py | 2 ++ apps/explorer/views.py | 2 +- project/templates/explorer/file_xml.html | 11 +++++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) 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 %} -- 2.20.1