Reworking the login page for #426

This commit is contained in:
tidusjar 2016-07-26 12:59:39 +01:00
commit f03392691c
5 changed files with 98 additions and 68 deletions

View file

@ -157,15 +157,9 @@
</div>
<div class="col-sm-5 ">
<div>
{{#if_eq type "movie"}}
<a href="https://www.themoviedb.org/movie/{{id}}/" target="_blank">
<h4>{{title}} ({{year}})</h4>
</a>
{{else}}
<a href="http://www.imdb.com/title/{{imdb}}/" target="_blank">
<h4>{{title}} ({{year}})</h4>
</a>
{{/if_eq}}
</div>
<p>{{overview}}</p>
</div>

View file

@ -1,5 +1,14 @@
@using PlexRequests.UI.Helpers

@using PlexRequests.UI.Helpers
@using PlexRequests.UI.Resources
@{
var nullableError = Context.ViewBag.TempMessage ?? string.Empty;
var error = false;
if (!string.IsNullOrEmpty(nullableError))
{
error = true;
}
}
<div class="home">
<h1>@UI.UserLogin_Title</h1>
<div>
@ -8,6 +17,7 @@
</p>
</div>
<form method="POST" id="loginForm">
<input id="dateTimeOffset" name="DateTimeOffset" hidden="hidden" />
<div>
<div>
<label>@UI.UserLogin_Username</label>
@ -24,7 +34,7 @@
<label> @UI.UserLogin_Password </label>
</div>
<div>
<input id="password" class="form-control form-control-custom" name="Password" type="password" placeholder="@UI.UserLogin_Password"/>
<input id="password" class="form-control form-control-custom" name="Password" type="password" placeholder="@UI.UserLogin_Password" />
</div>
</div>
<br />
@ -36,15 +46,25 @@
<script>
$(function () {
var base = '@Html.GetBaseUrl()';
$('#loginBtn').click(function (e) {
$('#dateTimeOffset').val(new Date().getTimezoneOffset());
@if (error)
{
<text>
generateNotify('@nullableError',"warning");
</text>
}
@*$('#loginBtn').click(function (e) {
e.preventDefault();
var $form = $("#loginForm");
var formData = $form.serialize();
var dtOffset = new Date().getTimezoneOffset();
formData += ('&DateTimeOffset=' + dtOffset);
var url = createBaseUrl(base, '/search');
$.ajax({
type: $form.prop("method"),
url: $form.prop("action"),
@ -53,9 +73,8 @@
success: function (response) {
console.log(response);
if (response.result === true) {
location.replace(response.message);
} else {
generateNotify(response.message, "warning");
}
@ -65,6 +84,7 @@
generateNotify("@UI.Javascript_SomethingWentWrong", "danger");
}
});
});
});*@
});
</script>