Browse Source

added order view

php2python
Holger Frey 7 years ago
parent
commit
7e601040b9
  1. 1
      ordr2/static/css/style.css
  2. 156
      ordr2/templates/orders/view.jinja2
  3. 9
      ordr2/views/orders.py

1
ordr2/static/css/style.css

@ -750,3 +750,4 @@ input.number { text-align:right; }
.moneyinput .amount { width:167px; text-align:right;} .moneyinput .amount { width:167px; text-align:right;}
.moneyinput .currency { width:30px; text-align:center;} .moneyinput .currency { width:30px; text-align:center;}
.controls .form-control-static { padding-top:5px; } .controls .form-control-static { padding-top:5px; }
.form-like-display.form-horizontal .control-group { margin-bottom:0px; }

156
ordr2/templates/orders/view.jinja2

@ -0,0 +1,156 @@
{% extends "ordr2:templates/layout.jinja2" %}
{% import 'ordr2:templates/macros.jinja2' as macros with context %}
{% block subtitle %} Order | View | {{ context.model.cas_desctiption }} {% endblock subtitle %}
{% block content %}
<div class="content controls">
<div class="container-fluid">
<div class="row-fluid">
<div class="page-controls">
<h1>
View Order: {{ context.model.cas_desctiption }}
</h1>
</div>
</div>
<div class="row edit-order">
<div class="span8 form-horizontal form-like-display">
<div class="controls">
<div class="panel panel-default">
<div class="panel-heading">
Order Information
</div>
<div class="panel-body">
<div class="control-group">
<label class="control-label"> Status </label>
<div class="controls">
{{ macros.colored_status(context.model.status) }}
</div>
</div>
<div class="control-group">
<label class="control-label"> Placed </label>
<div class="controls">
<p class="form-control-static">{{ context.model.placed }}</p>
</div>
</div>
<div class="control-group">
<label class="control-label"> Approved </label>
<div class="controls">
<p class="form-control-static">{{ context.model.approved }}</p>
</div>
</div>
<div class="control-group">
<label class="control-label"> Ordered </label>
<div class="controls">
<p class="form-control-static">{{ context.model.ordered }}</p>
</div>
</div>
<div class="control-group">
<label class="control-label"> Completed </label>
<div class="controls">
<p class="form-control-static">{{ context.model.completed }}</p>
</div>
</div>
</div>
</div>
</div>
<div class="controls">
<div class="panel panel-default">
<div class="panel-heading">
Item Information
</div>
<div class="panel-body">
<div class="control-group" >
<label class="control-label"> Cas Description </label>
<div class="controls">
<p class="form-control-static">{{ context.model.cas_description }}</p>
</div>
</div>
<div class="control-group" >
<label class="control-label"> Category </label>
<div class="controls">
<p class="form-control-static">{{ context.model.category.value|capitalize }}</p>
</div>
</div>
<div class="control-group" >
<label class="control-label"> Catalog Nr </label>
<div class="controls">
<p class="form-control-static">{{ context.model.catalog_nr }}</p>
</div>
</div>
<div class="control-group" >
<label class="control-label"> Vendor </label>
<div class="controls">
<p class="form-control-static">{{ context.model.vendor }}</p>
</div>
</div>
<div class="control-group" >
<label class="control-label"> Package Size </label>
<div class="controls">
<p class="form-control-static">{{ context.model.package_size }}</p>
</div>
</div>
</div>
</div>
</div>
<div class="controls">
<div class="panel panel-default">
<div class="panel-heading">
Pricing
</div>
<div class="panel-body">
<div class="control-group" >
<label class="control-label"> Unit Price </label>
<div class="controls">
<p class="form-control-static">{{ context.model.unit_price }} {{ context.model.currency }}</p>
</div>
</div>
<div class="control-group" >
<label class="control-label"> Quantity </label>
<div class="controls">
<p class="form-control-static">{{ context.model.amount }}</p>
</div>
</div>
<div class="control-group" >
<label class="control-label"> Total Price </label>
<div class="controls">
<p class="form-control-static">{{ context.model.total_price }} {{ context.model.currency }}</p>
</div>
</div>
</div>
</div>
</div>
<div class="controls">
<div class="panel panel-default">
<div class="panel-heading">
Optional Information
</div>
<div class="panel-body">
<div class="control-group" >
<label class="control-label "> Account </label>
<div class="controls">
<p class="form-control-static">{{ context.model.account }}</p>
</div>
</div>
<div class="control-group" >
<label class="control-label "> Comment </label>
<div class="controls">
<p class="form-control-static">{{ context.model.comment.replace('\n', '<br>') }}</p>
</div>
</div>
</div>
</div>
</div>
<div class="form-actions deform-form-buttons">
<a href="{{ request.resource_url(context.__parent__, 'new', query={'reorder':context.model.id}) }}" class="btn btn-success"> Reorder </a>
<a href="{{ context.__parent__.url() }}" class="btn btn-default"> cancel </a>
</div>
</div>
</div>
</div>
</div>
{% endblock content %}

9
ordr2/views/orders.py

@ -166,6 +166,15 @@ def order_delete_form_processing(context, request):
# single order processing # single order processing
@view_config(
context='ordr2:resources.OrderResource',
permission='view',
request_method='GET',
renderer='ordr2:templates/orders/view.jinja2'
)
def order_view(context, request):
return {}
@view_config( @view_config(
context='ordr2:resources.OrderResource', context='ordr2:resources.OrderResource',
name='delete', name='delete',