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

{% block title %}Pending Suggestions{% endblock %}

{% block content %}
<div class="container">

    <ol class="breadcrumb">
        <li><a href="/suggest/review">Suggestions</a></li>
        <li class="active">Webcasts</li>
    </ol>
    <h1>{{ suggestion_sets|length }} Pending Webcast Suggestions</h1>

    <form action="/suggest/event/webcast/review" method="post" id="review_webcasts">
        <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
        <div class="col-xs-12">

            {% if success == "accept" %}
            <div class="row">
                <div class="alert alert-success">
                    <button type="button" class="close" data-dismiss="alert">&times;</button>
                    <h4>Added webcast to {{event_key}}!</h4>
                    <div class="btn-group">
                        <a href="/event/{{event_key}}" class="btn btn-default">View on TBA</a>
                        <a href="/admin/event/{{event_key}}" class="btn btn-default">View in Admin</a>
                    </div>
                </div>
            </div>
            {% endif %}
            {% if success == "reject" %}
            <div class="row">
                <div class="alert alert-warning">
                    <button type="button" class="close" data-dismiss="alert">&times;</button>
                    <h4>Rejected webcast!</h4>
                </div>
            </div>
            {% endif %}
            {% if success == "reject_all" %}
            <div class="row">
                <div class="alert alert-warning">
                    <button type="button" class="close" data-dismiss="alert">&times;</button>
                    <h4>Rejected hella webcasts for {{event_key}}!</h4>
                </div>
            </div>
            {% endif %}

            {% include "suggestions/partials/webcast_add_instructions_partial.html" %}

            {% for suggestion_set in suggestion_sets %}
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <form action="/suggest/event/webcast/review" method="post" id="reject_all_{{ suggestion_set.event.key_name }}">
                            <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
                            <input type="hidden" name="suggestion_keys" value="{% for suggestion in suggestion_set.suggestions %}{{suggestion.key.id()}}{% if not loop.last %},{% endif %}{% endfor %}" />
                            <input type="hidden" name="event_key" value="{{suggestion_set.event.key_name}}" />
                            <button type="submit" class="btn btn-xs btn-danger pull-right" name="verdict" value="reject_all"><span class="glyphicon glyphicon-thumbs-down"></span> Reject All</button>
                        </form>
                        <h3 class="panel-title"><a href="/event/{{suggestion_set.event.key_name}}">{{suggestion_set.event.name}} ({{suggestion_set.event.start_date.strftime("M jS")}} - {{suggestion_set.event.end_date.strftime("M jS")}})</a></h3>
                    </div>
                    <div class="panel-body">
                        <ul><strong>Existing Webcasts</strong>
                        {% for webcast in suggestion_set.event.webcast %}
                            <li>{{webcast}}</li>
                        {% else %}
                            <li>None Yet!</li>
                        {% endfor %}
                        </ul>
                    </div>
                    <hr>
                    <ul class="list-group">
                        {% for suggestion in suggestion_set.suggestions %}
                            <li class="list-group-item">
                                <div class="row">
                                    <div class="col-xs-6">
                                        <p><strong><a href="{{suggestion.contents.webcast_url}}" target="_blank" rel="noopener noreferrer">{{suggestion.contents.webcast_url}}</a></strong></p>
                                        <form action="/suggest/event/webcast/review" method="post" id="review_{{ suggestion.key.id() }}">
                                            <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
                                            {% if suggestion.webcast_template %}
                                                {% set webcast = suggestion.contents['webcast_dict'] %}
                                                <div style="height:300px;">
                                                {% include suggestion.webcast_template %}
                                                </div>
                                                <table class="table table-striped table-hover table-condensed">
                                                    <tr>
                                                        <td>Type</td>
                                                        <td>{% include "suggestions/partials/webcast_type_select.html" %}</td>
                                                    </tr>
                                                    <tr>
                                                        <td>Channel</td>
                                                        <td><input type="text" name="webcast_channel" value="{{webcast.channel}}" /></td>
                                                    </tr>
                                                    <tr>
                                                        <td>File (RTMP and Livestream only)</td>
                                                        <td><input type="text" name="webcast_file" value="{{webcast.file}}" /></td>
                                                    </tr>
                                                    <tr>
                                                        <td>Date</td>
                                                        <td><input type="text" name="webcast_date" value="{% if suggestion.contents.webcast_date%}{{suggestion.contents.webcast_date}}{% endif %}" /></td>
                                                    </tr>
                                                </table>
                                            {% else %}
                                                {% include "suggestions/partials/webcast_add_form_partial.html" %}
                                            {% endif %}
                                            <input type="hidden" name="suggestion_key" value="{{suggestion.key.id()}}" />
                                            <input type="hidden" name="event_key" value="{{suggestion.target_key}}" />
                                            <button type="submit" class="btn btn-primary" name="verdict" value="accept"><span class="glyphicon glyphicon-thumbs-up"></span> Add Webcast</button> <button type="submit" class="btn btn-danger" name="verdict" value="reject"><span class="glyphicon glyphicon-thumbs-down"></span> Reject</button>
                                        </form>
                                    </div>
                                    <div class="col-xs-6">
                                        <ul>
                                            <li>{{ suggestion.key.id() }}</a></li>
                                            <li>{{ suggestion.author.get.email }}</a></li>
                                            <li>{{ suggestion.author.get.nickname }}</a></li>
                                            <li>{{ suggestion.target_model }}:{{ suggestion.target_key }}</li>
                                            <li>{{ suggestion.contents_json }}</li>
                                        </ul>
                                    </div>
                                </div>
                            </li>
                        {% endfor %}
                    </ul>
                </div>
            {% else %}
                <div class="row">
                    <div class="well">
                        <p>No suggestions! Go build more community!</p>
                    </div>
                </div>
            {% endfor %}
        </div>
    </form>
