- Creation of order-edit view

This commit is contained in:
mespeche
2013-09-12 12:40:46 +02:00
parent 1f7d8a20b3
commit c64b987e9b
5 changed files with 478 additions and 4 deletions

View File

@@ -50,6 +50,11 @@
<default key="_controller">Thelia\Controller\Admin\OrderController::indexAction</default> <default key="_controller">Thelia\Controller\Admin\OrderController::indexAction</default>
</route> </route>
<route id="admin.order.update.view" path="/admin/order/update/{order_id}">
<default key="_controller">Thelia\Controller\Admin\OrderController::viewAction</default>
<requirement key="order_id">\d+</requirement>
</route>
<!-- end Customer rule management --> <!-- end Customer rule management -->
<!-- Categories management --> <!-- Categories management -->

View File

@@ -36,4 +36,12 @@ class OrderController extends BaseAdminController
return $this->render("orders", array("display_order" => 20)); return $this->render("orders", array("display_order" => 20));
} }
public function viewAction($order_id)
{
return $this->render("order-edit", array(
"order_id" => $order_id
));
}
} }

View File

@@ -208,6 +208,16 @@
} }
} }
.tab-pane{
caption, .title{
margin-top: 0.5em;
.btn{
text-transform: none;
}
}
}
// The overall form container // The overall form container
.form-container { .form-container {

View File

@@ -0,0 +1,451 @@
{extends file="admin-layout.tpl"}
{block name="page-title"}{intl l='Edit an order'}{/block}
{block name="check-permissions"}admin.order.edit{/block}
{block name="main-content"}
<div class="orders edit-order">
<div id="wrapper" class="container">
<ul class="breadcrumb">
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
<li><a href="{url path='/admin/orders'}">{intl l="Orders"}</a></li>
</ul>
<div class="row">
<div class="col-md-12">
<div class="general-block-decorator">
<ul class="nav nav-tabs">
<li class="active"><a href="#cart" data-toggle="tab"><span class="glyphicon glyphicon-shopping-cart"></span> {intl l="Cart"}</a></li>
<li><a href="#bill" data-toggle="tab"><span class="glyphicon glyphicon-list-alt"></span> {intl l="Bill"}</a></li>
<li><a href="#carriage" data-toggle="tab"><span class="glyphicon glyphicon-send"></span> {intl l="Carriage"}</a></li>
<li><a href="#settlement" data-toggle="tab"><span class="glyphicon glyphicon-credit-card"></span> {intl l="Settlement"}</a></li>
<li><a href="#address" data-toggle="tab"><span class="glyphicon glyphicon-home"></span> {intl l="Address"}</a></li>
<li><a href="#supplements" data-toggle="tab"><span class="glyphicon glyphicon-info-sign"></span> {intl l="Further information"}</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane fade active in" id="cart">
<table class="table table-striped table-condensed table-left-aligned">
<caption class="clearfix">
{intl l='Information about order 01201303540354'}
</caption>
<thead>
<tr>
<th>{intl l="Designation"}</th>
<th>{intl l="Price"}</th>
<th>{intl l="Quantity"}</th>
<th>{intl l="Total"}</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#">T-Shirt F T1</a></td>
<td>20.00 &euro;</td>
<td>3</td>
<td>60.00 &euro;</td>
</tr>
<tr>
<td><a href="#">T-Shirt F T1</a></td>
<td>20.00 &euro;</td>
<td>3</td>
<td>60.00 &euro;</td>
</tr>
<tr>
<td><a href="#">T-Shirt F T1</a></td>
<td>20.00 &euro;</td>
<td>3</td>
<td>60.00 &euro;</td>
</tr>
</tbody>
<tfoot>
<tr class="active">
<td colspan="3"><strong>Total</strong></td>
<td><strong>180.00 &euro;</strong></td>
</tr>
</tfoot>
</table>
</div> <!-- #cart -->
<div class="tab-pane fade" id="bill">
<table class="table table-striped table-condensed table-left-aligned">
<caption>
{intl l='Information about the bill'}
</caption>
<thead>
<tr>
<th>{intl l="Bill n°"}</th>
<th>{intl l="Compagny"}</th>
<th>{intl l="Firstname & Lastname"}</th>
<th>{intl l="Date & Hour"}</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#">0001</a></td>
<td>Thelia</td>
<td>Dupont Jean</td>
<td>11/01/2013 14:11:00</td>
</tr>
</tbody>
</table>
</div> <!-- #bill -->
<div class="tab-pane fade" id="carriage">
<p class="title title-without-tabs clearfix">
{intl l='Information about the carriage'}
<a class="btn btn-default btn-primary pull-right" title="{intl l='Download pdf bill'}" href="#">
<span class="glyphicon glyphicon-cloud-download"></span> {intl l='Download pdf bill'}
</a>
</p>
<dl class="dl-horizontal">
<dt>{intl l="Mode of transportation"}</dt>
<dd>Colissimo</dd>
</dl>
<dl class="dl-horizontal">
<dt>{intl l="Description"}</dt>
<dd>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, error, necessitatibus ipsam dolores ad quisquam provident sed repudiandae ullam quasi quae perferendis numquam voluptates doloribus laborum possimus dicta similique in?</dd>
</dl>
</div> <!-- #carriage -->
<div class="tab-pane fade" id="settlement">
<table class="table table-striped table-condensed table-left-aligned">
<caption class="clearfix">
{intl l='Information about the settlement'}
</caption>
<tbody>
<tr>
<th>{intl l="Type of payment"}</th>
<td>Unknown</td>
</tr>
<tr>
<th>{intl l="Transaction reference"}</th>
<td>141100</td>
</tr>
<tr>
<th>{intl l="Total order before discount"}</th>
<td>60 &euro;</td>
</tr>
<tr>
<th>{intl l="Discount"}</th>
<td>10%</td>
</tr>
<tr>
<th>{intl l="Coupon code"}</th>
<td></td>
</tr>
<tr>
<th>{intl l="Total with discount"}</th>
<td>50 &euro;</td>
</tr>
<tr>
<th>{intl l="Freight"}</th>
<td>6 &euro;</td>
</tr>
<tr>
<th>{intl l="Total"}</th>
<td>56 &euro;</td>
</tr>
</tbody>
</table>
</div> <!-- #settlement -->
<div class="tab-pane fade clearfix" id="address">
<div class="col-md-6">
<table class="table table-striped table-condensed table-left-aligned">
<caption class="clearfix">
{intl l='Billing address'}
<a class="btn btn-default btn-primary pull-right" title="{intl l='Edit this billing address'}" href="#edit_address_dialog" data-toggle="modal">
<span class="glyphicon glyphicon-edit"></span>
</a>
</caption>
<tbody>
<tr>
<th>{intl l="Title"}</th>
<td>Mr</td>
</tr>
<tr>
<th>{intl l="Compagny"}</th>
<td>Thelia</td>
</tr>
<tr>
<th>{intl l="Firstname"}</th>
<td>Espeche</td>
</tr>
<tr>
<th>{intl l="Lastname"}</th>
<td>Michaël</td>
</tr>
<tr>
<th>{intl l="Street address"}</th>
<td>5, rue Rochon</td>
</tr>
<tr>
<th>{intl l="Additional address"}</th>
<td>Lorem ipsum dolor sit amet</td>
</tr>
<tr>
<th>{intl l="Additional address"}</th>
<td>Lorem ipsum dolor sit</td>
</tr>
<tr>
<th>{intl l="Zip code"}</th>
<td>63000</td>
</tr>
<tr>
<th>{intl l="City"}</th>
<td>Clermont-Fd</td>
</tr>
<tr>
<th>{intl l="Country"}</th>
<td>France</td>
</tr>
<tr>
<th>{intl l="Phone"}</th>
<td>01 02 03 04 05</td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-6">
<table class="table table-striped table-condensed table-left-aligned">
<caption class="clearfix">
{intl l='Delivery address'}
<a class="btn btn-default btn-primary pull-right" title="{intl l='Edit this delivery address'}" href="#edit_address_dialog" data-toggle="modal">
<span class="glyphicon glyphicon-edit"></span>
</a>
</caption>
<tbody>
<tr>
<th>{intl l="Title"}</th>
<td>Mr</td>
</tr>
<tr>
<th>{intl l="Compagny"}</th>
<td>Thelia</td>
</tr>
<tr>
<th>{intl l="Firstname"}</th>
<td>Espeche</td>
</tr>
<tr>
<th>{intl l="Lastname"}</th>
<td>Michaël</td>
</tr>
<tr>
<th>{intl l="Street address"}</th>
<td>5, rue Rochon</td>
</tr>
<tr>
<th>{intl l="Additional address"}</th>
<td>Lorem ipsum dolor sit amet</td>
</tr>
<tr>
<th>{intl l="Additional address"}</th>
<td>Lorem ipsum dolor sit</td>
</tr>
<tr>
<th>{intl l="Zip code"}</th>
<td>63000</td>
</tr>
<tr>
<th>{intl l="City"}</th>
<td>Clermont-Fd</td>
</tr>
<tr>
<th>{intl l="Country"}</th>
<td>France</td>
</tr>
<tr>
<th>{intl l="Phone"}</th>
<td>01 02 03 04 05</td>
</tr>
</tbody>
</table>
</div>
</div> <!-- #address -->
<div class="tab-pane fade clearfix" id="supplements">
<table class="table table-striped table-condensed table-left-aligned">
<caption>
{intl l='Further information'}
</caption>
<tbody>
<tr>
<th><label for="">{intl l='Status'}</label></th>
<td>
<form action="" method="">
<div class="row">
<div class="col-lg-4">
<select name="" id="" class="form-control">
<option value="">Status 1</option>
<option value="">Status 2</option>
<option value="">Status 3</option>
</select>
</div>
</div>
</form>
</td>
</tr>
<tr>
<th><label for="">{intl l='Order Tracking'}</label></th>
<td>
<form action="" method="">
<div class="row">
<div class="col-lg-4">
<input type="text" id="" name="" class="form-control" value="" title="" placeholder="">
</div>
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-ok"></span></button>
</div>
</form>
</td>
</tr>
<tr>
<th>{intl l='Bill'}</th>
<td><a href="#" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-cloud-download"></span> {intl l='Download bill to pdf'}</a></td>
</tr>
<tr>
<th>{intl l='Delivery'}</th>
<td><a href="#" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-cloud-download"></span> {intl l='Download delivery to pdf'}</a></td>
</tr>
</tbody>
</table>
</div> <!-- #supplements -->
</div>
</div>
</div>
</div>
</div>
</div>
{* Update an Address *}
{form name="thelia.address.update"}
{* Capture the dialog body, to pass it to the generic dialog *}
{capture "edit_address_dialog"}
{form_hidden_fields form=$form}
{form_field form=$form field='label'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Label'}">
</div>
{/form_field}
{form_field form=$form field='company'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Company'}">
</div>
{/form_field}
{form_field form=$form field='title'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<select name="{$name}" id="{$label_attr.for}" class="form-control">
{loop type="title" name="title1"}
<option value="{$ID}">{$LONG}</option>
{/loop}
</select>
</div>
{/form_field}
{form_field form=$form field='firstname'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Firstname'}">
</div>
{/form_field}
{form_field form=$form field='lastname'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Lastname'}">
</div>
{/form_field}
{form_field form=$form field='address1'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Address'}">
</div>
<div class="form-group">
{form_field form=$form field='address2'}
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Additional address'}">
{/form_field}
</div>
<div class="form-group">
{form_field form=$form field='address3'}
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Additional address'}">
{/form_field}
</div>
{/form_field}
{form_field form=$form field='zipcode'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Zip code'}">
</div>
{/form_field}
{form_field form=$form field='city'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='City'}">
</div>
{/form_field}
{form_field form=$form field='country'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<select name="{$name}" id="{$label_attr.for}" class="form-control">
{loop type="country" name="country1"}
<option value="{$ID}">{$TITLE}</option>
{/loop}
</select>
</div>
{/form_field}
{/capture}
{include
file = "includes/generic-create-dialog.html"
dialog_id = "edit_address_dialog"
dialog_title = {intl l="Edit an address"}
dialog_body = {$smarty.capture.edit_address_dialog nofilter}
dialog_ok_label = {intl l="Edit this address"}
dialog_cancel_label = {intl l="Cancel"}
form_action = {url path='/admin/address/update'}
form_enctype = {form_enctype form=$form}
form_error_message = $form_error_message
}
{/form}
{/block}

View File

@@ -60,7 +60,7 @@
<div class="btn-group"> <div class="btn-group">
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.orders.edit"} {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.orders.edit"}
<a class="btn btn-default btn-xs" title="{intl l='Edit this order'}" href="{url path='/admin/orders/update/$ID'}"><span class="glyphicon glyphicon-edit"></span></a> <a class="btn btn-default btn-xs" title="{intl l='Edit this order'}" href="{url path='/admin/order/update/$ID'}"><span class="glyphicon glyphicon-edit"></span></a>
{/loop} {/loop}
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.orders.delete"} {loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.orders.delete"}
@@ -84,7 +84,7 @@
<div class="btn-group"> <div class="btn-group">
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.orders.edit"} {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.orders.edit"}
<a class="btn btn-default btn-xs" title="{intl l='Edit this order'}" href="{url path='/admin/orders/update/$ID'}"><span class="glyphicon glyphicon-edit"></span></a> <a class="btn btn-default btn-xs" title="{intl l='Edit this order'}" href="{url path='/admin/order/update/$ID'}"><span class="glyphicon glyphicon-edit"></span></a>
{/loop} {/loop}
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.orders.delete"} {loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.orders.delete"}
@@ -108,7 +108,7 @@
<div class="btn-group"> <div class="btn-group">
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.orders.edit"} {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.orders.edit"}
<a class="btn btn-default btn-xs" title="{intl l='Edit this order'}" href="{url path='/admin/orders/update/$ID'}"><span class="glyphicon glyphicon-edit"></span></a> <a class="btn btn-default btn-xs" title="{intl l='Edit this order'}" href="{url path='/admin/order/update/$ID'}"><span class="glyphicon glyphicon-edit"></span></a>
{/loop} {/loop}
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.orders.delete"} {loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.orders.delete"}