@model Alpha.Coordinador.WebApp.Models.EditUserViewModel

@{
    ViewBag.Title = "Edit";
}

<h2>Editar</h2>

@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/bundles/bootstrap")
@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    <input type="password" style="display:none;" readonly>
    <div class="form-horizontal">
        <hr />
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        @Html.HiddenFor(model => model.Id)
        @Html.HiddenFor(model => model.LoginUtilsId)

        <div class="form-group">
            @Html.LabelFor(model => model.Username, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Username, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Username, "", new { @class = "text-danger" })
            </div>
        </div>

        @*<div class="form-group">
            @Html.LabelFor(model => model.Password, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Password, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Password, "", new { @class = "text-danger" })
            </div>
        </div>*@
        @*<div class="form-group">
            @Html.LabelFor(model => model.Admin, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.CheckBoxFor(model => model.Admin, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Admin, "", new { @class = "text-danger" })
            </div>
        </div>*@
    <div class="form-group">
        @Html.LabelFor(model => model.Services, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @{var Services = (IEnumerable<Alpha.Coordinador.Interfaces.Models.Service>)ViewBag.Services;}
            @Html.ListBoxFor(m => m.SelectedServices, new SelectList(Services, "Id", "ServiceName"), new { @class = "dropdown" })
            @Html.ValidationMessageFor(model => model.Services, "", new { @class = "text-danger" })
        </div>
    </div>
        <div class="form-group">
            @Html.LabelFor(model => model.VirtualMachines, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @{var VirtualMachines = (IEnumerable<Alpha.Coordinador.Interfaces.Models.VirtualMachine>)ViewBag.VirtualMachines;}
                @Html.ListBoxFor(m => m.SelectedVirtualMachines, new MultiSelectList(VirtualMachines, "ID", "Nombre", Model.SelectedVirtualMachines), new { @class = "dropdown" })
                @Html.ValidationMessageFor(model => model.VirtualMachines, "", new { @class = "text-danger" })
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Guardar" class="btn btn-default" />
            </div>
        </div>
    </div>
}
<script>
    document.ready = () => $("input").attr("autocomplete", "nope");
</script>
<hr />
<div>
    @Html.ActionLink("Volver", "Index")
</div>
