<?xml version="1.0" encoding="utf-8"?>
<configure xmlns="http://namespaces.zope.org/browser"
           xmlns:zope="http://namespaces.zope.org/zope"
           xmlns:zcml="http://namespaces.zope.org/zcml"
           i18n_domain="schooltool.intervention">

  <!-- Manage Tab -->
  <configure package="schooltool.skin">
    <navigationViewlet
        name="download_messages_goals_zip"
        for="*"
        manager="schooltool.app.browser.interfaces.IManageMenuViewletManager"
        template="templates/navigationViewlet.pt"
        class="schooltool.skin.skin.NavigationViewlet"
        permission="schooltool.edit"
        link="messages_goals.zip"
        title="Download Intervention CSV ZipFile"
        order="250"
        />
  </configure>

  <!-- Views for ISchoolToolApplication -->
  <page
      name="messages_goals.zip"
      for="schooltool.app.interfaces.ISchoolToolApplication"
      class=".intervention.MessagesGoalsCSVView"
      permission="schooltool.edit"
      />
  <page
      name="messages.csv"
      for="schooltool.app.interfaces.ISchoolToolApplication"
      class=".intervention.MessagesCSVView"
      permission="schooltool.edit"
      />
  <page
      name="goals.csv"
      for="schooltool.app.interfaces.ISchoolToolApplication"
      class=".intervention.GoalsCSVView"
      permission="schooltool.edit"
      />

  <!-- Navigation Tab and Startup View -->
  <navigationViewlet
      name="Intervention"
      for="*"
      manager="schooltool.skin.skin.INavigationManager"
      class=".intervention.InterventionNavigationViewlet"
      template="templates/intervention_tab.pt"
      permission="schooltool.view"
      order="310"
      />
  <page
      name="index.html"
      for="schooltool.intervention.interfaces.IInterventionTabProxy"
      class=".intervention.InterventionStartupView"
      template="templates/intervention_startup.pt"
      permission="schooltool.view"
      />
  <page
      name="search_students.html"
      for="schooltool.intervention.interfaces.IInterventionTabProxy"
      class=".intervention.InterventionStudentsView"
      template="templates/intervention_students.pt"
      permission="schooltool.view"
      />

  <!-- Interventions -->
  <configure package="schooltool.skin">
    <addform
        label="New Message"
        name="addMessage.html"
        schema="schooltool.intervention.interfaces.IInterventionMessage"
        fields="recipients body"
        arguments="recipients body"
        content_factory="schooltool.intervention.intervention.InterventionMessage"
        permission="schooltool.edit"
        template="templates/simple_add.pt"
        class="schooltool.intervention.browser.intervention.InterventionMessageAddView">
      <widget field="description" height="5" />
    </addform>
    <addform
        label="New Status Message"
        name="addStatusMessage.html"
        schema="schooltool.intervention.interfaces.IInterventionMessage"
        fields="recipients body"
        arguments="recipients body"
        content_factory="schooltool.intervention.intervention.InterventionMessage"
        permission="schooltool.edit"
        template="templates/simple_add.pt"
        class="schooltool.intervention.browser.intervention.InterventionStatusMessageAddView">
      <widget field="description" height="5" />
    </addform>
  </configure>
  <addform
      label="New Goal"
      name="addGoal.html"
      schema="schooltool.intervention.interfaces.IInterventionGoal"
      fields="presenting_concerns goal strengths indicators intervention timeline persons_responsible goal_met follow_up_notes"
      arguments="presenting_concerns goal strengths indicators intervention timeline persons_responsible"
      keyword_arguments="goal_met follow_up_notes"
      content_factory="schooltool.intervention.intervention.InterventionGoal"
      permission="schooltool.edit"
      template="templates/goal_add.pt"
      class="schooltool.intervention.browser.intervention.InterventionGoalAddView">
    <widget field="presenting_concerns" width="54" height="10" />
    <widget field="goal" width="54" height="10" />
    <widget field="strengths" width="54" height="10" />
    <widget field="indicators" width="54" height="10" />
    <widget field="intervention" width="54" height="10" />
    <widget field="follow_up_notes" width="54" height="10" />
  </addform>
  <editform
      label="Edit Goal"
      name="editGoal.html"
      for="schooltool.intervention.interfaces.IInterventionGoal"
      schema="schooltool.intervention.interfaces.IInterventionGoal"
      fields="presenting_concerns goal strengths indicators intervention timeline persons_responsible goal_met follow_up_notes"
      template="templates/goal_edit.pt"
      permission="schooltool.edit"
      class="schooltool.intervention.browser.intervention.InterventionGoalEditView"
      title="Edit Goal">
    <widget field="presenting_concerns" width="54" height="10" />
    <widget field="goal" width="54" height="10" />
    <widget field="strengths" width="54" height="10" />
    <widget field="indicators" width="54" height="10" />
    <widget field="intervention" width="54" height="10" />
    <widget field="follow_up_notes" width="54" height="10" />
  </editform>
  <page
      name="index.html"
      for="schooltool.intervention.interfaces.IInterventionStudent"
      class=".intervention.InterventionStudentView"
      template="templates/intervention.pt"
      permission="schooltool.edit"
      />
  <page
      name="intervention_student.pdf"
      for="schooltool.intervention.interfaces.IInterventionStudent"
      class=".pdf_views.InterventionStudentPDFView"
      permission="schooltool.edit"
      />
  <page
      name="intervention_center.html"
      for="schooltool.intervention.interfaces.IInterventionStudent"
      class=".intervention.InterventionStudentView"
      template="templates/intervention.pt"
      permission="schooltool.edit"
      />
  <page
      name="intervention_center.html"
      for="schooltool.basicperson.interfaces.IBasicPerson"
      class=".intervention.InterventionStudentRedirectView"
      permission="schooltool.edit"
      />
  <page
      name="allMessages.html"
      for="schooltool.intervention.interfaces.IInterventionMessages"
      class=".intervention.InterventionMessagesView"
      template="templates/intervention_messages.pt"
      permission="schooltool.edit"
      />
  <page
      name="allStatusMessages.html"
      for="schooltool.intervention.interfaces.IInterventionMessages"
      class=".intervention.InterventionStatusMessagesView"
      template="templates/intervention_messages.pt"
      permission="schooltool.edit"
      />
  <page
      name="index.html"
      for="schooltool.intervention.interfaces.IInterventionMessage"
      class=".intervention.InterventionMessageView"
      template="templates/intervention_message.pt"
      permission="schooltool.view"
      />
  <page
      name="allGoals.html"
      for="schooltool.intervention.interfaces.IInterventionGoals"
      class=".intervention.InterventionGoalsView"
      template="templates/goals_report.pt"
      permission="schooltool.edit"
      />
  <page
      name="index.html"
      for="schooltool.intervention.interfaces.IInterventionGoal"
      class=".intervention.InterventionGoalView"
      template="templates/intervention_goal.pt"
      permission="schooltool.view"
      />

  <!-- Special view for notifying persons responsible for goals that
       have come due -->
  <page
      name="notifyGoals.html"
      for="schooltool.intervention.interfaces.IInterventionRoot"
      class=".intervention.NotifyGoalsView"
      template="templates/notify_goals.pt"
      permission="schooltool.edit"
      />

  <!-- Intervention entry points from a section -->
  <page
      name="interventions.html"
      for="schooltool.course.interfaces.ISection"
      class=".intervention.SectionInterventionsView"
      template="templates/section_interventions.pt"
      permission="schooltool.edit"
      />

  <!-- Other resources -->
  <resource
      name="section_interventions.css"
      file="section_interventions.css"
      />

  <!-- Container views -->
  <containerViews
      for="schooltool.intervention.interfaces.IInterventionMessages"
      contents="schooltool.view"
      add="schooltool.edit"
      />
  <containerViews
      for="schooltool.intervention.interfaces.IInterventionGoals"
      contents="schooltool.view"
      add="schooltool.edit"
      />

  <!-- Action menu buttons -->
  <configure package="schooltool.skin">
    <navigationViewlet
      name="interventions"
      for="schooltool.course.interfaces.ISection"
      manager="schooltool.skin.IActionMenuManager"
      template="templates/actionsViewlet.pt"
      permission="schooltool.edit"
      link="@@interventions.html"
      title="Interventions"
      />
    <navigationViewlet
      name="intervention"
      for="schooltool.basicperson.interfaces.IBasicPerson"
      manager="schooltool.skin.IActionMenuManager"
      template="templates/actionsViewlet.pt"
      permission="schooltool.view"
      link="intervention/intervention_center.html"
      title="Intervention Center"
      />
    <navigationViewlet
      name="message_return"
      for="schooltool.intervention.interfaces.IInterventionMessage"
      manager="schooltool.skin.IActionMenuManager"
      template="templates/actionsViewlet.pt"
      permission="schooltool.edit"
      link="intervention"
      title="Intervention Center"
      />
    <navigationViewlet
      name="messages_return"
      for="schooltool.intervention.interfaces.IInterventionMessages"
      manager="schooltool.skin.IActionMenuManager"
      template="templates/actionsViewlet.pt"
      permission="schooltool.view"
      link=".."
      title="Intervention Center"
      />
    <navigationViewlet
      name="goal_edit"
      for="schooltool.intervention.interfaces.IInterventionGoal"
      manager="schooltool.skin.IActionMenuManager"
      template="templates/actionsViewlet.pt"
      permission="schooltool.edit"
      link="@@editGoal.html"
      title="Edit"
      />
    <navigationViewlet
      name="goals_return"
      for="schooltool.intervention.interfaces.IInterventionGoals"
      manager="schooltool.skin.IActionMenuManager"
      template="templates/actionsViewlet.pt"
      permission="schooltool.view"
      link=".."
      title="Intervention Center"
      />
    <navigationViewlet
      name="goal_return"
      for="schooltool.intervention.interfaces.IInterventionGoal"
      manager="schooltool.skin.IActionMenuManager"
      template="templates/actionsViewlet.pt"
      permission="schooltool.edit"
      link="intervention"
      title="Intervention Center"
      />
  </configure>

  <!-- Widget registration -->
  <zope:view
      type="zope.publisher.interfaces.browser.IBrowserRequest"
      for="schooltool.intervention.interfaces.IPersonListField"
      provides="zope.formlib.interfaces.IInputWidget"
      factory=".widgets.PersonListWidget"
      permission="zope.Public"
      />
  <zope:view
      type="zope.publisher.interfaces.browser.IBrowserRequest"
      for="schooltool.intervention.interfaces.IGoalMetField"
      provides="zope.formlib.interfaces.IInputWidget"
      factory=".widgets.GoalMetWidget"
      permission="zope.Public"
      />

  <!-- Table formatters and filter widgets -->
  <zope:adapter
      for="schooltool.intervention.interfaces.IInterventionSchoolYear
           zope.publisher.interfaces.browser.IBrowserRequest"
      factory=".intervention.StudentTableFormatter " />
  <zope:adapter
      for="schooltool.intervention.interfaces.IInterventionSchoolYear
           zope.publisher.interfaces.browser.IBrowserRequest"
      factory=".intervention.StudentFilterWidget" />
  <zope:adapter
      for="schooltool.intervention.interfaces.IInterventionRoot
           zope.publisher.interfaces.browser.IBrowserRequest"
      factory=".intervention.InterventionTableFormatter " />
  <zope:adapter
      for="schooltool.intervention.interfaces.IInterventionRoot
           zope.publisher.interfaces.browser.IBrowserRequest"
      factory=".intervention.InterventionFilterWidget" />

  <configure zcml:condition="have schooltool.skin.flourish">
    <include file="flourish.zcml" />
  </configure>

</configure>
