{% extends 'rcr/base.html' %}

{% block content %}
    <details>
        <summary>Filter</summary>
        <form method="get">
            {{ item_filter.form.as_p }}
            <input type="submit" />
        </form>
    </details>

    <table>
        <thead>
            <tr>
                <th>Specialty</th>
                <th>Name</th>
                <th>ID</th>
                <th>Assessed by</th>
                <th>Outcome</th>
                <th>Outcome (reason)</th>
                <th>Outcome (free text)</th>
                <th>Comments</th>
                <th>Level</th>
                <th>Radiology Category</th>
                <th>Oncology Category</th>
                <th>Radiology Condition</th>
            </tr>
        </thead>
        <tbody>

            {% for item in items %}
                <tr>
                    <td>{{item.specialty}}</td>
                    <td>{{item.name}}</td>
                    <td>{{item.rcr_platform_id}}</td>
                    <td>{{item.get_assessed_by_name|safe}}</td>
                    <td>{{item.outcome}}</td>
                    <td>{{item.outcome_reason}}</td>
                    <td>{{item.outcome_free_text}}</td>
                    <td>{{item.comments}}</td>
                    <td>{% for cat in item.level.all %}
                        {% if forloop.last %}
                            {{cat}}
                        {% else %}
                            {{cat}},

                        {% endif %}
                    {% endfor %}
                    </td>
                    <td>{% for cat in item.radiology_categories.all %}
                        {% if forloop.last %}
                            {{cat}}
                        {% else %}
                            {{cat}} |

                        {% endif %}
                    {% endfor %}
                    </td>
                    <td>{{item.oncology_category}}</td>
                    <td>{% for cat in item.radiology_condition.all %}
                        {% if forloop.last %}
                            {{cat}}
                        {% else %}
                            {{cat}} |

                        {% endif %}
                    {% endfor %}
                    </td>
                </tr>
            {% endfor %}
        </tbody>
    </table>

{% endblock %}


{% block css %}

    <style type="text/css">
        .review::after {
            content: '(R)';
            color: orange;
        }
        .completed-radiology::after {
            content: '✓';
            color: green;
        }
        .completed-oncology::after {
            content: '✓';
            color: blue;
        }
        .completed-oncology.completed-radiology::after {
            content: '✓';
            color: purple;
        }
        .completed::after {
            content: '✓';
            color: green;
        }
        .Radiology::before {
            content: "R";
        }
        .Radiology {
            color: green;
        }
        .Oncology::before {
            content: "O";
        }
        .Oncology {
            color: blue;
        }
        .Cross-faculty::before {
            content: "C";
        }
        .Cross-faculty {
            color: purple;
        }
        td {
            padding-right: 10px;
        }
        * {
            box-sizing: unset;
        }

    </style>
{% endblock css %}
