Merge branch 'master' into revision-view

This commit is contained in:
Tom Price
2015-05-18 14:36:23 +01:00
14 changed files with 82 additions and 26 deletions

View File

@@ -3,7 +3,9 @@ from django import forms
from django.utils import formats
from django.conf import settings
from django.core import serializers
from django.contrib.auth.forms import AuthenticationForm, PasswordResetForm
from registration.forms import RegistrationFormUniqueEmail
from captcha.fields import ReCaptchaField
import simplejson
from RIGS import models
@@ -14,6 +16,7 @@ class ProfileRegistrationFormUniqueEmail(RegistrationFormUniqueEmail):
last_name = forms.CharField(required=False, max_length=50)
initials = forms.CharField(required=True, max_length=5)
phone = forms.CharField(required=False, max_length=13)
captcha = ReCaptchaField()
def clean_initials(self):
"""
@@ -23,6 +26,13 @@ class ProfileRegistrationFormUniqueEmail(RegistrationFormUniqueEmail):
raise forms.ValidationError("These initials are already in use. Please supply different initials.")
return self.cleaned_data['initials']
# Login form
class LoginForm(AuthenticationForm):
captcha = ReCaptchaField(label='Captcha')
class PasswordReset(PasswordResetForm):
captcha = ReCaptchaField(label='Captcha')
# Events Shit
class EventForm(forms.ModelForm):
datetime_input_formats = formats.get_format_lazy("DATETIME_INPUT_FORMATS") + settings.DATETIME_INPUT_FORMATS

View File

@@ -25,7 +25,7 @@ function refreshUpdateHref(obj) {
// console.log('Trying to disable');
targetObject.attr('disabled', true);
} else {
// targetObject.attr('href', update_url);
targetObject.attr('href', update_url);
targetObject.attr('disabled', false);
}
}

View File

@@ -10,14 +10,16 @@
<link rel="stylesheet" href="{% static "css/ajax-bootstrap-select.css" %}"/>
{% endblock %}
{% block preload_js %}
<script src="{% static "js/bootstrap-select.js" %}"></script>
<script src="{% static "js/ajax-bootstrap-select.js" %}"></script>
{% endblock %}
{% block js %}
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script src="{% static "js/interaction.js" %}"></script>
<script src="{% static "js/modal.js" %}"></script>
<script src="{% static "js/bootstrap-select.js" %}"></script>
<script src="{% static "js/ajax-bootstrap-select.js" %}"></script>
<script src="{% static "js/autocompleter.js" %}"></script>
<script>
@@ -422,6 +424,13 @@
{% include "RIGS/item_table.html" %}
</div>
</div>
<div class="col-sm-12 text-right">
<div class="btn-group btn-page">
<button type="submit" class="btn btn-default" title="Save"><span
class="glyphicon glyphicon-floppy-disk"></span>
</button>
</div>
</div>
</div>
</form>

View File

@@ -84,9 +84,9 @@
<setFont name="OpenSans" size="9"/>
<drawString x="137" y="760">Portland Building, University Park, Nottingham, NG7 2RD</drawString>
<drawString x="137" y="746">Phone: (0115) 846 8720</drawString>
<drawString x="137" y="732">www.nottinghamtec.co.uk</drawString>
<drawString x="265" y="732">info@nottinghamtec.co.uk</drawString>
<drawString x="137" y="746">www.nottinghamtec.co.uk</drawString>
<drawString x="265" y="746">info@nottinghamtec.co.uk</drawString>
<drawString x="137" y="732">Phone: (0115) 846 8720</drawString>

View File

@@ -128,7 +128,7 @@
<keepTogether>
<blockTable style="totalTable" colWidths="300,115,80">
<tr>
<td>VAT may be charged at the current rate date of event ({{ object.vat_rate.as_percent|floatformat:2 }}%)</td>
<td></td>
<td>Total (ex. VAT)</td>
<td>£ {{ object.sum_total|floatformat:2 }}</td>
</tr>

View File

@@ -1,4 +1,4 @@
<div class="panel">
<div class="panel table-responsive">
<table class="table table-hover" id="item-table" {% if edit %}data-orderurl="{#% url 'item_order' %#}"{% endif %}>
<thead>
<tr>

View File

@@ -1,6 +1,6 @@
from django.conf.urls import patterns, include, url
from django.contrib.auth.decorators import login_required
from RIGS import views, rigboard, finance, ical
from RIGS import views, rigboard, finance, ical, forms
from django.views.generic import RedirectView
from PyRIGS.decorators import permission_required_with_403
@@ -14,6 +14,7 @@ urlpatterns = patterns('',
url(r'^closemodal/$', views.CloseModal.as_view(), name='closemodal'),
url('^user/login/$', 'RIGS.views.login', name='login'),
url(r'^user/password_reset/$', 'django.contrib.auth.views.password_reset', {'password_reset_form':forms.PasswordReset}),
# People
url(r'^people/$', permission_required_with_403('RIGS.view_person')(views.PersonList.as_view()),

View File

@@ -30,7 +30,7 @@ def login(request, **kwargs):
else:
from django.contrib.auth.views import login
return login(request)
return login(request, authentication_form=forms.LoginForm)
"""