From ffef07eef9943a795169c6e0cad7280a99099d96 Mon Sep 17 00:00:00 2001 From: Jachym Cepicky Date: Thu, 7 Mar 2019 11:23:37 +0100 Subject: [PATCH 1/4] Resize too big images Some too big images, if they are animated GIF's and overflow the page size, are not animated any more. We use animated GIFs for the demonstration how to do things in the knowledge base. This fix makes the GIFs move, even if they are big. --- helpdesk/static/helpdesk/helpdesk-extend.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helpdesk/static/helpdesk/helpdesk-extend.css b/helpdesk/static/helpdesk/helpdesk-extend.css index 4d280241..fc464507 100644 --- a/helpdesk/static/helpdesk/helpdesk-extend.css +++ b/helpdesk/static/helpdesk/helpdesk-extend.css @@ -76,3 +76,7 @@ Add your custom styles here } #helpdesk-body {padding-top: 100px;} img.brand {padding-right: 30px;} + +div.card-body img { + max-width: 900px; +} From d42fc23e08bd49094d35aac71b77bf264cf17ffa Mon Sep 17 00:00:00 2001 From: Garret Wassermann Date: Sat, 9 Mar 2019 18:38:24 -0500 Subject: [PATCH 2/4] Fix password change URLs and add basic templates, to address #734 --- demo/demodesk/config/settings.py | 3 ++ helpdesk/templates/helpdesk/navigation.html | 2 +- .../registration/change_password.html | 51 +++++++++++++++++++ .../registration/change_password_done.html | 10 ++++ helpdesk/urls.py | 11 ++++ 5 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 helpdesk/templates/helpdesk/registration/change_password.html create mode 100644 helpdesk/templates/helpdesk/registration/change_password_done.html diff --git a/demo/demodesk/config/settings.py b/demo/demodesk/config/settings.py index 256f1f15..2fb335c8 100644 --- a/demo/demodesk/config/settings.py +++ b/demo/demodesk/config/settings.py @@ -98,6 +98,9 @@ HELPDESK_SUBMIT_A_TICKET_PUBLIC = True # Should the Knowledgebase be enabled? HELPDESK_KB_ENABLED = True +# Allow users to change their passwords +HELPDESK_SHOW_CHANGE_PASSWORD = True + # Instead of showing the public web portal first, # we can instead redirect users straight to the login page. HELPDESK_REDIRECT_TO_LOGIN_BY_DEFAULT = False diff --git a/helpdesk/templates/helpdesk/navigation.html b/helpdesk/templates/helpdesk/navigation.html index 0121c4fb..f4311844 100644 --- a/helpdesk/templates/helpdesk/navigation.html +++ b/helpdesk/templates/helpdesk/navigation.html @@ -72,7 +72,7 @@
  • {% trans "RSS Feeds" %}
  • {% if helpdesk_settings.HELPDESK_SHOW_CHANGE_PASSWORD and user.has_usable_password %} -
  • {% trans "Change password" %}
  • +
  • {% trans "Change password" %}
  • {% endif %}
  • {% if user.is_superuser %} diff --git a/helpdesk/templates/helpdesk/registration/change_password.html b/helpdesk/templates/helpdesk/registration/change_password.html new file mode 100644 index 00000000..6867df0c --- /dev/null +++ b/helpdesk/templates/helpdesk/registration/change_password.html @@ -0,0 +1,51 @@ +{% extends "helpdesk/base.html" %}{% load i18n %} +{% block helpdesk_title %}{% trans "Change password" %}{% endblock %} + +{% block helpdesk_body %} + +

    {% trans "Change Password" %}

    + +
    {% csrf_token %} +
    +{% if form.errors %} +

    + {% if form.errors.items|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %} +

    +{% endif %} + + +

    {% trans "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly." %}

    + +
    + +
    + {{ form.old_password.errors }} + {{ form.old_password.label_tag }} {{ form.old_password }} +
    + +
    + {{ form.new_password1.errors }} + {{ form.new_password1.label_tag }} {{ form.new_password1 }} + {% if form.new_password1.help_text %} +
    {{ form.new_password1.help_text|safe }}
    + {% endif %} +
    + +
    +{{ form.new_password2.errors }} + {{ form.new_password2.label_tag }} {{ form.new_password2 }} + {% if form.new_password2.help_text %} +
    {{ form.new_password2.help_text|safe }}
    + {% endif %} +
    + +
    + +
    + +
    + +
    +
    + +{% endblock helpdesk_body %} diff --git a/helpdesk/templates/helpdesk/registration/change_password_done.html b/helpdesk/templates/helpdesk/registration/change_password_done.html new file mode 100644 index 00000000..e5e1db8b --- /dev/null +++ b/helpdesk/templates/helpdesk/registration/change_password_done.html @@ -0,0 +1,10 @@ +{% extends "helpdesk/base.html" %}{% load i18n %} +{% block helpdesk_title %}{% trans "Change password" %}{% endblock %} + +{% block helpdesk_body %} + +

    {% trans "Success!" %}

    + +

    {% trans 'Your password was changed.' %}

    + +{% endblock helpdesk_body %} diff --git a/helpdesk/urls.py b/helpdesk/urls.py index c6c7379f..0dae640a 100644 --- a/helpdesk/urls.py +++ b/helpdesk/urls.py @@ -194,6 +194,17 @@ urlpatterns += [ template_name='helpdesk/registration/login.html', next_page='../'), name='logout'), + + url(r'^password_change/$', + auth_views.PasswordChangeView.as_view( + template_name='helpdesk/registration/change_password.html', + success_url='./done'), + name='password_change'), + + url(r'^password_change/done$', + auth_views.PasswordChangeDoneView.as_view( + template_name='helpdesk/registration/change_password_done.html',), + name='password_change_done'), ] if helpdesk_settings.HELPDESK_KB_ENABLED: From 0124ae40186754b84e20c6c88c50bc77b78766a1 Mon Sep 17 00:00:00 2001 From: Garret Wassermann Date: Sat, 9 Mar 2019 18:40:38 -0500 Subject: [PATCH 3/4] Bump version to 0.2.15 --- demo/setup.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/demo/setup.py b/demo/setup.py index 248590e1..06385a1b 100644 --- a/demo/setup.py +++ b/demo/setup.py @@ -13,7 +13,7 @@ project_root = os.path.dirname(here) NAME = 'django-helpdesk-demodesk' DESCRIPTION = 'A demo Django project using django-helpdesk' README = open(os.path.join(here, 'README.rst')).read() -VERSION = '0.2.14' +VERSION = '0.2.15' #VERSION = open(os.path.join(project_root, 'VERSION')).read().strip() AUTHOR = 'django-helpdesk team' URL = 'https://github.com/django-helpdesk/django-helpdesk' diff --git a/setup.py b/setup.py index 9441cdd8..9f37bc37 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ from distutils.util import convert_path from fnmatch import fnmatchcase from setuptools import setup, find_packages -version = '0.2.14' +version = '0.2.15' # Provided as an attribute, so you can append to these instead # of replicating them: From c314d515c16da8ba97c257868b12ad75a5eac465 Mon Sep 17 00:00:00 2001 From: Garret Wassermann Date: Sat, 9 Mar 2019 18:42:10 -0500 Subject: [PATCH 4/4] Fix PEP8 in url.py changes --- helpdesk/urls.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpdesk/urls.py b/helpdesk/urls.py index 0dae640a..28cab023 100644 --- a/helpdesk/urls.py +++ b/helpdesk/urls.py @@ -194,13 +194,13 @@ urlpatterns += [ template_name='helpdesk/registration/login.html', next_page='../'), name='logout'), - + url(r'^password_change/$', auth_views.PasswordChangeView.as_view( template_name='helpdesk/registration/change_password.html', success_url='./done'), name='password_change'), - + url(r'^password_change/done$', auth_views.PasswordChangeDoneView.as_view( template_name='helpdesk/registration/change_password_done.html',),