foreveralone

foreveralone Git Source Tree


Root/web/application/views/info3.html

{% extends "base.html" %}

{% block content %}

<div class="container container-table">
    <div class="row vertical-center-row">
        <div class="text-center col-md-6 col-md-offset-3">
            <div>I just need a pieces of information from you so I can match you with your other half.</div>
            <br>
            <form role="form">
                <div class="form-group">
                    <label for="looking">Who are you looking for?</label>
                    <select class="form-control" id="looking" multiple>
                        <option value="male">Male</option>
                        <option value="female">Female</option>
                        <option value="transgender">Transgender</option>
                        <option value="other">Other</option>
                        <option value="agender">Agender</option>
                        <option value="transexual">Transexual</option>
                        <option value="pangender">Pangender</option>
                        <option value="genderfluid">Genderfluid</option>
                        <option value="transfeminine">Transfeminine</option>
                        <option value="transmasculine">Transmasculine</option>
                        <option value="trigenderpyrofox">Tri-gender pyrofox (from the forest planet)</option>

                    </select>
                </div>
                <div class="form-group">
                    <label>Or enter a custom gender:</label>
                    <input type="text" id="customGender"> <button id="genderAdd" type="button" class="btn btn-primary">Add</button>
                </div>
                <nav>
                    <ul class="pager">
                        <li><a href="./main/info/1">Prev</a></li>
                        <li><a href="./main/chat/">Find</a></li>
                    </ul>
                </nav>
            </form>
        </div>
    </div>
</div>


<script type="text/javascript">
    $(function () {
        $("#looking").select2();
        $("#looking").on("change", function () {
            $.post("./main/sessionset/looking/", {"looking": $(this).val()});
        });

        function addGender() {
            var value = $("#customGender").val();
            if (value) {
                $("#looking").append($("<option/>", {
                    value: value.toLowerCase(),
                    text: value.toLowerCase(),
                    selected: "selected"
                }));
                var original = $("#looking").val();
                var newval = $.merge([value], original);
                $("#looking").val(newval).change();
                $("#customGender").val("");
            }
        }

        $("#customGender").keyup(function (e) {
            if (e.which == $.ui.keyCode.ENTER) {
                addGender();
            }
        });

        $("#genderAdd").click(function () {
            addGender();
        });
    });
</script>

{% endblock %}

Archive Download this file

Branches

Tags

Number of commits:
Page rendered in 0.07220s using 11 queries.