# Path: apps/page/models.py
# class Page(models.Model):
# 
#     team        = models.ForeignKey("team.Team", related_name="pages")
#     link        = models.SlugField(unique=True)
#     name        = models.CharField(max_length=1024)
#     content     = SanitizedCharField(
#                     max_length=50000, allowed_tags=SANITIZER_ALLOWED_TAGS, 
#                     allowed_attributes=SANITIZER_ALLOWED_ATTRIBUTES, strip=False
#                 )
# 
#     order       = models.IntegerField(blank=True, null=True)
# 
#     # meta
#     created_by  = models.ForeignKey(Account, related_name="pages_created")
#     created_on  = models.DateTimeField(auto_now_add=True)
#     updated_by  = models.ForeignKey(Account, related_name="pages_updated")
#     updated_on  = models.DateTimeField(auto_now=True)
# 
#     def __unicode__(self):
#         return u"%s: %s" % (self.team.name, self.name)
# 
#     class Meta:                                                                                                 
#                                                                                                                 
#         unique_together = (("team", "name"), ("team", "link")) 
#         ordering = ["order", "name"]
# 
# Path: config/settings.py
# SANITIZER_ALLOWED_TAGS = [
#     'a', 'p', 'b', 'u', 'i', 'h1', 'h2', 'h3', 'img', 'br', 'table', 'tbody',
#     'tr', 'td', 'span', 'li', 'ul'
# ]
# 
# SANITIZER_ALLOWED_ATTRIBUTES = [ 'href', 'src', 'style', 'width', 'height']


from django import forms
from django.utils.translation import ugettext as _
from sanitizer.forms import SanitizedCharField
from apps.common.shortcuts import uslugify
from apps.page.models import Page
from config.settings import SANITIZER_ALLOWED_TAGS, SANITIZER_ALLOWED_ATTRIBUTES
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Fabian Barkhau <fabian.barkhau@gmail.com>                  
# License: MIT (see LICENSE.TXT file) 




_RESERVED_NAMES = [
    u"blog",
    u"bikes",
    u"borrows",
    u"stations",
    u"members",
    u"join_request",
    u"join_requested",
    u"join_requests",
    u"join_request_process",
    u"remove_requests",
]


class CreatePageForm(forms.Form):

    name = forms.CharField(label=_("PAGE_NAME"))
    content = SanitizedCharField(label=_("CONTENT"), widget=forms.Textarea,

# Path: apps/page/models.py
# class Page(models.Model):
# 
#     team        = models.ForeignKey("team.Team", related_name="pages")
#     link        = models.SlugField(unique=True)
#     name        = models.CharField(max_length=1024)
#     content     = SanitizedCharField(
#                     max_length=50000, allowed_tags=SANITIZER_ALLOWED_TAGS, 
#                     allowed_attributes=SANITIZER_ALLOWED_ATTRIBUTES, strip=False
#                 )
# 
#     order       = models.IntegerField(blank=True, null=True)
# 
#     # meta
#     created_by  = models.ForeignKey(Account, related_name="pages_created")
#     created_on  = models.DateTimeField(auto_now_add=True)
#     updated_by  = models.ForeignKey(Account, related_name="pages_updated")
#     updated_on  = models.DateTimeField(auto_now=True)
# 
#     def __unicode__(self):
#         return u"%s: %s" % (self.team.name, self.name)
# 
#     class Meta:                                                                                                 
#                                                                                                                 
#         unique_together = (("team", "name"), ("team", "link")) 
#         ordering = ["order", "name"]
# 
# Path: config/settings.py
# SANITIZER_ALLOWED_TAGS = [
#     'a', 'p', 'b', 'u', 'i', 'h1', 'h2', 'h3', 'img', 'br', 'table', 'tbody',
#     'tr', 'td', 'span', 'li', 'ul'
# ]
# 
# SANITIZER_ALLOWED_ATTRIBUTES = [ 'href', 'src', 'style', 'width', 'height']


# Path: apps/page/forms.py
from django import forms
from django.utils.translation import ugettext as _
from sanitizer.forms import SanitizedCharField
from apps.common.shortcuts import uslugify
from apps.page.models import Page
from config.settings import SANITIZER_ALLOWED_TAGS, SANITIZER_ALLOWED_ATTRIBUTES

# -*- coding: utf-8 -*-
# Copyright (c) 2012 Fabian Barkhau <fabian.barkhau@gmail.com>                  
# License: MIT (see LICENSE.TXT file) 




_RESERVED_NAMES = [
    u"blog",
    u"bikes",
    u"borrows",
    u"stations",
    u"members",
    u"join_request",
    u"join_requested",
    u"join_requests",
    u"join_request_process",
    u"remove_requests",
]


class CreatePageForm(forms.Form):

    name = forms.CharField(label=_("PAGE_NAME"))
    content = SanitizedCharField(label=_("CONTENT"), widget=forms.Textarea,

                                 max_length=50000, allowed_tags=SANITIZER_ALLOWED_TAGS,