mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-03-03 10:38:23 +00:00
Merge branch 'master' into timezone-fixes
This commit is contained in:
@@ -78,7 +78,7 @@ body .fc { /* extra precedence to overcome jqui */
|
||||
font-size: 1em;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
font-family: "Open Sans", sans-serif;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -43,7 +43,7 @@ $link-hover-color: darken($link-color, 15%) !default;
|
||||
//
|
||||
//## Font, line-height, and color for body text, headings, and more.
|
||||
|
||||
$font-family-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
|
||||
$font-family-sans-serif: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif !default;
|
||||
$font-family-serif: Georgia, "Times New Roman", Times, serif !default;
|
||||
//** Default monospace fonts for `<code>`, `<kbd>`, and `<pre>`.
|
||||
$font-family-monospace: Menlo, Monaco, Consolas, "Courier New", monospace !default;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{% extends request.is_ajax|yesno:"base_ajax.html,base.html" %}
|
||||
{% block title %}Event {% if object.is_rig %}N{{ object.pk|stringformat:"05d" }}{% else %}{{ object.pk }}
|
||||
{% endif %}{% endblock %}
|
||||
{% block title %}{% if object.is_rig %}N{{ object.pk|stringformat:"05d" }}{% else %}{{ object.pk }}{% endif %} | {{object.name}}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
@@ -9,7 +8,7 @@
|
||||
<div class="col-sm-8">
|
||||
<h1>
|
||||
{% if object.is_rig %}N{{ object.pk|stringformat:"05d" }}{% else %}{{ object.pk }}{% endif %}
|
||||
{{ object.name }}
|
||||
| {{ object.name }}
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -401,6 +401,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.col-sm-12 .col-md-6 -->
|
||||
<div class="col-sm-12 text-right">
|
||||
<div class="btn-group btn-page">
|
||||
<button type="submit" class="btn btn-default" title="Save"><span
|
||||
@@ -408,8 +410,7 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.col-sm-12 .col-md-6 -->
|
||||
|
||||
|
||||
{# Notes and item shit #}
|
||||
<div class="col-sm-12">
|
||||
@@ -424,14 +425,14 @@
|
||||
{% include "RIGS/item_table.html" %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 text-right">
|
||||
</div>
|
||||
<div class="col-sm-12 text-right form-hws form-is_rig">
|
||||
<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>
|
||||
|
||||
{% include 'RIGS/item_modal.html' %}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<div class="col-sm-4 text-right">
|
||||
<a href="{% url 'invoice_void' object.pk %}" class="btn btn-default" title="Void Invoice">
|
||||
<span class="glyphicon glyphicon-text-background"></span>
|
||||
<span class="glyphicon glyphicon-ban-circle"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -9,6 +9,7 @@ from django.core import serializers
|
||||
import simplejson
|
||||
from django.contrib import messages
|
||||
import datetime
|
||||
import operator
|
||||
|
||||
from RIGS import models, forms
|
||||
|
||||
@@ -253,27 +254,37 @@ class SecureAPIRequest(generic.View):
|
||||
# Supply data for autocomplete ajax request in json form
|
||||
term = request.GET.get('term', None)
|
||||
if term:
|
||||
if fields is None:
|
||||
if fields is None: # Default to just name
|
||||
fields = ['name']
|
||||
all_objects = self.models[model].objects
|
||||
results = []
|
||||
|
||||
# Build a list of Q objects for use later
|
||||
queries = []
|
||||
for part in term.split(" "):
|
||||
qs = []
|
||||
for field in fields:
|
||||
filter = field + "__icontains"
|
||||
objects = all_objects.filter(**{filter: term})
|
||||
q = Q(**{field + "__icontains": part})
|
||||
qs.append(q)
|
||||
queries.append(reduce(operator.or_, qs))
|
||||
|
||||
|
||||
# Build the data response list
|
||||
results = []
|
||||
query = reduce(operator.and_, queries)
|
||||
objects = self.models[model].objects.filter(query)
|
||||
for o in objects:
|
||||
data = {
|
||||
'pk': o.pk,
|
||||
'value': o.pk,
|
||||
'label': o.name,
|
||||
}
|
||||
|
||||
try: # See if there is an update url or don't bother with it otherwise
|
||||
try: # See if there is a valid update URL
|
||||
data['update'] = reverse("%s_update" % model, kwargs={'pk': o.pk})
|
||||
except NoReverseMatch:
|
||||
pass
|
||||
|
||||
results.append(data)
|
||||
json = simplejson.dumps(results[:20])
|
||||
|
||||
# return a data response
|
||||
json = simplejson.dumps(results)
|
||||
return HttpResponse(json, content_type="application/json") # Always json
|
||||
|
||||
start = request.GET.get('start', None)
|
||||
|
||||
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
@@ -13,6 +13,7 @@
|
||||
|
||||
<link rel="icon" type="image/png" href="/static/imgs/pyrigs-avatar.png">
|
||||
<link rel="apple-touch-icon" href="/static/imgs/pyrigs-avatar.png">
|
||||
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,700,300,400' rel='stylesheet' type='text/css'>
|
||||
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="{% static "css/screen.css" %}">
|
||||
|
||||
Reference in New Issue
Block a user