{% extends 'base.html' %}
{% load input_field %}
{% load step_order %}
{% load load_json %}

{% block title %}{{ block.super }}: Your Children{% endblock %}

{% block progress %}{% include "partials/progress.html" %}{% endblock %}

{% block content %}

<h1>
    <small>Step {% step_order step="children" %}:</small>Children Details
</h1>
<p>
    Please enter the names of the
    <span class="tooltip-link"
                          data-toggle="tooltip"
                          data-placement="right"
                          data-html="true"
                          title="<b>Children of the marriage</b><br /><br />
              Child of the marriage means a child of two spouses or former spouses who, at the material time,<br />
              <ul>
                <li>is under the age of majority and who has not withdrawn from their charge, or</li>
                <li>is the age of majority or over and under their charge but unable, by reason of illness,
                disability or other cause, to withdraw from their charge or to obtain the necessaries of life; (enfant à charge)?</li>
              </ul>
              More details on the definition of <a href=&quot;http://www.justice.gc.ca/eng/rp-pr/fl-lf/child-enfant/guide/step2-etap2.html#h4&quot; target=&quot;_blank&quot;>&quot;child of marriage&quot; </a>can be found on the Department of Justice website.
">
        children of the marriage.<i class="fa fa-question-circle" aria-hidden="true"></i>
    </span>
    This includes:
</p>
<ul>
    <li>Any children who are under 19 (includes step children and adopted children)</li>
    <li>Any children who are over 19 and require support, commonly referred to as dependents (e.g. due to disability, illness, attending post secondary institution)</li>
</ul>
<p>
    You <strong>do not</strong> need to provide the names of any children who are <strong>over 19</strong> (age of majority in B.C.)
    and <strong>are independent.</strong>
</p>

{% if 'Child support' not in want_which_orders|load_json %}
    <p><strong>Please note: Not asking for child support but have children</strong></p>
    <p>
        Even though you are not asking for an order for child support, you will still need to answer some questions
        about your children. If you're asking for a divorce, the court won't make an order unless they're satisfied
        that reasonable arrangements have been made for the children.
    </p>
    <p>
        "Arrangements for parenting" refers to who will be responsible for making decisions about the children and if
        and how they will spend time with each parent.
    </p>
{% endif %}
<div class="question-well children-list">
    <table id="claimant_children" class="list-builder">
        <thead>
            <tr>
                <th class="table-bordered">Child's Name</th>
                <th class="table-bordered">Birth date</th>
                <th class="table-bordered">Child now living with</th>
                <th class="table-bordered">Relationship to Claimant 1</th>
                <th class="table-bordered">Relationship to Claimant 2</th>
                <th></th>
                <th class="list-builder-hide-column"></th>
            </tr>
        </thead>
        <tbody>
            <tr class="child-disabled-group" data-counter="0" hidden>
                {% include "partials/your_children_child.html" with div_id="hidden" %}
            </tr>
        {% if claimant_children and claimant_children != '[]' %}
            {% multiple_values_to_list source=claimant_children as children %}
            {% for child in children %}
                <tr class="child-item-row" data-counter="{{ forloop.counter }}">
                {{  child.name }}
                    {% include "partials/your_children_child.html" with name=child.child_name birth_date=child.child_birth_date live_with=child.child_live_with custody=child.child_custody live_with=child.child_live_with relationship_to_you=child.child_relationship_to_you relationship_to_spouse=child.child_relationship_to_spouse other_details=child.child_live_with_other_details div_id=forloop.counter counter=forloop.counter %}
                </tr>
            {% endfor %}
        {% endif %}
        </tbody>
        <tbody>
            <tr>
                <td id="btn_add_child" class="btn-add-child fact-sheet-control" colspan="5" readonly>
                    <a href="#add"><i class="fa fa-plus btn-add-child"></i>   Add Child</a>
                </td>
            </tr>
        </tbody>
    </table>
</div>

