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

  <!-- Navigation Tab and Startup View -->
  <navigationViewlet
      name="Intervention"
      for="*"
      manager="schooltool.skin.skin.INavigationManager"
      class=".intervention.InterventionNavigationViewlet"
      template="intervention_tab.pt"
      permission="schooltool.view"
      order="310"
      />
  <page
      name="index.html"
      for="schooltool.intervention.interfaces.IInterventionTabProxy"
      class=".intervention.InterventionStartupView"
      template="intervention_startup.pt"
      permission="schooltool.view"
      />
  <page
      name="search_students.html"
      for="schooltool.intervention.interfaces.IInterventionTabProxy"
      class=".intervention.InterventionStudentsView"
      template="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="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="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="intervention.pt"
      permission="schooltool.edit"
      />
  <page
      name="intervention_center.html"
      for="schooltool.intervention.interfaces.IInterventionStudent"
      class=".intervention.InterventionStudentView"
      template="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="intervention_messages.pt"
      permission="schooltool.edit"
      />
  <page
      name="allStatusMessages.html"
      for="schooltool.intervention.interfaces.IInterventionMessages"
      class=".intervention.InterventionStatusMessagesView"
      template="intervention_messages.pt"
      permission="schooltool.edit"
      />
  <page
      name="index.html"
      for="schooltool.intervention.interfaces.IInterventionMessage"
      class=".intervention.InterventionMessageView"
      template="intervention_message.pt"
      permission="schooltool.view"
      />
  <page
      name="allGoals.html"
      for="schooltool.intervention.interfaces.IInterventionGoals"
      class=".intervention.InterventionGoalsView"
      template="goals_report.pt"
      permission="schooltool.edit"
      />
  <page
      name="index.html"
      for="schooltool.intervention.interfaces.IInterventionGoal"
      class=".intervention.InterventionGoalView"
      template="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="notify_goals.pt"
      permission="schooltool.edit"
      />

  <!-- Intervention reports -->
  <navigationViewlet
    name="schooltool.intervention.reports_action"
    for="*"
    manager="schooltool.skin.IActionMenuManager"
    permission="schooltool.view"
    template="reportsViewlet.pt"
    class=".reports.ReportsViewlet"
    title="Reports"
    />
  <viewletManager
      name="schooltool.intervention.reports_action_manager"
      permission="zope.Public"
      provides=".reports.IReportsViewletManager"
      class="schooltool.skin.skin.OrderedViewletManager"
      />

  <!-- Report menu item resources -->
  <resource
      name="reportsViewlet.css"
      file="reportsViewlet.css"
      />
  <viewlet
      name="reports_viewlet_css"
      for="*"
      manager="schooltool.skin.ICSSManager"
      class=".reports.ReportsCSSViewlet"
      permission="zope.View"
      />
  <resource
      name="reportsViewlet.js"
      file="reportsViewlet.js"
      />
  <viewlet
      name="reports_viewlet_js"
      for="*"
      manager="schooltool.skin.IJavaScriptManager"
      class=".reports.ReportsJSViewlet"
      permission="zope.View"
      />
  <resource
      name="intervention.js"
      file="intervention.js"
      />
  <viewlet
      name="intervention_viewlet_js"
      for="*"
      manager="schooltool.skin.IJavaScriptManager"
      class=".intervention.InterventionJSViewlet"
      permission="zope.View"
      />

  <!-- Intervention entry points from a section -->
  <page
      name="interventions.html"
      for="schooltool.course.interfaces.ISection"
      class=".intervention.SectionInterventionsView"
      template="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.app.form.interfaces.IInputWidget"
      factory=".widgets.PersonListWidget"
      permission="zope.Public"
      />
  <zope:view
      type="zope.publisher.interfaces.browser.IBrowserRequest"
      for="schooltool.intervention.interfaces.IGoalMetField"
      provides="zope.app.form.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>

