<commit_before>{% extends "main_bootstrap.html" %}
{% block head %}

{{ super() }}

<script src="/static/__shared/external/jquery-ui.min.js"></script>

<link href="/static/__shared/external/bootstrap-switch.css" rel="stylesheet">
<script src="/static/__shared/external/bootstrap-switch.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.10.1/bootstrap-table.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.10.1/bootstrap-table.min.css">

<link href="/static/__shared/external/bootstrap-markdown.min.css" rel="stylesheet">
<script src="/static/__shared/external/marked.min.js"></script>
<script src="/static/__shared/external/bootstrap-markdown.js"></script>

<script src="/static/__shared/editor.js"></script>

<script src="/static/__shared/collection_info.js"></script>

<script>
    var can_admin = {{ 'true' if can_admin() else 'false' }};
    var can_write = {{ 'true' if can_write() else 'false' }};
</script>


{% endblock %}

{% block content %}


<div class="row">
    <div class="page-header" style="margin-top: 10px">
        <h1 style="display: inline"><span id="coll-title">{{ collection.title }}</span>&nbsp;
            <div class="pull-right">
                {% if can_write() %}
                    <button id="add-recording" class="btn btn-primary btn-sm show-recorder">New Recording</button>
                {% endif %}
                {% if can_admin() %}
                    <a href="{{ collection.download_url }}" class="btn btn-primary btn-sm">Download</a>
                    <button id="delete-coll-btn" class="btn btn-sm btn-danger" data-toggle="modal" data-target="#confirm-delete-modal">Delete</button>
                {% endif %}
            </div>

            <div>
                <small>/{{ collection.id }}</small>
            </div>
        </h1>

    </div>
</div>

<div class="row">
    <span style="font-size: 14px" class="pull-right">
        <div style="margin: 18px 20px; display: inline-block">
            {% set is_public = collection['r:@public'] %}
            {% include 'frag_accessswitch.html' %}
        </div>
        <div style="margin-right: 20px; text-align: right">
            Space Used: <b data-size="{{ collection.size }}"></b>
        </div>
    </span>

    {% if can_write() and not is_anon() %}
        <div id="about">
            <div id="home-markdown" style="display: none">{{ collection.desc | default('Collection Desc TODO') }}</div>
            <div id="home-view"></div>

        </div>
        <button id="home-edit" class="btn btn-default btn-sm" data-toggle="button" aria-pressed="false">Edit</button>
    {% endif %}

    {% if is_anon() %}
        <p>This is a temporary, anonymous collection created in Webrecorder.</p>
        <p>These recordings are accessible only to you and will expire in <b data-anon-timer="{{ anon_ttl }}"></b></p>

        <div>To create permanent, shareable collections <a href="_register">Sign Up</a> or <a href="#" data-toggle="modal" data-target="#login-modal">Log In</a></div>
    {% endif %}

</div>

<div class="row" style="margin-top: 20px">
    <table id="rec_list" class="table table-striped">
        <caption><h4>Recordings</h4></caption>
        <thead>
            <tr>
                <th>Name</th>
                <th>Last Recorded</th>
                <th>Size</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
            {% for rec in collection.recordings %}
            {% set path = get_path(user, coll, rec.id) %}
            <tr>
                <td><a href="{{ path }}">{{ rec.title }}</a></td>
                <td data-time-sec="{{ rec.updated_at }}"></td>
                <td data-size="{{ rec.size }}"></td>
                <td>
                    <a class="btn btn-default btn-xs" href="{{ path }}">
                        <span class="glyphicon glyphicon-globe glyphicon-button"></span>Browse
                    </a>
                    <a class="btn btn-default btn-xs" href="{{ path }}/$download">
                        <span class="glyphicon glyphicon-download glyphicon-button"></span>Download
                    </a>
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>

<!-- Confirm Delete -->
<div class="modal fade" id="confirm-delete-modal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                Confirm Delete Collection?
            </div><commit_msg>fix permission bug: anyone could download a recording<commit_after>{% extends "main_bootstrap.html" %}
{% block head %}

{{ super() }}

<script src="/static/__shared/external/jquery-ui.min.js"></script>

<link href="/static/__shared/external/bootstrap-switch.css" rel="stylesheet">
<script src="/static/__shared/external/bootstrap-switch.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.10.1/bootstrap-table.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.10.1/bootstrap-table.min.css">

<link href="/static/__shared/external/bootstrap-markdown.min.css" rel="stylesheet">
<script src="/static/__shared/external/marked.min.js"></script>
<script src="/static/__shared/external/bootstrap-markdown.js"></script>

<script src="/static/__shared/editor.js"></script>

<script src="/static/__shared/collection_info.js"></script>

<script>
    var can_admin = {{ 'true' if can_admin() else 'false' }};
    var can_write = {{ 'true' if can_write() else 'false' }};
</script>


{% endblock %}

{% block content %}


<div class="row">
    <div class="page-header" style="margin-top: 10px">
        <h1 style="display: inline"><span id="coll-title">{{ collection.title }}</span>&nbsp;
            <div class="pull-right">
                {% if can_write() %}
                    <button id="add-recording" class="btn btn-primary btn-sm show-recorder">New Recording</button>
                {% endif %}
                {% if can_admin() %}
                    <a href="{{ collection.download_url }}" class="btn btn-primary btn-sm">Download</a>
                    <button id="delete-coll-btn" class="btn btn-sm btn-danger" data-toggle="modal" data-target="#confirm-delete-modal">Delete</button>
                {% endif %}
            </div>

            <div>
                <small>/{{ collection.id }}</small>
            </div>
        </h1>

    </div>
</div>

<div class="row">
    <span style="font-size: 14px" class="pull-right">
        <div style="margin: 18px 20px; display: inline-block">
            {% set is_public = collection['r:@public'] %}
            {% include 'frag_accessswitch.html' %}
        </div>
        <div style="margin-right: 20px; text-align: right">
            Space Used: <b data-size="{{ collection.size }}"></b>
        </div>
    </span>

    {% if can_write() and not is_anon() %}
        <div id="about">
            <div id="home-markdown" style="display: none">{{ collection.desc | default('Collection Desc TODO') }}</div>
            <div id="home-view"></div>

        </div>
        <button id="home-edit" class="btn btn-default btn-sm" data-toggle="button" aria-pressed="false">Edit</button>
    {% endif %}

    {% if is_anon() %}
        <p>This is a temporary, anonymous collection created in Webrecorder.</p>
        <p>These recordings are accessible only to you and will expire in <b data-anon-timer="{{ anon_ttl }}"></b></p>

        <div>To create permanent, shareable collections <a href="_register">Sign Up</a> or <a href="#" data-toggle="modal" data-target="#login-modal">Log In</a></div>
    {% endif %}

</div>

<div class="row" style="margin-top: 20px">
    <table id="rec_list" class="table table-striped">
        <caption><h4>Recordings</h4></caption>
        <thead>
            <tr>
                <th>Name</th>
                <th>Last Recorded</th>
                <th>Size</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
            {% for rec in collection.recordings %}
            {% set path = get_path(user, coll, rec.id) %}
            <tr>
                <td><a href="{{ path }}">{{ rec.title }}</a></td>
                <td data-time-sec="{{ rec.updated_at }}"></td>
                <td data-size="{{ rec.size }}"></td>
                <td>
                    <a class="btn btn-default btn-xs" href="{{ path }}">
                        <span class="glyphicon glyphicon-globe glyphicon-button"></span>Browse
                    </a>
                    {% if can_admin() %}
                        <a class="btn btn-default btn-xs" href="{{ path }}/$download">
                            <span class="glyphicon glyphicon-download glyphicon-button"></span>Download
                        </a>
                    {% endif %}
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>

<!-- Confirm Delete -->
<div class="modal fade" id="confirm-delete-modal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                Confirm Delete Collection?
            </div>
{'fraction_non_alphanumeric': 0.18270992777837664, 'fraction_numerical': 0.005389673385792821, 'mean_word_length': 2.227130434782609, 'pattern_counts': {'":': 0, '<': 237, '<?xml version=': 0, '>': 237, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 11, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2223813', 'n_tokens_mistral': 2939, 'n_tokens_neox': 2720, 'n_words': 583}