<commit_before>{% extends "_layout.html" %}

{% macro maximum_lifetime() -%}
<div class="row">
    <div class="col-lg-3 form-group">
        <input class="form-control" name="maxlife-value" type="number" min="1" value="1" /><br>
    </div>
    <div class="col-lg-9 form-group">
        <select class="form-control" name="maxlife-unit" size="1">
            <option value="months">Months</option>
            <option value="weeks">Weeks</option>
            <option value="days">Days</option>
            <option value="hours">Hours</option>
            <option value="minutes">Minutes</option>
            <option value="years">Years</option>
            <option value="forever">Keep Forever</option>
        </select>
    </div>
</div>
{% endmacro %}

{% block content %}
{% if may(CREATE) %}
<div class="row">
    <div class="col-md-8">
        <form action="{{ url_for('bepasty.upload') }}" method="POST" enctype="multipart/form-data">
            <div class="form-group">
                <textarea class="form-control" id="formupload" name="text" placeholder="Paste text here..." autofocus></textarea>
            </div>
            <div class="row">
                <div class="col-3 form-group">
                    <input class="form-control" type="text" id="contenttype" name="contenttype" size="30" placeholder="Content-Type">
                </div>
                <div class="col-6 form-group">
                    <input class="form-control" type="text" id="filename" name="filename" size="40" placeholder="optional download-filename">
                </div>
                <div class="col-3">
                    <button id="formupload-submit" class="btn btn-primary btn-block">Submit</button>
                </div>
            </div>
            <hr>
            <label>Maximum lifetime value (choose before dragging or submitting)</label>
            {{ maximum_lifetime() }}
            <span class="btn btn-light fileinput-button dropzone">
                <i class="fa fa-upload"></i>
                <span>drag and drop files here - or click to select files</span>
                <!-- Input for file upload widget -->
                <input id="fileupload" type="file" class="form-control-file" name="file" multiple style="height: 100%; width: 100%;">
            </span>
            <noscript><br><button id="fileupload-submit" class="btn btn-success btn-block">Upload</button></noscript>
        </form>
    </div>
    <div class="col-md-4">
        <!-- item name list assembled here and offered for submission -->
        <form id="filelist-form" style="display: none" action="{{ url_for('bepasty.upload') }}" method="POST" enctype="multipart/form-data">
            <div class="form-group">
                <textarea class="form-control" id="filelist" name="text" rows="10" cols="40"></textarea>
            </div>
            {{ maximum_lifetime() }}
            <input type="hidden" name="contenttype" value="text/x-bepasty-list">
            <div class="row">
                <div class="col-lg-7 form-group">
                    <input class="form-control" type="text" id="filelist-filename" name="filename" size="23" placeholder="optional list-name">
                </div>
                <div class="col-lg-5">
                    <button class="btn btn-success btn-block">Create List Item</button>
                </div>
            </div>
        </form>
        <div class="d-flex pt-3 pb-3 align-items-center">
            <!-- The progress bar -->
            <div class="col-lg-9 pl-0 pr-0">
                <div id="fileupload-progress" class="progress" style="visibility: hidden">
                    <div class="progress-bar progress-bar-striped active" role="progressbar"></div>
                </div>
            </div>
            <div class="col-lg-3">
                <button id="fileupload-abort" class="btn btn-danger" style="visibility: hidden">abort</button>
            </div>
        </div>
        <!-- Uploaded files -->
        <div id="files" class="files"></div>
    </div>
</div>

{% else %}
<div class="pb-2 mt-4 mb-2 border-bottom">
    <h1>bepasty, the Binary File Upload Site</h1>
</div>
<div class="jumbotron">
    <div class="row">
        <div class="col-md-3">
            <span class="fa fa-thumbs-o-up"></span>
            <h2>Free and Nice</h2>
            <p><commit_msg>Use shorter name for "Create List Item"<commit_after>{% extends "_layout.html" %}

