mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-02-01 21:02:15 +00:00
Merge from master
This commit is contained in:
@@ -12,6 +12,8 @@ https://docs.djangoproject.com/en/1.7/ref/settings/
|
|||||||
import os
|
import os
|
||||||
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
|
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
|
||||||
|
|
||||||
|
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
||||||
|
|
||||||
# Quick-start development settings - unsuitable for production
|
# Quick-start development settings - unsuitable for production
|
||||||
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
|
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
|
||||||
|
|
||||||
@@ -19,13 +21,13 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__))
|
|||||||
SECRET_KEY = 'gxhy(a#5mhp289_=6xx$7jh=eh$ymxg^ymc+di*0c*geiu3p_e'
|
SECRET_KEY = 'gxhy(a#5mhp289_=6xx$7jh=eh$ymxg^ymc+di*0c*geiu3p_e'
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = True
|
DEBUG = False
|
||||||
|
|
||||||
TEMPLATE_DEBUG = True
|
TEMPLATE_DEBUG = True
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['*']
|
ALLOWED_HOSTS = ['*']
|
||||||
|
|
||||||
INTERNAL_IPS = ['127.0.0.1', '10.20.30.20']
|
INTERNAL_IPS = ['127.0.0.1']
|
||||||
|
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
@@ -82,6 +84,44 @@ DATABASES = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if not DEBUG:
|
||||||
|
import dj_database_url
|
||||||
|
DATABASES['default'] = dj_database_url.config()
|
||||||
|
|
||||||
|
# Logging
|
||||||
|
LOGGING = {
|
||||||
|
'version': 1,
|
||||||
|
'disable_existing_loggers': False,
|
||||||
|
'formatters': {
|
||||||
|
'verbose': {
|
||||||
|
'format': ('%(asctime)s [%(process)d] [%(levelname)s] ' +
|
||||||
|
'pathname=%(pathname)s lineno=%(lineno)s ' +
|
||||||
|
'funcname=%(funcName)s %(message)s'),
|
||||||
|
'datefmt': '%Y-%m-%d %H:%M:%S'
|
||||||
|
},
|
||||||
|
'simple': {
|
||||||
|
'format': '%(levelname)s %(message)s'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'handlers': {
|
||||||
|
'null': {
|
||||||
|
'level': 'DEBUG',
|
||||||
|
'class': 'logging.NullHandler',
|
||||||
|
},
|
||||||
|
'console': {
|
||||||
|
'level': 'DEBUG',
|
||||||
|
'class': 'logging.StreamHandler',
|
||||||
|
'formatter': 'verbose'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'loggers': {
|
||||||
|
'RIGS': {
|
||||||
|
'handlers': ['console'],
|
||||||
|
'level': 'INFO',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# User system
|
# User system
|
||||||
AUTH_USER_MODEL = 'RIGS.Profile'
|
AUTH_USER_MODEL = 'RIGS.Profile'
|
||||||
|
|
||||||
@@ -95,11 +135,13 @@ ACCOUNT_ACTIVATION_DAYS = 7
|
|||||||
EMAILER_TEST = False
|
EMAILER_TEST = False
|
||||||
if not DEBUG or EMAILER_TEST:
|
if not DEBUG or EMAILER_TEST:
|
||||||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||||||
EMAIL_HOST = 'server.techost.co.uk'
|
EMAIL_HOST = 'mail.nottinghamtec.co.uk'
|
||||||
EMAIL_PORT = 465
|
EMAIL_PORT = 465
|
||||||
EMAIL_HOST_USER = 'tec'
|
EMAIL_HOST_USER = 'pyrigs@nottinghamtec.co.uk'
|
||||||
EMAIL_HOST_PASSWORD = '***REMOVED***'
|
EMAIL_HOST_PASSWORD = 'N_dF9T&dD(Th'
|
||||||
DEFAULT_FROM_EMAIL = 'rigs@nottinghamtec.co.uk'
|
EMAIL_USE_TLS = False
|
||||||
|
EMAIL_USE_SSL = True
|
||||||
|
DEFAULT_FROM_EMAIL = 'pyrigs@nottinghamtec.co.uk'
|
||||||
else:
|
else:
|
||||||
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,10 @@ It exposes the WSGI callable as a module-level variable named ``application``.
|
|||||||
For more information on this file, see
|
For more information on this file, see
|
||||||
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
|
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "PyRIGS.settings")
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "PyRIGS.settings")
|
||||||
|
|
||||||
from django.core.wsgi import get_wsgi_application
|
from django.core.wsgi import get_wsgi_application
|
||||||
application = get_wsgi_application()
|
from dj_static import Cling
|
||||||
|
|
||||||
|
application = Cling(get_wsgi_application())
|
||||||
|
|||||||
@@ -116,4 +116,4 @@ class EventForm(forms.ModelForm):
|
|||||||
fields = ['is_rig', 'name', 'venue', 'start_time', 'end_date', 'start_date',
|
fields = ['is_rig', 'name', 'venue', 'start_time', 'end_date', 'start_date',
|
||||||
'end_time', 'meet_at', 'access_at', 'description', 'notes', 'mic',
|
'end_time', 'meet_at', 'access_at', 'description', 'notes', 'mic',
|
||||||
'person', 'organisation', 'dry_hire', 'checked_in_by', 'status',
|
'person', 'organisation', 'dry_hire', 'checked_in_by', 'status',
|
||||||
'collector',]
|
'collector','purchase_order']
|
||||||
|
|||||||
27
RIGS/ical.py
27
RIGS/ical.py
@@ -12,13 +12,12 @@ class CalendarICS(ICalFeed):
|
|||||||
#Metadata which is passed on to clients
|
#Metadata which is passed on to clients
|
||||||
product_id = 'PyRIGS'
|
product_id = 'PyRIGS'
|
||||||
title = 'PyRIGS Calendar'
|
title = 'PyRIGS Calendar'
|
||||||
timezone = 'UTC'
|
|
||||||
file_name = "rigs.ics"
|
file_name = "rigs.ics"
|
||||||
|
|
||||||
def items(self):
|
def items(self):
|
||||||
#include events from up to 1 year ago
|
#include events from up to 1 year ago
|
||||||
start = datetime.datetime.now() - datetime.timedelta(days=365)
|
start = datetime.datetime.now() - datetime.timedelta(days=365)
|
||||||
filter = Q(start_date__gte=start)
|
filter = Q(start_date__gte=start) & ~Q(status=models.Event.CANCELLED)
|
||||||
|
|
||||||
return models.Event.objects.filter(filter).order_by('-start_date').select_related('person', 'organisation', 'venue', 'mic')
|
return models.Event.objects.filter(filter).order_by('-start_date').select_related('person', 'organisation', 'venue', 'mic')
|
||||||
|
|
||||||
@@ -46,11 +45,11 @@ class CalendarICS(ICalFeed):
|
|||||||
def item_start_datetime(self, item):
|
def item_start_datetime(self, item):
|
||||||
#set start date to the earliest defined time for the event
|
#set start date to the earliest defined time for the event
|
||||||
if item.meet_at:
|
if item.meet_at:
|
||||||
startDateTime = item.meet_at
|
startDateTime = item.meet_at.replace(tzinfo=None)
|
||||||
elif item.access_at:
|
elif item.access_at:
|
||||||
startDateTime = item.access_at
|
startDateTime = item.access_at.replace(tzinfo=None)
|
||||||
elif item.start_time:
|
elif item.has_start_time:
|
||||||
startDateTime = datetime.datetime.combine(item.start_date,item.start_time)
|
startDateTime = datetime.datetime.combine(item.start_date,item.start_time).replace(tzinfo=None)
|
||||||
else:
|
else:
|
||||||
startDateTime = item.start_date
|
startDateTime = item.start_date
|
||||||
|
|
||||||
@@ -64,10 +63,10 @@ class CalendarICS(ICalFeed):
|
|||||||
if item.end_date:
|
if item.end_date:
|
||||||
endDateTime = item.end_date
|
endDateTime = item.end_date
|
||||||
|
|
||||||
if item.start_time and item.end_time: # don't allow an event with specific end but no specific start
|
if item.has_start_time and item.has_end_time: # don't allow an event with specific end but no specific start
|
||||||
endDateTime = datetime.datetime.combine(endDateTime,item.end_time)
|
endDateTime = datetime.datetime.combine(endDateTime,item.end_time).replace(tzinfo=None)
|
||||||
elif item.start_time: # if there's a start time specified then an end time should also be specified
|
elif item.has_end_time: # if there's a start time specified then an end time should also be specified
|
||||||
endDateTime = datetime.datetime.combine(endDateTime+datetime.timedelta(days=1),datetime.time(00, 00))
|
endDateTime = datetime.datetime.combine(endDateTime+datetime.timedelta(days=1),datetime.time(00, 00)).replace(tzinfo=None)
|
||||||
#elif item.end_time: # end time but no start time - this is weird - don't think ICS will like it so ignoring
|
#elif item.end_time: # end time but no start time - this is weird - don't think ICS will like it so ignoring
|
||||||
# do nothing
|
# do nothing
|
||||||
|
|
||||||
@@ -95,9 +94,9 @@ class CalendarICS(ICalFeed):
|
|||||||
if item.access_at:
|
if item.access_at:
|
||||||
desc += 'Access At = ' + item.access_at.strftime('%Y-%m-%d %H:%M') + '\n'
|
desc += 'Access At = ' + item.access_at.strftime('%Y-%m-%d %H:%M') + '\n'
|
||||||
if item.start_date:
|
if item.start_date:
|
||||||
desc += 'Event Start = ' + item.start_date.strftime('%Y-%m-%d') + ((' '+item.start_time.strftime('%H:%M')) if item.start_time else '') + '\n'
|
desc += 'Event Start = ' + item.start_date.strftime('%Y-%m-%d') + ((' '+item.start_time.strftime('%H:%M')) if item.has_start_time else '') + '\n'
|
||||||
if item.end_date:
|
if item.end_date:
|
||||||
desc += 'Event End = ' + item.end_date.strftime('%Y-%m-%d') + ((' '+item.end_time.strftime('%H:%M')) if item.end_time else '') + '\n'
|
desc += 'Event End = ' + item.end_date.strftime('%Y-%m-%d') + ((' '+item.end_time.strftime('%H:%M')) if item.has_end_time else '') + '\n'
|
||||||
|
|
||||||
desc += '\n'
|
desc += '\n'
|
||||||
if item.description:
|
if item.description:
|
||||||
@@ -106,7 +105,7 @@ class CalendarICS(ICalFeed):
|
|||||||
desc += 'Notes:\n'+item.notes+'\n\n'
|
desc += 'Notes:\n'+item.notes+'\n\n'
|
||||||
|
|
||||||
base_url = "https://pyrigs.nottinghamtec.co.uk"
|
base_url = "https://pyrigs.nottinghamtec.co.uk"
|
||||||
desc += 'URL = '+base_url+str(reverse_lazy('event_detail',kwargs={'pk':item.pk}))
|
desc += 'URL = '+base_url+str(item.get_absolute_url())
|
||||||
|
|
||||||
return desc
|
return desc
|
||||||
|
|
||||||
@@ -119,7 +118,7 @@ class CalendarICS(ICalFeed):
|
|||||||
# return ''
|
# return ''
|
||||||
|
|
||||||
def item_updated(self, item): # some ical clients will display this
|
def item_updated(self, item): # some ical clients will display this
|
||||||
return item.last_edited_at
|
return item.last_edited_at.replace(tzinfo=None)
|
||||||
|
|
||||||
def item_guid(self, item): # use the rig-id as the ical unique event identifier
|
def item_guid(self, item): # use the rig-id as the ical unique event identifier
|
||||||
return item.pk
|
return item.pk
|
||||||
26
RIGS/migrations/0022_auto_20150424_2104.py
Normal file
26
RIGS/migrations/0022_auto_20150424_2104.py
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import models, migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('RIGS', '0021_auto_20150420_1155'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='event',
|
||||||
|
name='collector',
|
||||||
|
field=models.CharField(max_length=255, null=True, verbose_name=b'Collected by', blank=True),
|
||||||
|
preserve_default=True,
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='event',
|
||||||
|
name='purchase_order',
|
||||||
|
field=models.CharField(max_length=255, null=True, verbose_name=b'PO', blank=True),
|
||||||
|
preserve_default=True,
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -255,8 +255,8 @@ class Event(models.Model, RevisionMixin):
|
|||||||
# Monies
|
# Monies
|
||||||
payment_method = models.CharField(max_length=255, blank=True, null=True)
|
payment_method = models.CharField(max_length=255, blank=True, null=True)
|
||||||
payment_received = models.CharField(max_length=255, blank=True, null=True)
|
payment_received = models.CharField(max_length=255, blank=True, null=True)
|
||||||
purchase_order = models.CharField(max_length=255, blank=True, null=True)
|
purchase_order = models.CharField(max_length=255, blank=True, null=True, verbose_name='PO')
|
||||||
collector = models.CharField(max_length=255, blank=True, null=True, verbose_name='Collected By')
|
collector = models.CharField(max_length=255, blank=True, null=True, verbose_name='Collected by')
|
||||||
|
|
||||||
# Calculated values
|
# Calculated values
|
||||||
"""
|
"""
|
||||||
@@ -303,6 +303,14 @@ class Event(models.Model, RevisionMixin):
|
|||||||
def confirmed(self):
|
def confirmed(self):
|
||||||
return (self.status == self.BOOKED or self.status == self.CONFIRMED)
|
return (self.status == self.BOOKED or self.status == self.CONFIRMED)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def has_start_time(self):
|
||||||
|
return self.start_time is not None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def has_end_time(self):
|
||||||
|
return self.end_time is not None
|
||||||
|
|
||||||
objects = EventManager()
|
objects = EventManager()
|
||||||
|
|
||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
|
|||||||
27
RIGS/static/css/ajax-bootstrap-select.css
Executable file
27
RIGS/static/css/ajax-bootstrap-select.css
Executable file
@@ -0,0 +1,27 @@
|
|||||||
|
/*!
|
||||||
|
* Ajax Bootstrap Select
|
||||||
|
*
|
||||||
|
* Extends existing [Bootstrap Select] implementations by adding the ability to search via AJAX requests as you type. Originally for CROSCON.
|
||||||
|
*
|
||||||
|
* @version 1.3.1
|
||||||
|
* @author Adam Heim - https://github.com/truckingsim
|
||||||
|
* @link https://github.com/truckingsim/Ajax-Bootstrap-Select
|
||||||
|
* @copyright 2015 Adam Heim
|
||||||
|
* @license Released under the MIT license.
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Mark Carver - https://github.com/markcarver
|
||||||
|
*
|
||||||
|
* Last build: 2015-01-06 8:43:11 PM EST
|
||||||
|
*/
|
||||||
|
.bootstrap-select .status {
|
||||||
|
background: #f0f0f0;
|
||||||
|
clear: both;
|
||||||
|
color: #999;
|
||||||
|
font-size: 11px;
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 1;
|
||||||
|
margin-bottom: -5px;
|
||||||
|
padding: 10px 20px;
|
||||||
|
}
|
||||||
366
RIGS/static/css/bootstrap-datetimepicker.min.css
vendored
Normal file
366
RIGS/static/css/bootstrap-datetimepicker.min.css
vendored
Normal file
@@ -0,0 +1,366 @@
|
|||||||
|
/*!
|
||||||
|
* Datetimepicker for Bootstrap 3
|
||||||
|
* ! version : 4.7.14
|
||||||
|
* https://github.com/Eonasdan/bootstrap-datetimepicker/
|
||||||
|
*/
|
||||||
|
.bootstrap-datetimepicker-widget {
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu {
|
||||||
|
margin: 2px 0;
|
||||||
|
padding: 4px;
|
||||||
|
width: 19em;
|
||||||
|
}
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
|
||||||
|
width: 38em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media (min-width: 992px) {
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
|
||||||
|
width: 38em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media (min-width: 1200px) {
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
|
||||||
|
width: 38em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu:before,
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu:after {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu.bottom:before {
|
||||||
|
border-left: 7px solid transparent;
|
||||||
|
border-right: 7px solid transparent;
|
||||||
|
border-bottom: 7px solid #cccccc;
|
||||||
|
border-bottom-color: rgba(0, 0, 0, 0.2);
|
||||||
|
top: -7px;
|
||||||
|
left: 7px;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu.bottom:after {
|
||||||
|
border-left: 6px solid transparent;
|
||||||
|
border-right: 6px solid transparent;
|
||||||
|
border-bottom: 6px solid white;
|
||||||
|
top: -6px;
|
||||||
|
left: 8px;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu.top:before {
|
||||||
|
border-left: 7px solid transparent;
|
||||||
|
border-right: 7px solid transparent;
|
||||||
|
border-top: 7px solid #cccccc;
|
||||||
|
border-top-color: rgba(0, 0, 0, 0.2);
|
||||||
|
bottom: -7px;
|
||||||
|
left: 6px;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu.top:after {
|
||||||
|
border-left: 6px solid transparent;
|
||||||
|
border-right: 6px solid transparent;
|
||||||
|
border-top: 6px solid white;
|
||||||
|
bottom: -6px;
|
||||||
|
left: 7px;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:before {
|
||||||
|
left: auto;
|
||||||
|
right: 6px;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:after {
|
||||||
|
left: auto;
|
||||||
|
right: 7px;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget .list-unstyled {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget a[data-action] {
|
||||||
|
padding: 6px 0;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget a[data-action]:active {
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget .timepicker-hour,
|
||||||
|
.bootstrap-datetimepicker-widget .timepicker-minute,
|
||||||
|
.bootstrap-datetimepicker-widget .timepicker-second {
|
||||||
|
width: 54px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 1.2em;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget button[data-action] {
|
||||||
|
padding: 6px;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget .btn[data-action="incrementHours"]::after {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
margin: -1px;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0, 0, 0, 0);
|
||||||
|
border: 0;
|
||||||
|
content: "Increment Hours";
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget .btn[data-action="incrementMinutes"]::after {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
margin: -1px;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0, 0, 0, 0);
|
||||||
|
border: 0;
|
||||||
|
content: "Increment Minutes";
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget .btn[data-action="decrementHours"]::after {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
margin: -1px;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0, 0, 0, 0);
|
||||||
|
border: 0;
|
||||||
|
content: "Decrement Hours";
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget .btn[data-action="decrementMinutes"]::after {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
margin: -1px;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0, 0, 0, 0);
|
||||||
|
border: 0;
|
||||||
|
content: "Decrement Minutes";
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget .btn[data-action="showHours"]::after {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
margin: -1px;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0, 0, 0, 0);
|
||||||
|
border: 0;
|
||||||
|
content: "Show Hours";
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget .btn[data-action="showMinutes"]::after {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
margin: -1px;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0, 0, 0, 0);
|
||||||
|
border: 0;
|
||||||
|
content: "Show Minutes";
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget .btn[data-action="togglePeriod"]::after {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
margin: -1px;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0, 0, 0, 0);
|
||||||
|
border: 0;
|
||||||
|
content: "Toggle AM/PM";
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget .btn[data-action="clear"]::after {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
margin: -1px;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0, 0, 0, 0);
|
||||||
|
border: 0;
|
||||||
|
content: "Clear the picker";
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget .btn[data-action="today"]::after {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
margin: -1px;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0, 0, 0, 0);
|
||||||
|
border: 0;
|
||||||
|
content: "Set the date to today";
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget .picker-switch {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget .picker-switch::after {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
margin: -1px;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0, 0, 0, 0);
|
||||||
|
border: 0;
|
||||||
|
content: "Toggle Date and Time Screens";
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget .picker-switch td {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
height: auto;
|
||||||
|
width: auto;
|
||||||
|
line-height: inherit;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget .picker-switch td span {
|
||||||
|
line-height: 2.5;
|
||||||
|
height: 2.5em;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table {
|
||||||
|
width: 100%;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table td,
|
||||||
|
.bootstrap-datetimepicker-widget table th {
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table th {
|
||||||
|
height: 20px;
|
||||||
|
line-height: 20px;
|
||||||
|
width: 20px;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table th.picker-switch {
|
||||||
|
width: 145px;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table th.disabled,
|
||||||
|
.bootstrap-datetimepicker-widget table th.disabled:hover {
|
||||||
|
background: none;
|
||||||
|
color: #777777;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table th.prev::after {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
margin: -1px;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0, 0, 0, 0);
|
||||||
|
border: 0;
|
||||||
|
content: "Previous Month";
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table th.next::after {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
margin: -1px;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0, 0, 0, 0);
|
||||||
|
border: 0;
|
||||||
|
content: "Next Month";
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table thead tr:first-child th {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table thead tr:first-child th:hover {
|
||||||
|
background: #eeeeee;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table td {
|
||||||
|
height: 54px;
|
||||||
|
line-height: 54px;
|
||||||
|
width: 54px;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table td.cw {
|
||||||
|
font-size: .8em;
|
||||||
|
height: 20px;
|
||||||
|
line-height: 20px;
|
||||||
|
color: #777777;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table td.day {
|
||||||
|
height: 20px;
|
||||||
|
line-height: 20px;
|
||||||
|
width: 20px;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table td.day:hover,
|
||||||
|
.bootstrap-datetimepicker-widget table td.hour:hover,
|
||||||
|
.bootstrap-datetimepicker-widget table td.minute:hover,
|
||||||
|
.bootstrap-datetimepicker-widget table td.second:hover {
|
||||||
|
background: #eeeeee;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table td.old,
|
||||||
|
.bootstrap-datetimepicker-widget table td.new {
|
||||||
|
color: #777777;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table td.today {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table td.today:before {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
border: 0 0 7px 7px solid transparent;
|
||||||
|
border-bottom-color: #337ab7;
|
||||||
|
border-top-color: rgba(0, 0, 0, 0.2);
|
||||||
|
position: absolute;
|
||||||
|
bottom: 4px;
|
||||||
|
right: 4px;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table td.active,
|
||||||
|
.bootstrap-datetimepicker-widget table td.active:hover {
|
||||||
|
background-color: #337ab7;
|
||||||
|
color: #ffffff;
|
||||||
|
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table td.active.today:before {
|
||||||
|
border-bottom-color: #fff;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table td.disabled,
|
||||||
|
.bootstrap-datetimepicker-widget table td.disabled:hover {
|
||||||
|
background: none;
|
||||||
|
color: #777777;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table td span {
|
||||||
|
display: inline-block;
|
||||||
|
width: 54px;
|
||||||
|
height: 54px;
|
||||||
|
line-height: 54px;
|
||||||
|
margin: 2px 1.5px;
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table td span:hover {
|
||||||
|
background: #eeeeee;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table td span.active {
|
||||||
|
background-color: #337ab7;
|
||||||
|
color: #ffffff;
|
||||||
|
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table td span.old {
|
||||||
|
color: #777777;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget table td span.disabled,
|
||||||
|
.bootstrap-datetimepicker-widget table td span.disabled:hover {
|
||||||
|
background: none;
|
||||||
|
color: #777777;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
.bootstrap-datetimepicker-widget.usetwentyfour td.hour {
|
||||||
|
height: 27px;
|
||||||
|
line-height: 27px;
|
||||||
|
}
|
||||||
|
.input-group.date .input-group-addon {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.sr-only {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
margin: -1px;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0, 0, 0, 0);
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
6
RIGS/static/css/bootstrap-select.min.css
vendored
Normal file
6
RIGS/static/css/bootstrap-select.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1554
RIGS/static/js/ajax-bootstrap-select.js
Executable file
1554
RIGS/static/js/ajax-bootstrap-select.js
Executable file
File diff suppressed because it is too large
Load Diff
@@ -1,29 +1,104 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$(".autocomplete-json").each(function() {
|
clearSelectionLabel = '(no selection)';
|
||||||
var field = $(this)
|
|
||||||
$.getJSON($(this).data('valueurl'), function(json) {
|
|
||||||
field.val(json[0]['fields']['name']);
|
|
||||||
});
|
|
||||||
var source = $(this).data('sourceurl');
|
|
||||||
$(this).autocomplete({
|
|
||||||
source: source,
|
|
||||||
minLength: 3,
|
|
||||||
delay: 500,
|
|
||||||
focus: function(e, ui) {
|
|
||||||
e.preventDefault();
|
|
||||||
$(this).val(ui.item.label);
|
|
||||||
|
|
||||||
},
|
function changeSelectedValue(obj,pk,text,update_url) { //Pass in JQuery object and new parameters
|
||||||
select: function(e, ui) {
|
//console.log('Changing selected value');
|
||||||
e.preventDefault();
|
obj.find('option').remove(); //Remove all the available options
|
||||||
$(this).val(ui.item.label);
|
obj.append( //Add the new option
|
||||||
$("#"+$(this).data('target')).val(ui.item.value)
|
$("<option></option>")
|
||||||
|
.attr("value",pk)
|
||||||
|
.text(text)
|
||||||
|
.data('update_url',update_url)
|
||||||
|
);
|
||||||
|
obj.selectpicker('render'); //Re-render the UI
|
||||||
|
obj.selectpicker('refresh'); //Re-render the UI
|
||||||
|
obj.selectpicker('val', pk); //Set the new value to be selected
|
||||||
|
obj.change(); //Trigger the change function manually
|
||||||
|
}
|
||||||
|
|
||||||
|
function refreshUpdateHref(obj) {
|
||||||
|
//console.log('Refreshing Update URL');
|
||||||
|
targetObject = $('#'+obj.attr('id')+'-update');
|
||||||
|
update_url = $('option:selected', obj).data('update_url');
|
||||||
|
|
||||||
|
if (update_url=="") { //Probably "clear selection" has been chosen
|
||||||
|
// console.log('Trying to disable');
|
||||||
|
targetObject.attr('disabled', true);
|
||||||
|
} else {
|
||||||
|
// targetObject.attr('href', update_url);
|
||||||
|
targetObject.attr('disabled', false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$(".selectpicker").each(function() {
|
||||||
|
|
||||||
|
var options = {
|
||||||
|
ajax: {
|
||||||
|
url: $(this).data('sourceurl'),
|
||||||
|
type: 'GET',
|
||||||
|
dataType: 'json',
|
||||||
|
// Use "{{{q}}}" as a placeholder and Ajax Bootstrap Select will
|
||||||
|
// automatically replace it with the value of the search query.
|
||||||
|
data: {
|
||||||
|
term: '{{{q}}}'
|
||||||
}
|
}
|
||||||
});
|
},
|
||||||
$(this).on('blur', function () {
|
locale: {
|
||||||
if ($(this).val() == "") {
|
emptyTitle: ''
|
||||||
$("#" + $(this).data('target')).val('');
|
},
|
||||||
|
clearOnEmpty:false,
|
||||||
|
//log: 3,
|
||||||
|
preprocessData: function (data) {
|
||||||
|
var i, l = data.length, array = [];
|
||||||
|
array.push({
|
||||||
|
text: clearSelectionLabel,
|
||||||
|
value: '',
|
||||||
|
data:{
|
||||||
|
update_url: '',
|
||||||
|
subtext:''
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (l) {
|
||||||
|
for(i = 0; i < l; i++){
|
||||||
|
array.push($.extend(true, data[i], {
|
||||||
|
text: data[i]['label'],
|
||||||
|
value: data[i]['pk'],
|
||||||
|
data:{
|
||||||
|
update_url: data[i]['update'],
|
||||||
|
subtext:''
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
return array;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$(this).prepend($("<option></option>")
|
||||||
|
.attr("value",'')
|
||||||
|
.text(clearSelectionLabel)
|
||||||
|
.data('update_url','')); //Add "clear selection" option
|
||||||
|
|
||||||
|
|
||||||
|
$(this).selectpicker().ajaxSelectPicker(options); //Initiaise selectPicker
|
||||||
|
|
||||||
|
$(this).change(function(){ //on change, update the edit button href
|
||||||
|
// console.log('Selectbox Changed');
|
||||||
|
refreshUpdateHref($(this));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
refreshUpdateHref($(this)); //Ensure href is correct at the beginning
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
//When update/edit modal box submitted
|
||||||
|
$('#modal').on('hide.bs.modal', function (e) {
|
||||||
|
if (modaltarget != undefined && modalobject != "") {
|
||||||
|
//Update the selector with new values
|
||||||
|
changeSelectedValue($(modaltarget),modalobject[0]['pk'],modalobject[0]['fields']['name'],modalobject[0]['update_url']);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
8
RIGS/static/js/bootstrap-datetimepicker.min.js
vendored
Normal file
8
RIGS/static/js/bootstrap-datetimepicker.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1209
RIGS/static/js/bootstrap-select.js
vendored
Executable file
1209
RIGS/static/js/bootstrap-select.js
vendored
Executable file
File diff suppressed because it is too large
Load Diff
@@ -133,11 +133,3 @@ $("#item-table tbody").sortable({
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.autocomplete-update').on("autocompleteselect", function(event, ui) {
|
|
||||||
update_url = ui['item']['update'];
|
|
||||||
target = $('#' + event['target'].dataset.target + "-update");
|
|
||||||
console.log(update_url);
|
|
||||||
console.log(target);
|
|
||||||
target.attr('href', update_url);
|
|
||||||
});
|
|
||||||
@@ -157,6 +157,11 @@
|
|||||||
<dt>Collected By</dt>
|
<dt>Collected By</dt>
|
||||||
<dd>{{ object.collector }}</dd>
|
<dd>{{ object.collector }}</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if event.is_rig %}
|
||||||
|
<dt>PO</dt>
|
||||||
|
<dd>{{ object.purchase_order }}</dd>
|
||||||
|
{% endif %}
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
{{ object.pk }}{% endif %}{% else %}New Event{% endif %}{% endblock %}
|
{{ object.pk }}{% endif %}{% else %}New Event{% endif %}{% endblock %}
|
||||||
|
|
||||||
{% block css %}
|
{% block css %}
|
||||||
<link href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"/>
|
<link rel="stylesheet" href="{% static "css/bootstrap-select.min.css" %}"/>
|
||||||
|
<link rel="stylesheet" href="{% static "css/ajax-bootstrap-select.css" %}"/>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block js %}
|
{% block js %}
|
||||||
@@ -14,6 +15,9 @@
|
|||||||
<script src="{% static "js/interaction.js" %}"></script>
|
<script src="{% static "js/interaction.js" %}"></script>
|
||||||
<script src="{% static "js/modal.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 src="{% static "js/autocompleter.js" %}"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -62,6 +66,43 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
function supportsDate() {
|
||||||
|
//return false; //for development
|
||||||
|
var input = document.createElement('input');
|
||||||
|
input.setAttribute('type','date');
|
||||||
|
var notADateValue = 'not-a-date';
|
||||||
|
input.setAttribute('value', notADateValue);
|
||||||
|
return !(input.value === notADateValue);
|
||||||
|
}
|
||||||
|
if(supportsDate()){
|
||||||
|
//Good, we'll use the browser implementation
|
||||||
|
}else{
|
||||||
|
//Rubbish browser - do JQuery backup
|
||||||
|
$('<link>')
|
||||||
|
.appendTo('head')
|
||||||
|
.attr({type : 'text/css', rel : 'stylesheet'})
|
||||||
|
.attr('href', '{% static "css/bootstrap-datetimepicker.min.css" %}');
|
||||||
|
$.when(
|
||||||
|
$.getScript( "{% static "js/moment.min.js" %}" ),
|
||||||
|
$.getScript( "{% static "js/bootstrap-datetimepicker.min.js" %}" ),
|
||||||
|
$.Deferred(function( deferred ){
|
||||||
|
$( deferred.resolve );
|
||||||
|
})
|
||||||
|
).done(function(){
|
||||||
|
$('input[type=date]').attr('type','text').datetimepicker({
|
||||||
|
format: 'YYYY-MM-DD',
|
||||||
|
});
|
||||||
|
$('input[type=time]').attr('type','text').datetimepicker({
|
||||||
|
format: 'HH:mm',
|
||||||
|
});
|
||||||
|
$('input[type=datetime-local]').attr('type','text').datetimepicker({
|
||||||
|
format: 'YYYY-MM-DD[T]HH:mm',
|
||||||
|
sideBySide: true,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
@@ -123,15 +164,12 @@
|
|||||||
|
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<input type="hidden" id="{{ form.person.id_for_label }}" name="{{ form.person.name }}"
|
|
||||||
value="{{ form.person.value|default_if_none:"" }}"/>
|
|
||||||
|
|
||||||
<div class="col-sm-9 col-md-7 col-lg-8">
|
<div class="col-sm-9 col-md-7 col-lg-8">
|
||||||
<input type="text" id="{{ form.person.id_for_label }}-input"
|
<select id="{{ form.person.id_for_label }}" name="{{ form.person.name }}" class="form-control selectpicker" data-live-search="true" data-sourceurl="{% url 'api_secure' model='person' %}">
|
||||||
class="form-control autocomplete-json autocomplete-update"
|
{% if person %}
|
||||||
value="{{ person|default_if_none:"" }}"
|
<option value="{{form.person.value}}" selected="selected" data-update_url="{% url 'person_update' form.person.value %}">{{ person }}</option>
|
||||||
data-sourceurl="{% url 'api_secure' model='person' %}"
|
{% endif %}
|
||||||
data-target="{{ form.person.id_for_label }}"/>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-3 col-md-5 col-lg-4 align-right">
|
<div class="col-sm-3 col-md-5 col-lg-4 align-right">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
@@ -139,7 +177,7 @@
|
|||||||
data-target="#{{ form.person.id_for_label }}">
|
data-target="#{{ form.person.id_for_label }}">
|
||||||
<span class="glyphicon glyphicon-plus"></span>
|
<span class="glyphicon glyphicon-plus"></span>
|
||||||
</a>
|
</a>
|
||||||
<a href="{% if form.person.value %}{% url 'person_update' form.person.value %}{% endif %}" class="btn btn-default modal-href" id="{{ form.person.id_for_label }}-update">
|
<a href="{% if form.person.value %}{% url 'person_update' form.person.value %}{% endif %}" class="btn btn-default modal-href" id="{{ form.person.id_for_label }}-update" data-target="#{{ form.person.id_for_label }}">
|
||||||
<span class="glyphicon glyphicon-pencil"></span>
|
<span class="glyphicon glyphicon-pencil"></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -153,16 +191,12 @@
|
|||||||
|
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<input type="hidden" id="{{ form.organisation.id_for_label }}"
|
|
||||||
name="{{ form.organisation.name }}"
|
|
||||||
value="{{ form.organisation.value|default_if_none:"" }}"/>
|
|
||||||
|
|
||||||
<div class="col-sm-9 col-md-7 col-lg-8">
|
<div class="col-sm-9 col-md-7 col-lg-8">
|
||||||
<input type="text" id="{{ form.organisation.id_for_label }}-input"
|
<select id="{{ form.organisation.id_for_label }}" name="{{ form.organisation.name }}" class="form-control selectpicker" data-live-search="true" data-sourceurl="{% url 'api_secure' model='organisation' %}">
|
||||||
class="form-control autocomplete-json autocomplete-update"
|
{% if organisation %}
|
||||||
value="{{ organisation|default_if_none:"" }}"
|
<option value="{{form.organisation.value}}" selected="selected" data-update_url="{% url 'organisation_update' form.organisation.value %}">{{ organisation }}</option>
|
||||||
data-sourceurl="{% url 'api_secure' model='organisation' %}"
|
{% endif %}
|
||||||
data-target="{{ form.organisation.id_for_label }}"/>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-3 col-md-5 col-lg-4 align-right">
|
<div class="col-sm-3 col-md-5 col-lg-4 align-right">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
@@ -170,7 +204,7 @@
|
|||||||
data-target="#{{ form.organisation.id_for_label }}">
|
data-target="#{{ form.organisation.id_for_label }}">
|
||||||
<span class="glyphicon glyphicon-plus"></span>
|
<span class="glyphicon glyphicon-plus"></span>
|
||||||
</a>
|
</a>
|
||||||
<a href="{% if form.organisation.value %}{% url 'organisation_update' form.organisation.value %}{% endif %}" class="btn btn-default modal-href" id="{{ form.organisation.id_for_label }}-update">
|
<a href="{% if form.organisation.value %}{% url 'organisation_update' form.organisation.value %}{% endif %}" class="btn btn-default modal-href" id="{{ form.organisation.id_for_label }}-update" data-target="#{{ form.organisation.id_for_label }}">
|
||||||
<span class="glyphicon glyphicon-pencil"></span>
|
<span class="glyphicon glyphicon-pencil"></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -216,15 +250,12 @@
|
|||||||
|
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<input type="hidden" id="{{ form.venue.id_for_label }}" name="{{ form.venue.name }}"
|
|
||||||
value="{{ form.venue.value|default_if_none:"" }}"/>
|
|
||||||
|
|
||||||
<div class="col-sm-9 col-md-7 col-lg-8">
|
<div class="col-sm-9 col-md-7 col-lg-8">
|
||||||
<input type="text" id="{{ form.venue.id_for_label }}-input"
|
<select id="{{ form.venue.id_for_label }}" name="{{ form.venue.name }}" class="form-control selectpicker" data-live-search="true" data-sourceurl="{% url 'api_secure' model='venue' %}">
|
||||||
class="form-control autocomplete-json autocomplete-update"
|
{% if venue %}
|
||||||
value="{{ venue|default_if_none:"" }}"
|
<option value="{{form.venue.value}}" selected="selected" data-update_url="{% url 'venue_update' form.venue.value %}">{{ venue }}</option>
|
||||||
data-sourceurl="{% url 'api_secure' model='venue' %}"
|
{% endif %}
|
||||||
data-target="{{ form.venue.id_for_label }}"/>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-3 col-md-5 col-lg-4 align-right">
|
<div class="col-sm-3 col-md-5 col-lg-4 align-right">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
@@ -232,7 +263,7 @@
|
|||||||
data-target="#{{ form.venue.id_for_label }}">
|
data-target="#{{ form.venue.id_for_label }}">
|
||||||
<span class="glyphicon glyphicon-plus"></span>
|
<span class="glyphicon glyphicon-plus"></span>
|
||||||
</a>
|
</a>
|
||||||
<a href="{% if object.venue %}{% url 'venue_update' object.venue.pk %}{% endif %}" class="btn btn-default modal-href" id="{{ form.venue.id_for_label }}-update">
|
<a href="{% if object.venue %}{% url 'venue_update' object.venue.pk %}{% endif %}" class="btn btn-default modal-href" id="{{ form.venue.id_for_label }}-update" data-target="#{{ form.venue.id_for_label }}">
|
||||||
<span class="glyphicon glyphicon-pencil"></span>
|
<span class="glyphicon glyphicon-pencil"></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -325,14 +356,11 @@
|
|||||||
class="col-sm-4 control-label">{{ form.mic.label }}</label>
|
class="col-sm-4 control-label">{{ form.mic.label }}</label>
|
||||||
|
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="hidden" id="{{ form.mic.id_for_label }}" name="{{ form.mic.name }}"
|
<select id="{{ form.mic.id_for_label }}" name="{{ form.mic.name }}" class="form-control selectpicker" data-live-search="true" data-sourceurl="{% url 'api_secure' model='profile' %}?fields=first_name,last_name,initials">
|
||||||
value="{{ form.mic.value|default_if_none:"" }}"/>
|
{% if mic %}
|
||||||
|
<option value="{{form.mic.value}}" selected="selected" >{{ mic.name }}</option>
|
||||||
<input type="text" id="{{ form.mic.id_for_label }}-input"
|
{% endif %}
|
||||||
class="form-control autocomplete-json"
|
</select>
|
||||||
data-sourceurl="{% url 'api_secure' model='profile' %}?fields=first_name,last_name,initials"
|
|
||||||
data-target="{{ form.mic.id_for_label }}"
|
|
||||||
value="{{ mic.name|default_if_none:"" }}"/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -342,15 +370,11 @@
|
|||||||
class="col-sm-4 control-label">{{ form.checked_in_by.label }}</label>
|
class="col-sm-4 control-label">{{ form.checked_in_by.label }}</label>
|
||||||
|
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="hidden" id="{{ form.checked_in_by.id_for_label }}"
|
<select id="{{ form.checked_in_by.id_for_label }}" name="{{ form.checked_in_by.name }}" class="form-control selectpicker" data-live-search="true" data-sourceurl="{% url 'api_secure' model='profile' %}?fields=first_name,last_name,initials">
|
||||||
name="{{ form.checked_in_by.name }}"
|
{% if checked_in_by %}
|
||||||
value="{{ form.checked_in_by.value|default_if_none:"" }}"/>
|
<option value="{{form.checked_in_by.value}}" selected="selected" >{{ checked_in_by.name }}</option>
|
||||||
|
{% endif %}
|
||||||
<input type="text" id="{{ form.checked_in_by.id_for_label }}-input"
|
</select>
|
||||||
class="form-control autocomplete-json"
|
|
||||||
data-sourceurl="{% url 'api_secure' model='profile' %}?fields=first_name,last_name,initials"
|
|
||||||
data-target="{{ form.checked_in_by.id_for_label }}"
|
|
||||||
value="{{ checked_in_by.name|default_if_none:"" }}"/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -363,6 +387,14 @@
|
|||||||
{% render_field form.collector class+="form-control" %}
|
{% render_field form.collector class+="form-control" %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="{{ form.purchase_order.id_for_label }}"
|
||||||
|
class="col-sm-4 control-label">{{ form.purchase_order.label }}</label>
|
||||||
|
|
||||||
|
<div class="col-sm-8">
|
||||||
|
{% render_field form.purchase_order class+="form-control" %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -62,14 +62,14 @@
|
|||||||
<dt>Crew meet</dt>
|
<dt>Crew meet</dt>
|
||||||
<dd>{{ event.meet_at|date:"H:i" }}<br/>{{ event.meet_at|date:"(Y-m-d)" }}</dd>
|
<dd>{{ event.meet_at|date:"H:i" }}<br/>{{ event.meet_at|date:"(Y-m-d)" }}</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if event.start_time %}
|
{% if event.has_start_time %}
|
||||||
<dt>Event starts</dt>
|
<dt>Event starts</dt>
|
||||||
<dd>
|
<dd>
|
||||||
{{ event.start_time|date:"H:i" }}<br/>
|
{{ event.start_time|date:"H:i" }}<br/>
|
||||||
{{ event.start_date|date:"(Y-m-d)" }}<br/>
|
{{ event.start_date|date:"(Y-m-d)" }}<br/>
|
||||||
</dd>
|
</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if event.end_time%}{% if event.start_date != event.end_date or event.start_time != event.end_time %}
|
{% if event.has_end_time%}{% if event.start_date != event.end_date or event.start_time != event.end_time %}
|
||||||
<dt>Event ends</dt>
|
<dt>Event ends</dt>
|
||||||
<dd>
|
<dd>
|
||||||
{{ event.end_time|date:"H:i" }}<br/>
|
{{ event.end_time|date:"H:i" }}<br/>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<h2>Invoice {{ object.pk }}</h2>
|
<h2>Invoice {{ object.pk }} ({{ object.invoice_date|date:"d/m/Y"}})</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-sm-4 text-right">
|
<div class="col-sm-4 text-right">
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
<dd>N{{ object.event.pk|stringformat:"05d" }}</dd>
|
<dd>N{{ object.event.pk|stringformat:"05d" }}</dd>
|
||||||
|
|
||||||
<dt>Event</dt>
|
<dt>Event</dt>
|
||||||
<dd>{{ objet.event.pk }}</dd>
|
<dd>{{ object.event.name }}</dd>
|
||||||
|
|
||||||
<dt>Event Venue</dt>
|
<dt>Event Venue</dt>
|
||||||
<dd>{{ object.event.venue }}</dd>
|
<dd>{{ object.event.venue }}</dd>
|
||||||
@@ -48,6 +48,12 @@
|
|||||||
<dt>Event MIC</dt>
|
<dt>Event MIC</dt>
|
||||||
<dd>{{ object.event.mic.name }}</dd>
|
<dd>{{ object.event.mic.name }}</dd>
|
||||||
|
|
||||||
|
<dt>Event Starts</dt>
|
||||||
|
<dd>{{ object.event.start_date|date:"d M Y" }} {{ object.event.start_time|date:"H:i" }}</dd>
|
||||||
|
|
||||||
|
<dt>Event Ends</dt>
|
||||||
|
<dd>{{ object.event.end_date|date:"d M Y" }} {{ object.event.end_time|date:"H:i" }}</dd>
|
||||||
|
|
||||||
<dt>Status</dt>
|
<dt>Status</dt>
|
||||||
<dd>{{ object.event.get_status_display }}</dd>
|
<dd>{{ object.event.get_status_display }}</dd>
|
||||||
|
|
||||||
|
|||||||
@@ -24,9 +24,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="text-right col-sm-12">{% paginator %}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-right">{% paginator %}</div>
|
<div class="table-responsive">
|
||||||
<div>
|
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -24,9 +24,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="text-right col-sm-12">{% paginator %}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-right">{% paginator %}</div>
|
<div class="table-responsive">
|
||||||
<div>
|
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
{% if object.pk == user.pk %}
|
{% if object.pk == user.pk %}
|
||||||
|
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<a href="{% url 'reset_api_key' %}" class="btn">
|
<a href="{% url 'reset_api_key' %}" class="btn btn-default">
|
||||||
{% if user.api_key %}Reset API Key{% else %}Generate API Key{% endif %}
|
{% if user.api_key %}Reset API Key{% else %}Generate API Key{% endif %}
|
||||||
<span class="glyphicon glyphicon-repeat"></span>
|
<span class="glyphicon glyphicon-repeat"></span>
|
||||||
</a>
|
</a>
|
||||||
@@ -70,9 +70,12 @@
|
|||||||
<dd>
|
<dd>
|
||||||
{% if user.api_key %}
|
{% if user.api_key %}
|
||||||
<pre>http{{ request.is_secure|yesno:"s,"}}://{{ request.get_host }}{% url 'ics_calendar' api_pk=user.pk api_key=user.api_key %}</pre>
|
<pre>http{{ request.is_secure|yesno:"s,"}}://{{ request.get_host }}{% url 'ics_calendar' api_pk=user.pk api_key=user.api_key %}</pre>
|
||||||
|
<small><a href="http://www.google.com/calendar/render?cid=http{{ request.is_secure|yesno:"s,"}}://{{ request.get_host }}{% url 'ics_calendar' api_pk=user.pk api_key=user.api_key %}">Click here</a> to add to google calendar.<br/>
|
||||||
|
To sync from google calendar to mobile device, visit <a href="https://www.google.com/calendar/syncselect" target="_blank">this page</a> on your device and tick "PyRIGS Calendar".</small>
|
||||||
{% else %}
|
{% else %}
|
||||||
<pre>No API Key Generated</pre>
|
<pre>No API Key Generated</pre>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
|
|||||||
@@ -24,9 +24,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="text-right col-sm-12">{% paginator %}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-right">{% paginator %}</div>
|
|
||||||
<div>
|
<div class="table-responsive">
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ urlpatterns = patterns('',
|
|||||||
name='venue_update'),
|
name='venue_update'),
|
||||||
|
|
||||||
# Rigboard
|
# Rigboard
|
||||||
url(r'^rigboard/$', rigboard.RigboardIndex.as_view(), name='rigboard'),
|
url(r'^rigboard/$', login_required(rigboard.RigboardIndex.as_view()), name='rigboard'),
|
||||||
url(r'^rigboard/calendar/$', login_required()(rigboard.WebCalendar.as_view()), name='web_calendar'),
|
url(r'^rigboard/calendar/$', login_required()(rigboard.WebCalendar.as_view()), name='web_calendar'),
|
||||||
url(r'^rigboard/archive/$', RedirectView.as_view(pattern_name='event_archive')),
|
url(r'^rigboard/archive/$', RedirectView.as_view(pattern_name='event_archive')),
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,9 @@ class PersonCreate(generic.CreateView):
|
|||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
if self.request.is_ajax():
|
if self.request.is_ajax():
|
||||||
url = reverse_lazy('closemodal')
|
url = reverse_lazy('closemodal')
|
||||||
|
update_url = str(reverse_lazy('person_update',kwargs={'pk':self.object.pk}))
|
||||||
messages.info(self.request, "modalobject="+serializers.serialize("json", [self.object]))
|
messages.info(self.request, "modalobject="+serializers.serialize("json", [self.object]))
|
||||||
|
messages.info(self.request, "modalobject[0]['update_url']='"+update_url+"'")
|
||||||
else:
|
else:
|
||||||
url = reverse_lazy('person_detail', kwargs={
|
url = reverse_lazy('person_detail', kwargs={
|
||||||
'pk': self.object.pk,
|
'pk': self.object.pk,
|
||||||
@@ -85,7 +87,9 @@ class PersonUpdate(generic.UpdateView):
|
|||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
if self.request.is_ajax():
|
if self.request.is_ajax():
|
||||||
url = reverse_lazy('closemodal')
|
url = reverse_lazy('closemodal')
|
||||||
|
update_url = str(reverse_lazy('person_update',kwargs={'pk':self.object.pk}))
|
||||||
messages.info(self.request, "modalobject="+serializers.serialize("json", [self.object]))
|
messages.info(self.request, "modalobject="+serializers.serialize("json", [self.object]))
|
||||||
|
messages.info(self.request, "modalobject[0]['update_url']='"+update_url+"'")
|
||||||
else:
|
else:
|
||||||
url = reverse_lazy('person_detail', kwargs={
|
url = reverse_lazy('person_detail', kwargs={
|
||||||
'pk': self.object.pk,
|
'pk': self.object.pk,
|
||||||
@@ -119,7 +123,9 @@ class OrganisationCreate(generic.CreateView):
|
|||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
if self.request.is_ajax():
|
if self.request.is_ajax():
|
||||||
url = reverse_lazy('closemodal')
|
url = reverse_lazy('closemodal')
|
||||||
|
update_url = str(reverse_lazy('organisation_update',kwargs={'pk':self.object.pk}))
|
||||||
messages.info(self.request, "modalobject="+serializers.serialize("json", [self.object]))
|
messages.info(self.request, "modalobject="+serializers.serialize("json", [self.object]))
|
||||||
|
messages.info(self.request, "modalobject[0]['update_url']='"+update_url+"'")
|
||||||
else:
|
else:
|
||||||
url = reverse_lazy('organisation_detail', kwargs={
|
url = reverse_lazy('organisation_detail', kwargs={
|
||||||
'pk': self.object.pk,
|
'pk': self.object.pk,
|
||||||
@@ -133,7 +139,9 @@ class OrganisationUpdate(generic.UpdateView):
|
|||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
if self.request.is_ajax():
|
if self.request.is_ajax():
|
||||||
url = reverse_lazy('closemodal')
|
url = reverse_lazy('closemodal')
|
||||||
|
update_url = str(reverse_lazy('organisation_update',kwargs={'pk':self.object.pk}))
|
||||||
messages.info(self.request, "modalobject="+serializers.serialize("json", [self.object]))
|
messages.info(self.request, "modalobject="+serializers.serialize("json", [self.object]))
|
||||||
|
messages.info(self.request, "modalobject[0]['update_url']='"+update_url+"'")
|
||||||
else:
|
else:
|
||||||
url = reverse_lazy('organisation_detail', kwargs={
|
url = reverse_lazy('organisation_detail', kwargs={
|
||||||
'pk': self.object.pk,
|
'pk': self.object.pk,
|
||||||
@@ -167,7 +175,9 @@ class VenueCreate(generic.CreateView):
|
|||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
if self.request.is_ajax():
|
if self.request.is_ajax():
|
||||||
url = reverse_lazy('closemodal')
|
url = reverse_lazy('closemodal')
|
||||||
|
update_url = str(reverse_lazy('venue_update',kwargs={'pk':self.object.pk}))
|
||||||
messages.info(self.request, "modalobject="+serializers.serialize("json", [self.object]))
|
messages.info(self.request, "modalobject="+serializers.serialize("json", [self.object]))
|
||||||
|
messages.info(self.request, "modalobject[0]['update_url']='"+update_url+"'")
|
||||||
else:
|
else:
|
||||||
url = reverse_lazy('venue_detail', kwargs={
|
url = reverse_lazy('venue_detail', kwargs={
|
||||||
'pk': self.object.pk,
|
'pk': self.object.pk,
|
||||||
@@ -181,7 +191,9 @@ class VenueUpdate(generic.UpdateView):
|
|||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
if self.request.is_ajax():
|
if self.request.is_ajax():
|
||||||
url = reverse_lazy('closemodal')
|
url = reverse_lazy('closemodal')
|
||||||
|
update_url = str(reverse_lazy('venue_update',kwargs={'pk':self.object.pk}))
|
||||||
messages.info(self.request, "modalobject="+serializers.serialize("json", [self.object]))
|
messages.info(self.request, "modalobject="+serializers.serialize("json", [self.object]))
|
||||||
|
messages.info(self.request, "modalobject[0]['update_url']='"+update_url+"'")
|
||||||
else:
|
else:
|
||||||
url = reverse_lazy('venue_detail', kwargs={
|
url = reverse_lazy('venue_detail', kwargs={
|
||||||
'pk': self.object.pk,
|
'pk': self.object.pk,
|
||||||
@@ -287,13 +299,13 @@ class SecureAPIRequest(generic.View):
|
|||||||
if item.start_date:
|
if item.start_date:
|
||||||
data['start_date'] = item.start_date.strftime('%Y-%m-%d')
|
data['start_date'] = item.start_date.strftime('%Y-%m-%d')
|
||||||
|
|
||||||
if item.start_time:
|
if item.has_start_time:
|
||||||
data['start_time'] = item.start_time.strftime('%H:%M:%SZ')
|
data['start_time'] = item.start_time.strftime('%H:%M:%SZ')
|
||||||
|
|
||||||
if item.end_date:
|
if item.end_date:
|
||||||
data['end_date'] = item.end_date.strftime('%Y-%m-%d')
|
data['end_date'] = item.end_date.strftime('%Y-%m-%d')
|
||||||
|
|
||||||
if item.end_time:
|
if item.has_end_time:
|
||||||
data['end_time'] = item.end_time.strftime('%H:%M:%SZ')
|
data['end_time'] = item.end_time.strftime('%H:%M:%SZ')
|
||||||
|
|
||||||
if item.meet_at:
|
if item.meet_at:
|
||||||
|
|||||||
11
importer.py
11
importer.py
@@ -345,6 +345,7 @@ def main():
|
|||||||
# [x.start() for x in processs]
|
# [x.start() for x in processs]
|
||||||
# # Wait for all processs to finish
|
# # Wait for all processs to finish
|
||||||
# [x.join() for x in processs]
|
# [x.join() for x in processs]
|
||||||
|
|
||||||
import_users()
|
import_users()
|
||||||
import_people(True)
|
import_people(True)
|
||||||
import_organisations(True)
|
import_organisations(True)
|
||||||
@@ -354,8 +355,18 @@ def main():
|
|||||||
import_rigs(True)
|
import_rigs(True)
|
||||||
import_eventitem(True)
|
import_eventitem(True)
|
||||||
import_invoices(True)
|
import_invoices(True)
|
||||||
|
|
||||||
|
# Do this before doing non rigs else it gets ugly
|
||||||
|
sql = "SELECT setval(\'\"RIGS_%s_id_seq\"\', (SELECT MAX(id) FROM \"RIGS_%s\"));" % ('event', 'event')
|
||||||
|
cursor = connections['default'].cursor()
|
||||||
|
cursor.execute(sql)
|
||||||
import_nonrigs(False)
|
import_nonrigs(False)
|
||||||
|
|
||||||
|
sequences = ['profile', 'person', 'organisation', 'vatrate', 'venue', 'event', 'eventitem', 'invoice', 'payment']
|
||||||
|
for seq in sequences:
|
||||||
|
sql = "SELECT setval(\'\"RIGS_%s_id_seq\"\', (SELECT MAX(id) FROM \"RIGS_%s\"));" % (seq, seq)
|
||||||
|
cursor = connections['default'].cursor()
|
||||||
|
cursor.execute(sql)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
@@ -1,14 +1,34 @@
|
|||||||
Django==1.7.1
|
Django==1.7.1
|
||||||
|
Pillow==2.7.0
|
||||||
PyMySQL==0.6.2
|
PyMySQL==0.6.2
|
||||||
|
PyPDF2==1.23
|
||||||
|
Pygments==2.0.2
|
||||||
|
dj-database-url==0.3.0
|
||||||
|
dj-static==0.0.6
|
||||||
django-debug-toolbar==1.2.2
|
django-debug-toolbar==1.2.2
|
||||||
|
django-ical==1.3
|
||||||
django-registration-redux==1.1
|
django-registration-redux==1.1
|
||||||
django-reversion==1.8.5
|
django-reversion==1.8.5
|
||||||
sqlparse==0.1.13
|
django-toolbelt==0.0.1
|
||||||
simplejson==3.6.5
|
gunicorn==19.3.0
|
||||||
|
icalendar==3.9.0
|
||||||
lxml==3.4.1
|
lxml==3.4.1
|
||||||
pillow==2.7.0
|
psycopg2==2.6
|
||||||
|
python-dateutil==2.4.2
|
||||||
|
pytz==2015.2
|
||||||
reportlab==2.7
|
reportlab==2.7
|
||||||
|
selenium==2.45.0
|
||||||
|
simplejson==3.6.5
|
||||||
|
six==1.9.0
|
||||||
|
sqlparse==0.1.13
|
||||||
|
static3==0.5.1
|
||||||
|
svg2rlg==0.3
|
||||||
|
wsgiref==0.1.2
|
||||||
|
yolk==0.4.3
|
||||||
z3c.rml==2.7.2
|
z3c.rml==2.7.2
|
||||||
pyPDF2==1.23
|
pyPDF2==1.23
|
||||||
django-ical==1.3
|
django-ical==1.3
|
||||||
diff_match_patch
|
diff_match_patch
|
||||||
|
zope.event==4.0.3
|
||||||
|
zope.interface==4.1.2
|
||||||
|
zope.schema==4.4.2
|
||||||
|
|||||||
@@ -162,12 +162,6 @@
|
|||||||
jQuery('#modal').load(jQuery(this).attr('href'), function (e) {
|
jQuery('#modal').load(jQuery(this).attr('href'), function (e) {
|
||||||
jQuery('#modal').modal();
|
jQuery('#modal').modal();
|
||||||
});
|
});
|
||||||
jQuery('#modal').on('hide.bs.modal', function (e) {
|
|
||||||
if (modaltarget != "" && modalobject != "") {
|
|
||||||
jQuery(modaltarget).val(modalobject[0]['pk']);
|
|
||||||
jQuery(modaltarget + '-input').val(modalobject[0]['fields']['name']);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user