{% extends 'admin/base.html' %}
    



{% block content %}

<head>
    <style>
    .justify-content-center {
        -ms-flex-pack: center!important;
        justify-content: center!important;
    }
    .row {
        display: -ms-flexbox;
        display: flex;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
        margin-right: -7.5px;
        margin-left: -7.5px;
    }
    *, ::after, ::before {
        box-sizing: border-box;
    }
    user agent stylesheet
    div {
        display: block;
    }
    body {
        margin: 0;
        font-family: "Source Sans Pro",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
        font-size: 1rem;
        font-weight: 400;
        line-height: 1.5;
        color: #212529;
        text-align: left;
        background-color: #fff;
    }
    :root {
        --blue: #007bff;
        --indigo: #6610f2;
        --purple: #6f42c1;
        --pink: #e83e8c;
        --red: #dc3545;
        --orange: #fd7e14;
        --yellow: #ffc107;
        --green: #28a745;
        --teal: #20c997;
        --cyan: #17a2b8;
        --white: #fff;
        --gray: #6c757d;
        --gray-dark: #343a40;
        --primary: #007bff;
        --secondary: #6c757d;
        --success: #28a745;
        --info: #17a2b8;
        --warning: #ffc107;
        --danger: #dc3545;
        --light: #f8f9fa;
        --dark: #343a40;
        --breakpoint-xs: 0;
        --breakpoint-sm: 576px;
        --breakpoint-md: 768px;
        --breakpoint-lg: 992px;
        --breakpoint-xl: 1200px;
        --font-family-sans-serif: "Source Sans Pro",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
        --font-family-monospace: SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
    }
    
    :host, :root {
        --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Solid";
        --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Regular";
        --fa-font-light: normal 300 1em/1 "Font Awesome 6 Light";
        --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Thin";
        --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone";
        --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands";
    }
    html {
        font-family: sans-serif;
        line-height: 1.15;
        -webkit-text-size-adjust: 100%;
        -webkit-tap-highlight-color: transparent;
    }
    *, ::after, ::before {
        box-sizing: border-box;
    }
    *, ::after, ::before {
        box-sizing: border-box;
    }
</style>
</head>


<body class="hold-transition sidebar-mini layout-fixed">
    <h1>Mobile Management</h1>
 <section class="content">
    <div class="container-fluid"style="min-width: 1300px;">
<div class="row justify-content-center">
    <div class="col-md-4">
        <!-- general form elements -->
        <div class="card card-secondary">
            <div class="card-header">
                <h3 class="card-title"id ="hihihjihi">Version Management</h3>

            </div>
            <!-- /.card-header -->
            <!-- form start -->
            <form method="POST" action={% url 'deepak' %}>
                {% csrf_token %}
                <input type="hidden" name="_method" value="PATCH">                            <input type="hidden" name="_token" value="O8oTZWjHgd4XbXUnqQ28jji3HAq9eOjlTVAEsemh">                            <div class="card-body">
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="js-android-version">Android Version</label>

                    
                                <div class="input-group">
                                    <div class="input-group-prepend">
                                        <span class="input-group-text"><i class="fab fa-android"></i></span>
                                    </div>
                                    <input type="text" name="android[version]" class="form-control "
                                        id="js-android-versions" placeholder="Enter Android Version" value="0.0.0">
                                
                                                                                </div>
                            </div>
                            <div class="form-group">
                                <label for="js-android-force-update">Force Update</label>
                                <div class="input-group">
                                    <input 
                                    type="checkbox" 
                                    id="js-android-force-updates" 
                                    name="androidforce" 
                                    data-bootstrap-switch 
                                    data-off-color="danger"
                                    data-on-color="success"
                                    checked="true"
                                                                                    >
                                    
                                                                                </div>
                            </div>
                            
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="js-ios-version">iOS Version</label>
                                <div class="input-group">
                                    <div class="input-group-prepend">
                                        <span class="input-group-text"><i class="fab fa-apple"></i></span>
                                    </div>
                                    <input type="text" name="ios[version]" class="form-control "
                                        id="js-ioss-version" placeholder="Enter iOS Version" value="0.0.0">
                            
                                                                                </div>
                            </div>
                            <div class="form-group">
                                <label for="js-ios-force-update">Force Update</label>
                                <div class="input-group">
                                    <input 
                                    type="checkbox" 
                                    id="js-ios-force-updates" 
                                    name="iosforce" 
                                    data-bootstrap-switch 
                                    data-off-color="danger"
                                    data-on-color="success"
                                    checked="true"
                                                                                    >
                                    
                                                                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /.card-body -->
                <span style="color:red">
                    {{ error }}
                </span>
                <div class="card-footer">
                    <button type="submit" class="btn btn-secondary w-100 border border-dark">Submit</button>
                </div>
            </form>
        </div>
        <!-- /.card -->
    </div>