{% macro maximum_lifetime() -%}
<div class="row">
    <div class="col-lg-3 form-group">
        <input class="form-control" name="maxlife-value" type="number" min="1" value="1" /><br>
    </div>
    <div class="col-lg-9 form-group">
        <select class="form-control" name="maxlife-unit" size="1">
            <option value="months">Months</option>
            <option value="weeks">Weeks</option>
            <option value="days">Days</option>
            <option value="hours">Hours</option>
            <option value="minutes">Minutes</option>
            <option value="years">Years</option>
            <option value="forever">Keep Forever</option>
        </select>
    </div>
</div>
{% endmacro %}

{% block content %}
{% if may(CREATE) %}
<div class="row">
    <div class="col-md-8">
        <form action="{{ url_for('bepasty.upload') }}" method="POST" enctype="multipart/form-data">
            <div class="form-group">
                <textarea class="form-control" id="formupload" name="text" placeholder="Paste text here..." autofocus></textarea>
            </div>
            <div class="row">
                <div class="col-3 form-group">
                    <input class="form-control" type="text" id="contenttype" name="contenttype" size="30" placeholder="Content-Type">
                </div>
                <div class="col-6 form-group">
                    <input class="form-control" type="text" id="filename" name="filename" size="40" placeholder="optional download-filename">
                </div>
                <div class="col-3">
                    <button id="formupload-submit" class="btn btn-primary btn-block">Submit</button>
                </div>
            </div>
            <hr>
            <label>Maximum lifetime value (choose before dragging or submitting)</label>
            {{ maximum_lifetime() }}
            <span class="btn btn-light fileinput-button dropzone">
                <i class="fa fa-upload"></i>
                <span>drag and drop files here - or click to select files</span>
                <!-- Input for file upload widget -->
                <input id="fileupload" type="file" class="form-control-file" name="file" multiple style="height: 100%; width: 100%;">
            </span>
            <noscript><br><button id="fileupload-submit" class="btn btn-success btn-block">Upload</button></noscript>
        </form>
    </div>
    <div class="col-md-4">
        <!-- item name list assembled here and offered for submission -->
        <form id="filelist-form" style="display: none" action="{{ url_for('bepasty.upload') }}" method="POST" enctype="multipart/form-data">
            <div class="form-group">
                <textarea class="form-control" id="filelist" name="text" rows="10" cols="40"></textarea>
            </div>
            {{ maximum_lifetime() }}
            <input type="hidden" name="contenttype" value="text/x-bepasty-list">
            <div class="row">
                <div class="col-lg-7 form-group">
                    <input class="form-control" type="text" id="filelist-filename" name="filename" size="23" placeholder="optional list-name">
                </div>
                <div class="col-lg-5">
                    <button class="btn btn-success btn-block text-nowrap">Create List</button>
                </div>
            </div>
        </form>
        <div class="d-flex pt-3 pb-3 align-items-center">
            <!-- The progress bar -->
            <div class="col-lg-9 pl-0 pr-0">
                <div id="fileupload-progress" class="progress" style="visibility: hidden">
                    <div class="progress-bar progress-bar-striped active" role="progressbar"></div>
                </div>
            </div>
            <div class="col-lg-3">
                <button id="fileupload-abort" class="btn btn-danger" style="visibility: hidden">abort</button>
            </div>
        </div>
        <!-- Uploaded files -->
        <div id="files" class="files"></div>
    </div>
</div>

{% else %}
<div class="pb-2 mt-4 mb-2 border-bottom">
    <h1>bepasty, the Binary File Upload Site</h1>
</div>
<div class="jumbotron">
    <div class="row">
        <div class="col-md-3">
            <span class="fa fa-thumbs-o-up"></span>
            <h2>Free and Nice</h2>
            <p>
{'fraction_non_alphanumeric': 0.17054708108728064, 'fraction_numerical': 0.009634132354627824, 'mean_word_length': 2.1076265146115465, 'pattern_counts': {'":': 0, '<': 221, '<?xml version=': 0, '>': 221, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4604527', 'n_tokens_mistral': 2609, 'n_tokens_neox': 2478, 'n_words': 561}