Skip to content

Commit

Permalink
Override allauth /signup page (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
jajodiaraghav authored and souravbadami committed Jun 12, 2017
1 parent 7e7d368 commit 1e4619f
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 2 deletions.
83 changes: 83 additions & 0 deletions website/templates/account/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{% extends "base.html" %}

{% load i18n %}
{% load account socialaccount %}

{% block style %}
.inner-addon {
position: relative;
}
.inner-addon .glyphicon {
position: absolute;
padding: 10px;
pointer-events: none;
}
.left-addon .glyphicon { left: 0px;}
.right-addon .glyphicon { right: 0px;}
.left-addon input { padding-left: 30px; }
.right-addon input { padding-right: 30px; }
{% endblock %}

{% block content %}
{% get_providers as socialaccount_providers %}

<h3 class="text-center">Login</h3>
{% if socialaccount_providers %}
<div class="row">
<div class="col-md-4 col-md-offset-4">
<div class="socialaccount_ballot text-center">
<ul class="socialaccount_providers list-unstyled list-inline">
{% for provider in socialaccount_providers %}
{% if provider.id == "openid" %}
{% for brand in provider.get_brands %}
<li>
<a title="{{brand.name}}"
class="socialaccount_provider {{provider.id}} {{brand.id}} btn btn-default"
href="{% provider_login_url provider.id openid=brand.openid_url process=process %}"
>{{brand.name}}</a>
</li>
{% endfor %}
{% endif %}
<li>
<a title="{{provider.name}}" class="socialaccount_provider {{provider.id}} btn btn-default"
href="{% provider_login_url provider.id process=process scope=scope auth_params=auth_params %}">{{provider.name}}</a>
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
{% include "socialaccount/snippets/login_extra.html" %}
{% endif %}

<div class="row">
<div class="col-md-4 col-md-offset-4 col-lg-4 col-lg-offset-4">
<form class="login" method="POST" action="{% url 'account_login' %}">
{% csrf_token %}
{% if redirect_field_value %}
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
{% endif %}
<div class="form-group inner-addon left-addon {% if form.login.errors %}has-error{% endif %}">
<i class="glyphicon glyphicon-user"></i>
<input class="form-control" type="text" id="id_login" name="login" placeholder="Username">
<span class="help-block">{{ form.login.errors }}</span>
</div>
<div class="form-group inner-addon left-addon {% if form.password1.errors %}has-error{% endif %}">
<i class="glyphicon glyphicon-lock"></i>
<input class="form-control login-field" type="password" id="id_password" name="password" placeholder="Password">
<span class="help-block">{{ form.password.errors }}</span>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="id_remember" name="remember"> Remember Me
</label>
</div>
<div class="form-actions">
<button class="btn btn-primary pull-right" type="submit">{% trans "Sign In" %}</button>
<a class="btn" href="{% url 'account_reset_password' %}">{% trans "Forgot Password?" %}</a>
</div>
</form>
<span class="text-center">Not yet a member? <a href="{% url 'account_signup' %}">Join</a></span>
</div>
</div>
{% endblock %}
16 changes: 16 additions & 0 deletions website/templates/account/logout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{% extends "account/base.html" %}

{% load i18n %}

{% block content %}
<h1>{% trans "Sign Out" %}</h1>
<p>{% trans 'Are you sure?' %}</p>
<form method="post" action="{% url 'account_logout' %}">
{% csrf_token %}
{% if redirect_field_value %}
<input type="hidden" name="{{redirect_field_name}}" value="{{redirect_field_value}}"/>
{% endif %}
<button class="btn btn-primary" type="submit">{% trans 'Yes' %}</button>
<a href="/accounts/profile/" class="btn btn-default">{% trans 'Cancel' %}</a>
</form>
{% endblock %}
2 changes: 0 additions & 2 deletions website/templates/account/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

{% load i18n %}

{% block head_title %}{% trans "Signup" %}{% endblock %}

{% block style %}
.inner-addon {
position: relative;
Expand Down

0 comments on commit 1e4619f

Please sign in to comment.