forked from amfoss/club-website-2018
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added oauth with google, github and some minor edits
- Loading branch information
Showing
9 changed files
with
298 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from allauth.socialaccount.adapter import DefaultSocialAccountAdapter | ||
from django.shortcuts import redirect, render | ||
from django.core.exceptions import ObjectDoesNotExist | ||
from django.contrib.auth.models import User | ||
|
||
class CustomLogin(DefaultSocialAccountAdapter): | ||
|
||
def is_auto_signup_allowed(self, request, sociallogin): | ||
return False | ||
|
||
def is_open_for_signup(self, request, sociallogin): | ||
return True | ||
|
||
def pre_social_login(self, request, sociallogin): | ||
user = sociallogin.user | ||
if user.id: | ||
return | ||
try: | ||
existing_user = User.objects.get(email=sociallogin.account.extra_data['email']) | ||
if existing_user.is_active: | ||
sociallogin.connect(request, existing_user) | ||
else: | ||
return | ||
except ObjectDoesNotExist: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
{% load static %} | ||
{% load socialaccount %} | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="description" content=""> | ||
<meta name="author" content=""> | ||
|
||
<title>amFOSS. Code | Share | Grow</title> | ||
|
||
<!-- Favicons --> | ||
<link rel="shortcut icon" href="{% static 'home/assets/images/favicon.png' %}"> | ||
<link rel="apple-touch-icon" href="{% static 'home/assets/images/apple-touch-icon.png' %}"> | ||
<link rel="apple-touch-icon" sizes="72x72" href="{% static 'home/assets/images/apple-touch-icon-72x72.png' %}"> | ||
<link rel="apple-touch-icon" sizes="114x114" href="{% static 'home/assets/images/apple-touch-icon-114x114.png' %}"> | ||
<!-- Fonts --> | ||
<link href='https://fonts.googleapis.com/css?family=Roboto+Condensed:400,300,400italic,700' rel='stylesheet' | ||
type='text/css'> | ||
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700' rel='stylesheet' type='text/css'> | ||
|
||
<!-- Fonts --> | ||
<link href='https://fonts.googleapis.com/css?family=Roboto+Condensed:400,300,400italic,700' rel='stylesheet' | ||
type='text/css'> | ||
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700' rel='stylesheet' type='text/css'> | ||
|
||
<!-- Bootstrap core CSS --> | ||
<link href="{% static 'home/assets/bootstrap/css/bootstrap.min.css' %}" rel="stylesheet"> | ||
|
||
<!-- Icon Fonts --> | ||
<link href="{% static 'home/assets/css/font-awesome.min.css' %}" rel="stylesheet"> | ||
<link href="{% static 'home/assets/css/et-line-font.min.css' %}" rel="stylesheet"> | ||
|
||
<!-- Font awesome CDN --> | ||
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" | ||
integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous"> | ||
|
||
<!-- Plugins --> | ||
<link href="{% static 'home/assets/css/magnific-popup.css' %}" rel="stylesheet"> | ||
<link href="{% static 'home/assets/css/owl.carousel.css' %}" rel="stylesheet"> | ||
<link href="{% static 'home/assets/css/superslides.css' %}" rel="stylesheet"> | ||
<link href="{% static 'home/assets/css/vertical.min.css' %}" rel="stylesheet"> | ||
|
||
<!-- Template core CSS --> | ||
<link href="{% static 'home/assets/css/template.css' %}" rel="stylesheet"> | ||
<link href="{% static 'home/css/login.css' %}" rel="stylesheet"> | ||
</head> | ||
|
||
<body> | ||
|
||
{#<!-- PRELOADER -->#} | ||
{#<div class="page-loader">#} | ||
{# <div class="loader">Loading...</div>#} | ||
{#</div>#} | ||
{#<!-- /PRELOADER -->#} | ||
|
||
<!-- Incudes navigation bar. --> | ||
{% include 'home/../../../Home/templates/base/side-nav.html' %} | ||
|
||
<div class="notifications" style="padding-left: 80%;"> | ||
{% if form.errors %} | ||
{% for field in form %} | ||
{% for error in field.errors %} | ||
<div class="alert alert-danger alert-dismissable"> | ||
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a> | ||
{{ field.label }}: {{ error|escape }} | ||
</div> | ||
{% endfor %} | ||
{% endfor %} | ||
{% for error in form.non_field_errors %} | ||
<div class="alert alert-danger alert-dismissable"> | ||
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a> | ||
{{ error|escape }} | ||
</div> | ||
{% endfor %} | ||
{% endif %} | ||
</div> | ||
|
||
|
||
<div class="logmod"> | ||
<div class="logmod__wrapper"> | ||
<span class="logmod__close">Close</span> | ||
<div class="logmod__container"> | ||
<ul class="logmod__tabs"> | ||
<li data-tabtar="lgm-1"><a href="#">Sign Up</a></li> | ||
</ul> | ||
<div class="logmod__tab-wrapper"> | ||
<div class="logmod__tab lgm-1"> | ||
<div class="logmod__heading"> | ||
<span class="logmod__heading-subtitle">Enter your personal details <strong>to create an account</strong></span> | ||
</div> | ||
<div class="logmod__form"> | ||
<form accept-charset="utf-8" action="{% url 'signup' %}" class="simform" method="post"> | ||
{% csrf_token %} | ||
<div class="sminputs"> | ||
<div class="input string optional"> | ||
<label class="string optional" for="user-name">First Name*</label> | ||
<input class="string optional" maxlength="255" id="user-name" | ||
placeholder="First Name" name="first_name" type="text" size="50" | ||
value="{{ form.first_name.value|default_if_none:"" }}"/> | ||
</div> | ||
<div class="input string optional"> | ||
<label class="string optional" for="user-name">Last Name*</label> | ||
<input class="string optional" maxlength="255" id="user-name" | ||
placeholder="Last Name" name="last_name" type="text" size="50" | ||
value="{{ form.last_name.value|default_if_none:"" }}"/> | ||
</div> | ||
</div> | ||
<div class="sminputs"> | ||
<div class="input full"> | ||
<label class="string optional" for="user-name">Email*</label> | ||
<input class="string optional" maxlength="255" id="user-email" name="email" | ||
placeholder="Email" type="email" size="50" | ||
value="{{ form.email.value|default_if_none:"" }}"/> | ||
</div> | ||
</div> | ||
<div class="sminputs"> | ||
<div class="input string optional"> | ||
<label class="string optional" for="user-name">UserName*</label> | ||
<input class="string optional" maxlength="255" id="user-name" name="username" | ||
placeholder="Username" type="text" size="50" | ||
value="{{ form.username.value|default_if_none:"" }}"/> | ||
</div> | ||
<div class="input string optional"> | ||
<label class="string optional" for="user-name">Batch*</label> | ||
<input type="number" min="2006" class="form-control" name="year" id="year" | ||
value="{{ form.year.value|default_if_none:"" }}" placeholder="YYYY"> | ||
</div> | ||
</div> | ||
<div class="sminputs"> | ||
<div class="input string optional"> | ||
<label class="string optional" for="user-pw">Password *</label> | ||
<input class="string optional" maxlength="255" name="password1" id="user-pw" | ||
placeholder="Password" type="password" size="50"/> | ||
</div> | ||
<div class="input string optional"> | ||
<label class="string optional" for="user-pw-repeat">Repeat password *</label> | ||
<input class="string optional" maxlength="255" name="password2" id="user-pw-repeat" | ||
placeholder="Repeat password" type="password" size="50" | ||
value="{{ object.email }}"/> | ||
</div> | ||
</div> | ||
<div class="simform__actions"> | ||
<input class="sumbit" name="commit" type="submit" value="Create Account"/> | ||
<span class="simform__actions-sidetext">By creating an account you agree to our <a | ||
class="special" href="#" target="_blank" role="link">Terms & Privacy</a></span> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<hr class="divider"> | ||
|
||
{##} | ||
{# <!-- Footer section -->#} | ||
{# {% include 'home/footer.html' %}#} | ||
|
||
<!-- /WRAPPER --> | ||
|
||
<!-- JAVASCRIPT FILES --> | ||
<script src="{% static 'home/assets/js/jquery-2.1.4.min.js' %}"></script> | ||
<script src="{% static 'home/assets/bootstrap/js/bootstrap.min.js' %}"></script> | ||
<script src="{% static 'home/assets/js/jquery.superslides.min.js' %}"></script> | ||
<script src="{% static 'home/assets/js/jquery.mb.YTPlayer.min.js' %}"></script> | ||
<script src="{% static 'home/assets/js/imagesloaded.pkgd.js' %}"></script> | ||
<script src="{% static 'home/assets/js/isotope.pkgd.min.js' %}"></script> | ||
<script src="{% static 'home/assets/js/jquery.magnific-popup.min.js' %}"></script> | ||
<script src="{% static 'home/assets/js/owl.carousel.min.js' %}"></script> | ||
<script src="{% static 'home/assets/js/jquery.fitvids.js' %}"></script> | ||
<script src="{% static 'home/assets/js/jqBootstrapValidation.js' %}"></script> | ||
<script src="http://maps.google.com/maps/api/js?sensor=true"></script> | ||
<script src="{% static 'home/assets/js/gmap3.min.js' %}"></script> | ||
<script src="{% static 'home/assets/js/appear.js' %}"></script> | ||
<script src="{% static 'home/assets/js/smoothscroll.js' %}"></script> | ||
<script src="{% static 'home/assets/js/submenu-fix.js' %}"></script> | ||
<script src="{% static 'home/assets/js/contact.js' %}"></script> | ||
<script src="{% static 'home/assets/js/custom.js' %}"></script> | ||
|
||
{# Login JavaScript Src#} | ||
|
||
<script src="{% static 'home/js/login.js' %}"></script> | ||
|
||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.