87 lines
2.8 KiB
Plaintext
87 lines
2.8 KiB
Plaintext
@using EnVisage.Models;
|
|
@using Microsoft.AspNet.Identity;
|
|
@model EnVisage.Models.ManageUserViewModel
|
|
@{
|
|
ViewBag.Title = "Manage Account";
|
|
}
|
|
|
|
<h2>@ViewBag.Title.</h2>
|
|
|
|
<p class="text-success">@ViewBag.StatusMessage</p>
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
@if (ViewBag.HasLocalPassword)
|
|
{
|
|
@Html.Partial("_ChangePasswordPartial")
|
|
}
|
|
else
|
|
{
|
|
@Html.Partial("_SetPasswordPartial")
|
|
}
|
|
|
|
<div class="panel-body">
|
|
<div class="form-group">
|
|
@Html.LabelFor(model => model.Email, new { @class = "col-sm-2 control-label" })
|
|
<div class="col-sm-10">
|
|
@Html.TextBoxFor(model => model.Email, new { @class = "form-control email" })
|
|
@Html.ValidationMessageFor(model => model.Email)
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
@Html.LabelFor(model => model.Phone, new { @class = "col-sm-2 control-label" })
|
|
<div class="col-sm-10">
|
|
@Html.TextBoxFor(model => model.Phone, new { @class = "form-control phone" })
|
|
@Html.ValidationMessageFor(model => model.Phone)
|
|
</div>
|
|
</div>
|
|
<div class="form-group" style="margin-top: 20px;margin-bottom: 20px;">
|
|
@Html.LabelFor(model => model.PreferredResourceAllocation, new { @class = "col-sm-2 control-label" })
|
|
<div class="col-sm-10">
|
|
@Html.CheckBoxFor(model => model.PreferredResourceAllocation, new { @id = "preferredallocation"})
|
|
</div>
|
|
</div>
|
|
<div class="form-group" style="margin-top: 20px;margin-bottom: 20px;">
|
|
<div class="col-sm-2"></div>
|
|
<div class="col-sm-10">
|
|
<button class="btn btn-success" id="btnsave" onclick="changeEmailAndPhone()"><i class="fa fa-save"></i> Save</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@*<section id="externalLogins">
|
|
@Html.Action("RemoveAccountList")
|
|
@Html.Partial("_ExternalLoginsListPartial", new { Action = "LinkLogin", ReturnUrl = ViewBag.ReturnUrl })
|
|
</section>*@
|
|
</div>
|
|
</div>
|
|
@section Scripts {
|
|
@Scripts.Render("~/bundles/jqueryval")
|
|
|
|
<script type="text/javascript">
|
|
init.push(function () {
|
|
$('#preferredallocation').switcher({
|
|
on_state_content: 'Number of Resources',
|
|
off_state_content: 'Number of Hours'
|
|
});
|
|
$('#preferredallocation').parent().css("width", "140px");
|
|
|
|
});
|
|
function changeEmailAndPhone() {
|
|
var email = $('.email').val();
|
|
var phone = $('.phone').val();
|
|
var alloc = $('#preferredallocation').is(':checked');
|
|
var param = { newEmail: email, newPhone: phone, newPreferredResourceAllocation: alloc };
|
|
blockUI();
|
|
$.post('@Url.Action("ChangeEmailAndPhone", "Account")', param, function (data) {
|
|
unblockUI();
|
|
if (data.Status == 'OK') {
|
|
alert('saved');
|
|
} else if (data.Status == 'Error') {
|
|
console.debug(data.Exception);
|
|
showErrorModal('Update error.', data.Msg);
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
}
|