Added a view to the about menu to read the LICENSE file included with Mayan

This commit is contained in:
Roberto Rosario
2011-08-14 23:31:12 -04:00
parent 094a4125dc
commit aba9d47ad8
4 changed files with 47 additions and 15 deletions

View File

@@ -149,19 +149,27 @@ class EmailAuthenticationForm(AuthenticationForm):
EmailAuthenticationForm.base_fields.keyOrder = ['email', 'password']
class ChangelogForm(forms.Form):
class FileDisplayForm(forms.Form):
text = forms.CharField(
label=_(u'Text'),
label='',#_(u'Text'),
widget=forms.widgets.Textarea(
attrs={'cols': 40, 'rows': 20, 'readonly': 'readonly'}
)
)
def __init__(self, *args, **kwargs):
super(ChangelogForm, self).__init__(*args, **kwargs)
CHANGELOG_FILENAME = u'Changelog.txt'
CHANGELOG_DIRECTORY = u'docs'
changelog_path = os.path.join(settings.PROJECT_ROOT, CHANGELOG_DIRECTORY, CHANGELOG_FILENAME)
super(FileDisplayForm, self).__init__(*args, **kwargs)
changelog_path = os.path.join(settings.PROJECT_ROOT, self.DIRECTORY, self.FILENAME)
fd = open(changelog_path)
self.fields['text'].initial = fd.read()
fd.close()
class ChangelogForm(FileDisplayForm):
FILENAME = u'Changelog.txt'
DIRECTORY = u'docs'
class LicenseForm(FileDisplayForm):
FILENAME = u'LICENSE'
DIRECTORY = u'docs'