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

{% block body_attrs %}id="video_profile" class="v1 video_view"{% endblock %}

{% load escapejs widget comments recent_activity paginator i18n subtitles_tags teams_tags videos_tags media_compressor moderation doorman utils_tags %}

{% block css %}
    {{ block.super }}
    {% include_bundle "video_history" %}
    {% include_bundle "widget-css"%}
{% endblock %}

{% block scripts %}
    {{ block.super }}
    {% include_bundle "unisubs-onsite-compiled" %}
    <script src="{{ STATIC_URL }}js/jquery.tabs.js" type="text/javascript"></script>
    <script src="{{ STATIC_URL }}js/unisubs.modal.js" type="text/javascript"></script>
    <script src="{{ STATIC_URL }}js/unisubs.abbr.js" type="text/javascript"></script>
    <script src="{% url videos:rpc_api %}" type="text/javascript"></script>
    {% with write_video_type_js as jsinclude %}{% if jsinclude %}{% write_video_type_js video %}{% endif %}{% endwith %}

    <script type="text/javascript">
        jQuery(document).ready( function($) {
            $('.tabs').tabs();

            $('.add_subtitles').click( function() {
                widget_widget_div.selectMenuItem(
                unisubs.widget.DropDown.Selection.IMPROVE_SUBTITLES);
                return false;
            });
            $('.add-translation-behavior').click( function() {
                widget_widget_div.selectMenuItem(
                unisubs.widget.DropDown.Selection.ADD_LANGUAGE);
                return false;
            });
            var VIDEO_ID = '{{ video.pk }}';

            $('.edit-title').click( function() {
                $('#edit-title-dialog .title-input').val($('.title-container').html());
            });

            $('#edit-title-dialog .save-title').click(function(){
                var title = $('#edit-title-dialog .title-input').val();
                if (title) {
                    $('.title-container').html(title).hide().fadeIn();
                    VideosApi.change_title_video(VIDEO_ID, title, function(response){
                        if (response.error) {
                            $.jGrowl.error(response.error);
                        } else {
                            $('.title-container').html(title);
                            document.title = title + " | Universal Subtitles";
                        }
                    });
                    $('#edit-title-dialog').modClose();
                }else{
                    $.jGrowl.error('{% trans "Enter non-empty title" %}');
                }
            });

        });
    </script>
{% endblock %}

{% block title %}
    "{{ video.title_display }}" | Universal Subtitles
{% endblock %}

{% block opengraph-head %}
    {{block.super}}
    <meta property="og:title" content="{% title_for_video video  %}"/>
    <meta property="og:type" content="video"/>
    <meta property="og:url" content="http://{{ current_site.domain }}{{ video.get_absolute_url }}"/>
    {% if video.thumbnail %}
    <meta property="og:image" content="{{ video.get_thumbnail }}" />
    {% else %}
    <meta property="og:image" content="{{ STATIC_URL }}images/small_logo.png" />
    {% endif %}

    <meta property="og:site_name" content="Universal Subtitles"/>
    <meta property="og:description"
          content="{% title_for_video video %}"/>
{% endblock  %}

