Skip to content

Commit

Permalink
changed login form layout #5
Browse files Browse the repository at this point in the history
  • Loading branch information
liling-wu committed Nov 6, 2022
1 parent 8c3589e commit e96a3ac
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 22 deletions.
12 changes: 11 additions & 1 deletion learning_environment/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,20 @@


class CustomUserCreationForm(UserCreationForm):

password1 = forms.CharField(
label='Password',
widget=forms.PasswordInput(attrs={'style': 'border-radius: 40px;'})
)
password2 = forms.CharField(
label='Password Confirmation',
widget=forms.PasswordInput(attrs={'style': 'border-radius: 40px;'})
)
class Meta:
model = User
fields = ('username', 'password1', 'password2')
widgets = {
'username': forms.TextInput(attrs={'style': 'border-radius: 40px;'}),
}

class LessonCreationForm(forms.Form):
json5 = forms.CharField(widget=forms.Textarea(attrs={'rows': 25}), label="JSON5 code")
Expand Down
1 change: 0 additions & 1 deletion learning_environment/static/learning_environment/ipaca.css
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,3 @@ textarea {
border: 1px solid #6c70e2;
background: #e7efff;
}

48 changes: 28 additions & 20 deletions learning_environment/templates/registration/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,39 @@

{% block content %}

<div class="row justify-content-evenly">
<div class="row justify-content-evenly">
<div class="col" style="margin-left:50px;">
{# space for left side content #}
<div class="col-5" style="margin-left:50px;">
<img src="/static/img/login_img.svg" class="img-fluid">

</div>

<div class="col">
{# space for right side content #}
<div class="card" style="border: none; margin-top: 25vh;">
<div class="card-header" style="background-color:transparent;" align="center">
<h2>Log In to IPACA</h2>
</div>
<div class="card-body">
</div>
<div class="container">
<form method="post">
{% csrf_token %}
{{ form|crispy }}
<button type="submit" class="btn btn-primary ">Log In</button>
<span class="col text-center"> New to Ipaca?
<a class="link-secondary" href="{% url 'signup' %}" style="margin: 1vh"> Sign Up</a>
</span>
</form>
<div class="col-4" style="margin-right:10vw;">
{# space for right side content #}
<div class="text-right" style="color: #0A125E;"> New to Ipaca?
<a class="link-secondary" href="{% url 'signup' %}" style="margin:1vw; color:#009A3F;"> Register now</a>
</div>

<div class="card" style="border: none; margin-top: 22vh;">
<div class="card-header" style="border-bottom:none; background-color:transparent;" align="center">
<h2>Log In to IPACA</h2>
<span style="font-size: 18px;">Glad to see you again!</span>
</div>

<div class="card-body">
<div class="container">
<form method="post">
{% csrf_token %}
{# {% bootstrap_form form%} #}
<div class="form-group">
<input type="text" class="form-control" style="border-radius:40px; height: 45px; margin:10px;" name="username" placeholder="Enter Username" required="required">
</div>
<div class="form-group">
<input type="password" class="form-control" style="border-radius:40px; height: 45px; margin:10px;" name="password" placeholder="Password" required="required">
</div>
<button type="submit" class="btn btn-primary">Log In</button>
</form>
</div>
</div>
</div>

</div>
Expand Down

0 comments on commit e96a3ac

Please sign in to comment.