Commit 72a28846 by benjaoming

Update TODO. Should allow null values of image width and height since image…

Update TODO. Should allow null values of image width and height since image files disappear sometimes and fields have to be emptied.
parent 46c48575
...@@ -10,11 +10,11 @@ Not implemented - will be ASAP ...@@ -10,11 +10,11 @@ Not implemented - will be ASAP
* Searching * Searching
* "Are you sure you want to leave this page" confirmation for Edit page. * "Are you sure you want to leave this page" confirmation for Edit page.
* Finish all class-based views * Finish all class-based views
* View source for read-only articles + locked status **Almost Done**
* Are you sure you wanna leave this page? * Are you sure you wanna leave this page?
* Customize bootstrap to look a bit less like a default installation and add styles for the wiki articles * Customize bootstrap to look a bit less like a default installation and add styles for the wiki articles
* Embeddable article template tag * Embeddable article template tag
* "Fix Wiki URL bug in the footnotes plugin for python-markdown" ? * "Fix Wiki URL bug in the footnotes plugin for python-markdown" ?
* View source for read-only articles + locked status **Done**
* Index views for urlpaths **Done** * Index views for urlpaths **Done**
* Permission system in settings tab **Done** * Permission system in settings tab **Done**
* Special view for deleted articles w/ restore button **Done** * Special view for deleted articles w/ restore button **Done**
......
...@@ -15,6 +15,17 @@ from django.forms.widgets import HiddenInput ...@@ -15,6 +15,17 @@ from django.forms.widgets import HiddenInput
from wiki.core.plugins.base import PluginSettingsFormMixin from wiki.core.plugins.base import PluginSettingsFormMixin
from django.contrib.auth.models import User from django.contrib.auth.models import User
class SpamProtectionMixin():
def check_spam(self, current_revision, request):
"""Check that user or IP address does not perform content edits that
are not allowed.
current_revision can be any object inheriting from models.BaseRevisionMixin
"""
ipaddress = request.META.get('REMOTE_ADDR', None)
class CreateRootForm(forms.Form): class CreateRootForm(forms.Form):
title = forms.CharField(label=_(u'Title'), help_text=_(u'Initial title of the article. May be overridden with revision titles.')) title = forms.CharField(label=_(u'Title'), help_text=_(u'Initial title of the article. May be overridden with revision titles.'))
...@@ -79,6 +90,7 @@ class EditForm(forms.Form): ...@@ -79,6 +90,7 @@ class EditForm(forms.Form):
raise forms.ValidationError(_(u'No changes made. Nothing to save.')) raise forms.ValidationError(_(u'No changes made. Nothing to save.'))
return cd return cd
class SelectWidgetBootstrap(forms.Select): class SelectWidgetBootstrap(forms.Select):
""" """
http://twitter.github.com/bootstrap/components.html#buttonDropdowns http://twitter.github.com/bootstrap/components.html#buttonDropdowns
......
...@@ -48,8 +48,8 @@ class ImageRevision(RevisionPluginRevision): ...@@ -48,8 +48,8 @@ class ImageRevision(RevisionPluginRevision):
max_length=2000, height_field='height', max_length=2000, height_field='height',
width_field='width', blank=True, null=True) width_field='width', blank=True, null=True)
width = models.SmallIntegerField(default=0) width = models.SmallIntegerField(blank=True, null=True)
height = models.SmallIntegerField(default=0) height = models.SmallIntegerField(blank=True, null=True)
def get_filename(self): def get_filename(self):
if self.image: if self.image:
......
...@@ -27,9 +27,10 @@ ...@@ -27,9 +27,10 @@
.form-horizontal label { font-size: 18px; font-weight: bold; color: #777;} .form-horizontal label { font-size: 18px; font-weight: bold; color: #777;}
.settings-form label {min-width: 200px; max-width: 200px; font-size: inherit; font-weight: normal;} .settings-form label {min-width: 250px; font-size: inherit; font-weight: normal;}
.settings-form .controls {margin-left: 220px;} .settings-form .controls {margin-left: 270px;}
.settings-form select {} .settings-form select {}
.settings-form .form-actions { padding-left: 270px; }
#attachment_form #id_description #attachment_form #id_description
{ width: 95% } { width: 95% }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment