<commit_before>{% extends "base.html" %}
{% block jquery %}<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>{% endblock %}
{% load get_api %}
{% block title %}Presentation Form &mdash; Celebration of Scholars &mdash; Carthage College{% endblock %}
{% block extra_javascript %}
    <script type="text/javascript" src="/static/forms/js/jHtmlArea-0.7.5.min.js"></script>
    <script src="http://www.carthage.edu/assets/js/jquery/ui/ui.core.js" type="text/javascript" charset="utf-8"></script>
    <script src="http://www.carthage.edu/assets/js/jquery/plugins/jquery.blockUI.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
        $(function() {
            $("#id_abstract_text").htmlarea({
                toolbar: ["html","bold", "italic", "underline", "superscript", "subscript", "|", "h1", "h2", "h3", "h4", "|", "indent", "outdent", "horizontalrule", "link", "unlink", "|", "orderedList", "unorderedList"]
            });
            var copies = {{copies}};
            // copy duplicate master for new presenter
            $("#clone").click(function () {
                copies++;
                newId = "doop_" + copies;
                $("#doopmaster").clone().attr("id",newId).appendTo("#duplicates");
                $.growlUI('Number of Presenters: ', copies);
            });
            // flag presenters that have a mugshot for upload.
            // cgi on the backend does not include empty filefields in []
            // hidden field name = "mugshoth"
            $(".mugshot").live('change', function() {
                $(this).next(':hidden').val("True");
            });
            // remove presenter
            $(".destroy_school").live('click', function() {
                if (copies > 0) {
                    copies--;
                    $(this).parent().remove();
                    $.growlUI('Number of Presenters: ', copies);
                }else{
                    $.growlUI('Warning', 'No presenters to delete');
                }
            });
            // switch for faculty/staff vs student
            $("select[name='prez_type[]']").live('change', function () {
                if ( $(this).val()=="Student" ) {
                    $(this).parent().nextAll('.student:first').addClass("shown");
                    $(this).parent().nextAll('.facstaff:first').removeClass("shown");
                } else {
                    $(this).parent().nextAll('.facstaff:first').addClass("shown");
                    $(this).parent().nextAll('.student:first').removeClass("shown");
                }
            });
            $( "#profile" ).live('submit', function( event ) {
                var error = false;
                $("div[id^='doop_']").each(function() {
                    var prez_type_obj = $(this).find('select[name="prez_type[]"]');
                    var prez_type = prez_type_obj.val();
                    if (prez_type) {
                        prez_type_obj.removeClass("error");
                    }
                    if ( prez_type == "Student" ) {
                        // Students
                        $(this).find(":input").each(function () {
                            if (this.name != "department[]" && this.name != "sponsor_other[]" && this.name != "leader[]" && this.name != "mugshot[]") {
                                if (this.name == "mugshoth[]") {
                                    if ( this.value == '') {
                                        $(this).prev().addClass("error");
                                        error = true;
                                    }else{
                                        $(this).prev().removeClass("error");
                                    }
                                }else if (!this.value) {
                                    $(this).addClass("error");
                                    error = true;
                                }else{
                                    $(this).removeClass("error");
                                }
                            }
                        });
                    } else if ( prez_type == "Faculty" || prez_type == "Staff" ) {
                        // Faculty or Staff
                        $(this).find(":input").each(function () {
                            //console.log(this.name, this.value);
                            if (this.name == "department[]" || this.name == "first_name[]" || this.name == "last_name[]" || this.name == "prez_type[]" || this.name == "mugshoth[]") {
                                if (this.name == "mugshoth[]") {
                                    if ( this.value == '') {
                                        $(this).prev().addClass("error");
                                        error = true;
                                    }else{
                                        $(this).prev().removeClass("error");
                                    }
                                }else if (!this.value) {
                                    $(this).addClass("error");
                                    error = true;
                                }else{
                                    $(this).removeClass("error");
                                }
                            }
                        });
                    } else {
                        prez_type_obj.addClass("error");
                        error = true;
                    }
                });
                if (error) {
                    return false;
                }
            });
        });
    </script>
{% endblock %}
{% block extra_style %}
    <link href="http://www.carthage.edu/assets/css/jquery/ui/datepicker/ui.datepicker.css" rel="stylesheet" type="text/css" />
    <link rel="Stylesheet" type="text/css" href="/static/forms/css/jHtmlArea.css" />
    <style type="text/css">

    div.jHtmlArea .ToolBar {width: 470px !important; }
    div.jHtmlArea .ToolBar ul li a.custom_disk_button
    {
        background: url(/static/forms/css/disk.png) no-repeat;
        background-position: 0 0;
    }
    div.jHtmlArea { width:500px !important;border: solid 1px #ccc; background: #efefef; }
    iframe {width:500px !important;height:300px !important;background: #fff;border: solid 1px #ccc;}
    #second ul, #second ol { margin: 0; }
    #second li {margin-left:0;}
    #second p {line-height: 1.1;margin-bottom: .5em;}
    #doopmaster {display: none;}
    div.growlUI {background: url(/media/img/ico/information.png) no-repeat 10px 10px; height:90px;}
    div.growlUI h1, div.growlUI h2 {font-size: 1.4em; color: white; padding: 5px 5px 5px 75px; text-align: left;}
    .form input[type=text] {width: 350px;}
    .form input[type=file] {width: 200px;}
    .form input.tiny {margin:0;width:30px;vertical-align:middle;}
    .form input.small {margin:0;width:100px;vertical-align:middle;}
    .form input.medium {margin:0;width:150px;}
    .form input.large {margin:0;width:250px;}
    .form .blockLabels label {display: inline;}
    .ctrlcx {float:right;width:25px;}
    .presenter {border: 1px solid #FFD324; border-radius: 3px 3px 3px 3px; box-shadow: 0 1px 0 #FFFFFF inset; margin: 0 auto 8px; padding: 6px 8px; background-color:#FFF6BF;}
    .hidden {display:none;}
    .facstaff {display:none;}
    .student {display:none;}
    .shown {display:block;}
    .mtop {margin-top:9px;}
    .fleft{width:265px;}
    </style>
{% endblock %}
{% block left_nav %}
    {% include "scholars/left_nav.html" %}
{% endblock %}
{% block content %}
{% get_api_object as title cms snippet 1014 code %}
{{title}}
<div class="buffer">
    {% if manager and presentation %}
        {% include "scholars/presentation/action_form.inc.html" %}
    {% endif %}
    <h1>Presentation Form</h1>
    <p>Fields marked with an asterisk<img src="/static/forms/img/icons/red_asterisk.png" alt="asterisk" style="margin-bottom:-3px;" />are required.</p>
    {% if form.errors %}
        <p class="error">There were errors with the data submitted, see below.</p>
    {% endif %}
    <form method="post" action="." class="form" id="profile" enctype="multipart/form-data">{% csrf_token %}
        {% for hidden in form.hidden_fields %}
        {{ hidden }}
        {% endfor %}
        <fieldset class="blockLabels">
            <ol>
                {% for field in form.visible_fields %}
                    {% if field.name == "poster_file" %}
                        {% if presentation.status %}
                            {% include "form_field.inc.html" %}
                        {% endif %}
                    {% else %}
                        {% include "form_field.inc.html" %}
                    {% endif %}
                {% endfor %}
                {% if manager %}
                <li class="ctrlHolder">
                    <h3><label>Status</label></h3>
                    <p class="help">
                    <input type="checkbox" id="id_status" name="status"{% if presentation.status %} checked="checked"{% endif %} />
                    Is this presentation complete?
                    </p>
                </li>
                {% endif %}
                <li class="ctrlHolder">
                    <div id="doopmaster" class="presenter">
                        <img class="destroy_school fright" src="http://www.carthage.edu/assets/img/ico/silk/icons/delete.png" title="Remove Presenter" alt="Remove Presenter" />
                        {% include "scholars/presentation/presenters.inc.html" %}
                    </div>
                    <h3><label>Presenters</label></h3>
                </li>
                <li style="margin-top:10px;">
                    <p>Click on the <img style="margin-bottom:-3px;" src="http://www.carthage.edu/assets/img/ico/silk/icons/add.png" /> symbol to add more presenters. Click on the <img style="margin-bottom:-3px;" src="http://www.carthage.edu/assets/img/ico/silk/icons/delete.png" /> icon to remove presenters. NOTE: Photos must be JPEG format.</p>
                    <p style="float:left;"><strong class="help">All fields are required.</strong></p>
                    <div class="ctrlcx">
                        <img id="clone" src="http://www.carthage.edu/assets/img/ico/silk/icons/add.png" />
                    </div>
                </li>
                <li class="ctrlHolder" id="duplicates">
                    {% for p in presenters %}
                    <div id="doop_{{forloop.counter}}" class="presenter">
                        {% if forloop.counter != 1 %}
                        <img class="destroy_school fright" src="http://www.carthage.edu/assets/img/ico/silk/icons/delete.png" title="Remove Presenter" alt="Remove Presenter" />
                        {% else %}
                        <div style="height:15px;width:15px;float:right;">&nbsp;</div>
                        {% endif %}
                        {% include "scholars/presentation/presenters.inc.html" %}
                    </div>
                    {% endfor %}
                </li>
                {% block buttons %}
                <li class="btnHolder">
                    <label for="id_submit">&nbsp;&nbsp;</label>
                    <input type="submit" value="Submit" class="button" />
                </li>
                {% endblock %}
            </ol>
        </fieldset>
    </form>
</div><commit_msg>text that explains photo quality of mugshot<commit_after>{% extends "base.html" %}
{% block jquery %}<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>{% endblock %}
{% load get_api %}
{% block title %}Presentation Form &mdash; Celebration of Scholars &mdash; Carthage College{% endblock %}
{% block extra_javascript %}
    <script type="text/javascript" src="/static/forms/js/jHtmlArea-0.7.5.min.js"></script>
    <script src="http://www.carthage.edu/assets/js/jquery/ui/ui.core.js" type="text/javascript" charset="utf-8"></script>
    <script src="http://www.carthage.edu/assets/js/jquery/plugins/jquery.blockUI.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
        $(function() {
            $("#id_abstract_text").htmlarea({
                toolbar: ["html","bold", "italic", "underline", "superscript", "subscript", "|", "h1", "h2", "h3", "h4", "|", "indent", "outdent", "horizontalrule", "link", "unlink", "|", "orderedList", "unorderedList"]
            });
            var copies = {{copies}};
            // copy duplicate master for new presenter
            $("#clone").click(function () {
                copies++;
                newId = "doop_" + copies;
                $("#doopmaster").clone().attr("id",newId).appendTo("#duplicates");
                $.growlUI('Number of Presenters: ', copies);
            });
            // flag presenters that have a mugshot for upload.
            // cgi on the backend does not include empty filefields in []
            // hidden field name = "mugshoth"
            $(".mugshot").live('change', function() {
                $(this).next(':hidden').val("True");
            });
            // remove presenter
            $(".destroy_school").live('click', function() {
                if (copies > 0) {
                    copies--;
                    $(this).parent().remove();
                    $.growlUI('Number of Presenters: ', copies);
                }else{
                    $.growlUI('Warning', 'No presenters to delete');
                }
            });
            // switch for faculty/staff vs student
            $("select[name='prez_type[]']").live('change', function () {
                if ( $(this).val()=="Student" ) {
                    $(this).parent().nextAll('.student:first').addClass("shown");
                    $(this).parent().nextAll('.facstaff:first').removeClass("shown");
                } else {
                    $(this).parent().nextAll('.facstaff:first').addClass("shown");
                    $(this).parent().nextAll('.student:first').removeClass("shown");
                }
            });
            $( "#profile" ).live('submit', function( event ) {
                var error = false;
                $("div[id^='doop_']").each(function() {
                    var prez_type_obj = $(this).find('select[name="prez_type[]"]');
                    var prez_type = prez_type_obj.val();
                    if (prez_type) {
                        prez_type_obj.removeClass("error");
                    }
                    if ( prez_type == "Student" ) {
                        // Students
                        $(this).find(":input").each(function () {
                            if (this.name != "department[]" && this.name != "sponsor_other[]" && this.name != "leader[]" && this.name != "mugshot[]") {
                                if (this.name == "mugshoth[]") {
                                    if ( this.value == '') {
                                        $(this).prev().addClass("error");
                                        error = true;
                                    }else{
                                        $(this).prev().removeClass("error");
                                    }
                                }else if (!this.value) {
                                    $(this).addClass("error");
                                    error = true;
                                }else{
                                    $(this).removeClass("error");
                                }
                            }
                        });
                    } else if ( prez_type == "Faculty" || prez_type == "Staff" ) {
                        // Faculty or Staff
                        $(this).find(":input").each(function () {
                            //console.log(this.name, this.value);
                            if (this.name == "department[]" || this.name == "first_name[]" || this.name == "last_name[]" || this.name == "prez_type[]" || this.name == "mugshoth[]") {
                                if (this.name == "mugshoth[]") {
                                    if ( this.value == '') {
                                        $(this).prev().addClass("error");
                                        error = true;
                                    }else{
                                        $(this).prev().removeClass("error");
                                    }
                                }else if (!this.value) {
                                    $(this).addClass("error");
                                    error = true;
                                }else{
                                    $(this).removeClass("error");
                                }
                            }
                        });
                    } else {
                        prez_type_obj.addClass("error");
                        error = true;
                    }
                });
                if (error) {
                    return false;
                }
            });
        });
    </script>
{% endblock %}
{% block extra_style %}
    <link href="http://www.carthage.edu/assets/css/jquery/ui/datepicker/ui.datepicker.css" rel="stylesheet" type="text/css" />
    <link rel="Stylesheet" type="text/css" href="/static/forms/css/jHtmlArea.css" />
    <style type="text/css">

    div.jHtmlArea .ToolBar {width: 470px !important; }
    div.jHtmlArea .ToolBar ul li a.custom_disk_button
    {
        background: url(/static/forms/css/disk.png) no-repeat;
        background-position: 0 0;
    }
    div.jHtmlArea { width:500px !important;border: solid 1px #ccc; background: #efefef; }
    iframe {width:500px !important;height:300px !important;background: #fff;border: solid 1px #ccc;}
    #second ul, #second ol { margin: 0; }
    #second li {margin-left:0;}
    #second p {line-height: 1.1;margin-bottom: .5em;}
    #doopmaster {display: none;}
    div.growlUI {background: url(/media/img/ico/information.png) no-repeat 10px 10px; height:90px;}
    div.growlUI h1, div.growlUI h2 {font-size: 1.4em; color: white; padding: 5px 5px 5px 75px; text-align: left;}
    .form input[type=text] {width: 350px;}
    .form input[type=file] {width: 200px;}
    .form input.tiny {margin:0;width:30px;vertical-align:middle;}
    .form input.small {margin:0;width:100px;vertical-align:middle;}
    .form input.medium {margin:0;width:150px;}
    .form input.large {margin:0;width:250px;}
    .form .blockLabels label {display: inline;}
    .ctrlcx {float:right;width:25px;}
    .presenter {border: 1px solid #FFD324; border-radius: 3px 3px 3px 3px; box-shadow: 0 1px 0 #FFFFFF inset; margin: 0 auto 8px; padding: 6px 8px; background-color:#FFF6BF;}
    .hidden {display:none;}
    .facstaff {display:none;}
    .student {display:none;}
    .shown {display:block;}
    .mtop {margin-top:9px;}
    .fleft{width:265px;}
    </style>
{% endblock %}
{% block left_nav %}
    {% include "scholars/left_nav.html" %}
{% endblock %}
{% block content %}
{% get_api_object as title cms snippet 1014 code %}
{{title}}
<div class="buffer">
    {% if manager and presentation %}
        {% include "scholars/presentation/action_form.inc.html" %}
    {% endif %}
    <h1>Presentation Form</h1>
    <p>Fields marked with an asterisk<img src="/static/forms/img/icons/red_asterisk.png" alt="asterisk" style="margin-bottom:-3px;" />are required.</p>
    {% if form.errors %}
        <p class="error">There were errors with the data submitted, see below.</p>
    {% endif %}
    <form method="post" action="." class="form" id="profile" enctype="multipart/form-data">{% csrf_token %}
        {% for hidden in form.hidden_fields %}
        {{ hidden }}
        {% endfor %}
        <fieldset class="blockLabels">
            <ol>
                {% for field in form.visible_fields %}
                    {% if field.name == "poster_file" %}
                        {% if presentation.status %}
                            {% include "form_field.inc.html" %}
                        {% endif %}
                    {% else %}
                        {% include "form_field.inc.html" %}
                    {% endif %}
                {% endfor %}
                {% if manager %}
                <li class="ctrlHolder">
                    <h3><label>Status</label></h3>
                    <p class="help">
                    <input type="checkbox" id="id_status" name="status"{% if presentation.status %} checked="checked"{% endif %} />
                    Is this presentation complete?
                    </p>
                </li>
                {% endif %}
                <li class="ctrlHolder">
                    <div id="doopmaster" class="presenter">
                        <img class="destroy_school fright" src="http://www.carthage.edu/assets/img/ico/silk/icons/delete.png" title="Remove Presenter" alt="Remove Presenter" />
                        {% include "scholars/presentation/presenters.inc.html" %}
                    </div>
                    <h3><label>Presenters</label></h3>
                </li>
                <li style="margin-top:10px;">
                    <p>Click on the <img style="margin-bottom:-3px;" src="http://www.carthage.edu/assets/img/ico/silk/icons/add.png" /> symbol to add more presenters. Click on the <img style="margin-bottom:-3px;" src="http://www.carthage.edu/assets/img/ico/silk/icons/delete.png" /> icon to remove presenters.</p>
                    <p><strong>NOTE</strong>: Photos must be JPEG format and must be high resolution&mdash;at least 300 DPI.</p>
                    <p style="float:left;"><strong class="help">All fields are required.</strong></p>
                    <div class="ctrlcx">
                        <img id="clone" src="http://www.carthage.edu/assets/img/ico/silk/icons/add.png" />
                    </div>
                </li>
                <li class="ctrlHolder" id="duplicates">
                    {% for p in presenters %}
                    <div id="doop_{{forloop.counter}}" class="presenter">
                        {% if forloop.counter != 1 %}
                        <img class="destroy_school fright" src="http://www.carthage.edu/assets/img/ico/silk/icons/delete.png" title="Remove Presenter" alt="Remove Presenter" />
                        {% else %}
                        <div style="height:15px;width:15px;float:right;">&nbsp;</div>
                        {% endif %}
                        {% include "scholars/presentation/presenters.inc.html" %}
                    </div>
                    {% endfor %}
                </li>
                {% block buttons %}
                <li class="btnHolder">
                    <label for="id_submit">&nbsp;&nbsp;</label>
                    <input type="submit" value="Submit" class="button" />
                </li>
                {% endblock %}
            </ol>
        </fieldset>
    </form>
</div>
{'fraction_non_alphanumeric': 0.1571086435880688, 'fraction_numerical': 0.009884607010668409, 'mean_word_length': 1.4944064298903008, 'pattern_counts': {'":': 4, '<': 151, '<?xml version=': 0, '>': 153, 'https://': 2, 'lorem ipsum': 0, 'www.': 16, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 44, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4326071', 'n_tokens_mistral': 6648, 'n_tokens_neox': 6037, 'n_words': 1195}