<commit_before>{% extends "account/base.html" %}


{% block page_title %}
    Webdnd ~ {% if create %}New{% else %}Edit{% endif %} Campaign
{% endblock %}
{% block tab_name %}campaigns{% endblock %}


{% block content %}
<form class="form-horizontal form-search" id="campaign" method="POST">
    {% csrf_token %}
    <legend>
        {% if create %}New{% else %}Edit{% endif %} Campaign
        <div class="control-group pull-right">
            <div class="controls">
                <button type="submit" class="btn btn-success" name="campaign_create">
                    {% if create %}Create{% else %}Save{% endif %} Campaign
                </button>
            </div>
        </div>
    </legend>

    <div class="control-group" id="group-name">
        <label class="control-label" for="input-name">Name</label>
        <div class="controls">
            <input type="text" id="input-name" name="name" placeholder="Campaign Name" value="{{ campaign.name }}">
        </div>
    </div>
    <div class="control-group" id="group-system">
        <label class="control-label" for="input-system">Roleplaying System</label>
        <div class="controls">
            <select id="input-system" name="system">
                {% for sys in systems %}
                    <option value="{{ sys }}" {% if sys == campaign.rp_system %}selected{% endif %}>
                        {{ sys }}
                    </option>
                {% endfor %}
            </select>
        </div>
    </div>

    <legend>Players</legend>

    <div class="control-group" id="group-players">
        <label class="control-label" for="input-players">Players: </label>
        <div class="controls" id="input-players" data-name="players[]">
            {% for player in friends %}
                <blockquote class="user span2">
                    <span class="pull-right action text-error add">✘</span>
                    <span class="pull-right action text-success remove hide">✔</span>
                    <span class="username">{{ player.name }}</span>
                    <input class="hide" name="" value="{{ player.id }}"></input>
                </blockquote>
            {% empty %}
                <blockquote class="span9 muted">Your friends list is empty.</blockquote>
            {% endfor %}
        </div>
    </div>

<!--     <div class="control-group">
        <label class="control-label" for="user-search">Find User </label>
        <div class="controls" id="user-search">
            <div class="input-append">
                <input type="text" class="span2 search-query">
                <button class="btn btn-small"><i class="icon-search"></i> Search</button>
            </div>
        </div>
        <div class="controls" id="user-search-results">
        </div>

        <script type="text/template" id="search-result-user-template">
            <div class="user search-result span2">
                <small class="username">name</small>
                <input class="hide" name="players[]" value="{{ player.name }}"></input>
                <span class="pull-right action text-error">✘</span>
                <span class="add text-success hide pull-right">✔</span>
            </div>
        </script> -->
</form>
{% endblock content %}


{% block compress_js %}
<script type="text/javascript">
$(function() {
    var player_input_name = $('#input-players').data('name');

    $('.user .action.add').on('click', function() {
        $(this).hide();
        var elem = $(this).parents('.user');
        elem.find('.action.remove').show();

        elem.find('input').attr('name', player_input_name);
    });

    $('.user .action.remove').on('click', function() {
        $(this).hide();
        var elem = $(this).parents('.user');
        elem.find('.action.add').show();

        elem.find('input').attr('name', '');
    });

    {% for player in players %}
    $('input[value={{ player.account.id }}]').parents('.user').find('.add').trigger('click')
    {% endfor %}
});
</script>
{% endblock %}


