<?xml version="1.0"?>
<configure xmlns="http://namespaces.zope.org/browser"
           xmlns:z3c="http://namespaces.zope.org/z3c"
           xmlns:zope="http://namespaces.zope.org/zope"
           xmlns:flourish="http://schooltool.org/flourish"
           xmlns:report="http://namespaces.schooltool.org/report"
           i18n_domain="schooltool.intervention">

  <flourish:viewlet
      name="intervention"
      after="gradebook journal"
      manager="schooltool.skin.flourish.page.IHeaderNavigationManager"
      class=".intervention.FlourishInterventionNavViewlet"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="intervention-center-person-link"
      link="intervention"
      title="Interventions"
      class="schooltool.skin.flourish.page.LinkViewlet"
      manager="schooltool.basicperson.browser.person.PersonLinks"
      permission="schooltool.view"
      />

  <flourish:page
      name="index.html"
      for="schooltool.intervention.interfaces.IInterventionTabProxy"
      title="Intervention"
      subtitle="Inbox"
      content_template="templates/f_intervention_startup.pt"
      class=".intervention.FlourishInterventionStartupView"
      permission="schooltool.view"
      />

  <flourish:page
      name="search_students.html"
      for="schooltool.intervention.interfaces.IInterventionTabProxy"
      title="Intervention"
      subtitle="Search Students"
      content_template="templates/f_intervention_students.pt"
      class=".intervention.FlourishInterventionStudentsView"
      permission="schooltool.view"
      />

  <zope:adapter
      for="schooltool.intervention.interfaces.IInterventionSchoolYear
           schooltool.skin.flourish.IFlourishLayer"
      factory=".intervention.FlourishStudentFilterWidget" />
  <zope:adapter
      for="schooltool.intervention.interfaces.IInterventionRoot
           schooltool.skin.flourish.IFlourishLayer"
      factory=".intervention.FlourishInterventionFilterWidget" />

  <flourish:page
      name="index.html"
      for="schooltool.intervention.interfaces.IInterventionStudent"
      content_template="templates/f_intervention.pt"
      class=".intervention.FlourishInterventionStudentView"
      permission="schooltool.view"
      />

  <flourish:viewletManager
      name="tertiary_navigation"
      provides="schooltool.skin.flourish.page.ITertiaryNavigationManager"
      class=".intervention.InterventionStudentTertiaryNavigationManager"
      view=".intervention.FlourishInterventionStudentView"
      permission="zope.Public"
      />

  <flourish:viewlet
      name="intervention_dashboard"
      manager="schooltool.skin.flourish.page.IPageRefineManager"
      class=".intervention.FlourishInterventionStartupLinks"
      for="schooltool.intervention.interfaces.IInterventionTabProxy"
      title="Search"
      permission="schooltool.view"
      view=".intervention.FlourishInterventionStartupView"
      />

  <flourish:viewlet
      name="search_students.html"
      title="Students"
      class="schooltool.skin.flourish.page.LinkViewlet"
      manager=".intervention.FlourishInterventionStartupLinks"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="what-is-this"
      class="schooltool.skin.flourish.page.Related"
      template="templates/f_inbox_related.pt"
      for="schooltool.intervention.interfaces.IInterventionTabProxy"
      view=".intervention.FlourishInterventionStartupView"
      manager="schooltool.skin.flourish.page.IPageRelatedManager"
      permission="schooltool.view"
      />

<!--
  <flourish:viewlet
      name="intervention_student"
      manager="schooltool.skin.flourish.page.IPageRefineManager"
      class=".intervention.FlourishInterventionStudentLinks"
      for="schooltool.intervention.interfaces.IInterventionStudent"
      title="Add"
      permission="schooltool.view"
      view=".intervention.FlourishInterventionStudentView"
      />

  <flourish:viewlet
      name="messages/addMessage.html"
      title="Message"
      class="schooltool.skin.flourish.page.LinkViewlet"
      manager=".intervention.FlourishInterventionStudentLinks"
      permission="schooltool.view"
      />

  <flourish:viewlet
      name="goals/addGoal.html"
      after="messages/addMessage.html"
      title="Goal"
      class="schooltool.skin.flourish.page.LinkViewlet"
      manager=".intervention.FlourishInterventionStudentLinks"
      permission="schooltool.view"
      />
