Reset password (#60)
* updated travis yml file * removed xml files * passsword reset issue fixed, updated html design with django-crm theme, added named urls in templates * updated readme.rst file
This commit is contained in:
parent
ecc3e88e5b
commit
508e048d68
18 changed files with 95 additions and 72 deletions
12
README.rst
12
README.rst
|
|
@ -4,9 +4,6 @@ Django-CRM
|
|||
Django CRM is opensourse CRM developed on django framework. It has all the basic features of CRM to start with. We welcome code contributions and feature requests via github.
|
||||
|
||||
|
||||
.. image:: https://coveralls.io/repos/github/MicroPyramid/Django-CRM/badge.svg?branch=master
|
||||
:target: https://coveralls.io/github/MicroPyramid/Django-CRM?branch=master
|
||||
|
||||
.. image:: https://landscape.io/github/MicroPyramid/Django-CRM/master/landscape.svg?style=flat
|
||||
:target: https://landscape.io/github/MicroPyramid/Django-CRM/master
|
||||
:alt: Code Health
|
||||
|
|
@ -23,10 +20,19 @@ Django CRM is opensourse CRM developed on django framework. It has all the basic
|
|||
- Codacy
|
||||
- Support
|
||||
* - .. image:: https://travis-ci.org/MicroPyramid/Django-CRM.svg?branch=master
|
||||
:target: https://travis-ci.org/MicroPyramid/Django-CRM
|
||||
- .. image:: https://api.codacy.com/project/badge/Grade/b11da5f09dd542479fd3bd53944595d2
|
||||
:target: https://app.codacy.com/project/ashwin/Django-CRM/dashboard
|
||||
:alt: Codacy Dashboard
|
||||
.. image:: https://api.codacy.com/project/badge/Coverage/b11da5f09dd542479fd3bd53944595d2
|
||||
:target: https://app.codacy.com/project/ashwin/Django-CRM/dashboard
|
||||
:alt: Codacy Coverage
|
||||
- .. image:: https://badges.gitter.im/Micropyramid/Django-CRM.png
|
||||
:target: https://gitter.im/MicroPyramid/Django-CRM
|
||||
:alt: Gitter
|
||||
.. image:: https://www.codetriage.com/micropyramid/django-crm/badges/users.svg
|
||||
:target: https://www.codetriage.com/micropyramid/django-crm
|
||||
:alt: Code Helpers
|
||||
|
||||
|
||||
http://django-crm.readthedocs.io for latest documentation
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ urlpatterns = [
|
|||
path('login/', LoginView.as_view(), name='login'),
|
||||
path('forgot-password/', ForgotPasswordView.as_view(), name='forgot_password'),
|
||||
path('logout/', LogoutView.as_view(), name='logout'),
|
||||
path('change-password/', ChangePasswordView.as_view(), name='change_pass'),
|
||||
path('change-password/', ChangePasswordView.as_view(), name='change_password'),
|
||||
path('profile/', ProfileView.as_view(), name='profile'),
|
||||
|
||||
# User views
|
||||
|
|
@ -26,9 +26,9 @@ urlpatterns = [
|
|||
path('users/<int:pk>/view/', UserDetailView.as_view(), name='view_user'),
|
||||
path('users/<int:pk>/delete/', UserDeleteView.as_view(), name='remove_user'),
|
||||
|
||||
url(r'^password_reset/$',auth_views.password_reset,name='password_reset'),
|
||||
url(r'^passowrd-reset/done/$',auth_views.password_reset_done,name='password_reset_done'),
|
||||
url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
|
||||
path('password-reset/', auth_views.password_reset, name='password_reset'),
|
||||
path('password-reset/done/', auth_views.password_reset_done, name='password_reset_done'),
|
||||
path('reset/uidb64>/<token>/',
|
||||
auth_views.password_reset_confirm, name='password_reset_confirm'),
|
||||
url(r'^reset/done/$', auth_views.password_reset_complete, name='password_reset_complete'),
|
||||
path('reset/done/', auth_views.password_reset_complete, name='password_reset_complete'),
|
||||
]
|
||||
|
|
|
|||
|
|
@ -128,8 +128,8 @@ EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
|||
|
||||
|
||||
EMAIL_HOST = 'smtp.sendgrid.net'
|
||||
EMAIL_HOST_USER = '****'
|
||||
EMAIL_HOST_PASSWORD = '*******'
|
||||
EMAIL_HOST_USER = os.getenv('SG_USER', '')
|
||||
EMAIL_HOST_PASSWORD = os.getenv('SG_PWD', '')
|
||||
EMAIL_PORT = 587
|
||||
EMAIL_USE_TLS = True
|
||||
|
||||
|
|
|
|||
19
crm/urls.py
19
crm/urls.py
|
|
@ -4,13 +4,14 @@ from django.urls import include, path
|
|||
app_name = 'crm'
|
||||
|
||||
urlpatterns = [
|
||||
path('', include('common.urls', namespace="common")),
|
||||
path('accounts/', include('accounts.urls', namespace="accounts")),
|
||||
path('leads/', include('leads.urls', namespace="leads")),
|
||||
path('contacts/', include('contacts.urls', namespace="contacts")),
|
||||
path('opportunities/', include('opportunity.urls', namespace="opportunities")),
|
||||
path('cases/', include('cases.urls', namespace="cases")),
|
||||
path('emails/', include('emails.urls', namespace="emails")),
|
||||
# path('planner/', include('planner.urls', namespace="planner")),
|
||||
path('logout/', views.logout, {'next_page': '/login/'}, name="logout"),
|
||||
path('', include('common.urls', namespace="common")),
|
||||
path('', include('django.contrib.auth.urls')),
|
||||
path('accounts/', include('accounts.urls', namespace="accounts")),
|
||||
path('leads/', include('leads.urls', namespace="leads")),
|
||||
path('contacts/', include('contacts.urls', namespace="contacts")),
|
||||
path('opportunities/', include('opportunity.urls', namespace="opportunities")),
|
||||
path('cases/', include('cases.urls', namespace="cases")),
|
||||
path('emails/', include('emails.urls', namespace="emails")),
|
||||
# path('planner/', include('planner.urls', namespace="planner")),
|
||||
path('logout/', views.logout, {'next_page': '/login/'}, name="logout"),
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
Django==2.1
|
||||
Django==2.0.7
|
||||
django-simple-pagination==1.1.8
|
||||
pytz==2018.3
|
||||
psycopg2-binary==2.7.4
|
||||
|
|
|
|||
|
|
@ -67,12 +67,15 @@ a{
|
|||
.form-group {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.errorlist li{
|
||||
color: red;
|
||||
}
|
||||
label {
|
||||
font-size: 12px;
|
||||
font-size: 14px;
|
||||
color: darken($text_color2, 15%);
|
||||
font-weight:500;
|
||||
}
|
||||
.form-control {
|
||||
.form-control, input {
|
||||
color: $text_color;
|
||||
min-height: 40px;
|
||||
font-size: 13px;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
{% if request.user.is_authenticated %}
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
{% if request.user.role == "ADMIN" %}
|
||||
|
|
@ -53,7 +53,7 @@
|
|||
{% endwith %}
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
|
||||
{% if request.user.role == "USER" %}
|
||||
<a class="dropdown-item" href="/change-password/"><i class="fas fa-key"></i> Change Password</a>
|
||||
<a class="dropdown-item" href="{% url 'common:change_password' %}"><i class="fas fa-key"></i> Change Password</a>
|
||||
{% endif %}
|
||||
<a class="dropdown-item" href="{% url 'common:profile' %}"><i class="fas fa-user"></i> Profile</a>
|
||||
<a class="dropdown-item" href="{% url 'common:logout' %}"><i class="fas fa-sign-out-alt"></i> Logout</a>
|
||||
|
|
@ -61,6 +61,7 @@
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
</nav>
|
||||
</header>
|
||||
<!-- header ends here -->
|
||||
|
|
@ -88,7 +89,7 @@
|
|||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
word = window.location.pathname.split('/')[1]
|
||||
$('#'+word).addClass('active')
|
||||
$('#' + word).addClass('active')
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -12,16 +12,15 @@
|
|||
</div>
|
||||
<div class="row marl no-gutters">
|
||||
<div class="col-md-12">
|
||||
|
||||
{% if not user_obj %}
|
||||
<div class="filter_col col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail1">Old Password</label>
|
||||
<input type="password" class="form-control" name="CurrentPassword" value="{{request.POST.CurrentPassword}}">
|
||||
<input type="password" class="form-control" name="CurrentPassword" value="{{ request.POST.CurrentPassword }}">
|
||||
</div>
|
||||
<span class="error">{{ errors.CurrentPassword }}</span>
|
||||
{% if error %}
|
||||
<span class="error">{{error}}</span>
|
||||
<span class="error">{{ error }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
@ -29,7 +28,7 @@
|
|||
<div class="filter_col col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail1">New Password</label>
|
||||
<input type="password" class="form-control" name="Newpassword" value="{{request.POST.Newpassword}}">
|
||||
<input type="password" class="form-control" name="Newpassword" value="{{ request.POST.Newpassword }}">
|
||||
</div>
|
||||
<span class="error">{{ errors.Newpassword }}</span>
|
||||
</div>
|
||||
|
|
@ -38,7 +37,7 @@
|
|||
<div class="filter_col col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail1">Confirm New Password</label>
|
||||
<input type="password" class="form-control" name="confirm" value="{{request.POST.confirm}}">
|
||||
<input type="password" class="form-control" name="confirm" value="{{ request.POST.confirm }}">
|
||||
</div>
|
||||
<span class="error">{{ errors.confirm }}</span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -32,8 +32,7 @@
|
|||
<div class="form-group">
|
||||
<input type="text" class="form-control" id="exampleInputEmail1" placeholder="Email" name="email">
|
||||
</div>
|
||||
|
||||
<div class="forgot">Back to login <a href="/login/">Click Here?</a></div>
|
||||
<div class="forgot">Back to login <a href="{% url "common:login" %}">Click Here?</a></div>
|
||||
<button type="submit" class="btn btn-danger">Reset Password</button>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
{% extends 'base.html' %}
|
||||
<a href="/logout/"><button class="btn btn-primary" type="button">Logout</button></a
|
||||
<a href="{% url "common:logout" %}"><button class="btn btn-primary" type="button">Logout</button></a
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
<div class="form-group">
|
||||
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password" name="password">
|
||||
</div>
|
||||
<div class="forgot">Forgot Password <a href="/password-reset/">Click Here?</a></div>
|
||||
<div class="forgot">Forgot Password <a href="{% url "common:password_reset" %}">Click Here?</a></div>
|
||||
{% if error %}
|
||||
<p>{{ message }}</p>
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
<div class="overview_form_block row marl justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
|
||||
<div class="card-body" id="datashow">
|
||||
<div class="panel-heading card-title view-pad text-center">
|
||||
<h5>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<div class="row marl justify-content-center login_row">
|
||||
<div class="col-md-6 col-lg-6 col-xl-4">
|
||||
{% block content %}
|
||||
|
||||
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,12 @@
|
|||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<p>
|
||||
Your password has been set. You may go ahead and <a href="{% url 'common:login' %}">sign in</a> now.
|
||||
</p>
|
||||
<div class="row marl justify-content-center login_row">
|
||||
<div class="col-md-12 col-lg-6 col-xl-4">
|
||||
<div class="login_block">
|
||||
<div class="login_form_block">
|
||||
Your password has been set. You may go ahead and <a href="{% url 'common:login' %}">sign in</a> now.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -1,17 +1,24 @@
|
|||
{% extends 'registration/base.html' %}
|
||||
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
{% if validlink %}
|
||||
<h3>Change password</h3>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="btn btn-danger">Change password</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<p>
|
||||
The password reset link was invalid, possibly because it has already been used.
|
||||
Please request a new password reset.
|
||||
</p>
|
||||
{% endif %}
|
||||
<div class="row marl justify-content-center login_row">
|
||||
<div class="col-md-6 col-lg-6 col-xl-4">
|
||||
<div class="login_block">
|
||||
<div class="login_form_block">
|
||||
{% if validlink %}
|
||||
<h3 class="welcome">Change password</h3>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="btn btn-danger">Change password</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<p>
|
||||
The password reset link was invalid, possibly because it has already been used.
|
||||
Please request a new password reset.
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -1,11 +1,18 @@
|
|||
{% extends 'registration/base.html' %}
|
||||
{% block content %}
|
||||
<p>
|
||||
We've emailed you instructions for setting your password, if an account exists with the email you entered.
|
||||
You should receive them shortly.
|
||||
</p>
|
||||
<p>
|
||||
If you don't receive an email, please make sure you've entered the address you registered with,
|
||||
and check your spam folder.
|
||||
</p>
|
||||
<div class="ow marl justify-content-center login_row">
|
||||
<div class="login_block">
|
||||
<div class="login_form_block">
|
||||
<div class="welcome">Django CRM</div>
|
||||
<p>
|
||||
We've emailed you instructions for setting your password, if an account exists with the email you entered.
|
||||
You should receive them shortly.
|
||||
</p>
|
||||
<p>
|
||||
If you don't receive an email, please make sure you've entered the address you registered with,
|
||||
and check your spam folder.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
@ -1,12 +1,9 @@
|
|||
{% autoescape off %}
|
||||
To initiate the password reset process for your {{ user.get_username }} TestSite Account,
|
||||
To initiate the password reset process for your {{ user.get_username }} Django-CRM Account,
|
||||
click the link below:
|
||||
|
||||
{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %}
|
||||
|
||||
If clicking the link above doesn't work, please copy and paste the URL in a new browser
|
||||
window instead.
|
||||
|
||||
Sincerely,
|
||||
The TestSite Team
|
||||
The Django-CRM Team
|
||||
{% endautoescape %}
|
||||
|
|
@ -1,17 +1,16 @@
|
|||
{% extends 'registration/base.html' %}
|
||||
{% block content %}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="login_block">
|
||||
<div class="login_form_block">
|
||||
<div class="card-title">
|
||||
<center><h2>Forgot password</center></h2>
|
||||
<center><h2 class="welcome">Forgot password</center></h2>
|
||||
</div>
|
||||
<form method="post">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" id="exampleinputmail" placeholder="Email" name="email">
|
||||
</div>
|
||||
{% csrf_token %}
|
||||
|
||||
<center><button type="submit" class="btn btn-danger">Submit</button></center>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue