Skip to content

Commit 9840f3b

Browse files
committed
Implemented register screen.
1 parent c495940 commit 9840f3b

File tree

7 files changed

+76
-75
lines changed

7 files changed

+76
-75
lines changed

aspnet-core/src/AbpCompanyName.AbpProjectName.Core/Localization/SourceFiles/AbpProjectName-tr.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
<text name="ChangeTenant">Müşteri değiştir</text>
6464

6565
<text name="MultiLevelMenu" value="Çok Seviyeli Menü" />
66-
66+
<text name="Back" value="Geri" />
67+
6768
</texts>
6869
</localizationDictionary>

aspnet-core/src/AbpCompanyName.AbpProjectName.Core/Localization/SourceFiles/AbpProjectName.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
<text name="ChangeTenant">Change tenant</text>
6464

6565
<text name="MultiLevelMenu" value="Multi Level Menu" />
66+
<text name="Back" value="Back" />
6667

6768
</texts>
6869
</localizationDictionary>
Lines changed: 51 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
@model AbpCompanyName.AbpProjectName.Web.Models.Account.RegisterViewModel
1+
@using Abp.Authorization.Users
2+
@model AbpCompanyName.AbpProjectName.Web.Models.Account.RegisterViewModel
23
@{
34
ViewBag.DisableTopBar = true;
45
}
@@ -21,62 +22,62 @@
2122
<script src="~/view-resources/Views/Account/Register.min.js" asp-append-version="true"></script>
2223
</environment>
2324
}
24-
<div class="container">
25-
<div id="LoginArea" class="row">
26-
<div class="col-lg-12">
27-
<div class="well bs-component">
28-
<form asp-action="Register" class="form-horizontal register-form" method="POST">
29-
<fieldset>
30-
<legend>@L("Register")</legend>
25+
<div class="card">
26+
<div class="body">
27+
<form id="RegisterForm" asp-action="Register" method="POST">
28+
<h4 class="text-center">@L("Register")</h4>
3129

32-
@if (@ViewBag.ErrorMessage != null)
33-
{
34-
<div class="alert alert-danger">
35-
<i class="fa fa-warning"></i> @ViewBag.ErrorMessage
36-
</div>
37-
}
30+
@if (@ViewBag.ErrorMessage != null)
31+
{
32+
<div class="alert alert-danger">
33+
<i class="fa fa-warning"></i> @ViewBag.ErrorMessage
34+
</div>
35+
}
3836

39-
<input type="hidden" name="IsExternalLogin" value="@Model.IsExternalLogin.ToString()" />
40-
<input type="hidden" name="ExternalLoginAuthSchema" value="@Model.ExternalLoginAuthSchema"/>
37+
<input type="hidden" name="IsExternalLogin" value="@Model.IsExternalLogin.ToString()" />
38+
<input type="hidden" name="ExternalLoginAuthSchema" value="@Model.ExternalLoginAuthSchema" />
4139

42-
<div class="form-group">
43-
<div class="col-lg-12">
44-
<input type="text" class="form-control" name="Name" value="@Model.Name" placeholder="@L("Name")" required maxlength="@AbpCompanyName.AbpProjectName.Authorization.Users.User.MaxNameLength">
45-
</div>
46-
</div>
47-
48-
<div class="form-group">
49-
<div class="col-lg-12">
50-
<input type="text" class="form-control" name="Surname" value="@Model.Surname" placeholder="@L("Surname")" required maxlength="@AbpCompanyName.AbpProjectName.Authorization.Users.User.MaxSurnameLength">
51-
</div>
52-
</div>
40+
<div class="form-group form-float">
41+
<div class="form-line">
42+
<input type="text" class="form-control" name="Name" value="@Model.Name" required maxlength="@AbpUserBase.MaxNameLength">
43+
<label class="form-label">@L("Name")</label>
44+
</div>
45+
</div>
5346

54-
<div class="form-group">
55-
<div class="col-lg-12">
56-
<input type="email" class="form-control" name="EmailAddress" value="@Model.EmailAddress" placeholder="@L("EmailAddress")" required maxlength="@AbpCompanyName.AbpProjectName.Authorization.Users.User.MaxEmailAddressLength">
57-
</div>
58-
</div>
47+
<div class="form-group form-float">
48+
<div class="form-line">
49+
<input type="text" class="form-control" name="Surname" value="@Model.Surname" required maxlength="@AbpUserBase.MaxSurnameLength">
50+
<label class="form-label">@L("Surname")</label>
51+
</div>
52+
</div>
5953