{% block main_content %}
    {% if saved %}
        <div id="messages">
            <p>{% blocktrans %}Subtitles saved! You can share the video with friends, or get an embed code for your site. To add atranslation, click the button below.{% endblocktrans %}</p>
            <a href="#" id="closeBut">{% trans "Close" %}</a>
        </div>
    {% endif %}

    <div class="grid_4 context alpha">
        <h2 class="main-title">
            <a href="{{share_panel_permalink}}" title="Video permalink">{{ video }}</a>
        </h2>
        <div id="description"{% if video.description|length > 300 %} class="abbr collapsed"{% endif %}>
            <div>
                {{ video.description|urlize|linebreaks }}
            </div>
            {% if video.description|length > 300 %}
                <a class="expand" href="#">Show all ↓</a>
            {% endif %}
        </div>
        <ul class="metrics">
            <li>
                <p>{{ video.widget_views_count|simplify_number }}</p>
                <h4>{% trans "View" %}{{ video.widget_views_count|pluralize }}</h4>
            </li>
            <li>
                <p>{{ video.followers.count }}</p>
                <h4>{% trans "Follower" %}{{ video.followers.count|pluralize }}</h4>
            </li>
            <li>
                <p>{{ video|get_comment_count }}</p>
                <h4>{% trans "Comment" %}{{ video|get_comment_count|pluralize }}</h4>
            </li>
            <li>
                <p>{{ video.languages_count }}</p>
                <h4>{% trans "Language" %}{{ video.languages_count|pluralize }}</h4>
            </li>
        </ul>
        <div class="sharing-tools">
            {% if shows_widget_sharing %}
                {% include '_sharing_widget.html' %}
            {% endif %}
        </div>
        <h3>
            {% trans "View Subtitles" %}
            {% if video.languages_count > 0 %}
                ({{ video.languages_count }})
            {% endif %}
        </h3>
        {% if video.subtitle_language or translations %}
            <div{% if video.languages_count > 15 %} class="abbr collapsed"{% endif %}>
                <div>
                    <ul id="subtitles-menu">
                        {% include 'videos/_left_navigation.html' %}
                    </ul>
                </div>
                {% if video.languages_count > 15 %}
                    <a class="expand" href="#">Show all ↓</a>
                {% endif %}
            </div>
        {% else %}
            {% if request.user|can_create_subtitles_for:video or request.user|can_create_translations_for:video %}
                <p>{% trans "Be the first to " %}<a href="#" class="add_subtitles">{% trans 'create subtitles' %}</a>!</p>
            {% else %}
                <p>
                    {% trans "This video doesn't have any subtitles yet" %} :(
                </p>
            {% endif %}
        {% endif %}
    </div>
    <div class="grid_8 view omega">
        {% if user.is_authenticated %}
            {% include 'videos/_follow_video_button.html' %}
        {% endif %}
        <ul class="tabs">
            <li class="current"><a href="#video-tab">{% trans "Video" %}</a></li>
            <li class="hascount"><a href="#comments-tab">{% trans "Comments" %}<span>{{ video|get_comment_count }}</span></a></li>
            <li><a href="#activity-tab">{% trans "Activity" %}</a></li>
            <li class="hascount"><a href="#urls-tab">{% trans "URLs" %}<span>{% video_url_count video %}</span></a></li>
        </ul>
        <div class="tab" id="video-tab">
            {% widget widget_params %}
            <div class="clearboth">
                <div class="video-tools grid_4 alpha">
                    <h3>{% trans "Contribute" %}</h3>
                    <p>
                        {% if video.languages_count < 1 %}
                            {% if request.user|can_create_subtitles_for:video %}
                                {% trans "This video doesn't have any subtitles yet" %} :( <a href="#" class="add_subtitles">{% trans 'Create subtitles now' %}</a>!
                            {% endif %}
                        {% else %}
                            {% if request.user|can_create_translations_for:video %}
                                {% trans "Don't see the language you're looking for?" %} <a class="add-translation-behavior" id="add_translation " href="#">{% trans 'Start a new translation' %}</a>!
                            {% endif %}
                        {% endif %}
                        {% if request.user|can_create_subtitles_for:video or request.user|can_create_translations_for:video %}
                            {% upload_subtitles video %}
                            {% paste_transcription %}
                        {% else %}
                            {% trans 'Subtitles for this video are moderated. If it belongs to a team, try joining the team to contribute.' %}
                        {% endif %}
                    </p>
                </div>
                {% if video.get_team_video or user.managed_teams %}
                <div class="video-tools grid_4 omega">
                    <h3>{% trans "Collaborate" %}</h3>
                    {% if video.get_team_video %}
                        <p>
                            {% trans "This video belongs to the following team" %}:
                        </p>
                        {% render_belongs_to_team_list video %}
                    {% else %}
                        {% team_add_video_select %}
                    {% endif %}
                </div>
                {% endif %}
            </div>
        </div>
        <div class="tab" id="comments-tab" style="display:none;">
            <h3>{% trans "Leave a comment" %}</h3>
            {% render_comment_form video %}<commit_msg>Remove "add to team" menu if video is already moderated<commit_after>{% extends "base.html" %}

{% block body_attrs %}id="video_profile" class="v1 video_view"{% endblock %}

{% load escapejs widget comments recent_activity paginator i18n subtitles_tags teams_tags videos_tags media_compressor moderation doorman utils_tags %}

{% block css %}
    {{ block.super }}
    {% include_bundle "video_history" %}
    {% include_bundle "widget-css"%}
{% endblock %}

{% block scripts %}
    {{ block.super }}
    {% include_bundle "unisubs-onsite-compiled" %}
    <script src="{{ STATIC_URL }}js/jquery.tabs.js" type="text/javascript"></script>
    <script src="{{ STATIC_URL }}js/unisubs.modal.js" type="text/javascript"></script>
    <script src="{{ STATIC_URL }}js/unisubs.abbr.js" type="text/javascript"></script>
    <script src="{% url videos:rpc_api %}" type="text/javascript"></script>
    {% with write_video_type_js as jsinclude %}{% if jsinclude %}{% write_video_type_js video %}{% endif %}{% endwith %}

    <script type="text/javascript">
        jQuery(document).ready( function($) {
            $('.tabs').tabs();

            $('.add_subtitles').click( function() {
                widget_widget_div.selectMenuItem(
                unisubs.widget.DropDown.Selection.IMPROVE_SUBTITLES);
                return false;
            });
            $('.add-translation-behavior').click( function() {
                widget_widget_div.selectMenuItem(
                unisubs.widget.DropDown.Selection.ADD_LANGUAGE);
                return false;
            });
            var VIDEO_ID = '{{ video.pk }}';

            $('.edit-title').click( function() {
                $('#edit-title-dialog .title-input').val($('.title-container').html());
            });

            $('#edit-title-dialog .save-title').click(function(){
                var title = $('#edit-title-dialog .title-input').val();
                if (title) {
                    $('.title-container').html(title).hide().fadeIn();
                    VideosApi.change_title_video(VIDEO_ID, title, function(response){
                        if (response.error) {
                            $.jGrowl.error(response.error);
                        } else {
                            $('.title-container').html(title);
                            document.title = title + " | Universal Subtitles";
                        }
                    });
                    $('#edit-title-dialog').modClose();
                }else{
                    $.jGrowl.error('{% trans "Enter non-empty title" %}');
                }
            });

        });
    </script>
{% endblock %}

{% block title %}
    "{{ video.title_display }}" | Universal Subtitles
{% endblock %}

{% block opengraph-head %}
    {{block.super}}
    <meta property="og:title" content="{% title_for_video video  %}"/>
    <meta property="og:type" content="video"/>
    <meta property="og:url" content="http://{{ current_site.domain }}{{ video.get_absolute_url }}"/>
    {% if video.thumbnail %}
    <meta property="og:image" content="{{ video.get_thumbnail }}" />
    {% else %}
    <meta property="og:image" content="{{ STATIC_URL }}images/small_logo.png" />
    {% endif %}

    <meta property="og:site_name" content="Universal Subtitles"/>
    <meta property="og:description"
          content="{% title_for_video video %}"/>
{% endblock  %}

{% block main_content %}
    {% if saved %}
        <div id="messages">
            <p>{% blocktrans %}Subtitles saved! You can share the video with friends, or get an embed code for your site. To add atranslation, click the button below.{% endblocktrans %}</p>
            <a href="#" id="closeBut">{% trans "Close" %}</a>
        </div>
    {% endif %}

    <div class="grid_4 context alpha">
        <h2 class="main-title">
            <a href="{{share_panel_permalink}}" title="Video permalink">{{ video }}</a>
        </h2>
        <div id="description"{% if video.description|length > 300 %} class="abbr collapsed"{% endif %}>
            <div>
                {{ video.description|urlize|linebreaks }}
            </div>
            {% if video.description|length > 300 %}
                <a class="expand" href="#">Show all ↓</a>
            {% endif %}
        </div>
        <ul class="metrics">
            <li>
                <p>{{ video.widget_views_count|simplify_number }}</p>
                <h4>{% trans "View" %}{{ video.widget_views_count|pluralize }}</h4>
            </li>
            <li>
                <p>{{ video.followers.count }}</p>
                <h4>{% trans "Follower" %}{{ video.followers.count|pluralize }}</h4>
            </li>
            <li>
                <p>{{ video|get_comment_count }}</p>
                <h4>{% trans "Comment" %}{{ video|get_comment_count|pluralize }}</h4>
            </li>
            <li>
                <p>{{ video.languages_count }}</p>
                <h4>{% trans "Language" %}{{ video.languages_count|pluralize }}</h4>
            </li>
        </ul>
        <div class="sharing-tools">
            {% if shows_widget_sharing %}
                {% include '_sharing_widget.html' %}
            {% endif %}
        </div>
        <h3>
            {% trans "View Subtitles" %}
            {% if video.languages_count > 0 %}
                ({{ video.languages_count }})
            {% endif %}
        </h3>
        {% if video.subtitle_language or translations %}
            <div{% if video.languages_count > 15 %} class="abbr collapsed"{% endif %}>
                <div>
                    <ul id="subtitles-menu">
                        {% include 'videos/_left_navigation.html' %}
                    </ul>
                </div>
                {% if video.languages_count > 15 %}
                    <a class="expand" href="#">Show all ↓</a>
                {% endif %}
            </div>
        {% else %}
            {% if request.user|can_create_subtitles_for:video or request.user|can_create_translations_for:video %}
                <p>{% trans "Be the first to " %}<a href="#" class="add_subtitles">{% trans 'create subtitles' %}</a>!</p>
            {% else %}
                <p>
                    {% trans "This video doesn't have any subtitles yet" %} :(
                </p>
            {% endif %}
        {% endif %}
    </div>
    <div class="grid_8 view omega">
        {% if user.is_authenticated %}
            {% include 'videos/_follow_video_button.html' %}
        {% endif %}
        <ul class="tabs">
            <li class="current"><a href="#video-tab">{% trans "Video" %}</a></li>
            <li class="hascount"><a href="#comments-tab">{% trans "Comments" %}<span>{{ video|get_comment_count }}</span></a></li>
            <li><a href="#activity-tab">{% trans "Activity" %}</a></li>
            <li class="hascount"><a href="#urls-tab">{% trans "URLs" %}<span>{% video_url_count video %}</span></a></li>
        </ul>
        <div class="tab" id="video-tab">
            {% widget widget_params %}
            <div class="clearboth">
                <div class="video-tools grid_4 alpha">
                    <h3>{% trans "Contribute" %}</h3>
                    <p>
                        {% if video.languages_count < 1 %}
                            {% if request.user|can_create_subtitles_for:video %}
                                {% trans "This video doesn't have any subtitles yet" %} :( <a href="#" class="add_subtitles">{% trans 'Create subtitles now' %}</a>!
                            {% endif %}
                        {% else %}
                            {% if request.user|can_create_translations_for:video %}
                                {% trans "Don't see the language you're looking for?" %} <a class="add-translation-behavior" id="add_translation " href="#">{% trans 'Start a new translation' %}</a>!
                            {% endif %}
                        {% endif %}
                        {% if request.user|can_create_subtitles_for:video or request.user|can_create_translations_for:video %}
                            {% upload_subtitles video %}
                            {% paste_transcription %}
                        {% else %}
                            {% trans 'Subtitles for this video are moderated. If it belongs to a team, try joining the team to contribute.' %}
                        {% endif %}
                    </p>
                </div>
                {% if video.get_team_video or user.managed_teams and not video.is_moderated %}
                    <div class="video-tools grid_4 omega">
                        <h3>{% trans "Collaborate" %}</h3>
                        {% if video.get_team_video %}
                            <p>
                                {% trans "This video belongs to the following team" %}:
                            </p>
                            {% render_belongs_to_team_list video %}
                        {% endif %}
                        {% if user.managed_teams and not video.is_moderated %}
                            {% team_add_video_select %}
                        {% endif %}
                    </div>
                {% endif %}
            </div>
        </div>
        <div class="tab" id="comments-tab" style="display:none;">
            <h3>{% trans "Leave a comment" %}</h3>
            {% render_comment_form video %}
{'fraction_non_alphanumeric': 0.15827610447196236, 'fraction_numerical': 0.004001514086411075, 'mean_word_length': 1.6690720161639485, 'pattern_counts': {'":': 0, '<': 255, '<?xml version=': 0, '>': 263, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7298697', 'n_tokens_mistral': 5619, 'n_tokens_neox': 5029, 'n_words': 1093}