Skip to content
Browse files

Picture plugin: try to improve the help_text on the plugin fields.

  • Loading branch information...
1 parent e688b11 commit 593422e49526ef9474e96ad9816a529eabb50acc @richardbarran richardbarran committed Oct 8, 2012
Showing with 22 additions and 13 deletions.
  1. +22 −13 cms/plugins/picture/models.py
View
35 cms/plugins/picture/models.py
@@ -6,29 +6,38 @@
class Picture(CMSPlugin):
"""
- A Picture with or without a link
+ A Picture with or without a link.
"""
- CENTER = "center"
LEFT = "left"
RIGHT = "right"
- FLOAT_CHOICES = ((CENTER, _("center")),
- (LEFT, _("left")),
+ CENTER = "center"
+ FLOAT_CHOICES = ((LEFT, _("left")),
(RIGHT, _("right")),
+ (CENTER, _("center")),
)
-
-
+
image = models.ImageField(_("image"), upload_to=CMSPlugin.get_media_path)
- url = models.CharField(_("link"), max_length=255, blank=True, null=True, help_text=_("if present image will be clickable"))
- page_link = models.ForeignKey(Page, verbose_name=_("page"), null=True, blank=True, help_text=_("if present image will be clickable"))
- alt = models.CharField(_("alternate text"), max_length=255, blank=True, null=True, help_text=_("textual description of the image"))
- longdesc = models.CharField(_("long description"), max_length=255, blank=True, null=True, help_text=_("additional description of the image"))
- float = models.CharField(_("side"), max_length=10, blank=True, null=True, choices=FLOAT_CHOICES)
-
+ url = models.CharField(_("link"), max_length=255, blank=True, null=True,
+ help_text=_("If present, clicking on image will take user to link."))
+ page_link = models.ForeignKey(Page, verbose_name=_("page"), null=True,
+ blank=True, help_text=_("If present, clicking on image will take user \
+ to specified page."))
+ alt = models.CharField(_("alternate text"), max_length=255, blank=True,
+ null=True, help_text=_("Specifies an alternate text for an image, if \
+ the image cannot be displayed.<br />Is also used by search engines to \
+ classify the image."))
+ longdesc = models.CharField(_("long description"), max_length=255,
+ blank=True, null=True, help_text=_("When user hovers above picture,\
+ this text will appear in a popup."))
+ float = models.CharField(_("side"), max_length=10, blank=True, null=True,
+ choices=FLOAT_CHOICES, help_text=_("Move image left, right or center."))
+
def __unicode__(self):
if self.alt:
return self.alt[:40]
elif self.image:
- # added if, because it raised attribute error when file wasn't defined
+ # added if, because it raised attribute error when file wasn't
+ # defined.
try:
return u"%s" % basename(self.image.path)
except:

0 comments on commit 593422e

Please sign in to comment.
Something went wrong with that request. Please try again.