<commit_before>
{% block navbar %}
   {% include "csv2/navigation_bar.html" %}
{% endblock %}

<link rel="stylesheet" href="/static/glintwebui/css/glint_matrix.css">

<style>
.pending {
    background-color: #EC9600;
}

.error {
    background-color: #FF0000;
}

.shared {
    background-color: #4FE53E;
}

.private {
    background-color: #4FE53E;
}

.public {
    background-color: #FFCD00;
}

.button {
    font-size: 20px !important;
}


</style>

<head>
    {% load glint_template_utils %}
    {% load static %}
    <link rel="stylesheet" type="text/css" href="{% static "csv2/common.css" %}?{{version}}">
    <link rel="stylesheet" type="text/css" href="{% static "csv2/menu.css" %}?{{version}}">
    <link rel="stylesheet" type="text/css" href="{% static "csv2/overlay.css" %}?{{version}}">

    <script type="text/javascript" src="{% static "csv2/common.js" %}?{{version}}"></script>

    <script type="text/javascript">

        function save_location(group){
            sessionStorage.setItem("group", group);
        }

        function set_location(){
            if(sessionStorage.getItem("group")){
                document.location.hash = sessionStorage.getItem("group");
            }
            else{
                document.location.hash = "{{group_list.0.group_name}}"
            }
        }

    </script>
</head>


<body style="position: absolute; top: 62px; padding-bottom: 129px; overflow: auto;">
<div>
<div class="glinttoolbar" style="float:left">
    <table style="border:none"><tr>
        <td style="border:none"> <input type="text" id="image_search" onkeyup="image_search()" autofocus="autofocus" placeholder="Search by Image Name"> </td>
        <td ><input type="button" value="+Upload Image" onclick="window.location.href='/images/upload_image/{{active_group}}/?{{active_group}}'"></td>
    </tr></table>
</div>

<div class="image_matrix" style="clear:left; float:left">
    {% csrf_token %}
    <table id="image_matrix">
        <!-- First make headers -->
        <tr class="header"> <th> IMAGES </th>
            {% for cloud in cloud_list %}
                <th> {{ cloud.cloud_name }} </th>
            {% endfor %}
        </tr>
        {% for image_key, image_list in image_dict.items %}
            <tr class="image_row">
                <!-- need to make a split template macro to achieve this, may want to only return first token for rendering simplicity -->
                <td><b> {{ image_key|first_split:'---' }}</b>
                    <img title="Download Image" src="/static/glintwebui/img/green_download_icon.png" onclick="downloadImage('{{image_key}}');" style="width:20px;height:20px; float:right; padding-left:5px; cursor: pointer;"/>
                    {% if image_key|first_split:'---' == default_image %}
                        <img title="Default Image" src="/static/glintwebui/img/gold_star.png" style="width:20px;height:20px; float:right; padding-left:5px;" />
                    {% endif %}
                </td>
                <!-- img tuples have the following format: (status, message, visibility) where status' are missing, present, pending delete, pending transfer, error-->
                {% for img_tuple in image_list %}
                    {% if img_tuple.0 == "missing" %}
                        <td title="{{img_tuple.1}}" style="text-align:center" class="missing"><button onclick='transfer_req("{{image_key}}", "{{img_tuple.3}}", "{{active_group}}")'>O</button> </td>
                    {% elif img_tuple.0 == "present" %}
                        <!-- If image is here and the visibility is shared, we can't delete it so grey out the button -->
                        {% if img_tuple.2 == "public" %}
                            <td title="Can't delete public images" style="text-align:center" class="{{img_tuple.2}}"><button onclick='delete_req("{{image_key}}", "{{img_tuple.3}}", "{{active_group}}")' disabled>✔️</button></td>
                        {% else %}
                            <td title="{{img_tuple.1}}" style="text-align:center" class="{{img_tuple.2}}"><button class="button" title="Delete image" onclick='delete_req("{{image_key}}", "{{img_tuple.3}}", "{{active_group}}")'>✔️</button></td>
                        {% endif %}
                    {% elif img_tuple.0 == "pending" %}
                        <td title="{{img_tuple.1}}" style="text-align:center" class="{{img_tuple.2}}">pending transfer</td>
                    {% elif img_tuple.0 == "claimed" %}
                        <td title="{{img_tuple.1}}" style="text-align:center" class="{{img_tuple.2}}">transfering</td>
                    {% elif img_tuple.0 == "pending delete" %}
                        <td title="{{img_tuple.1}}" style="text-align:center" class="{{img_tuple.2}}">pending delete</td>
                    {% elif img_tuple.0 == "error"%}
                        <td title="Error: {{img_tuple.1}}" style="text-align:center" class="error"><button title="Retry request" onclick='retry_req("{{image_key}}", "{{img_tuple.3}}", "{{active_group}}")'>↻</button><button title="Clear request" onclick='clear_req("{{image_key}}", "{{img_tuple.3}}", "{{active_group}}")'>✘</button></td>
                    {% endif %}
                {% endfor %}
            </tr>
        {% endfor %}<commit_msg>add error message to retry and clear button mouseovers on image matrix<commit_after>
{% block navbar %}
   {% include "csv2/navigation_bar.html" %}
{% endblock %}

<link rel="stylesheet" href="/static/glintwebui/css/glint_matrix.css">

