Various misc fixes

This commit is contained in:
2020-09-17 09:08:00 +01:00
parent ce5a92dfa8
commit dcc0e53062
23 changed files with 41 additions and 57 deletions

View File

@@ -1,10 +0,0 @@
{% extends 'base_rigs.html' %}
{% block title %}Activation Complete{% endblock %}
{% block content %}
<div class="alert alert-success">
<h2>Activation Complete</h2>
<p>Your user account is now awaiting administrator approval. Won't be long!</p>
</div>
{% endblock %}

View File

@@ -1,7 +0,0 @@
Welcome {{ user }},
Thank you for registering on {{ site }}
To continue the registration process please visit http://{{ site.domain }}{% url 'registration_activate' activation_key=activation_key %}.
This link will be active for the next {{ expiration_days }} days.

View File

@@ -1 +0,0 @@
{{ user|safe }} activation required

View File

@@ -1,10 +0,0 @@
{% extends 'base_rigs.html' %}
{% block title %}Logout Successful{% endblock %}
{% block content %}
<div class="alert alert-success">
<h2>Logout Successful</h2>
<p>You have successfully been logged out of RIGS</p>
</div>
{% endblock %}

View File

@@ -1,10 +0,0 @@
{% extends 'base_rigs.html' %}
{% block title %}Login{% endblock %}
{% block content %}
<div class="text-center">
<h1>R<small>ig</small> I<small>nformation</small> G<small>athering</small> S<small>ystem</small></h1>
</div>
{% include 'registration/loginform.html' %}
{% endblock %}

View File

@@ -1,34 +0,0 @@
{% extends 'base_embed.html' %}
{% load widget_tweaks %}
{% block title %}Login{% endblock %}
{% block content %}
<div class="text-center">
<h1>R<small>ig</small> I<small>nformation</small> G<small>athering</small> S<small>ystem</small></h1>
</div>
{% include 'form_errors.html' %}
<div class="col-sm-6 col-sm-offset-3 col-lg-4 col-lg-offset-4">
<form id="loginForm" action="" method="post" role="form" target="_self">{% csrf_token %}
<div class="form-group">
<label for="id_username">{{ form.username.label }}</label>
{% render_field form.username class+="form-control" placeholder=form.username.label %}
</div>
<div class="form-group">
<label for="{{ form.password.id_for_label }}">{{ form.password.label }}</label>
{% render_field form.password class+="form-control" placeholder=form.password.label %}
</div>
<div class="text-right">
<input type="submit" value="Login" class="btn btn-primary"/>
</div>
<input type="hidden" name="next" value="{{ next }}"/>
</form>
</div>
{% endblock %}

View File

@@ -1,20 +0,0 @@
{% load widget_tweaks %}
{% include 'form_errors.html' %}
<div class="col-sm-6 offset-sm-3 col-lg-4 offset-lg-4">
<form action="{% url 'login' %}" method="post" role="form" target="_self">{% csrf_token %}
<div class="form-group">
<label for="id_username">{{ form.username.label }}</label>
{% render_field form.username class+="form-control" placeholder=form.username.label autofocus="" %}
</div>
<div class="form-group">
<label for="{{ form.password.id_for_label }}">{{ form.password.label }}</label>
{% render_field form.password class+="form-control" placeholder=form.password.label %}
</div>
<div class="text-right">
<a href="{% url 'registration_register' %}" class="btn">Register</a>
<a href="{% url 'password_reset' %}" class="btn">Forgotten Password</a>
<input type="submit" id="id_submit" value="Login" class="btn btn-primary"/>
<input type="hidden" name="next" value="{{ next }}"/>
</div>
</form>
</div>

View File

