Setting Taxes rules management default view

This commit is contained in:
mespeche
2013-09-24 13:12:52 +02:00
parent cf8af9c1bb
commit b0a357d222
4 changed files with 144 additions and 0 deletions

View File

@@ -551,6 +551,14 @@
<default key="_controller">Thelia\Controller\Admin\AdminProfileController::defaultAction</default>
</route>
<!-- end admin profiles management -->
<!-- taxe rules management -->
<route id="admin.configuration.taxes-rules.default" path="/admin/configuration/taxes_rules">
<default key="_controller">Thelia\Controller\Admin\TaxRuleController::defaultAction</default>
</route>
<!-- end admin profiles management -->

View File

@@ -0,0 +1,39 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
namespace Thelia\Controller\Admin;
/**
* Class TaxRuleController
* @package Thelia\Controller\Admin
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class TaxRuleController extends BaseAdminController
{
public function defaultAction()
{
if (null !== $response = $this->checkAuth("admin.taxes-rules.view")) return $response;
return $this->render("taxes-rules", array("display_taxes_rules" => 20));
}
}

View File

@@ -58,6 +58,13 @@
</tr>
{/loop}
{loop type="auth" name="pcc6" roles="ADMIN" permissions="admin.configuration.taxe-rules"}
<tr>
<td><a href="{url path='/admin/configuration/taxes_rules'}">{intl l='Taxes rules'}</a></td>
<td><a class="btn btn-default btn-xs" href="{url path='/admin/configuration/taxes_rules'}"><i class="glyphicon glyphicon-edit"></i></a></td>
</tr>
{/loop}
{module_include location='catalog_configuration_bottom'}
</table>
</div>

View File

@@ -0,0 +1,90 @@
{extends file="admin-layout.tpl"}
{block name="page-title"}{intl l='Taxes rules'}{/block}
{block name="check-permissions"}admin.taxes-rules.view{/block}
{block name="main-content"}
<div class="taxes-rules">
<div id="wrapper" class="container">
<div class="clearfix">
<ul class="breadcrumb">
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
<li><a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a></li>
<li><a href="{url path='/admin/configuration/taxes_rules'}">{intl l="Taxes rules"}</a></li>
</ul>
</div>
{module_include location='taxes_rules_top'}
<div class="row">
<div class="col-md-12">
<div class="general-block-decorator">
<div class="table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<caption class="clearfix">
{intl l="Taxes rules"}
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.taxes-rules.create"}
<a class="btn btn-default btn-primary pull-right" title="{intl l='Create a new tax rule'}" href="#creation_dialog" data-toggle="modal">
<span class="glyphicon glyphicon-plus"></span>
</a>
{/loop}
</caption>
<thead>
<tr>
<th>{intl l="Name"}</th>
<th>{intl l="Description"}</th>
<th>{intl l="Actions"}</th>
</tr>
</thead>
<tbody>
<tr>
<td>Eco taxe</td>
<td>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequatur, aperiam, voluptatibus odio numquam adipisci!</td>
<td>
<div class="btn-group">
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.taxes-rules.change"}
<a class="btn btn-default btn-xs" title="{intl l='Change this tax rule'}" href="{url path="/admin/configuration/taxes_rules/update/{$ID}"}"><span class="glyphicon glyphicon-edit"></span></a>
{/loop}
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.taxes-rules.delete"}
<a class="btn btn-default btn-xs" title="{intl l='Delete this tax rule'}" href="#tax_rule_delete_dialog" data-id="{$ID}" data-toggle="modal"><span class="glyphicon glyphicon-trash"></span></a>
{/loop}
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
{module_include location='taxes_rules_bottom'}
</div>
</div>
{* -- Delete category confirmation dialog ----------------------------------- *}
{capture "tax_rule_delete_dialog"}
<input type="hidden" name="tax_rule_id" id="tax_rule_delete_id" value="" />
{module_include location='tax_rule_delete_form'}
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "tax_rule_delete_dialog"
dialog_title = {intl l="Delete tax rule"}
dialog_message = {intl l="Do you really want to delete this tax rule ?"}
form_action = {url path='/admin/configuration/taxes_rules/delete'}
form_content = {$smarty.capture.tax_rule_delete_dialog nofilter}
}
{/block}