<commit_before>{% extends 'oj_base.html' %}
{% block css_block %}
    <style>
        .CodeMirror {
            height: auto;
        }
    </style>
{% endblock %}
{% block body %}
    {% load submission %}
    <div class="container main">
        <ul class="nav nav-tabs nav-tabs-google">
            <li role="presentation">
                {% if submission.contest_id %}

                    <a href="/contest/{{ submission.contest_id }}/problem/{{ problem.id }}/">题目</a>

                {% else %}
                    <a href="/problem/{{ problem.id }}/">题目</a>
                {% endif %}
            </li>


            <li role="presentation" class="active">
                {% if submission.contest_id %}
                    <a href="/contest/{{ submission.contest_id }}/problem/{{ problem.id }}/submissions/">我的提交</a>
                {% else %}
                    <a href="/problem/{{ problem.id }}/submissions/">我的提交</a>
                {% endif %}
            </li>

        </ul>
        {% include "oj/problem/_problem_header.html" %}
        <div class="panel panel-default">
            <div class="panel-body">
                <h4>运行结果 : <span class="text-{{ submission.result|translate_result_class }}">
                    {{ submission.result|translate_result }}
                </span>
                </h4>
                {% ifequal submission.result 0 %}
                    <p>时间 : {{ submission.accepted_answer_time }}ms 语言 :
                        {{ submission.language|translate_language }}
                    </p>
                {% endifequal %}
                {% ifequal submission.result 4 %}
                    <pre>{{ submission.info }}</pre>
                {% endifequal %}
                <p>提交时间 : {{ submission.create_time }}</p>
            </div>
        </div>
        {% ifequal request.user.admin_type 2 %}
            <p>本调试信息仅超级管理员可见</p>
            {% ifequal submission.result 7 %}
                <pre>System Error: {{ submission.info }}</pre>
            {% else %}
                <pre>{{ info }}</pre>
            {% endifequal %}

        {% endifequal %}


        <div id="code-field">
            <textarea id="code-editor">{{ submission.code }}</textarea>
        </div>
    {% ifequal request.user.id submission.user_id %}

        <div id="share-code" class="col-lg-6 col-md-6">
            {% if submission.shared %}
                <button class="btn btn-warning" id="share-code-btn">取消分享</button>
            {% else %}
                <button class="btn btn-primary" id="share-code-btn">分享我的代码</button>
            {% endif %}
            <textarea class="form-control" id="share-code-textarea"
                      {% if not submission.shared %}style="display: none" {% endif %}>【{{ problem.title }}】- {{ request.user.username }}的提交
{{ request.build_absolute_uri }}</textarea>
        </div>
    {% endifequal %}

    </div>

{% endblock %}
{% block js_block %}
    <script>
        require(["jquery", "codeMirror", "csrfToken"], function ($, codeMirror, csrfTokenHeader) {
            {% ifequal submission.language 1 %}
                var language = "text/x-csrc";
            {% else %}
                {% ifequal submission.language 2 %}
                    var language = "text/x-c++src";
                {% else %}
                    var language = "text/x-java";
                {% endifequal %}
            {% endifequal %}
            var codeEditor = codeMirror($("#code-editor")[0], language);
            codeEditor.setOption("readOnly", true);<commit_msg>修复分享时用户名显示错误的问题<commit_after>{% extends 'oj_base.html' %}
{% block css_block %}
    <style>
        .CodeMirror {
            height: auto;
        }
    </style>
{% endblock %}
{% block body %}
    {% load submission %}
    <div class="container main">
        <ul class="nav nav-tabs nav-tabs-google">
            <li role="presentation">
                {% if submission.contest_id %}

                    <a href="/contest/{{ submission.contest_id }}/problem/{{ problem.id }}/">题目</a>

                {% else %}
                    <a href="/problem/{{ problem.id }}/">题目</a>
                {% endif %}
            </li>


            <li role="presentation" class="active">
                {% if submission.contest_id %}
                    <a href="/contest/{{ submission.contest_id }}/problem/{{ problem.id }}/submissions/">我的提交</a>
                {% else %}
                    <a href="/problem/{{ problem.id }}/submissions/">我的提交</a>
                {% endif %}
            </li>

        </ul>
        {% include "oj/problem/_problem_header.html" %}
        <div class="panel panel-default">
            <div class="panel-body">
                <h4>运行结果 : <span class="text-{{ submission.result|translate_result_class }}">
                    {{ submission.result|translate_result }}
                </span>
                </h4>
                {% ifequal submission.result 0 %}
                    <p>时间 : {{ submission.accepted_answer_time }}ms 语言 :
                        {{ submission.language|translate_language }}
                    </p>
                {% endifequal %}
                {% ifequal submission.result 4 %}
                    <pre>{{ submission.info }}</pre>
                {% endifequal %}
                <p>提交时间 : {{ submission.create_time }}</p>
            </div>
        </div>
        {% ifequal request.user.admin_type 2 %}
            <p>本调试信息仅超级管理员可见</p>
            {% ifequal submission.result 7 %}
                <pre>System Error: {{ submission.info }}</pre>
            {% else %}
                <pre>{{ info }}</pre>
            {% endifequal %}

        {% endifequal %}


        <div id="code-field">
            <textarea id="code-editor">{{ submission.code }}</textarea>
        </div>
    {% ifequal request.user.id submission.user_id %}

        <div id="share-code" class="col-lg-6 col-md-6">
            {% if submission.shared %}
                <button class="btn btn-warning" id="share-code-btn">取消分享</button>
            {% else %}
                <button class="btn btn-primary" id="share-code-btn">分享我的代码</button>
            {% endif %}
            <textarea class="form-control" id="share-code-textarea"
                      {% if not submission.shared %}style="display: none" {% endif %}>{{ problem.title }}
{{ request.build_absolute_uri }}</textarea>
        </div>
    {% endifequal %}

    </div>

{% endblock %}
{% block js_block %}
    <script>
        require(["jquery", "codeMirror", "csrfToken"], function ($, codeMirror, csrfTokenHeader) {
            {% ifequal submission.language 1 %}
                var language = "text/x-csrc";
            {% else %}
                {% ifequal submission.language 2 %}
                    var language = "text/x-c++src";
                {% else %}
                    var language = "text/x-java";
                {% endifequal %}
            {% endifequal %}
            var codeEditor = codeMirror($("#code-editor")[0], language);
            codeEditor.setOption("readOnly", true);
{'fraction_non_alphanumeric': 0.16070921985815603, 'fraction_numerical': 0.003120567375886525, 'mean_word_length': 1.5281462889924704, 'pattern_counts': {'":': 0, '<': 105, '<?xml version=': 0, '>': 105, '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': '2878608', 'n_tokens_mistral': 2222, 'n_tokens_neox': 1962, 'n_words': 377}