<style>
.pending {
    background-color: #EC9600;
}

.error {
    background-color: #FF0000;
}

.shared {
    background-color: #4FE53E;
}

.private {
    background-color: #4FE53E;
}

.public {
    background-color: #FFCD00;
}

.button {
    font-size: 20px !important;
}


</style>

<head>
    {% load glint_template_utils %}
    {% load static %}
    <link rel="stylesheet" type="text/css" href="{% static "csv2/common.css" %}?{{version}}">
    <link rel="stylesheet" type="text/css" href="{% static "csv2/menu.css" %}?{{version}}">
    <link rel="stylesheet" type="text/css" href="{% static "csv2/overlay.css" %}?{{version}}">

    <script type="text/javascript" src="{% static "csv2/common.js" %}?{{version}}"></script>

    <script type="text/javascript">

        function save_location(group){
            sessionStorage.setItem("group", group);
        }

        function set_location(){
            if(sessionStorage.getItem("group")){
                document.location.hash = sessionStorage.getItem("group");
            }
            else{
                document.location.hash = "{{group_list.0.group_name}}"
            }
        }

    </script>
</head>


<body style="position: absolute; top: 62px; padding-bottom: 129px; overflow: auto;">
<div>
<div class="glinttoolbar" style="float:left">
    <table style="border:none"><tr>
        <td style="border:none"> <input type="text" id="image_search" onkeyup="image_search()" autofocus="autofocus" placeholder="Search by Image Name"> </td>
        <td ><input type="button" value="+Upload Image" onclick="window.location.href='/images/upload_image/{{active_group}}/?{{active_group}}'"></td>
    </tr></table>
</div>

<div class="image_matrix" style="clear:left; float:left">
    {% csrf_token %}
    <table id="image_matrix">
        <!-- First make headers -->
        <tr class="header"> <th> IMAGES </th>
            {% for cloud in cloud_list %}
                <th> {{ cloud.cloud_name }} </th>
            {% endfor %}
        </tr>
        {% for image_key, image_list in image_dict.items %}
            <tr class="image_row">
                <!-- need to make a split template macro to achieve this, may want to only return first token for rendering simplicity -->
                <td><b> {{ image_key|first_split:'---' }}</b>
                    <img title="Download Image" src="/static/glintwebui/img/green_download_icon.png" onclick="downloadImage('{{image_key}}');" style="width:20px;height:20px; float:right; padding-left:5px; cursor: pointer;"/>
                    {% if image_key|first_split:'---' == default_image %}
                        <img title="Default Image" src="/static/glintwebui/img/gold_star.png" style="width:20px;height:20px; float:right; padding-left:5px;" />
                    {% endif %}
                </td>
                <!-- img tuples have the following format: (status, message, visibility) where status' are missing, present, pending delete, pending transfer, error-->
                {% for img_tuple in image_list %}
                    {% if img_tuple.0 == "missing" %}
                        <td title="{{img_tuple.1}}" style="text-align:center" class="missing"><button onclick='transfer_req("{{image_key}}", "{{img_tuple.3}}", "{{active_group}}")'>O</button> </td>
                    {% elif img_tuple.0 == "present" %}
                        <!-- If image is here and the visibility is shared, we can't delete it so grey out the button -->
                        {% if img_tuple.2 == "public" %}
                            <td title="Can't delete public images" style="text-align:center" class="{{img_tuple.2}}"><button onclick='delete_req("{{image_key}}", "{{img_tuple.3}}", "{{active_group}}")' disabled>✔️</button></td>
                        {% else %}
                            <td title="{{img_tuple.1}}" style="text-align:center" class="{{img_tuple.2}}"><button class="button" title="Delete image" onclick='delete_req("{{image_key}}", "{{img_tuple.3}}", "{{active_group}}")'>✔️</button></td>
                        {% endif %}
                    {% elif img_tuple.0 == "pending" %}
                        <td title="{{img_tuple.1}}" style="text-align:center" class="{{img_tuple.2}}">pending transfer</td>
                    {% elif img_tuple.0 == "claimed" %}
                        <td title="{{img_tuple.1}}" style="text-align:center" class="{{img_tuple.2}}">transfering</td>
                    {% elif img_tuple.0 == "pending delete" %}
                        <td title="{{img_tuple.1}}" style="text-align:center" class="{{img_tuple.2}}">pending delete</td>
                    {% elif img_tuple.0 == "error"%}
                        <td title="Error: {{img_tuple.1}}" style="text-align:center" class="error"><button title="Retry request
Error: {{img_tuple.1}}" onclick='retry_req("{{image_key}}", "{{img_tuple.3}}", "{{active_group}}")'>↻</button><button title="Clear request
Error: {{img_tuple.1}}" onclick='clear_req("{{image_key}}", "{{img_tuple.3}}", "{{active_group}}")'>✘</button></td>
                    {% endif %}
                {% endfor %}
            </tr>
        {% endfor %}
{'fraction_non_alphanumeric': 0.18738840334555024, 'fraction_numerical': 0.011840992387933465, 'mean_word_length': 2.5952702702702704, 'pattern_counts': {'":': 0, '<': 143, '<?xml version=': 0, '>': 143, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1794431', 'n_tokens_mistral': 3358, 'n_tokens_neox': 3146, 'n_words': 647}