# Path: djangocms_page_meta/models.py
# class PageMeta(PageExtension):
#     image = FilerFileField(
#         null=True,
#         blank=True,
#         related_name="djangocms_page_meta_page",
#         help_text=_("Used if title image is empty."),
#         on_delete=models.CASCADE,
#     )
#     og_type = models.CharField(
#         _("Resource type"),
#         max_length=255,
#         choices=meta_settings.FB_TYPES,
#         blank=True,
#         help_text=_("Use Article for generic pages."),
#     )
#     og_author = models.ForeignKey(
#         settings.AUTH_USER_MODEL,
#         verbose_name=_("Author account"),
#         null=True,
#         blank=True,
#         on_delete=models.CASCADE,
#     )
#     og_author_url = models.CharField(_("Author Facebook URL"), max_length=255, default="", blank=True)
#     og_author_fbid = models.CharField(
#         _("Author Facebook ID"), max_length=16, default="", blank=True, help_text=_("Use Facebook numeric ID.")
#     )
#     og_publisher = models.CharField(_("Website Facebook URL"), max_length=255, default="", blank=True)
#     og_app_id = models.CharField(_("Facebook App ID"), max_length=255, default="", blank=True)
#     fb_pages = models.CharField(_("Facebook Pages ID"), max_length=255, default="", blank=True)
#     twitter_author = models.CharField(
#         _("Author Twitter Account"), max_length=255, default="", blank=True, help_text=_("'@' character not required.")
#     )
#     twitter_site = models.CharField(
#         _("Website Twitter Account"),
#         max_length=255,
#         default="",
#         blank=True,
#         help_text=_("'@' character not required."),
#     )
#     twitter_type = models.CharField(
#         _("Resource type"), max_length=255, choices=meta_settings.TWITTER_TYPES, blank=True
#     )
# 
#     schemaorg_type = models.CharField(
#         _("Resource type"),
#         max_length=255,
#         choices=meta_settings.SCHEMAORG_TYPES,
#         blank=True,
#         help_text=_("Use Article for generic pages."),
#     )
# 
#     class Meta:
#         verbose_name = _("Page meta info (all languages)")
#         verbose_name_plural = _("Page meta info (all languages)")
# 
#     def __str__(self):
#         return _("Page Meta for {0}").format(self.extended_object)
# 
#     def copy_relations(self, oldinstance, language):
#         # Remove old refs to prep for copying
#         self.extra.all().delete()
# 
#         # Copy everyting to published page instance
#         for item in oldinstance.extra.all():
#             item.pk = None
#             item.page = self
#             item.save()
# 
# class TitleMeta(TitleExtension):
#     image = FilerFileField(
#         null=True,
#         blank=True,
#         related_name="djangocms_page_meta_title",
#         help_text=_("If empty, page image will be used for all languages."),
#         on_delete=models.CASCADE,
#     )
#     keywords = models.CharField(max_length=2000, default="", blank=True)
#     description = models.CharField(max_length=2000, default="", blank=True)
#     og_description = models.CharField(_("Facebook Description"), max_length=2000, default="", blank=True)
#     twitter_description = models.CharField(_("Twitter Description"), max_length=2000, default="", blank=True)
#     schemaorg_name = models.CharField(
#         _("Schemaorg Name"), max_length=255, blank=True, help_text=_("Name of the item.")
#     )
#     schemaorg_description = models.CharField(
#         _("Schemaorg Description"), max_length=255, blank=True, help_text=_("Description of the item.")
#     )
# 
#     class Meta:
#         verbose_name = _("Page meta info (language-dependent)")
#         verbose_name_plural = _("Page meta info (language-dependent)")
# 
#     def __str__(self):
#         return _("Title Meta for {0}").format(self.extended_object)
# 
#     @property
#     def locale(self):
#         if self.extended_object.language.find("_") > -1:
#             return self.extended_object.language
#         else:
#             return None
# 
#     def copy_relations(self, oldinstance, language):
#         # Remove old refs to prep for copying
#         self.extra.all().delete()
# 
#         # Copy everyting to published page instance
#         for item in oldinstance.extra.all():
#             item.pk = None
#             item.title = self
#             item.save()


from cms.api import get_page_draft
from cms.cms_toolbars import PAGE_MENU_SECOND_BREAK
from cms.toolbar.items import Break
from cms.toolbar_base import CMSToolbar
from cms.toolbar_pool import toolbar_pool
from cms.utils.i18n import get_language_list, get_language_object
from cms.utils.permissions import has_page_permission
from django.urls import NoReverseMatch, reverse
from django.utils.translation import ugettext_lazy as _
from .models import PageMeta, TitleMeta
    from cms.utils import get_cms_setting
    from cms.utils.conf import get_cms_setting


try:
except ImportError:


PAGE_META_MENU_TITLE = _("Meta-information")
PAGE_META_ITEM_TITLE = _("Common")


@toolbar_pool.register