60-
<div class="form-group">
61-
<div class="col-lg-12">
62-
<input type="text" class="form-control" name="UserName" value="@Model.UserName" placeholder="@L("UserName")" required maxlength="@AbpCompanyName.AbpProjectName.Authorization.Users.User.MaxUserNameLength">
63-
</div>
64-
</div>
54+
<div class="form-group form-float">
55+
<div class="form-line">
56+
<input type="email" class="form-control" name="EmailAddress" value="@Model.EmailAddress" required maxlength="@AbpUserBase.MaxEmailAddressLength">
57+
<label class="form-label">@L("EmailAddress")</label>
58+
</div>
59+
</div>
6560

66-
<div class="form-group">
67-
<div class="col-lg-12">
68-
<input type="password" class="form-control" name="Password" placeholder="@L("Password")" required maxlength="@AbpCompanyName.AbpProjectName.Authorization.Users.User.MaxPlainPasswordLength">
69-
</div>
70-
</div>
61+
<div class="form-group form-float">
62+
<div class="form-line">
63+
<input type="text" class="form-control" name="UserName" value="@Model.UserName" required maxlength="@AbpUserBase.MaxUserNameLength">
64+
<label class="form-label">@L("UserName")</label>
65+
</div>
66+
</div>
7167

72-
<div class="form-group">
73-
<div class="col-lg-12">
74-
<button type="submit" id="RegisterButton" class="btn btn-primary"><i class="fa fa-sign-in"></i> @L("Register")</button>
75-
</div>
76-
</div>
77-
</fieldset>
78-
</form>
68+
<div class="form-group form-float">
69+
<div class="form-line">
70+
<input type="password" class="form-control" name="Password" required maxlength="@AbpUserBase.MaxPlainPasswordLength">
71+
<label class="form-label">@L("Password")</label>
72+
</div>
73+
</div>
74+
75+
<div class="row">
76+
<div class="col-xs-12">
77+
<a asp-action="Login" class="btn btn-default waves-effect" >@L("Back")</a>
78+
<button id="RegisterButton" class="btn bg-pink waves-effect" type="submit">@L("Register")</button>
79+
</div>
7980
</div>
80-
</div>
81+
</form>
8182
</div>
8283
</div>

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/wwwroot/view-resources/Views/Account/Login.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
$loginForm.validate({
77
highlight: function (input) {
8-
console.log(input);
98
$(input).parents('.form-line').addClass('error');
109
},
1110
unhighlight: function (input) {

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/wwwroot/view-resources/Views/Account/Login.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/wwwroot/view-resources/Views/Account/Register.js

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,37 @@
44
return;
55
}
66

7-
$.validator.addMethod("customUsername", function (value, element) {
8-
if (value === $('input[name="EmailAddress"]').val()) {
9-
return true;
10-
}
11-
12-
return !$.validator.methods.email.apply(this, arguments);
13-
}, abp.localization.localize("RegisterFormUserNameInvalidMessage", "AbpProjectName"));
14-
15-
$(document).ready(function () {
16-
$('.register-form').validate({
17-
errorElement: 'span', //default input error message container
18-
errorClass: 'text-danger', // default input error message class
19-
focusInvalid: false, // do not focus the last invalid input
20-
ignore: "",
7+
$(function () {
8+
9+
var $registerForm = $('#RegisterForm');
10+
11+
$.validator.addMethod("customUsername", function (value, element) {
12+
if (value === $registerForm.find('input[name="EmailAddress"]').val()) {
13+
return true;
14+
}
15+
16+
//Username can not be an email address (except the email address entered)
17+
return !$.validator.methods.email.apply(this, arguments);
18+
}, abp.localization.localize("RegisterFormUserNameInvalidMessage", "AbpProjectName"));
19+
20+
$registerForm.validate({
2121
rules: {
2222
UserName: {
2323
required: true,
2424
customUsername: true
2525
}
2626
},
2727

28-
highlight: function (element) {
29-
$(element).closest('.form-group').addClass('has-error');
28+
highlight: function (input) {
29+
$(input).parents('.form-line').addClass('error');
3030
},
3131

32-
success: function (label) {
33-
label.closest('.form-group').removeClass('has-error');
34-
label.remove();
32+
unhighlight: function (input) {
33+
$(input).parents('.form-line').removeClass('error');
3534
},
3635

37-
submitHandler: function (form) {
38-
form.submit();
36+
errorPlacement: function (error, element) {
37+
$(element).parents('.form-group').append(error);
3938
}
4039
});
4140
});

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/wwwroot/view-resources/Views/Account/Register.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)