mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-25 09:22:21 +00:00
Merge conflict from master
This commit is contained in:
111
RIGS/templates/RIGS/calendar.html
Normal file
111
RIGS/templates/RIGS/calendar.html
Normal file
@@ -0,0 +1,111 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load static %}
|
||||
|
||||
|
||||
{% block title %}Calendar{% endblock %}
|
||||
|
||||
{% block css %}
|
||||
<link href="{% static "css/fullcalendar.css" %}" rel='stylesheet' />
|
||||
<link href="{% static "css/fullcalendar.print.css" %}" rel='stylesheet' media='print' />
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
{# <script src="//code.jquery.com/jquery-latest.min.js"></script> #}
|
||||
<script src="{% static "js/moment.min.js" %}"></script>
|
||||
<script src="{% static "js/fullcalendar.js" %}"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#calendar').fullCalendar({
|
||||
//defaultDate: '2015-02-12',
|
||||
editable: false,
|
||||
eventLimit: true, // allow "more" link when too many events
|
||||
firstDay: 1,
|
||||
aspectRatio: 1.5,
|
||||
timeFormat: 'HH:mm',
|
||||
views: {
|
||||
basic: {
|
||||
// options apply to basicWeek and basicDay views
|
||||
},
|
||||
agenda: {
|
||||
// options apply to agendaWeek and agendaDay views
|
||||
},
|
||||
week: {
|
||||
columnFormat:'ddd D/M'
|
||||
},
|
||||
day: {
|
||||
// options apply to basicDay and agendaDay views
|
||||
}
|
||||
},
|
||||
buttonText:{
|
||||
today: 'Today',
|
||||
month: 'Month',
|
||||
week: 'Week',
|
||||
day: 'Day'
|
||||
},
|
||||
header:{
|
||||
left: 'title',
|
||||
center: '',
|
||||
right: 'today prev,next month,agendaWeek,agendaDay'
|
||||
},
|
||||
events: function(start_moment, end_moment, timezone, callback) {
|
||||
|
||||
$.ajax({
|
||||
url: '/api/event',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
start: moment(start_moment).format("YYYY-MM-DD[T]HH:mm:ss[Z]"),
|
||||
end: moment(end_moment).format("YYYY-MM-DD[T]HH:mm:ss[Z]")
|
||||
},
|
||||
success: function(doc) {
|
||||
var events = [];
|
||||
var colours =
|
||||
$(doc).each(function() {
|
||||
thisEvent = [];
|
||||
colours = {'Provisional': 'orange',
|
||||
'Confirmed': 'green' ,
|
||||
'Booked': 'green' ,
|
||||
'Cancelled': 'grey'
|
||||
};
|
||||
|
||||
thisEvent['start'] = $(this).attr('start_date');
|
||||
if ($(this).attr('start_time')) {
|
||||
thisEvent['start'] += 'T' + $(this).attr('start_time');
|
||||
|
||||
}
|
||||
|
||||
if ($(this).attr('end_date')) {
|
||||
thisEvent['end'] = $(this).attr('end_date');
|
||||
if ($(this).attr('end_time')) {
|
||||
thisEvent['end'] += 'T' + $(this).attr('end_time');
|
||||
}
|
||||
}
|
||||
thisEvent['className'] = 'modal-href';
|
||||
|
||||
thisEvent['title'] = $(this).attr('title');
|
||||
|
||||
thisEvent['color'] = colours[$(this).attr('status')];
|
||||
|
||||
thisEvent['url'] = $(this).attr('url');
|
||||
|
||||
events.push(thisEvent);
|
||||
});
|
||||
callback(events);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div style="col-sm-12">
|
||||
<div id='calendar'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,18 +1,27 @@
|
||||
{% extends 'base.html' %}
|
||||
{% 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 buttons %}
|
||||
{% if not request.is_ajax %}
|
||||
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
{% if not request.is_ajax %}
|
||||
<div class="col-sm-12">
|
||||
<div class="col-sm-8">
|
||||
<h1>Event {% if object.is_rig %}N{{ object.pk|stringformat:"05d" }}{% else %}{{ object.pk }}{% endif %}</h1>
|
||||
</div>
|
||||
<div class="col-sm-4 text-right">
|
||||
<div class="col-sm-12 text-right">
|
||||
<div class="btn-group btn-page">
|
||||
<a href="{% url 'event_update' event.pk %}" class="btn btn-default"><span
|
||||
class="glyphicon glyphicon-edit"></span></a>
|
||||
{% if event.is_rig %}
|
||||
<a href="{% url 'event_print' event.pk %}" class="btn btn-default"><span
|
||||
<a href="{% url 'event_print' event.pk %}" target="_blank" class="btn btn-default"><span
|
||||
class="glyphicon glyphicon-print"></span></a>
|
||||
{% endif %}
|
||||
<a href="{% url 'event_duplicate' event.pk %}" class="btn btn-default" title="Duplicate Rig"><span
|
||||
@@ -26,7 +35,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
{% if object.is_rig %}
|
||||
{# only need contact details for a rig #}
|
||||
<div class="col-sm-12 col-md-6 col-lg-5">
|
||||
@@ -154,12 +163,13 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if not request.is_ajax %}
|
||||
<div class="col-sm-12 text-right">
|
||||
<div class="btn-group btn-page">
|
||||
<a href="{% url 'event_update' event.pk %}" class="btn btn-default"><span
|
||||
class="glyphicon glyphicon-edit"></span></a>
|
||||
{% if event.is_rig %}
|
||||
<a href="{% url 'event_print' event.pk %}" class="btn btn-default"><span
|
||||
<a href="{% url 'event_print' event.pk %}" target="_blank" class="btn btn-default"><span
|
||||
class="glyphicon glyphicon-print"></span></a>
|
||||
{% endif %}
|
||||
<a href="{% url 'event_duplicate' event.pk %}" class="btn btn-default" title="Duplicate Rig"><span
|
||||
@@ -172,6 +182,7 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if event.is_rig %}
|
||||
<div class="col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
@@ -185,22 +196,50 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if not request.is_ajax %}
|
||||
<div class="col-sm-12 text-right">
|
||||
<div class="btn-group btn-page">
|
||||
<a href="{% url 'event_update' event.pk %}" class="btn btn-default"><span
|
||||
class="glyphicon glyphicon-edit"></span></a>
|
||||
<a href="{% url 'event_print' event.pk %}" class="btn btn-default"><span
|
||||
<<<<<<< HEAD
|
||||
{% if event.is_rig %}
|
||||
<a href="{% url 'event_print' event.pk %}" class="btn btn-default"><span
|
||||
class="glyphicon glyphicon-print"></span></a>
|
||||
{% endif %}
|
||||
=======
|
||||
<a href="{% url 'event_print' event.pk %}" target="_blank" class="btn btn-default"><span
|
||||
class="glyphicon glyphicon-print"></span></a>
|
||||
>>>>>>> master
|
||||
<a href="{% url 'event_duplicate' event.pk %}" class="btn btn-default" title="Duplicate Rig"><span
|
||||
class="glyphicon glyphicon-duplicate"></span></a>
|
||||
{% if perms.RIGS.add_invoice %}
|
||||
<a href="{% url 'invoice_event' event.pk %}" class="btn btn-default" title="Invoice Rig"><span
|
||||
class="glyphicon glyphicon-gbp"></span></a>
|
||||
{% if event.is_rig %}
|
||||
{% if perms.RIGS.add_invoice %}
|
||||
<a href="{% url 'invoice_event' event.pk %}" class="btn btn-default" title="Invoice Rig"><span
|
||||
class="glyphicon glyphicon-gbp"></span></a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div>Last edited at {{ object.last_edited_at|date:"SHORT_DATETIME_FORMAT" }}
|
||||
by {{ object.last_edited_by.name }}.
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% if request.is_ajax %}
|
||||
{% block footer %}
|
||||
<div class="row">
|
||||
<div class="col-sm-10 align-left">
|
||||
Lasted edited at {{ object.last_edited_at|date:"SHORT_DATE_FORMAT" }} by {{ object.last_edited_by.name }}
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<div class="pull-right">
|
||||
<a href="{% url 'event_detail' object.pk %}" class="btn btn-primary">Open Event Page <span
|
||||
class="glyphicon glyphicon-eye"></span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endif %}
|
||||
|
||||
@@ -53,8 +53,8 @@
|
||||
<img src="{{ object.mic.profile_picture }}" class="event-mic-photo"/>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<a href="{% url 'invoice_event' object.pk %}" class="btn btn-default">
|
||||
<span class="glyphicon glyphicon-pencil"></span>
|
||||
<a href="{% url 'invoice_event' object.pk %}" target="_blank" class="btn btn-default">
|
||||
<span class="glyphicon glyphicon-gbp"></span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td rowspan="3" colspan="2"></td>
|
||||
<td>Sum Total</td>
|
||||
<td>Total (ex. VAT)</td>
|
||||
<td colspan="2">£ <span id="sumtotal">{{object.sum_total|default:0|floatformat:2}}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -3,17 +3,23 @@
|
||||
{% block title %}RIGS Profile {{object.pk}}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-sm-10 col-sm-offset-1">
|
||||
<div class="col-sm-10">
|
||||
<div class="col-md-10 col-md-offset-1">
|
||||
|
||||
<div class="col-sm-12">
|
||||
|
||||
<div class="col-sm-6">
|
||||
<h3>{{object.name}}</h3>
|
||||
</div>
|
||||
{% if object.pk == user.pk %}
|
||||
<div class="col-sm-2">
|
||||
<div class="pull-right">
|
||||
<a href="{% url 'profile_update_self' %}" class="btn btn-primary">
|
||||
Edit <span class="glyphicon glyphicon-pencil"></span>
|
||||
<div class="col-sm-6 text-right">
|
||||
<div class="btn-group btn-page">
|
||||
<a href="{% url 'profile_update_self' %}" class="btn btn-default">
|
||||
Edit Profile <span class="glyphicon glyphicon-pencil"></span>
|
||||
</a>
|
||||
</div>
|
||||
<a href="{% url 'password_change' %}" class="btn btn-default">
|
||||
Change Password <span class="glyphicon glyphicon-lock"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="col-sm-8 ">
|
||||
|
||||
Reference in New Issue
Block a user