Beispiel #1
0
class OwnHTMLContainer(CMSPlugin):
    name = models.CharField(_context("Name", "Name of the custom HTML"),
                            max_length=255)
    html = models.TextField("HTML")

    def __str__(self):
        return self.name
Beispiel #2
0
class ArticlePublisher(models.Model):
    name = models.CharField(_context("Name", "Name of a person"),
                            max_length=255)
    image = FilerImageField(null=True,
                            blank=True,
                            default=None,
                            verbose_name=_("Photo"),
                            on_delete=models.CASCADE)

    class Meta:
        verbose_name = _("Publisher")
        verbose_name_plural = _("Publishers")

    def __str__(self):
        return self.name
Beispiel #3
0
def authenticated_menu(request, menu_items):
    if not request.user.is_authenticated():
        return
    menu_items += ({
        'title': _('Your profile'),
        'view': views.user_profile,
    }, {
        'title': _context('account', 'History'),
        'view': views.user_history,
    }, {
        'title': _('Change profile'),
        'view': views.change_user_profile,
    }, {
        'title': _('Logout'),
        'view': 'logout',
    })
Beispiel #4
0
def authenticated_menu(request, menu_items):
    if not request.user.is_authenticated():
        return
    menu_items += (
        {
            'title': _('Your profile'),
            'view': views.user_profile,
        },
        {
            'title': _context('account', 'History'),
            'view': views.user_history,
        },
        {
            'title': _('Change profile'),
            'view': views.change_user_profile,
        },
        {
            'title': _('Logout'),
            'view': 'logout',
        }
    )