mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-25 17:32:16 +00:00
CHANGE: First pass at opening up RIGS #233
Whilst it makes it something of a misnomer, the intent is to make the 'view_event' perm a permission to view event details like client/price. I don't see the point in giving everyone 'view_event' and adding a new 'view_event_detail'...Open to arguments the other way.
This commit is contained in:
@@ -10,12 +10,14 @@
|
|||||||
| {{ object.name }} {% if event.dry_hire %}<span class="badge">Dry Hire</span>{% endif %}
|
| {{ object.name }} {% if event.dry_hire %}<span class="badge">Dry Hire</span>{% endif %}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
{% if perms.RIGS.view_event %}
|
||||||
<div class="col-sm-12 text-right">
|
<div class="col-sm-12 text-right">
|
||||||
{% include 'RIGS/event_detail_buttons.html' %}
|
{% include 'RIGS/event_detail_buttons.html' %}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if object.is_rig %}
|
{% if object.is_rig and perms.RIGS.view_event %}
|
||||||
{# only need contact details for a rig #}
|
{# only need contact details for a rig #}
|
||||||
<div class="col-sm-12 col-md-6 col-lg-5">
|
<div class="col-sm-12 col-md-6 col-lg-5">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
@@ -147,7 +149,7 @@
|
|||||||
<dd>{{ object.collector }}</dd>
|
<dd>{{ object.collector }}</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if event.is_rig and not event.internal %}
|
{% if event.is_rig and not event.internal and perms.RIGS.view_event %}
|
||||||
<dd> </dd>
|
<dd> </dd>
|
||||||
<dt>PO</dt>
|
<dt>PO</dt>
|
||||||
<dd>{{ object.purchase_order }}</dd>
|
<dd>{{ object.purchase_order }}</dd>
|
||||||
@@ -156,7 +158,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% if event.is_rig and event.internal %}
|
{% if event.is_rig and event.internal and perms.RIGS.view_event %}
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">Client Authorisation</div>
|
<div class="panel-heading">Client Authorisation</div>
|
||||||
@@ -204,7 +206,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if not request.is_ajax %}
|
{% if not request.is_ajax and perms.RIGS.view_event %}
|
||||||
<div class="col-sm-12 text-right">
|
<div class="col-sm-12 text-right">
|
||||||
{% include 'RIGS/event_detail_buttons.html' %}
|
{% include 'RIGS/event_detail_buttons.html' %}
|
||||||
</div>
|
</div>
|
||||||
@@ -214,15 +216,17 @@
|
|||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">Event Details</div>
|
<div class="panel-heading">Event Details</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
|
{% if perms.RIGS.view_event %}
|
||||||
<div class="well well-sm">
|
<div class="well well-sm">
|
||||||
<h4>Notes</h4>
|
<h4>Notes</h4>
|
||||||
{{ event.notes|linebreaksbr }}
|
{{ event.notes|linebreaksbr }}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% include 'RIGS/item_table.html' %}
|
{% include 'RIGS/item_table.html' %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% if not request.is_ajax %}
|
{% if not request.is_ajax and perms.RIGS.view_event %}
|
||||||
<div class="col-sm-12 text-right">
|
<div class="col-sm-12 text-right">
|
||||||
{% include 'RIGS/event_detail_buttons.html' %}
|
{% include 'RIGS/event_detail_buttons.html' %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<h4>
|
<h4>
|
||||||
<a {% if perms.RIGS.view_event %}href="{% url 'event_detail' event.pk %}" {% endif %}>
|
<a href="{% url 'event_detail' event.pk %}">
|
||||||
{{ event.name }}
|
{{ event.name }}
|
||||||
</a>
|
</a>
|
||||||
{% if event.venue %}
|
{% if event.venue %}
|
||||||
|
|||||||
@@ -6,17 +6,19 @@
|
|||||||
<em class="description">{{item.description|linebreaksbr}}</em>
|
<em class="description">{{item.description|linebreaksbr}}</em>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
{% if perms.RIGS.view_event %}
|
||||||
<td>£ <span class="cost">{{item.cost|floatformat:2}}</span></td>
|
<td>£ <span class="cost">{{item.cost|floatformat:2}}</span></td>
|
||||||
<td class="quantity">{{item.quantity}}</td>
|
<td class="quantity">{{item.quantity}}</td>
|
||||||
<td>£ <span class="sub-total" data-subtotal="{{item.total_cost}}">{{item.total_cost|floatformat:2}}</span></td>
|
<td>£ <span class="sub-total" data-subtotal="{{item.total_cost}}">{{item.total_cost|floatformat:2}}</span></td>
|
||||||
|
{% endif %}
|
||||||
{% if edit %}
|
{% if edit %}
|
||||||
<td class="vert-align text-right">
|
<td class="vert-align text-right">
|
||||||
<button type="button" class="item-edit btn btn-xs btn-default"
|
<button type="button" class="item-edit btn btn-xs btn-default"
|
||||||
data-pk="{{item.pk}}"
|
data-pk="{{item.pk}}"
|
||||||
data-toggle="modal" data-target="#itemModal">
|
data-toggle="modal" data-target="#itemModal">
|
||||||
<span class="glyphicon glyphicon-edit"></span>
|
<span class="glyphicon glyphicon-edit"></span>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="item-delete btn btn-xs btn-danger"
|
<button type="button" class="item-delete btn btn-xs btn-danger"
|
||||||
data-pk="{{item.pk}}">
|
data-pk="{{item.pk}}">
|
||||||
<span class="glyphicon glyphicon-remove"></span>
|
<span class="glyphicon glyphicon-remove"></span>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -3,9 +3,11 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Item</td>
|
<td>Item</td>
|
||||||
|
{% if perms.RIGS.view_event %}
|
||||||
<td>Price</td>
|
<td>Price</td>
|
||||||
<td>Quantity</td>
|
<td>Quantity</td>
|
||||||
<td>Sub-total</td>
|
<td>Sub-total</td>
|
||||||
|
{% endif %}
|
||||||
{% if edit %}
|
{% if edit %}
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
<button type="button" class="btn btn-default btn-xs item-add"
|
<button type="button" class="btn btn-default btn-xs item-add"
|
||||||
@@ -22,6 +24,7 @@
|
|||||||
{% include 'RIGS/item_row.html' %}
|
{% include 'RIGS/item_row.html' %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
{% if perms.RIGS.view_event %}
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<td rowspan="3" colspan="2"></td>
|
<td rowspan="3" colspan="2"></td>
|
||||||
@@ -43,6 +46,7 @@
|
|||||||
<td colspan="2">£ <span id="total">{{object.total|default:0|floatformat:2}}</span></td>
|
<td colspan="2">£ <span id="total">{{object.total|default:0|floatformat:2}}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
|
{% endif %}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<table class="hidden invisible">
|
<table class="hidden invisible">
|
||||||
|
|||||||
@@ -81,14 +81,13 @@ urlpatterns = [
|
|||||||
login_required()(rigboard.WebCalendar.as_view()), name='web_calendar'),
|
login_required()(rigboard.WebCalendar.as_view()), name='web_calendar'),
|
||||||
url(r'^rigboard/archive/$', RedirectView.as_view(permanent=True, pattern_name='event_archive')),
|
url(r'^rigboard/archive/$', RedirectView.as_view(permanent=True, pattern_name='event_archive')),
|
||||||
url(r'^rigboard/activity/$',
|
url(r'^rigboard/activity/$',
|
||||||
permission_required_with_403('RIGS.view_event')(versioning.ActivityTable.as_view()),
|
login_required()(versioning.ActivityTable.as_view()),
|
||||||
name='activity_table'),
|
name='activity_table'),
|
||||||
url(r'^rigboard/activity/feed/$',
|
url(r'^rigboard/activity/feed/$',
|
||||||
permission_required_with_403('RIGS.view_event')(versioning.ActivityFeed.as_view()),
|
login_required()(versioning.ActivityFeed.as_view()),
|
||||||
name='activity_feed'),
|
name='activity_feed'),
|
||||||
|
|
||||||
url(r'^event/(?P<pk>\d+)/$',
|
url(r'^event/(?P<pk>\d+)/$',(
|
||||||
permission_required_with_403('RIGS.view_event', oembed_view="event_oembed")(
|
|
||||||
rigboard.EventDetail.as_view()),
|
rigboard.EventDetail.as_view()),
|
||||||
name='event_detail'),
|
name='event_detail'),
|
||||||
url(r'^event/(?P<pk>\d+)/embed/$',
|
url(r'^event/(?P<pk>\d+)/embed/$',
|
||||||
@@ -117,7 +116,7 @@ urlpatterns = [
|
|||||||
name='event_archive'),
|
name='event_archive'),
|
||||||
|
|
||||||
url(r'^event/(?P<pk>\d+)/history/$',
|
url(r'^event/(?P<pk>\d+)/history/$',
|
||||||
permission_required_with_403('RIGS.view_event')(versioning.VersionHistory.as_view()),
|
login_required()(versioning.VersionHistory.as_view()),
|
||||||
name='event_history', kwargs={'model': models.Event}),
|
name='event_history', kwargs={'model': models.Event}),
|
||||||
|
|
||||||
# Finance
|
# Finance
|
||||||
|
|||||||
Reference in New Issue
Block a user