{% block compress_css %}
<style>
/*#user-search .search-query {
    height: 16px;
}
.search-result {
    clear: both;
    border: 1px solid #AAA;
    margin-left: 0px;
    -webkit-border-radius: 14px 0 0 14px;
    -moz-border-radius: 14px 0 0 14px;
    border-radius: 14px 0 0 14px;
    padding-left: 14px;
    border-right-width: 3px;

    cursor: pointer;
}
.search-result:hover .add {
    display: block;
    padding-right: 2px;
}
*/
/* Player Selection */
.user {
    -webkit-border-radius: 14px 14px 14px 14px;
    -moz-border-radius: 14px 14px 14px 14px;
    border-radius: 14px 14px 14px 14px;
}
.user .action {
    font-size: 9px;
    border: 1px solid #ADE;
    -webkit-border-radius: 100%;
    -moz-border-radius: 100%;
    border-radius: 100%;
    text-align: center;
    width: 20px;
    cursor: pointer;

    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.user .action:hover {
    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
    -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
}

</style>
{% endblock %}
<commit_msg>Added Button (does nothing)<commit_after>{% extends "account/base.html" %}


{% block page_title %}
    Webdnd ~ {% if create %}New{% else %}Edit{% endif %} Campaign
{% endblock %}
{% block tab_name %}campaigns{% endblock %}


{% block content %}
<form class="form-horizontal form-search" id="campaign" method="POST">
    {% csrf_token %}
    <legend>
        {% if create %}New{% else %}Edit{% endif %} Campaign
        <div class="control-group pull-right">
            <div class="controls">
                <button type="submit" class="btn btn-success" name="campaign_create">
                    {% if create %}Create{% else %}Save{% endif %} Campaign
                </button>
                {% if not create %}
                    <button type="button" class="btn btn-info" name="campaign_play">
                        Play
                    </button>
                {% endif %}
            </div>
        </div>
    </legend>

    <div class="control-group" id="group-name">
        <label class="control-label" for="input-name">Name</label>
        <div class="controls">
            <input type="text" id="input-name" name="name" placeholder="Campaign Name" value="{{ campaign.name }}">
        </div>
    </div>
    <div class="control-group" id="group-system">
        <label class="control-label" for="input-system">Roleplaying System</label>
        <div class="controls">
            <select id="input-system" name="system">
                {% for sys in systems %}
                    <option value="{{ sys }}" {% if sys == campaign.rp_system %}selected{% endif %}>
                        {{ sys }}
                    </option>
                {% endfor %}
            </select>
        </div>
    </div>

    <legend>Players</legend>

    <div class="control-group" id="group-players">
        <label class="control-label" for="input-players">Players: </label>
        <div class="controls" id="input-players" data-name="players[]">
            {% for player in friends %}
                <blockquote class="user span2">
                    <span class="pull-right action text-error add">✘</span>
                    <span class="pull-right action text-success remove hide">✔</span>
                    <span class="username">{{ player.name }}</span>
                    <input class="hide" name="" value="{{ player.id }}"></input>
                </blockquote>
            {% empty %}
                <blockquote class="span9 muted">Your friends list is empty.</blockquote>
            {% endfor %}
        </div>
    </div>

<!--     <div class="control-group">
        <label class="control-label" for="user-search">Find User </label>
        <div class="controls" id="user-search">
            <div class="input-append">
                <input type="text" class="span2 search-query">
                <button class="btn btn-small"><i class="icon-search"></i> Search</button>
            </div>
        </div>
        <div class="controls" id="user-search-results">
        </div>

        <script type="text/template" id="search-result-user-template">
            <div class="user search-result span2">
                <small class="username">name</small>
                <input class="hide" name="players[]" value="{{ player.name }}"></input>
                <span class="pull-right action text-error">✘</span>
                <span class="add text-success hide pull-right">✔</span>
            </div>
        </script> -->
</form>
{% endblock content %}


{% block compress_js %}
<script type="text/javascript">
$(function() {
    var player_input_name = $('#input-players').data('name');

    $('.user .action.add').on('click', function() {
        $(this).hide();
        var elem = $(this).parents('.user');
        elem.find('.action.remove').show();

        elem.find('input').attr('name', player_input_name);
    });

    $('.user .action.remove').on('click', function() {
        $(this).hide();
        var elem = $(this).parents('.user');
        elem.find('.action.add').show();

        elem.find('input').attr('name', '');
    });

    {% for player in players %}
    $('input[value={{ player.account.id }}]').parents('.user').find('.add').trigger('click')
    {% endfor %}
});
</script>
{% endblock %}


{% block compress_css %}
<style>
/*#user-search .search-query {
    height: 16px;
}
.search-result {
    clear: both;
    border: 1px solid #AAA;
    margin-left: 0px;
    -webkit-border-radius: 14px 0 0 14px;
    -moz-border-radius: 14px 0 0 14px;
    border-radius: 14px 0 0 14px;
    padding-left: 14px;
    border-right-width: 3px;

    cursor: pointer;
}
.search-result:hover .add {
    display: block;
    padding-right: 2px;
}
*/
/* Player Selection */
.user {
    -webkit-border-radius: 14px 14px 14px 14px;
    -moz-border-radius: 14px 14px 14px 14px;
    border-radius: 14px 14px 14px 14px;
}
.user .action {
    font-size: 9px;
    border: 1px solid #ADE;
    -webkit-border-radius: 100%;
    -moz-border-radius: 100%;
    border-radius: 100%;
    text-align: center;
    width: 20px;
    cursor: pointer;

    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.user .action:hover {
    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
    -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
}

</style>
{% endblock %}

{'fraction_non_alphanumeric': 0.1804256099798202, 'fraction_numerical': 0.024949550541185105, 'mean_word_length': 2.2228791013892994, 'pattern_counts': {'":': 0, '<': 161, '<?xml version=': 0, '>': 161, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '955855', 'n_tokens_mistral': 3794, 'n_tokens_neox': 3291, 'n_words': 800}