cciw-website / templates / cciw / officers / manage_crbs.html

{% extends "cciw/officers/base.html" %}
{% load url from future %}
{% block content %}
<script type="text/javascript">
function CRBFormSent(officerId) {
        type: "POST",
        url: "{% url 'cciw.officers.views.mark_crb_sent' %}",
        data: "officer_id=" + officerId.toString(),
        dataType: 'json',
        success: function(data) {
            // We need undo information, and we need to update the 'CRB form
            // sent' column. We store undo information in a stack, on the undo
            // button itself.
            var btn = jQuery('#id_undo_' + officerId.toString());
            var lastSentCell = jQuery('#id_last_crb_form_sent_' + officerId.toString());
            var highlightDiv = jQuery('#id_highlightdiv_' + officerId.toString());
            if ('undoIdList') == null) {
      'undoIdList', new Array);
            if ('undoLastSentList') == null) {
      'undoLastSentList', new Array);
            var undoIdList ='undoIdList');
            var undoLastSentList ='undoLastSentList');
            lastSentCell.html('Just now');

            // Add callback to undo button
                // Delete server side
                    type: "POST",
                    url: "{% url 'cciw.officers.views.undo_mark_crb_sent' %}",
                    data: "crbformlog_id=" + undoIdList.pop().toString(),
                    dataType: 'json'
                // Fix up cell client side
                var lastSentCellContents = undoLastSentList.pop();
                if (undoIdList.length == 0) {
                if (lastSentCellContents.replace(/\n|\r| /g, '') == "") {


function alertLeadersCrbConsentCheck(applicationId) {"{% url 'cciw.officers.views.crb_consent_problem' %}?application_id=" + applicationId.toString(),


<h1>Manage CRBs</h1>

<p>This pages shows all officers on camps, year {{ year }}, and their status
regarding needing CRB forms.</p>

<p>For officers needing CRBs:</p>

  <li>Use 'Show address' to view the officer's address (from application form)</li>
  <li>Use the buttons in the 'Manage' column to indicate you've physically sent them a CRB form to fill in.</li>
  <li>Officers most likely to need attention are <span class="actionable">highlighted</span>.</li>

<p>To enter information for CRBs that have been <em>completed</em>, use the <a href="{% url 'admin:officers_crbapplication_changelist' %}">CRB Disclosures admin</a>.</p>

      <th>Application form</th>
      <th>CRB form sent</th>
    {% for officer in all_officers %}
      <tr id="id_highlightdiv_{{ }}" {% if not officer.temp.has_valid_crb and officer.temp.has_application_form and not officer.temp.last_crb_form_sent %}class="actionable"{% endif %}>
        <td>{{ officer.first_name }} {{ officer.last_name }}</td>
        <td>{% for camp in officer.temp.camps %}
              <a href="{% url 'cciw.officers.views.officer_list' year=camp.year number=camp.number %}">{{ camp.number }}</a>{% if not forloop.last %}, {% endif %}
            {% endfor %}
        <td>{% if officer.temp.has_application_form %}<img src="{{ STATIC_URL }}admin/img/admin/icon-yes.gif"> <a href="{% url 'admin:officers_application_change' officer.temp.application_id %}" rel="external">View/edit</a>{% endif %}</td>
        <td>{% if not officer.temp.has_crb %}<img src="{{ STATIC_URL }}admin/img/admin/icon_error.gif"> Never{% else %}{% if officer.temp.has_valid_crb %}<img src="{{ STATIC_URL }}admin/img/admin/icon_success.gif"> Recent{% else %}<img src="{{ STATIC_URL }}admin/img/admin/icon_alert.gif"> Out of date{% endif %}{% endif %}</td>
        <td id="id_last_crb_form_sent_{{ }}">
          {% if officer.temp.has_valid_crb %}
          {% else %}
            {% if officer.temp.last_crb_form_sent %}
              {{ officer.temp.last_crb_form_sent|timesince }} ago
            {% endif %}
          {% endif %}
          {% if not officer.temp.has_valid_crb %}
            {% if officer.temp.has_application_form %}
              {% if officer.temp.crb_check_consent %}
                <a href="javascript:void(0)" onclick="$('#id_address_{{ }}').toggle();">Show address</a> <span class="address" style="display:none;" id="id_address_{{ }}">{{ officer.temp.address }}</span>
              {% else %}
                <b>Officer does not<br/> consent to CRB check.<br/></b>
                <button onclick="alertLeadersCrbConsentCheck({{ officer.temp.application_id }})">Alert leaders</button>
              {% endif %}
            {% else %}
              Needs application form
            {% endif %}
          {% endif %}
          {% if not officer.temp.has_valid_crb and officer.temp.has_application_form and officer.temp.crb_check_consent %}
            <button onclick="CRBFormSent({{ }});">Click when sent</button>
            <button id="id_undo_{{ }}" style="display: none;">Undo</button>
          {% endif %}
    {% endfor %}
{% endblock %}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.