</div>

{% endblock %}
<commit_msg>Fix date rendering in webcast suggest template<commit_after>{% extends "base.html" %}

{% block title %}Pending Suggestions{% endblock %}

{% block content %}
<div class="container">

    <ol class="breadcrumb">
        <li><a href="/suggest/review">Suggestions</a></li>
        <li class="active">Webcasts</li>
    </ol>
    <h1>{{ suggestion_sets|length }} Pending Webcast Suggestions</h1>

    <form action="/suggest/event/webcast/review" method="post" id="review_webcasts">
        <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
        <div class="col-xs-12">

            {% if success == "accept" %}
            <div class="row">
                <div class="alert alert-success">
                    <button type="button" class="close" data-dismiss="alert">&times;</button>
                    <h4>Added webcast to {{event_key}}!</h4>
                    <div class="btn-group">
                        <a href="/event/{{event_key}}" class="btn btn-default">View on TBA</a>
                        <a href="/admin/event/{{event_key}}" class="btn btn-default">View in Admin</a>
                    </div>
                </div>
            </div>
            {% endif %}
            {% if success == "reject" %}
            <div class="row">
                <div class="alert alert-warning">
                    <button type="button" class="close" data-dismiss="alert">&times;</button>
                    <h4>Rejected webcast!</h4>
                </div>
            </div>
            {% endif %}
            {% if success == "reject_all" %}
            <div class="row">
                <div class="alert alert-warning">
                    <button type="button" class="close" data-dismiss="alert">&times;</button>
                    <h4>Rejected hella webcasts for {{event_key}}!</h4>
                </div>
            </div>
            {% endif %}

            {% include "suggestions/partials/webcast_add_instructions_partial.html" %}

            {% for suggestion_set in suggestion_sets %}
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <form action="/suggest/event/webcast/review" method="post" id="reject_all_{{ suggestion_set.event.key_name }}">
                            <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
                            <input type="hidden" name="suggestion_keys" value="{% for suggestion in suggestion_set.suggestions %}{{suggestion.key.id()}}{% if not loop.last %},{% endif %}{% endfor %}" />
                            <input type="hidden" name="event_key" value="{{suggestion_set.event.key_name}}" />
                            <button type="submit" class="btn btn-xs btn-danger pull-right" name="verdict" value="reject_all"><span class="glyphicon glyphicon-thumbs-down"></span> Reject All</button>
                        </form>
                        <h3 class="panel-title"><a href="/event/{{suggestion_set.event.key_name}}">{{suggestion_set.event.name}} ({{suggestion_set.event.start_date|strftime("%b %d%t")}} - {{suggestion_set.event.end_date|strftime("%b %d%t")}})</a></h3>
                    </div>
                    <div class="panel-body">
                        <ul><strong>Existing Webcasts</strong>
                        {% for webcast in suggestion_set.event.webcast %}
                            <li>{{webcast}}</li>
                        {% else %}
                            <li>None Yet!</li>
                        {% endfor %}
                        </ul>
                    </div>
                    <hr>
                    <ul class="list-group">
                        {% for suggestion in suggestion_set.suggestions %}
                            <li class="list-group-item">
                                <div class="row">
                                    <div class="col-xs-6">
                                        <p><strong><a href="{{suggestion.contents.webcast_url}}" target="_blank" rel="noopener noreferrer">{{suggestion.contents.webcast_url}}</a></strong></p>
                                        <form action="/suggest/event/webcast/review" method="post" id="review_{{ suggestion.key.id() }}">
                                            <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
                                            {% if suggestion.webcast_template %}
                                                {% set webcast = suggestion.contents['webcast_dict'] %}
                                                <div style="height:300px;">
                                                {% include suggestion.webcast_template %}
                                                </div>
                                                <table class="table table-striped table-hover table-condensed">
                                                    <tr>
                                                        <td>Type</td>
                                                        <td>{% include "suggestions/partials/webcast_type_select.html" %}</td>
                                                    </tr>
                                                    <tr>
                                                        <td>Channel</td>
                                                        <td><input type="text" name="webcast_channel" value="{{webcast.channel}}" /></td>
                                                    </tr>
                                                    <tr>
                                                        <td>File (RTMP and Livestream only)</td>
                                                        <td><input type="text" name="webcast_file" value="{{webcast.file}}" /></td>
                                                    </tr>
                                                    <tr>
                                                        <td>Date</td>
                                                        <td><input type="text" name="webcast_date" value="{% if suggestion.contents.webcast_date%}{{suggestion.contents.webcast_date}}{% endif %}" /></td>
                                                    </tr>
                                                </table>
                                            {% else %}
                                                {% include "suggestions/partials/webcast_add_form_partial.html" %}
                                            {% endif %}
                                            <input type="hidden" name="suggestion_key" value="{{suggestion.key.id()}}" />
                                            <input type="hidden" name="event_key" value="{{suggestion.target_key}}" />
                                            <button type="submit" class="btn btn-primary" name="verdict" value="accept"><span class="glyphicon glyphicon-thumbs-up"></span> Add Webcast</button> <button type="submit" class="btn btn-danger" name="verdict" value="reject"><span class="glyphicon glyphicon-thumbs-down"></span> Reject</button>
                                        </form>
                                    </div>
                                    <div class="col-xs-6">
                                        <ul>
                                            <li>{{ suggestion.key.id() }}</a></li>
                                            <li>{{ suggestion.author.get.email }}</a></li>
                                            <li>{{ suggestion.author.get.nickname }}</a></li>
                                            <li>{{ suggestion.target_model }}:{{ suggestion.target_key }}</li>
                                            <li>{{ suggestion.contents_json }}</li>
                                        </ul>
                                    </div>
                                </div>
                            </li>
                        {% endfor %}
                    </ul>
                </div>
            {% else %}
                <div class="row">
                    <div class="well">
                        <p>No suggestions! Go build more community!</p>
                    </div>
                </div>
            {% endfor %}
        </div>
    </form>
</div>

{% endblock %}

{'fraction_non_alphanumeric': 0.13638836829695908, 'fraction_numerical': 0.0020554984583761563, 'mean_word_length': 1.0444938820912124, 'pattern_counts': {'":': 0, '<': 315, '<?xml version=': 0, '>': 315, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 162, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5834278', 'n_tokens_mistral': 3900, 'n_tokens_neox': 3565, 'n_words': 686}