# Path: server/whatsbuzz/forms.py
# class TrendForm(forms.ModelForm):
#     class Meta:
#         model = Trend
#         fields = ('title', 'body', 'banner_image', 'buzz', 'age_categories', 'publish', 'code', 'tags', )
#         widgets = {
#             'tags': autocomplete.ModelSelect2Multiple(url='tags-autocomplete', attrs={
#                 'data-placeholder': _('Select Tags'),
#                 'data-multiple': 'multiple',
#                 'style': 'width: 625px',
#             })
#         }
# 
# class FacebookGameForm(forms.ModelForm):
#     class Meta:
#         model = FacebookGame
#         fields = ('title', 'body', 'banner_image', 'buzz', 'age_categories', 'publish', 'tags', )
#         widgets = {
#             'tags': autocomplete.ModelSelect2Multiple(url='tags-autocomplete', attrs={
#                 'data-placeholder': _('Select Tags'),
#                 'data-multiple': 'multiple',
#                 'style': 'width: 625px',
#             })
#         }
# 
# Path: server/whatsbuzz/models.py
# class User(models.Model):
#     """
#     All the facebook users that ever logged in to the site.
#     """
#     token = models.TextField()
#     user_id = models.TextField(_('user_id'), max_length=225)
#     name = models.CharField(_('name'), max_length=225)
#     created_at = models.DateTimeField(auto_now_add=True)
#     last_time_visit = models.DateTimeField(_('last_time_visit'))
# 
#     class Meta:
#         verbose_name = _('Facebook User')
#         verbose_name_plural = _('Facebook Users')
# 
# class Tags(models.Model):
#     name = models.CharField(_('tag'), max_length=255)
# 
#     def __str__(self):
#         return "{0}".format(self.name)
# 
#     class Meta:
#         verbose_name = _('Tag')
#         verbose_name_plural = _('Tags')
# 
# class Trend(Post):
#     """
#     An article like post.
#     """
#     code = models.TextField(_('code'))
# 
#     class Meta:
#         verbose_name = _('Trend')
#         verbose_name_plural = _('Trends')
# 
# class FacebookGame(Post):
#     """
#     Facebook Game contains all the facebook related entities.
#     """
#     class Meta:
#         verbose_name = _('Facebook Game')
#         verbose_name_plural = _('Facebook Games')
# 
# class FacebookGamesImage(models.Model):
#     """
#     All the background images for a Facebook Game.
#     """
#     post = models.ForeignKey(FacebookGame, related_name='background_image')
#     background_image = models.ImageField(_('background image'), upload_to='posts/%Y/%m/%d/', blank=True)
# 
#     class Meta:
#         verbose_name = _('facebook background image')
#         verbose_name_plural = _('facebook background images')
# 
# class FacebookUsername(models.Model):
#     """
#     The username options for a Facebook Game.
#     """
#     post = models.ForeignKey(FacebookGame, related_name='facebook_username')
#     username = models.CharField(_('username'), max_length=255, choices=FacebookUserName.choices, default='empty')
#     x = models.PositiveIntegerField(_('x'))
#     y = models.PositiveIntegerField(_('y'))
#     color = models.CharField(_('color'), max_length=255)
#     font_size = models.PositiveIntegerField(_('font_size'))
#     text_align = models.CharField(_('text align'), max_length=225, choices=UserNameAlign.choices, default='center')
# 
#     class Meta:
#         verbose_name = _('facebook username')
#         verbose_name_plural = _('facebook usernames')
# 
# class FacebookProfileImage(models.Model):
#     """
#     The facebook profile image of the user, for a Facebook Game.
#     """
#     post = models.ForeignKey(FacebookGame, related_name='facebook_profile_image')
#     width = models.PositiveIntegerField(_('width'))
#     height = models.PositiveIntegerField(_('height'))
#     x = models.PositiveIntegerField(_('x'))
#     y = models.PositiveIntegerField(_('y'))
# 
#     class Meta:
#         verbose_name = _('facebook profile image')
#         verbose_name_plural = _('facebook profile images')


from django.contrib import admin
from modeltranslation.admin import TranslationAdmin
from .forms import TrendForm, FacebookGameForm
from .models import User, Tags, Trend, FacebookGame, FacebookGamesImage, FacebookUsername, FacebookProfileImage
        )
        css = {
            "all": ("css/admin.css",),
            'screen': ('modeltranslation/css/tabbed_translation_fields.css',),
        }


class FacebookGameAdmin(TranslationAdmin):
    form = FacebookGameForm
    model = FacebookGame
    inlines = [FacebookGamesImageAdmin, FacebookUsernameAdmin, FacebookProfileImageAdmin]
    list_display = ['title', 'buzz', 'age_categories', 'publish']
    search_fields = ['title', 'buzz', 'age_categories', 'publish']

    class Media:
        js = (
            'modeltranslation/js/force_jquery.js',
            '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/jquery-ui.min.js',
            'modeltranslation/js/tabbed_translation_fields.js',
            '//cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js',
        )
        css = {
            "all": ("css/admin.css",),
            'screen': ('modeltranslation/css/tabbed_translation_fields.css',),
        }


admin.site.register(User, UserAdmin)
admin.site.register(Trend, TrendAdmin)
admin.site.register(Tags, TagsAdmin)