<div class="children-questions" hidden>

    <div class="question-well">
        <h3>What is your child's name?</h3>
        <p>Enter full name</p>
        {% input_field type="text" name="child_name" class="form-block input-wide response-textbox children-input-block" placeholder="First, Middle, Last Name" data_mirror="true" data_mirror_target="#child_name_0" data_skip_ajax="true" %}
    </div>


    <div class="question-well">
        <h3>What is your child's date of birth?</h3>
        <p>
    <span class="input-group date date-picker-group">
        {% input_field type="text" name="child_birth_date" class="date-picker form-control children-input-block" id="childs_birth_date" placeholder="MMM D, YYYY" data_mirror="true" data_mirror_target="#child_birth_date_0" data_skip_ajax="true" %}
        <span class="input-group-addon">
            <i class="fa fa-calendar circle"></i>
        </span>
    </span>
        </p>
    </div>

    <div class="question-well">
        <h3>Where/whom does this child currently live with?</h3>
        <p>Please select one</p>
        <div class="radio">
            <label class="tight-spacing">
                {% input_field type="radio" class="radio-with-other  children-input-block" name="child_live_with" value="Lives with you" data_target_id="other_child_details" data_reveal_target="false" data_mirror="true" data_mirror_target="#child_live_with_0" data_skip_ajax="true" %}
                {% if name_you %}{{ name_you }}{% else %}You{% endif %}
            </label>
            <p>Child lives primarily (more than 60%) with this parent. This is referred to as sole custody (Divorce Act) or guardianship (Family Law Act).</p>
        </div>
        <div class="radio">
            <label class="tight-spacing">
                {% input_field type="radio" class="radio-with-other  children-input-block" name="child_live_with" value="Lives with spouse" data_target_id="other_child_details" data_reveal_target="false" data_mirror="true" data_mirror_target="#child_live_with_0" data_skip_ajax="true" %}
                {% if name_spouse %}{{ name_spouse }}{% else %}Your spouse{% endif %}
            </label>
            <p>Child lives primarily (more than 60%) with this parent.  This is  referred to as sole custody.</p>
        </div>
        <div class="radio">
            <label class="tight-spacing">
                {% input_field type="radio" class="radio-with-other  children-input-block" name="child_live_with" value="Lives with both" data_target_id="other_child_details" data_reveal_target="false" data_mirror="true" data_mirror_target="#child_live_with_0" data_skip_ajax="true" %}
                Both parents -
                {% if name_you %}{{ name_you }}{% else %}you{% endif %} and
                {% if name_spouse %}{{ name_spouse }}{% else %}your spouse{% endif %}
            </label>
            <p>
                The child lives with both parents more or less equally (between 40-60% of the time with each parent).
                This is referred to as shared custody.
            </p>
        </div>

    {# Future releases will use the feature below. #}
{#        <div class="radio">#}
{#            <label>#}
{#                {% input_field type="radio" class="radio-with-other radio-with-textbox children-input-block" name="child_live_with" value="Other" data_target_id="other_child_details" data_reveal_target="true" data_mirror="true" data_mirror_target="#child_live_with_0" data_skip_ajax="true" %}#}
{#                Other#}
{#                {% input_field type="textarea" class="response-textbox other-textbox input-inline children-input-block" name="child_live_with_other_details" id="other_child_details" maxlength="500" rows="3" tabindex="-1" hidden="" data_mirror="true" data_mirror_target="#child_live_with_other_details_0" data_skip_ajax="true" %}#}
{#            </label>#}
{#        </div>#}
{##}
{#        <div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false"#}
{#             data-target="#collapseChildLivingOptions" aria-controls="collapseChildLivingOptions">#}
{#            <div>#}
{#                Which option applies if my child is living away from home attending school?#}
{#            </div>#}
{#        </div>#}
{#        <div class="collapse" id="collapseChildLivingOptions">#}
{#            <div>#}
{#                <p>#}
{#                    If the child is a dependent living away from home much of the year to attend school, select#}
{#                    the parent with whom the child primarily lives when he/she returns home.#}
{#                </p>#}
{#            </div>#}
{#        </div>#}
    </div>

    <div class="question-well">
        <h3>What is your relationship to this child?</h3>
        <div class="radio">
            <label>{% input_field type="radio" class="radio-with-other children-input-block" name="child_relationship_to_you" value="Natural child" data_mirror="true" data_mirror_target="#child_relationship_you_0" data_skip_ajax="true" %}Natural
                child</label>
        </div>
        <div class="radio">
            <label>{% input_field type="radio" class="radio-with-other children-input-block" name="child_relationship_to_you" value="Step child" data_mirror="true" data_mirror_target="#child_relationship_you_0" data_skip_ajax="true" %}Step
                child</label>
        </div>
        <div class="radio">
            <label class="tight-spacing">{% input_field type="radio" class="radio-with-other children-input-block" name="child_relationship_to_you" value="Adopted child" data_mirror="true" data_mirror_target="#child_relationship_you_0" data_skip_ajax="true" %}Adopted
                child</label>
            <p>
                Once a child is legally adopted, he or she becomes the child of the adoptive parent(s) for all
                purposes.
            </p>
        </div>

        <div class="collapse-trigger collapsed" data-toggle="collapse" aria-expanded="false"
             data-target="#collapseParentRights" aria-controls="collapseParentRights">
            <div>
                What are a step-parents' rights and responsibilities?
            </div>
        </div>
        <div class="collapse" id="collapseParentRights">
            <div>
                <p>
                    If you have stepchildren and you separate from their parent, you may want to continue your
                    relationship
                    with those children. You can try to negotiate an arrangement with the child's parent for you to
                    have
                    regular contact with the child. The only thing you and the other parent can consider when making
                    these
                    decisions is the best interests of the child. You can put these arrangements into an agreement
                    that the
                    two of you write down and sign.
                </p>
                <p>As a step-parent, you may be responsible to pay child support if:</p>
                <ul>
                    <li>you and the child's parent are or were married or lived common-law for at least two years,
                        and
                    </li>
                    <li>you also lived with the child.</li>
                </ul>
                <p>You aren't responsible to pay child support for stepchildren unless</p>
                <ul>
                    <li>
                        you contributed to the child's support for at least one year during your relationship with
                        the
                        child's parent, and
                    </li>
                    <li>
                        the application for support is made within a year of the last time you contributed to the
                        child's support.
                    </li>
                </ul>
                <p>
                    For more information on
                    <a href="http://www.familylaw.lss.bc.ca/resources/fact_sheets/step_parents_rights.php"
                       target="_blank">step-parents' rights and responsibilities</a>
                    please refer to the Family Law of B.C. website.
                </p>
            </div>
        </div>
    </div>

    <div class="question-well">
        <h3>What is your spouse's relationship to this child?</h3>
        <div class="radio">
            <label>{% input_field type="radio" class="radio-with-other children-input-block" name="child_relationship_to_spouse" value="Natural child" data_mirror="true" data_mirror_target="#child_relationship_spouse_0" data_skip_ajax="true" %}Natural
                child</label>
        </div>
        <div class="radio">
            <label>{% input_field type="radio" class="radio-with-other children-input-block" name="child_relationship_to_spouse" value="Step child" data_mirror="true" data_mirror_target="#child_relationship_spouse_0" data_skip_ajax="true" %}Step
                child</label>
        </div>
        <div class="radio">
            <label class="tight-spacing">{% input_field type="radio" class="radio-with-other children-input-block" name="child_relationship_to_spouse" value="Adopted child" data_mirror="true" data_mirror_target="#child_relationship_spouse_0" data_skip_ajax="true" %}Adopted
                child</label>
            <p>
                Once a child is legally adopted, he or she becomes the child of the adoptive parent(s) for all
                purposes.
            </p>
        </div>
    </div>
</div>


<div id="questions_modal" class="modal in" tabindex="-1" role="dialog" style="display: block">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <i class="fa fa-users" aria-hidden="true"></i>
                <h1 class="modal-title">Your children</h1>
            </div>
            <div class="modal-body">
                <p>
                    Next up, we have questions about your children. If  you and the other parent have lived together
                    with your children, generally both of you continue to be guardians after you separate. As guardians,
                    you'll need to figure out how you'll care for and make decisions about your children. That is, how
                    will you divide or share parenting responsibilities and parenting time? Even though parents share
                    these responsibilities when they're living together, the law does not assume that any particular
                    arrangement is in the children's best interests after you split up.
                </p>
            </div>
            <div class="modal-footer">
                <a type="button" class="btn btn-primary btn-lg" data-dismiss="modal">Continue</a>
            </div>
        </div>
    </div>
</div>

<div id="delete_child_modal" class="modal" tabindex="-1" role="dialog" data-backdrop="static">
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <div class="modal-body">
                <p>Please confirm that you want to delete this child?</p>
            </div>
            <div class="modal-footer">
                <a type="button" id="confirm_delete_child" class="btn btn-danger btn-lg">Delete Child</a>
                <a type="button" id="cancel_delete_child" class="btn btn-primary btn-lg">Cancel</a>
                <span id="delete_child_id" hidden></span>
            </div>
        </div>
    </div>
</div>

<div class="modal-backgrop in"></div>
{% endblock %}

{% block formbuttons %}
<div id="children_review_buttons" class="form-buttons clearfix">
    <a class="btn btn-primary" href="{% prev_step step='children' sub_step='your_children' %}"><i class="fa fa-arrow-circle-o-left"></i>&nbsp;&nbsp;&nbsp;Back</a>
    <a class="btn btn-success pull-right" href="{% next_step step='children' sub_step='your_children' %}">Next&nbsp;&nbsp;&nbsp;<i class="fa fa-arrow-circle-o-right"></i></a>
    <a class="btn btn-primary pull-right save-spinner" href="{% url 'overview' %}"><i class="fa fa-floppy-o"></i>&nbsp;&nbsp;&nbsp;Save and return later</a>
</div>
<div id="child_edit_buttons" class="form-buttons clearfix" hidden>
    <a class="btn btn-primary" id="btn_revert_child" href="#"><i class="fa fa-arrow-circle-o-left"></i>&nbsp;&nbsp;&nbsp;Back</a>
    <a class="btn btn-success pull-right" id="btn_save_child" name="claimant_children" href="#">Save changes&nbsp;&nbsp;&nbsp;<i class="fa fa-floppy-o"></i></a>
    <a class="btn btn-primary pull-right save-spinner" href="{% url 'overview' %}"><i class="fa fa-floppy-o"></i>&nbsp;&nbsp;&nbsp;Save and return later</a>
</div>
{% endblock %}

{% block sidebarText %}
    <p><strong>Sole Custody Example</strong></p>
    <p>
        Maria and Pedro have decided to divorce. Their children, Christine and Manuel, are having a hard time coping
        with the idea. They are afraid of the changes it will mean in their lives.
    </p>
    <p>
        Maria and Pedro want to protect their children as much as possible. They agree that it will probably be better
        for Christine and Manuel to continue living in the family home with Maria. It is closer to their school and
        friends than the new place Pedro plans to move to. The children will spend a fair bit of time with Pedro, too,
        especially on weekends and holidays. But Maria and Pedro calculate that, over the entire year, the children will
        spend 65% of the time with Maria and 35% of the time with Pedro. This means that Maria will have sole custody
        for child support purposes, although they have decided that they will have joint custody for decision-making
        purposes. Pedro will pay support.
    </p>
    <p>
    Source: The
    {% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://www.justice.gc.ca/eng/rp-pr/fl-lf/child-enfant/guide/step3-etap3.html" link_text="Federal Child Support Guidelines: Step-by-Step" %}
    </p>

    <p><strong>Split Custody Example</strong></p>
    <p>
        Bill and Janet have decided to go their separate ways and get a divorce. They are having a hard time agreeing on
        the parenting arrangements for their three children. But there is one thing they do agree on—that it is important
        to put their children’s best interests first.
    </p>
    <p>
        They both realize that their oldest child, 15-year-old Marc, is particularly close to Bill. After discussing the
        issue with Marc, they all agree that it will be best for Marc to spend most of the time with his father. With
        the help of a mediator, Bill and Janet are also able to agree that the two youngest children, three-year-old
        Caroline and five-year-old Albert, will spend time mainly with Janet.
    </p>
    <p>
        In other words, Marc will spend more than 60% of the time with Bill while Caroline and Albert will spend more
        than 60% of the time with Janet over the course of a year. This means that Bill and Janet will each have sole
        custody of at least one of the children. They have a split-custody arrangement.
    </p>
    <p>
    Source: The
    {% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://www.justice.gc.ca/eng/rp-pr/fl-lf/child-enfant/guide/step3-etap3.html" link_text="Federal Child Support Guidelines: Step-by-Step" %}
    </p>

    <p><strong>Shared Custody Example</strong></p>
    <p>
        Eight-year-old twins Malia and Emma are very worried. They have just found out that their dad, Raoul, and mom,
        Lily, have decided to divorce and live in separate homes. Malia and Emma wonder where they will live. They are
        afraid that if one of their parents lives in a different house, they will hardly ever see that parent again.
        This happened to one of their friends at school.
    </p>
    <p>
        Raoul and Lily listen to their children’s concerns. They assure Malia and Emma that they both love them very
        much and will always be their parents. They also explain that the children will get to live in two houses.
    </p>
    <p>
        Lily and Raoul have a number of discussions and take a close look at their family’s situation to come up with a
        plan that is workable and best for Malia and Emma. They explain to Malia and Emma that they will spend alternate
        weeks with each parent. They will spend one week with mom, and they will spend the next week with dad. The
        schedule will vary a bit sometimes. For example, in the summer, Malia and Emma will spend a complete month with
        each parent. But they should not worry. Mom and dad will work together to ensure that their decisions are in
        Malia’s and Emma’s best interests.
    </p>
    <p>
        Since Malia and Emma spend at least 40% of the time with each parent, Raoul and Lily have a shared-custody
        arrangement for child support purposes.
    </p>
    <p>
    Source: The
    {% include "partials/tooltip_link_federal_child_support_guidelines.html" with reference_link="http://www.justice.gc.ca/eng/rp-pr/fl-lf/child-enfant/guide/step3-etap3.html" link_text="Federal Child Support Guidelines: Step-by-Step" %}
    </p>
{% endblock %}