</div>
</div>
</section>
</div>
         </div>
            </div>

        <script>
        $("input[data-bootstrap-switch]").each(function(){
            $(this).bootstrapSwitch('state', $(this).prop('checked'));
        })
    </script>
<script type="text/javascript">
var phpdebugbar = new PhpDebugBar.DebugBar();
phpdebugbar.addIndicator("php_version", new PhpDebugBar.DebugBar.Indicator({"icon":"code","tooltip":"PHP Version"}), "right");
phpdebugbar.addTab("messages", new PhpDebugBar.DebugBar.Tab({"icon":"list-alt","title":"Messages", "widget": new PhpDebugBar.Widgets.MessagesWidget()}));
phpdebugbar.addIndicator("time", new PhpDebugBar.DebugBar.Indicator({"icon":"clock-o","tooltip":"Request Duration"}), "right");
phpdebugbar.addTab("timeline", new PhpDebugBar.DebugBar.Tab({"icon":"tasks","title":"Timeline", "widget": new PhpDebugBar.Widgets.TimelineWidget()}));
phpdebugbar.addIndicator("memory", new PhpDebugBar.DebugBar.Indicator({"icon":"cogs","tooltip":"Memory Usage"}), "right");
phpdebugbar.addTab("exceptions", new PhpDebugBar.DebugBar.Tab({"icon":"bug","title":"Exceptions", "widget": new PhpDebugBar.Widgets.ExceptionsWidget()}));
phpdebugbar.addTab("views", new PhpDebugBar.DebugBar.Tab({"icon":"leaf","title":"Views", "widget": new PhpDebugBar.Widgets.TemplatesWidget()}));
phpdebugbar.addTab("route", new PhpDebugBar.DebugBar.Tab({"icon":"share","title":"Route", "widget": new PhpDebugBar.Widgets.HtmlVariableListWidget()}));
phpdebugbar.addIndicator("currentroute", new PhpDebugBar.DebugBar.Indicator({"icon":"share","tooltip":"Route"}), "right");
phpdebugbar.addTab("queries", new PhpDebugBar.DebugBar.Tab({"icon":"database","title":"Queries", "widget": new PhpDebugBar.Widgets.LaravelSQLQueriesWidget()}));
phpdebugbar.addTab("models", new PhpDebugBar.DebugBar.Tab({"icon":"cubes","title":"Models", "widget": new PhpDebugBar.Widgets.HtmlVariableListWidget()}));
phpdebugbar.addTab("gate", new PhpDebugBar.DebugBar.Tab({"icon":"list-alt","title":"Gate", "widget": new PhpDebugBar.Widgets.MessagesWidget()}));
phpdebugbar.addTab("session", new PhpDebugBar.DebugBar.Tab({"icon":"archive","title":"Session", "widget": new PhpDebugBar.Widgets.VariableListWidget()}));
phpdebugbar.addTab("request", new PhpDebugBar.DebugBar.Tab({"icon":"tags","title":"Request", "widget": new PhpDebugBar.Widgets.HtmlVariableListWidget()}));
phpdebugbar.setDataMap({
"php_version": ["php.version", ],
"messages": ["messages.messages", []],
"messages:badge": ["messages.count", null],
"time": ["time.duration_str", '0ms'],
"timeline": ["time", {}],
"memory": ["memory.peak_usage_str", '0B'],
"exceptions": ["exceptions.exceptions", []],
"exceptions:badge": ["exceptions.count", null],
"views": ["views", []],
"views:badge": ["views.nb_templates", 0],
"route": ["route", {}],
"currentroute": ["route.uri", ],
"queries": ["queries", []],
"queries:badge": ["queries.nb_statements", 0],
"models": ["models.data", {}],
"models:badge": ["models.count", 0],
"gate": ["gate.messages", []],
"gate:badge": ["gate.count", null],
"session": ["session", {}],
"request": ["request", {}]
});

</script>
</body>
{% endblock %}  

{% block extrajs %}
<script>
    $(document).ready(function(){
        $.ajax({ url: "/currentversion/",
            context: document.body,
            success: function(data){
                console.log(data)
                document.getElementById("js-android-versions").value =data.android['version']
                document.getElementById("js-android-force-updates").checked =data.android['force_update']
                document.getElementById("js-ioss-version").value =data.ios['version']
                document.getElementById("js-ios-force-updates").checked =data.ios['force_update']
            }
        });
    });
</script>
{% endblock %}