@@ -1,20 +0,0 @@
{% extends "base_rigs.html" %}
{% load i18n %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; {% trans 'Password reset' %}
</div>
{% endblock %}
{% block title %}{% trans 'Password change successful' %}{% endblock %}
{% block content %}
<div class="col-sm-12">
<h1>{% trans 'Password change successful' %}</h1>
<p>{% trans "Your password has been changed" %}</p>
</div>
{% endblock %}

View File

@@ -1,33 +0,0 @@
{% extends "base_rigs.html" %}
{% load widget_tweaks %}
{% block title %}Change Password{% endblock %}
{% block content %}
<div class="col-sm-10 col-sm-offset-1">
<h3>Change Password</h3>
{% if form.errors or supplement_form.errors %}
<div class="alert alert-danger">
Please correct the error(s) below.
{{form.errors}}
{{supplement_form.errors}}
</div>
{% endif %}
<p>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.</p>
<div class="col-sm-8 col-sm-offset-2">
<form action="" method="post" class="form-horizontal" role="form">{% csrf_token %}
{% for field in form %}
<div class="form-group">
<label for="{{ field.id_for_label }}" class="control-label col-sm-4">{{ field.label }}</label>
<div class="controls col-sm-8">
{% render_field field class+="form-control" placeholder=field.label %}
</div>
</div>
{% endfor %}
<p><input type="submit" value="Change Password" class="btn btn-primary pull-right"></p>
</form>
</div>
{% endblock %}

View File

@@ -1,23 +0,0 @@
{% extends "base_rigs.html" %}
{% load i18n %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; {% trans 'Password reset' %}
</div>
{% endblock %}
{% block title %}{% trans 'Password reset complete' %}{% endblock %}
{% block content %}
<div class="col-sm-12">
<h1>{% trans 'Password reset complete' %}</h1>
<p>{% trans "Your password has been set. You may go ahead and log in now." %}</p>
<p><a href="{{ login_url }}">{% trans 'Log in' %}</a></p>
</div>
{% endblock %}

View File

@@ -1,61 +0,0 @@
{% extends "base_rigs.html" %}
{% load i18n %}
{% load widget_tweaks %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; {% trans 'Password reset confirmation' %}
</div>
{% endblock %}
{% block title %}{% trans 'Password reset' %}{% endblock %}
{% block content %}
{% if validlink %}
<div class="col-sm-12">
<h1>{% trans 'Enter new password' %}</h1>
<p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p>
<div class="col-sm-8 col-sm-offset-2 well">
<form action="" method="post" role="form" class="form-horizontal">{% csrf_token %}
{% if form.errors %}
{% include 'form_errors.html' %}
{% endif %}
<div class="form-group">
<label for="{{form.new_password1.id_for_label}}" class="col-sm-4 control-label">{{form.new_password1.label}}</label>
<div class="col-sm-8">
{% render_field form.new_password1 class+="form-control" %}
</div>
</div>
<div class="form-group">
<label for="{{form.new_password2.id_for_label}}" class="col-sm-4 control-label">{{form.new_password2.label}}</label>
<div class="col-sm-8">
{% render_field form.new_password2 class+="form-control" %}
</div>
</div>
<div class="col-sm-12">
<div class="pull-right">
<div class="form-group">
<input type="submit" value="{% trans 'Change my password' %}" class="btn btn-primary" />
</div>
</div>
</div>
</form>
</div>
{% else %}
<h1>{% trans 'Password reset unsuccessful' %}</h1>
<p>{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}</p>
</div>
{% endif %}
{% endblock %}

View File

@@ -1,20 +0,0 @@
{% extends "base_rigs.html" %}
{% load i18n %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; {% trans 'Password reset' %}
</div>
{% endblock %}
{% block title %}{% trans 'Password reset successful' %}{% endblock %}
{% block content %}
<div class="col-sm-12">
<h1>{% trans 'Password reset successful' %}</h1>
<p>{% trans "We've e-mailed you instructions for setting your password to the e-mail address you submitted. You should be receiving it shortly." %}</p>
</div>
{% endblock %}

View File

@@ -1,14 +0,0 @@
{% load i18n %}{% autoescape off %}
{% blocktrans %}You're receiving this e-mail because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %}
{% trans "Please go to the following page and choose a new password:" %}
{% block reset_link %}
{{ protocol }}://{{ domain }}{% url 'auth_password_reset_confirm' uidb64=uid token=token %}
{% endblock %}
{% trans "Your username, in case you've forgotten:" %} {{ user.username }}
{% trans "Thanks for using our site!" %}
{% blocktrans %}The {{ site_name }} team{% endblocktrans %}
{% endautoescape %}

View File

@@ -1,35 +0,0 @@
{% extends 'base_rigs.html' %}
{% load i18n %}
{% load widget_tweaks %}
{% block title %}Password reset{% endblock %}
{% block content %}
<div class="col-sm-12">
<h1>Password Reset</h1>
<p>{% trans "Forgotten your password? Enter your e-mail address below, and we'll e-mail instructions for setting a new one." %}</p>
<div class="col-sm-8 col-sm-offset-2 well">
<form action="" method="POST" role="form" class="form-horizontal">{% csrf_token %}
{% if form.errors %}
{% include 'form_errors.html' %}
{% endif %}
<div class="form-group">
<label for="{{form.email.id_for_label}}" class="col-sm-2 control-label">{{form.email.label}}</label>
<div class="col-sm-10">
{% render_field form.email type="email" class+="form-control" %}
</div>
</div>
<div class="form-group">
<div class="col-sm-10 col-md-8 col-md-offset-2">
{{ form.captcha }}
</div>
<div class="col-sm-2 text-right">
<input type="submit" value="Submit" class="btn btn-primary" />
</div>
</div>
</form>
</div>
</div>
{% endblock %}

View File

@@ -1,10 +0,0 @@
{% extends 'base_rigs.html' %}
{% block title %}Registration complete{% endblock %}
{% block content %}
<div class="alert alert-success">
<h2>Thanks for registering</h2>
<p>Thanks for registering with RIGS, further details will be emailed to you.</p>
</div>
{% endblock %}

View File

@@ -1,29 +0,0 @@
{% extends 'base_rigs.html' %}
{% load widget_tweaks %}
{% block title %}Registration{% endblock %}
{% block content %}
<div class="col-sm-10 col-sm-offset-1">
<h3>New User Registration</h3>
{% if form.errors or supplement_form.errors %}
<div class="alert alert-danger">
{{form.errors}}
{{supplement_form.errors}}
</div>
{% endif %}
<div class="col-sm-8 col-sm-offset-2">
<form action="" method="post" class="form-horizontal" role="form">{% csrf_token %}
{% for field in form %}
<div class="form-group">
<label for="{{ field.id_for_label }}" class="control-label col-sm-4">{{ field.label }}</label>
<div class="controls col-sm-8">
{% render_field field class+="form-control" placeholder=field.label %}
</div>
</div>
{% endfor %}
<p><input type="submit" value="Register" class="btn btn-primary pull-right"></p>
</form>
</div>
</div>
{% endblock %}

View File

@@ -11,8 +11,6 @@ from PyRIGS.decorators import permission_required_with_403
from users import regbackend, forms, views
urlpatterns = [
path('user/', include('django.contrib.auth.urls')),
path('user/', include('registration.backends.default.urls')),
path('user/register/', RegistrationView.as_view(form_class=forms.ProfileRegistrationFormUniqueEmail),
name="registration_register"),
path('user/login/', LoginView.as_view(authentication_form=forms.CheckApprovedForm), name='login'),
@@ -23,7 +21,9 @@ urlpatterns = [
path('user/reset_api_key', login_required(views.ResetApiKey.as_view(permanent=False)),
name='reset_api_key'),
path('user/', login_required(views.ProfileDetail.as_view()), name='profile_detail'),
path('user/<pk>/',
path('user/<int:pk>/',
permission_required_with_403('RIGS.view_profile')(views.ProfileDetail.as_view()),
name='profile_detail'),
path('user/', include('django.contrib.auth.urls')),
path('user/', include('registration.backends.default.urls')),
]