# Path: server/whatsbuzz/forms.py
# class TrendForm(forms.ModelForm):
#     class Meta:
#         model = Trend
#         fields = ('title', 'body', 'banner_image', 'buzz', 'age_categories', 'publish', 'code', 'tags', )
#         widgets = {
#             'tags': autocomplete.ModelSelect2Multiple(url='tags-autocomplete', attrs={
#                 'data-placeholder': _('Select Tags'),
#                 'data-multiple': 'multiple',
#                 'style': 'width: 625px',
#             })
#         }
# 
# class FacebookGameForm(forms.ModelForm):
#     class Meta:
#         model = FacebookGame
#         fields = ('title', 'body', 'banner_image', 'buzz', 'age_categories', 'publish', 'tags', )
#         widgets = {
#             'tags': autocomplete.ModelSelect2Multiple(url='tags-autocomplete', attrs={
#                 'data-placeholder': _('Select Tags'),
#                 'data-multiple': 'multiple',
#                 'style': 'width: 625px',
#             })
#         }
# 
# Path: server/whatsbuzz/models.py
# class User(models.Model):
#     """
#     All the facebook users that ever logged in to the site.
#     """
#     token = models.TextField()
#     user_id = models.TextField(_('user_id'), max_length=225)
#     name = models.CharField(_('name'), max_length=225)
#     created_at = models.DateTimeField(auto_now_add=True)
#     last_time_visit = models.DateTimeField(_('last_time_visit'))
# 
#     class Meta:
#         verbose_name = _('Facebook User')
#         verbose_name_plural = _('Facebook Users')
# 
# class Tags(models.Model):
#     name = models.CharField(_('tag'), max_length=255)
# 
#     def __str__(self):
#         return "{0}".format(self.name)
# 
#     class Meta:
#         verbose_name = _('Tag')
#         verbose_name_plural = _('Tags')
# 
# class Trend(Post):
#     """
#     An article like post.
#     """
#     code = models.TextField(_('code'))
# 
#     class Meta:
#         verbose_name = _('Trend')
#         verbose_name_plural = _('Trends')
# 
# class FacebookGame(Post):
#     """
#     Facebook Game contains all the facebook related entities.
#     """
#     class Meta:
#         verbose_name = _('Facebook Game')
#         verbose_name_plural = _('Facebook Games')
# 
# class FacebookGamesImage(models.Model):
#     """
#     All the background images for a Facebook Game.
#     """
#     post = models.ForeignKey(FacebookGame, related_name='background_image')
#     background_image = models.ImageField(_('background image'), upload_to='posts/%Y/%m/%d/', blank=True)
# 
#     class Meta:
#         verbose_name = _('facebook background image')
#         verbose_name_plural = _('facebook background images')
# 
# class FacebookUsername(models.Model):
#     """
#     The username options for a Facebook Game.
#     """
#     post = models.ForeignKey(FacebookGame, related_name='facebook_username')
#     username = models.CharField(_('username'), max_length=255, choices=FacebookUserName.choices, default='empty')
#     x = models.PositiveIntegerField(_('x'))
#     y = models.PositiveIntegerField(_('y'))
#     color = models.CharField(_('color'), max_length=255)
#     font_size = models.PositiveIntegerField(_('font_size'))
#     text_align = models.CharField(_('text align'), max_length=225, choices=UserNameAlign.choices, default='center')
# 
#     class Meta:
#         verbose_name = _('facebook username')
#         verbose_name_plural = _('facebook usernames')
# 
# class FacebookProfileImage(models.Model):
#     """
#     The facebook profile image of the user, for a Facebook Game.
#     """
#     post = models.ForeignKey(FacebookGame, related_name='facebook_profile_image')
#     width = models.PositiveIntegerField(_('width'))
#     height = models.PositiveIntegerField(_('height'))
#     x = models.PositiveIntegerField(_('x'))
#     y = models.PositiveIntegerField(_('y'))
# 
#     class Meta:
#         verbose_name = _('facebook profile image')
#         verbose_name_plural = _('facebook profile images')


# Path: server/whatsbuzz/admin.py
from django.contrib import admin
from modeltranslation.admin import TranslationAdmin
from .forms import TrendForm, FacebookGameForm
from .models import User, Tags, Trend, FacebookGame, FacebookGamesImage, FacebookUsername, FacebookProfileImage

        )
        css = {
            "all": ("css/admin.css",),
            'screen': ('modeltranslation/css/tabbed_translation_fields.css',),
        }


class FacebookGameAdmin(TranslationAdmin):
    form = FacebookGameForm
    model = FacebookGame
    inlines = [FacebookGamesImageAdmin, FacebookUsernameAdmin, FacebookProfileImageAdmin]
    list_display = ['title', 'buzz', 'age_categories', 'publish']
    search_fields = ['title', 'buzz', 'age_categories', 'publish']

    class Media:
        js = (
            'modeltranslation/js/force_jquery.js',
            '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/jquery-ui.min.js',
            'modeltranslation/js/tabbed_translation_fields.js',
            '//cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js',
        )
        css = {
            "all": ("css/admin.css",),
            'screen': ('modeltranslation/css/tabbed_translation_fields.css',),
        }


admin.site.register(User, UserAdmin)
admin.site.register(Trend, TrendAdmin)
admin.site.register(Tags, TagsAdmin)

admin.site.register(FacebookGame, FacebookGameAdmin)