comparison personasbackend/personas/models.py @ 154:e86018a689ba

Moved the URL field for the persona to be below the header and footer image, which should be easier for users to understand, and modified field documentation to be more user-friendly too.
author Atul Varma <varmaa@toolness.com>
date Fri, 04 Apr 2008 13:37:37 -0700
parents 094102bd9529
children 7182070b0875
comparison
equal deleted inserted replaced
153:094102bd9529 154:e86018a689ba
263 description = models.TextField( 263 description = models.TextField(
264 help_text = "HTML is allowed.", 264 help_text = "HTML is allowed.",
265 blank=False, 265 blank=False,
266 ) 266 )
267 267
268 url = models.URLField(
269 "Dynamic Persona URL",
270 help_text=("URL for the content that will be placed behind "
271 "the browser's chrome. This is an advanced option, "
272 "and only needs to be specified if a header and "
273 "footer image are not uploaded."),
274 verify_exists=False,
275 blank=True,
276 )
277
278 def __get_resolved_url(self): 268 def __get_resolved_url(self):
279 if not self.url: 269 if not self.url:
280 return make_absolute_url( reverse( 270 return make_absolute_url( reverse(
281 'hosted-static-persona', 271 'hosted-static-persona',
282 kwargs = {'persona_id' : str(self.id)} 272 kwargs = {'persona_id' : str(self.id)}
357 MAX_FILE_NAME_LENGTH = 255 347 MAX_FILE_NAME_LENGTH = 255
358 348
359 header_img = models.ImageField( 349 header_img = models.ImageField(
360 "Header image", 350 "Header image",
361 help_text=("File for the image that will be placed behind " 351 help_text=("File for the image that will be placed behind "
362 "the browser's top chrome. Only required if " 352 "the browser's top chrome. It's also used to "
363 "a URL is not specified; however, if a URL " 353 "generate the preview of the Persona."),
364 "is specified, this image can be used as "
365 "a preview and/or fallback."),
366 upload_to="hosted-content/headers", 354 upload_to="hosted-content/headers",
367 blank=True, 355 blank=True,
368 max_length=MAX_FILE_NAME_LENGTH, 356 max_length=MAX_FILE_NAME_LENGTH,
369 ) 357 )
370 358
374 ) 362 )
375 363
376 footer_img = models.ImageField( 364 footer_img = models.ImageField(
377 "Footer image", 365 "Footer image",
378 help_text=("File for the image that will be placed behind " 366 help_text=("File for the image that will be placed behind "
379 "the browser's bottom chrome. Only required if " 367 "the browser's bottom chrome. It's also used "
380 "a URL is not specified; however, if a URL " 368 "to generate the preview of the Persona."),
381 "is specified, this image can be used as "
382 "a preview and/or fallback."),
383 upload_to="hosted-content/footers", 369 upload_to="hosted-content/footers",
384 blank=True, 370 blank=True,
385 max_length=MAX_FILE_NAME_LENGTH, 371 max_length=MAX_FILE_NAME_LENGTH,
386 ) 372 )
387 373
388 def get_absolute_footer_img_url( self ): 374 def get_absolute_footer_img_url( self ):
389 return make_absolute_url( 375 return make_absolute_url(
390 self.get_footer_img_url() 376 self.get_footer_img_url()
391 ) 377 )
378
379 url = models.URLField(
380 "Dynamic Persona URL",
381 help_text=(
382 "<b>Advanced:</b> Specifies a URL for the content that will "
383 "provide "
384 "dynamic content to be placed behind the browser chrome. "
385 "If you don't know what this means, you can leave the field "
386 "blank."),
387 verify_exists=False,
388 blank=True,
389 )
392 390
393 text_color = models.CharField( 391 text_color = models.CharField(
394 help_text=("The RGB color, as a #RRGGBB color hash, " 392 help_text=("The RGB color, as a #RRGGBB color hash, "
395 "of the color of text that will be displayed " 393 "of the color of text that will be displayed "
396 "on the persona."), 394 "on the persona."),