Skip to content

Commit

Permalink
Major update on Login and Registration styling.""
Browse files Browse the repository at this point in the history
This reverts commit daed0a9.
  • Loading branch information
tamaraiselvan committed Jan 9, 2023
1 parent daed0a9 commit f1c3fba
Show file tree
Hide file tree
Showing 21 changed files with 422 additions and 689 deletions.
Binary file added Base_Master/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file added Base_Master/__pycache__/settings.cpython-311.pyc
Binary file not shown.
Binary file added Base_Master/__pycache__/urls.cpython-311.pyc
Binary file not shown.
Binary file added Base_Master/__pycache__/wsgi.cpython-311.pyc
Binary file not shown.
1 change: 0 additions & 1 deletion Base_Master/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from django.contrib import admin
from django.urls import path,include, re_path
from django.contrib.auth.views import LoginView
Expand Down
Binary file added firstapp/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file added firstapp/__pycache__/admin.cpython-311.pyc
Binary file not shown.
Binary file added firstapp/__pycache__/apps.cpython-311.pyc
Binary file not shown.
Binary file added firstapp/__pycache__/forms.cpython-311.pyc
Binary file not shown.
Binary file added firstapp/__pycache__/models.cpython-311.pyc
Binary file not shown.
Binary file added firstapp/__pycache__/views.cpython-311.pyc
Binary file not shown.
24 changes: 19 additions & 5 deletions firstapp/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,25 @@
from django.contrib.auth.models import User


class SignUpForm(UserCreationForm):
first_name = forms.CharField(max_length=30, required=False, help_text='Optional.')
last_name = forms.CharField(max_length=30, required=False, help_text='Optional.')
email = forms.EmailField(max_length=254, help_text='Required. Inform a valid email address.')
class SignUpForm(UserCreationForm):
first_name = forms.CharField(widget=forms.TextInput(attrs={'class':'form-control', 'placeholder': 'Enter First name'}), required=True)
last_name = forms.CharField(widget=forms.TextInput(attrs={'class':'form-control', 'placeholder': 'Enter last name'}), required=True)
email = forms.EmailField(widget=forms.EmailInput(attrs={'class':'form-control', 'placeholder': 'Enter Email address'}), required=True)
username = forms.CharField(widget=forms.TextInput(attrs={'class':'form-control', 'placeholder': 'Enter username'}), required=True)
password1 = forms.CharField(widget=forms.PasswordInput(attrs={'class':'form-control', 'placeholder': 'Enter Password'}), required=True)
password2 = forms.CharField(widget=forms.PasswordInput(attrs={'class':'form-control', 'placeholder': 'ReEnter Password'}), required=True)
class Meta:
model = User
fields = ('username', 'first_name', 'last_name', 'email', 'password1', 'password2', )

def clean_email(self):
email = self.cleaned_data.get("email")
user_count = User.objects.filter(email=email).count()
if user_count > 0:
raise forms.ValidationError("This email is already exists.")
return email

class profile_edit(forms.ModelForm):
class Meta:
model = User
fields = ('username', 'first_name', 'last_name', 'email', 'password1', 'password2', )
fields=['username','email','first_name','last_name', "is_superuser"]
Binary file not shown.
33 changes: 13 additions & 20 deletions firstapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,21 @@ def home(request):
messages.error(request, 'Please Provide the credentials to Login to your account.')
return redirect("login")

from .forms import SignUpForm


from .forms import SignUpForm, profile_edit
def signup_view(request):
form = SignUpForm(request.POST)
if form.is_valid():
form.save()
return redirect('login')
if request.method == 'POST':
form = SignUpForm(request.POST)

if form.is_valid():
form.save()
messages.success(request, 'Your account has been created ! You are now able to log in')
return redirect('login')
else:
messages.error(request, 'Please Provide the appropriate credentials to create your account.')
else:
messages.error(request, 'Please Provide the credentials to Login to your account.')
form = SignUpForm()
return render(request, 'registration/login.html', {'form': form})
return render(request, 'registration/registration.html', {'form': form})

def profile(request):
return render(request, 'profile.html')

def deactivate(request):
if request.user.is_authenticated:

return render(request, 'home.html')
else:
return redirect(home)



def profile(request):
return render(request, 'profile.html')
11 changes: 0 additions & 11 deletions static/login_styling/app.js

This file was deleted.

1 change: 0 additions & 1 deletion static/login_styling/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1048,4 +1048,3 @@ body {

}


106 changes: 106 additions & 0 deletions static/login_styling/loginstyle.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
body {
font-family: "Karla", sans-serif;
background-color: #fff;
min-height: 100vh; }

.brand-wrapper {
padding-top: 7px;
padding-bottom: 8px; }
.brand-wrapper .logo {
height: 25px; }

.login-section-wrapper {
display: -webkit-box;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
flex-direction: column;
padding: 68px 100px;
background-color: #fff; }
@media (max-width: 991px) {
.login-section-wrapper {
padding-left: 50px;
padding-right: 50px; } }
@media (max-width: 575px) {
.login-section-wrapper {
padding-top: 20px;
padding-bottom: 20px;
min-height: 100vh; } }

.login-wrapper {
width: 300px;
max-width: 100%;
padding-top: 24px;
padding-bottom: 24px; }
@media (max-width: 575px) {
.login-wrapper {
width: 100%; } }
.login-wrapper label {
font-size: 14px;
font-weight: bold;
color: #b0adad; }
.login-wrapper .form-control {
border: none;
border-bottom: 1px solid #e7e7e7;
border-radius: 0;
padding: 9px 5px;
min-height: 40px;
font-size: 18px;
font-weight: normal; }
.login-wrapper .form-control::-webkit-input-placeholder {
color: #b0adad; }
.login-wrapper .form-control::-moz-placeholder {
color: #b0adad; }
.login-wrapper .form-control:-ms-input-placeholder {
color: #b0adad; }
.login-wrapper .form-control::-ms-input-placeholder {
color: #b0adad; }
.login-wrapper .form-control::placeholder {
color: #b0adad; }
.login-wrapper .login-btn {
padding: 13px 20px;
background-color: #fdbb28;
border-radius: 0;
font-size: 20px;
font-weight: bold;
color: #fff;
margin-bottom: 14px; }
.login-wrapper .login-btn:hover {
border: 1px solid #fdbb28;
background-color: #fff;
color: #fdbb28; }
.login-wrapper a.forgot-password-link {
color: #080808;
font-size: 14px;
text-decoration: underline;
display: inline-block;
margin-bottom: 54px; }
@media (max-width: 575px) {
.login-wrapper a.forgot-password-link {
margin-bottom: 16px; } }
.login-wrapper-footer-text {
font-size: 16px;
color: #000;
margin-bottom: 0; }

.login-title {
font-size: 30px;
color: #000;
font-weight: bold;
margin-bottom: 25px; }

.login-img {
width: 100%;
height: 100vh;
-o-object-fit: cover;
object-fit: cover;
-o-object-position: left;
object-position: left; }

.footer-link {
position: absolute;
bottom: 1rem;
text-align: center;
width: 100%; }

/*# sourceMappingURL=login.css.map */
Loading

0 comments on commit f1c3fba

Please sign in to comment.