-->

  <configure package="schooltool.skin.flourish">
    <flourish:page
       name="addMessage.html"
       for="schooltool.intervention.interfaces.IInterventionMessages"
       subtitle="New Intervention Message"
       class="schooltool.intervention.browser.intervention.FlourishInterventionMessageAddView"
       content_template="templates/z3c_form_edit.pt"
       permission="schooltool.view"
       />

    <flourish:page
       name="addGoal.html"
       for="schooltool.intervention.interfaces.IInterventionGoals"
       subtitle="New Intervention Goal"
       class="schooltool.intervention.browser.intervention.FlourishInterventionGoalAddView"
       content_template="templates/z3c_form_edit.pt"
       permission="schooltool.view"
       />

    <flourish:page
       name="edit.html"
       for="schooltool.intervention.interfaces.IInterventionGoal"
       subtitle="Edit Intervention Goal"
       content_template="templates/z3c_form_edit.pt"
       class="schooltool.intervention.browser.intervention.FlourishInterventionGoalEditView"
       permission="schooltool.view"
       />
  </configure>

  <zope:adapter
      for="..interfaces.IInterventionGoal"
      provides=".intervention.IGoalAddForm"
      factory=".intervention.SimpleFormAdapter"
      />

  <flourish:page
      name="index.html"
      for="schooltool.intervention.interfaces.IInterventionMessage"
      subtitle="Intervention Message"
      content_template="templates/f_intervention_message.pt"
      class=".intervention.FlourishInterventionMessageView"
      permission="schooltool.view"
      />

  <flourish:page
      name="allMessages.html"
      for="schooltool.intervention.interfaces.IInterventionMessages"
      subtitle="Intervention Messages"
      content_template="templates/f_intervention_messages.pt"
      class=".intervention.FlourishInterventionMessagesView"
      permission="schooltool.view"
      />

  <flourish:page
      name="index.html"
      for="schooltool.intervention.interfaces.IInterventionGoal"
      subtitle="Intervention Goal"
      content_template="templates/f_intervention_goal.pt"
      class=".intervention.FlourishInterventionGoalView"
      permission="schooltool.view"
      />

  <flourish:page
      name="allGoals.html"
      for="schooltool.intervention.interfaces.IInterventionGoals"
      subtitle="Intervention Goals"
      content_template="templates/f_intervention_goals.pt"
      class=".intervention.FlourishInterventionGoalsView"
      permission="schooltool.view"
      />

  <!-- Section interventions -->
  <flourish:viewlet
      name="interventions.html"
      after="schedule"
      title="Interventions"
      class="schooltool.skin.flourish.page.LinkViewlet"
      manager="schooltool.course.browser.section.SectionLinks"
      permission="schooltool.edit"
      />

  <flourish:page
      name="interventions.html"
      for="schooltool.course.interfaces.ISection"
      subtitle="Interventions"
      content_template="templates/f_section_interventions.pt"
      class=".intervention.FlourishSectionInterventionsView"
      permission="schooltool.edit"
      />

  <flourish:viewletManager
      name="tertiary_navigation"
      provides="schooltool.skin.flourish.page.ITertiaryNavigationManager"
      class=".intervention.SectionInterventionsTertiaryNavigationManager"
      view=".intervention.FlourishSectionInterventionsView"
      permission="zope.Public"
      />

  <!-- Widget registration -->
  <zope:adapter
      factory=".widgets.PersonListFieldWidget"
      for="schooltool.intervention.interfaces.IPersonListField
           z3c.form.interfaces.IFormLayer"
      provides="z3c.form.interfaces.IFieldWidget"
      />
  <zope:class class=".widgets.PersonListZ3CFormWidget">
     <require
         permission="zope.Public"
         interface="z3c.form.interfaces.IWidget"
         />
   </zope:class>
  <zope:adapter
      factory=".widgets.PersonListFieldDataConverter"
      />

  <!-- Breadcrumbs -->

  <flourish:activeViewlet
      name="intervention"
      manager="schooltool.skin.flourish.page.IHeaderNavigationManager"
      for="schooltool.intervention.interfaces.IInterventionTabProxy"
      />

  <flourish:breadcrumb
      title="Interventions"
      for="schooltool.intervention.interfaces.IInterventionTabProxy"
      crumb_parent="schooltool.app.interfaces.ISchoolToolApplication"
      />

  <flourish:activeViewlet
      name="intervention"
      manager="schooltool.skin.flourish.page.IHeaderNavigationManager"
      for="schooltool.intervention.interfaces.IInterventionStudent"
      />

  <flourish:breadcrumb
      title="Interventions"
      for="schooltool.intervention.interfaces.IInterventionStudent"
      crumb_parent="schooltool.person.interfaces.IPerson"
      />

  <flourish:page_breadcrumbs
      show_page_title="false"
      title="Interventions"
      for="schooltool.intervention.interfaces.IInterventionStudent"
      crumb_parent="schooltool.person.interfaces.IPerson"
      />

  <flourish:breadcrumb
      title="Goals"
      for="schooltool.intervention.interfaces.IInterventionGoals"
      link="allGoals.html"
      />

  <flourish:page_breadcrumbs
      show_page_title="false"
      title="Goals"
      for="schooltool.intervention.interfaces.IInterventionGoals"
      view=".intervention.FlourishInterventionGoalsView"
      url=""
      />

  <flourish:breadcrumb
      title=""
      for="schooltool.intervention.interfaces.IInterventionGoal"
      crumb_parent="schooltool.intervention.interfaces.IInterventionStudent"
      />

  <flourish:breadcrumb
      title="Messages"
      for="schooltool.intervention.interfaces.IInterventionMessages"
      link="allMessages.html"
      />

  <flourish:page_breadcrumbs
      show_page_title="false"
      title="Messages"
      for="schooltool.intervention.interfaces.IInterventionMessages"
      view=".intervention.FlourishInterventionMessagesView"
      url=""
      />

  <flourish:breadcrumb
      title=""
      for="schooltool.intervention.interfaces.IInterventionMessage"
      crumb_parent="schooltool.intervention.interfaces.IInterventionStudent"
      />

  <!-- Reports -->

  <flourish:viewlet
      name="intervention-reports-links"
      manager="schooltool.skin.flourish.page.IPageRefineManager"
      class="schooltool.report.browser.report.ReportsLinks"
      title="Reports"
      view=".intervention.FlourishInterventionStudentView"
      permission="schooltool.edit"
      />

  <report:reportLink
      name="intervention_student_report"
      for="schooltool.intervention.interfaces.IInterventionStudent"
      permission="schooltool.edit"
      group="Student"
      description="Contains the current set of goals and messages for the student."
      title="Interventions PDF"
      file_type="pdf"
      link="request_intervention_student_report.html"
      />

  <flourish:page
      name="request_intervention_student_report.html"
      for="schooltool.intervention.interfaces.IInterventionStudent"
      class=".intervention.FlourishRequestInterventionStudentReportView"
      permission="schooltool.edit"
      />

</configure>