# Path: djangocms_page_meta/models.py
# class PageMeta(PageExtension):
#     image = FilerFileField(
#         null=True,
#         blank=True,
#         related_name="djangocms_page_meta_page",
#         help_text=_("Used if title image is empty."),
#         on_delete=models.CASCADE,
#     )
#     og_type = models.CharField(
#         _("Resource type"),
#         max_length=255,
#         choices=meta_settings.FB_TYPES,
#         blank=True,
#         help_text=_("Use Article for generic pages."),
#     )
#     og_author = models.ForeignKey(
#         settings.AUTH_USER_MODEL,
#         verbose_name=_("Author account"),
#         null=True,
#         blank=True,
#         on_delete=models.CASCADE,
#     )
#     og_author_url = models.CharField(_("Author Facebook URL"), max_length=255, default="", blank=True)
#     og_author_fbid = models.CharField(
#         _("Author Facebook ID"), max_length=16, default="", blank=True, help_text=_("Use Facebook numeric ID.")
#     )
#     og_publisher = models.CharField(_("Website Facebook URL"), max_length=255, default="", blank=True)
#     og_app_id = models.CharField(_("Facebook App ID"), max_length=255, default="", blank=True)
#     fb_pages = models.CharField(_("Facebook Pages ID"), max_length=255, default="", blank=True)
#     twitter_author = models.CharField(
#         _("Author Twitter Account"), max_length=255, default="", blank=True, help_text=_("'@' character not required.")
#     )
#     twitter_site = models.CharField(
#         _("Website Twitter Account"),
#         max_length=255,
#         default="",
#         blank=True,
#         help_text=_("'@' character not required."),
#     )
#     twitter_type = models.CharField(
#         _("Resource type"), max_length=255, choices=meta_settings.TWITTER_TYPES, blank=True
#     )
# 
#     schemaorg_type = models.CharField(
#         _("Resource type"),
#         max_length=255,
#         choices=meta_settings.SCHEMAORG_TYPES,
#         blank=True,
#         help_text=_("Use Article for generic pages."),
#     )
# 
#     class Meta:
#         verbose_name = _("Page meta info (all languages)")
#         verbose_name_plural = _("Page meta info (all languages)")
# 
#     def __str__(self):
#         return _("Page Meta for {0}").format(self.extended_object)
# 
#     def copy_relations(self, oldinstance, language):
#         # Remove old refs to prep for copying
#         self.extra.all().delete()
# 
#         # Copy everyting to published page instance
#         for item in oldinstance.extra.all():
#             item.pk = None
#             item.page = self
#             item.save()
# 
# class TitleMeta(TitleExtension):
#     image = FilerFileField(
#         null=True,
#         blank=True,
#         related_name="djangocms_page_meta_title",
#         help_text=_("If empty, page image will be used for all languages."),
#         on_delete=models.CASCADE,
#     )
#     keywords = models.CharField(max_length=2000, default="", blank=True)
#     description = models.CharField(max_length=2000, default="", blank=True)
#     og_description = models.CharField(_("Facebook Description"), max_length=2000, default="", blank=True)
#     twitter_description = models.CharField(_("Twitter Description"), max_length=2000, default="", blank=True)
#     schemaorg_name = models.CharField(
#         _("Schemaorg Name"), max_length=255, blank=True, help_text=_("Name of the item.")
#     )
#     schemaorg_description = models.CharField(
#         _("Schemaorg Description"), max_length=255, blank=True, help_text=_("Description of the item.")
#     )
# 
#     class Meta:
#         verbose_name = _("Page meta info (language-dependent)")
#         verbose_name_plural = _("Page meta info (language-dependent)")
# 
#     def __str__(self):
#         return _("Title Meta for {0}").format(self.extended_object)
# 
#     @property
#     def locale(self):
#         if self.extended_object.language.find("_") > -1:
#             return self.extended_object.language
#         else:
#             return None
# 
#     def copy_relations(self, oldinstance, language):
#         # Remove old refs to prep for copying
#         self.extra.all().delete()
# 
#         # Copy everyting to published page instance
#         for item in oldinstance.extra.all():
#             item.pk = None
#             item.title = self
#             item.save()


# Path: djangocms_page_meta/cms_toolbars.py
from cms.api import get_page_draft
from cms.cms_toolbars import PAGE_MENU_SECOND_BREAK
from cms.toolbar.items import Break
from cms.toolbar_base import CMSToolbar
from cms.toolbar_pool import toolbar_pool
from cms.utils.i18n import get_language_list, get_language_object
from cms.utils.permissions import has_page_permission
from django.urls import NoReverseMatch, reverse
from django.utils.translation import ugettext_lazy as _
from .models import PageMeta, TitleMeta
    from cms.utils import get_cms_setting
    from cms.utils.conf import get_cms_setting



try:
except ImportError:


PAGE_META_MENU_TITLE = _("Meta-information")
PAGE_META_ITEM_TITLE = _("Common")


@toolbar_pool.register

class PageToolbarMeta(CMSToolbar):