<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:browser="http://namespaces.zope.org/browser"
    xmlns:plone="http://namespaces.plone.org/plone"
    i18n_domain="untranslated"
    >

  <include
      package="ploneintranet.layout"
      file="permissions.zcml"
      />
  <include
      package="plone.tiles"
      file="meta.zcml"
      />


  <!-- ======== MAGAZINE VIEWS =============== -->

  <browser:page
      name="view"
      for="ploneintranet.news.content.INewsApp"
      class=".magazine.NewsMagazine"
      template="templates/magazine.pt"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="magazine-preview"
      for="ploneintranet.news.content.INewsApp"
      class=".magazine.NewsMagazine"
      template="templates/magazine_preview.pt"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="panel-edit-frontpage.html"
      for="ploneintranet.news.content.INewsApp"
      class=".publisher.PanelEditFrontPage"
      template="templates/panel_edit_frontpage.pt"
      permission="zope2.View"
      layer=".interfaces.INewsLayer"
      />

  <!-- the "inner magazine" is used in both magazine and publisher -->
  <browser:page
      name="newsfeed"
      for="ploneintranet.news.content.INewsApp"
      class=".magazine.NewsMagazine"
      template="templates/newsfeed.pt"
      permission="zope2.View"
      layer=".interfaces.INewsLayer"
      />

  <browser:page
      name="newssubnav"
      for="*"
      class=".magazine.SubNav"
      template="templates/news-sub-nav.pt"
      permission="zope2.View"
      layer=".interfaces.INewsLayer"
      />

  <browser:page
      name="view"
      for="ploneintranet.news.content.INewsSection"
      class=".magazine.NewsSectionView"
      template="templates/magazine_section.pt"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="trending"
      for="ploneintranet.news.content.INewsSection"
      class=".magazine.TrendingNewsSectionView"
      template="templates/magazine_section.pt"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="mygroups"
      for="ploneintranet.news.content.INewsSection"
      class=".magazine.MyGroupsNewsSectionView"
      template="templates/magazine_section.pt"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="events-as-news"
      for="ploneintranet.news.content.INewsSection"
      class=".magazine.EventsNewsSectionView"
      template="templates/magazine_section.pt"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="feeditem"
      for="plone.app.contenttypes.interfaces.INewsItem"
      class=".magazine.FeedItem"
      template="templates/feeditem.pt"
      permission="zope2.View"
      layer=".interfaces.INewsContentLayer"
      />

  <browser:page
      name="feeditem"
      for="plone.app.contenttypes.interfaces.IEvent"
      class=".magazine.FeedItem"
      template="templates/feeditem-event.pt"
      permission="zope2.View"
      layer=".interfaces.INewsContentLayer"
      />

  <browser:page
      name="newsitem_view"
      for="plone.app.contenttypes.interfaces.INewsItem"
      class=".magazine.NewsItemView"
      template="templates/news-item.html"
      permission="zope2.View"
      layer=".interfaces.INewsContentLayer"
      />

  <!-- ======== PUBLISHER VIEWS =============== -->

  <browser:page
      name="publisher"
      for="ploneintranet.news.content.INewsApp"
      class=".publisher.NewsPublisher"
      allowed_attributes="get_target_sections"
      template="templates/publisher.pt"
      permission="ploneintranet.news.ViewPublisher"
      layer=".interfaces.INewsLayer"
      />

  <browser:page
      name="section-load-more"
      for="ploneintranet.news.content.INewsSection"
      class=".publisher.SectionLoadMore"
      template="templates/section_load_more.pt"
      permission="ploneintranet.news.ViewPublisher"
      layer=".interfaces.INewsLayer"
      />

  <browser:page
      name="panel-create-news.html"
      for="ploneintranet.news.content.INewsApp"
      class=".publisher.AddPanel"
      template="templates/panel-create-news.html"
      permission="ploneintranet.news.ViewPublisher"
      layer=".interfaces.INewsLayer"
      />

  <browser:page
      name="panel-edit-news-section-info.html"
      for="ploneintranet.news.content.INewsSection"
      class=".publisher.SectionEdit"
      template="templates/panel-edit-news-section-info.html"
      permission="cmf.ModifyPortalContent"
      layer=".interfaces.INewsLayer"
      />

  <browser:page
      name="confirm-delete-section.html"
      for="ploneintranet.news.content.INewsSection"
      class=".publisher.SectionDelete"
      template="templates/confirm-delete-section.html"
      permission="cmf.ModifyPortalContent"
      layer=".interfaces.INewsLayer"
      />

  <!-- Workflow changes might cause you to lose 'modify'
       so 'view' is the safer permission.
       The template and backend are locked down.
  -->
  <browser:page
      name="edit.html"
      for="plone.app.contenttypes.interfaces.INewsItem"
      class=".publisher.NewsItemEdit"
      template="templates/edit.html"
      permission="zope2.View"
      layer=".interfaces.INewsContentLayer"
      />

  <browser:page
      name="upload-slide-images"
      for="plone.app.contenttypes.interfaces.INewsItem"
      class=".publisher.UploadSlideImages"
      permission="cmf.AddPortalContent"
      layer=".interfaces.INewsContentLayer"
      />

  <browser:page
      name="remove-slide-image"
      for="plone.app.contenttypes.interfaces.INewsItem"
      class=".publisher.RemoveSlideImage"
      permission="cmf.ModifyPortalContent"
      layer=".interfaces.INewsContentLayer"
      />

  <browser:page
      name="edit-slide-description"
      for="plone.app.contenttypes.interfaces.IImage"
      class=".publisher.EditSlideDescription"
      permission="cmf.ModifyPortalContent"
      layer=".interfaces.INewsContentLayer"
      />

  <browser:page
      name="panel-select-image-image-bank"
      for="plone.app.contenttypes.interfaces.INewsItem"
      class=".gallery.BrowseGalleryPanel"
      template="templates/panel-select-image-image-bank.pt"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="panel-select-image-image-bank-collection"
      for="plone.app.contenttypes.interfaces.INewsItem"
      class=".gallery.BrowseGalleryPanel"
      template="templates/panel-select-image-image-bank-collection.pt"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="panel-select-image-pixxio"
      for="plone.app.contenttypes.interfaces.INewsItem"
      class=".gallery.BrowsePixxioPanel"
      template="templates/panel-select-image-pixxio.pt"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="panel-select-image-pixxio-collection"
      for="plone.app.contenttypes.interfaces.INewsItem"
      class=".gallery.BrowsePixxioPanel"
      template="templates/panel-select-image-pixxio-collection.pt"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="carousel"
      for="plone.app.contenttypes.interfaces.INewsItem"
      class=".gallery.Carousel"
      template="templates/carousel.pt"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="delete_confirmation"
      for="plone.app.contenttypes.interfaces.INewsItem"
      class=".publisher.NewsItemDelete"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="tip-of-the-day"
      for="*"
      class=".tip_of_the_day.View"
      template="templates/tip_of_the_day.pt"
      permission="zope2.View"
      layer=".interfaces.INewsLayer"
      />

  <browser:page
      name="feed-aggregator"
      for="Products.CMFPlone.interfaces.IPloneSiteRoot"
      class=".utils.FeedAggregator"
      permission="cmf.ManagePortal"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <configure package="ploneintranet.layout.browser">
    <browser:page
        name="workflow_menu"
        for="plone.app.contenttypes.interfaces.INewsItem"
        class="ploneintranet.news.browser.workflow.NewsWorkflowMenu"
        template="templates/workflow_menu.pt"
        permission="zope2.View"
        layer="ploneintranet.news.browser.interfaces.INewsContentLayer"
        />
  </configure>

  <plone:tile
      name="sidebar.tile"
      title="Sidebar tile"
      for="*"
      class=".sidebar.SidebarTile"
      template="templates/sidebar.tile.pt"
      permission="zope2.View"
      add_permission="cmf.ManagePortal"
      layer="ploneintranet.news.browser.interfaces.INewsContentLayer"
      />

  <browser:viewlet
      name="plone.path_bar"
      view=".interfaces.IPublisherView"
      manager="plone.app.layout.viewlets.interfaces.IAboveContent"
      class=".path_bar.NewsEditPathBarViewlet"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="translations_view"
      for="plone.app.contenttypes.interfaces.INewsItem"
      class=".translations.TranslationsView"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="language-menu"
      for="plone.app.contenttypes.interfaces.INewsItem"
      template="templates/language_menu.pt"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="panel-create-language"
      for="plone.app.contenttypes.interfaces.INewsItem"
      class=".translations.CreateLanguagePanel"
      template="templates/panel-create-language.pt"
      permission="zope2.View"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="panel-remove-language"
      for="plone.app.contenttypes.interfaces.INewsItem"
      class=".translations.RemoveLanguagePanel"
      template="templates/panel-remove-language.pt"
      permission="zope2.DeleteObjects"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="more-menu"
      for="plone.app.contenttypes.interfaces.INewsItem"
      class=".publisher.NewsItemEdit"
      template="templates/more-menu.pt"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="edit-button"
      for="plone.app.contenttypes.interfaces.INewsItem"
      class=".iterate.EditButton"
      template="templates/edit-button.pt"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="panel-check-out"
      for="plone.app.contenttypes.interfaces.INewsItem"
      class=".iterate.CheckOutPanel"
      template="templates/panel-check-out.pt"
      permission="plone.app.iterate.CheckOutContent"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="panel-check-in"
      for="plone.app.contenttypes.interfaces.INewsItem"
      class=".iterate.CheckInPanel"
      template="templates/panel-check-in.pt"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

  <browser:page
      name="panel-cancel-check-out"
      for="plone.app.contenttypes.interfaces.INewsItem"
      class=".iterate.RemovePanel"
      template="templates/panel-cancel-check-out.pt"
      permission="cmf.ModifyPortalContent"
      layer="ploneintranet.layout.interfaces.INoBarcelonetaLayer"
      />

</configure>
