Started category modification
This commit is contained in:
@@ -37,6 +37,7 @@ use Thelia\Model\Lang;
|
|||||||
use Thelia\Core\Translation\Translator;
|
use Thelia\Core\Translation\Translator;
|
||||||
use Thelia\Core\Event\CategoryUpdatePositionEvent;
|
use Thelia\Core\Event\CategoryUpdatePositionEvent;
|
||||||
use Thelia\Model\CategoryQuery;
|
use Thelia\Model\CategoryQuery;
|
||||||
|
use Thelia\Form\CategoryModificationForm;
|
||||||
|
|
||||||
class CategoryController extends BaseAdminController
|
class CategoryController extends BaseAdminController
|
||||||
{
|
{
|
||||||
@@ -46,13 +47,10 @@ class CategoryController extends BaseAdminController
|
|||||||
* @return Symfony\Component\HttpFoundation\Response the response
|
* @return Symfony\Component\HttpFoundation\Response the response
|
||||||
*/
|
*/
|
||||||
protected function renderList() {
|
protected function renderList() {
|
||||||
|
return $this->render('categories', $this->getTemplateArgs());
|
||||||
$args = $this->setupArgs();
|
|
||||||
|
|
||||||
return $this->render('categories', $args);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setupArgs() {
|
protected function getTemplateArgs() {
|
||||||
|
|
||||||
// Get the category ID
|
// Get the category ID
|
||||||
$category_id = $this->getRequest()->get('category_id', 0);
|
$category_id = $this->getRequest()->get('category_id', 0);
|
||||||
@@ -164,8 +162,14 @@ class CategoryController extends BaseAdminController
|
|||||||
// Prepare the data that will hydrate the form
|
// Prepare the data that will hydrate the form
|
||||||
$data = array(
|
$data = array(
|
||||||
'id' => $category->getId(),
|
'id' => $category->getId(),
|
||||||
'name' => $category->getTitle(),
|
|
||||||
'locale' => $category->getLocale(),
|
'locale' => $category->getLocale(),
|
||||||
|
'title' => $category->getTitle(),
|
||||||
|
'chapo' => $category->getChapo(),
|
||||||
|
'description' => $category->getDescription(),
|
||||||
|
'postscriptum' => $category->getPostscriptum(),
|
||||||
|
'parent' => $category->getParent(),
|
||||||
|
'visible' => $category->getVisible() ? true : false,
|
||||||
|
'url' => $category->getUrl($this->getCurrentEditionLocale())
|
||||||
// tbc !!!
|
// tbc !!!
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -177,7 +181,7 @@ class CategoryController extends BaseAdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Render the edition template.
|
// Render the edition template.
|
||||||
return $this->render('category-edit', array('category_id' => $this->getRequest()->get('category_id')));
|
return $this->render('category-edit', $this->getTemplateArgs());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ class AsseticHelper
|
|||||||
//
|
//
|
||||||
// before generating 3bc974a-ad3ef47.css, delete 3bc974a-* files.
|
// before generating 3bc974a-ad3ef47.css, delete 3bc974a-* files.
|
||||||
//
|
//
|
||||||
if (/*$dev_mode == true || */! file_exists($target_file)) {
|
if ($dev_mode == true || ! file_exists($target_file)) {
|
||||||
|
|
||||||
// Delete previous version of the file
|
// Delete previous version of the file
|
||||||
list($commonPart, $dummy) = explode('-', $asset_target_path);
|
list($commonPart, $dummy) = explode('-', $asset_target_path);
|
||||||
|
|||||||
@@ -23,51 +23,33 @@
|
|||||||
namespace Thelia\Form;
|
namespace Thelia\Form;
|
||||||
|
|
||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
|
use Thelia\Model\LangQuery;
|
||||||
|
use Propel\Runtime\ActiveQuery\Criteria;
|
||||||
|
use Symfony\Component\Validator\Constraints\GreaterThan;
|
||||||
|
use Thelia\Core\Translation\Translator;
|
||||||
|
|
||||||
/**
|
class CategoryModificationForm extends CategoryCreationForm
|
||||||
* A base form for all objects with standard contents.
|
|
||||||
*
|
|
||||||
* @author Franck Allimant <franck@cqfdev.fr>
|
|
||||||
*/
|
|
||||||
abstract class BaseDescForm extends BaseForm
|
|
||||||
{
|
{
|
||||||
|
use StandardDescriptionFieldsTrait;
|
||||||
|
|
||||||
protected function buildForm()
|
protected function buildForm()
|
||||||
{
|
{
|
||||||
|
parent::buildForm(true);
|
||||||
|
|
||||||
$this->formBuilder
|
$this->formBuilder
|
||||||
->add("locale", "hidden", array(
|
->add("id", "hidden", array("constraints" => array(new GreaterThan(array('value' => 0)))))
|
||||||
"constraints" => array(
|
|
||||||
new NotBlank()
|
->add("visible", "checkbox", array(
|
||||||
)
|
"label" => Translator::getInstance()->trans("This category is online on the front office.")
|
||||||
)
|
|
||||||
)
|
|
||||||
->add("title", "text", array(
|
|
||||||
"constraints" => array(
|
|
||||||
new NotBlank()
|
|
||||||
),
|
|
||||||
"label" => "Title",
|
|
||||||
"label_attr" => array(
|
|
||||||
"for" => "title"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
->add("chapo", "text", array(
|
|
||||||
"label" => "Summary",
|
|
||||||
"label_attr" => array(
|
|
||||||
"for" => "summary"
|
|
||||||
)
|
|
||||||
))
|
|
||||||
->add("description", "text", array(
|
|
||||||
"label" => "Detailed description",
|
|
||||||
"label_attr" => array(
|
|
||||||
"for" => "detailed_description"
|
|
||||||
)
|
|
||||||
))
|
|
||||||
->add("postscriptum", "text", array(
|
|
||||||
"label" => "Conclusion",
|
|
||||||
"label_attr" => array(
|
|
||||||
"for" => "conclusion"
|
|
||||||
)
|
|
||||||
))
|
))
|
||||||
;
|
;
|
||||||
}
|
|
||||||
|
// Add standard description fields
|
||||||
|
$this->addStandardDescFields(array('title', 'locale'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getName()
|
||||||
|
{
|
||||||
|
return "thelia_category_modification";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -27,12 +27,12 @@ use Thelia\Model\LangQuery;
|
|||||||
use Propel\Runtime\ActiveQuery\Criteria;
|
use Propel\Runtime\ActiveQuery\Criteria;
|
||||||
use Symfony\Component\Validator\Constraints\GreaterThan;
|
use Symfony\Component\Validator\Constraints\GreaterThan;
|
||||||
|
|
||||||
class ConfigModificationForm extends BaseDescForm
|
class ConfigModificationForm extends BaseForm
|
||||||
{
|
{
|
||||||
|
use StandardDescriptionFieldsTrait;
|
||||||
|
|
||||||
protected function buildForm()
|
protected function buildForm()
|
||||||
{
|
{
|
||||||
parent::buildForm(true);
|
|
||||||
|
|
||||||
$this->formBuilder
|
$this->formBuilder
|
||||||
->add("id", "hidden", array(
|
->add("id", "hidden", array(
|
||||||
"constraints" => array(
|
"constraints" => array(
|
||||||
@@ -61,6 +61,9 @@ class ConfigModificationForm extends BaseDescForm
|
|||||||
"label" => "Prevent variable modification or deletion, except for super-admin"
|
"label" => "Prevent variable modification or deletion, except for super-admin"
|
||||||
))
|
))
|
||||||
;
|
;
|
||||||
|
|
||||||
|
// Add standard description fields
|
||||||
|
$this->addStandardDescFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName()
|
public function getName()
|
||||||
|
|||||||
@@ -24,35 +24,69 @@ namespace Thelia\Form;
|
|||||||
|
|
||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
|
|
||||||
|
use Thelia\Core\Translation\Translator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This form defines all standard description fields:
|
* A trait to add standard localized description fields to a form.
|
||||||
* - title
|
|
||||||
* - chapo
|
|
||||||
* - description
|
|
||||||
* - postscriptum
|
|
||||||
*
|
*
|
||||||
* @author Franck Allimant <franck@cqfdev.fr>
|
* @author Franck Allimant <franck@cqfdev.fr>
|
||||||
*/
|
*/
|
||||||
Trait StandardDescriptionFieldsTrait
|
trait StandardDescriptionFieldsTrait
|
||||||
{
|
{
|
||||||
protected function addStandardDescriptionFields()
|
/**
|
||||||
|
* Add standard description fields + locale tot the form
|
||||||
|
*
|
||||||
|
* @param array $exclude name of the fields that should not be added to the form
|
||||||
|
*/
|
||||||
|
protected function addStandardDescFields($exclude = array())
|
||||||
{
|
{
|
||||||
$this->formBuilder
|
if (! in_array('locale', $exclude))
|
||||||
->add("locale", "hidden", array(
|
$this->formBuilder
|
||||||
|
->add("locale", "hidden", array(
|
||||||
|
"constraints" => array(
|
||||||
|
new NotBlank()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (! in_array('title', $exclude))
|
||||||
|
$this->formBuilder
|
||||||
|
->add("title", "text", array(
|
||||||
"constraints" => array(
|
"constraints" => array(
|
||||||
new NotBlank()
|
new NotBlank()
|
||||||
|
),
|
||||||
|
"label" => Translator::getInstance()->trans("Title"),
|
||||||
|
"label_attr" => array(
|
||||||
|
"for" => "title"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
);
|
||||||
->add("title", "text", array(
|
|
||||||
"constraints" => array(
|
if (! in_array('chapo', $exclude))
|
||||||
new NotBlank()
|
$this->formBuilder
|
||||||
|
->add("chapo", "text", array(
|
||||||
|
"label" => Translator::getInstance()->trans("Summary"),
|
||||||
|
"label_attr" => array(
|
||||||
|
"for" => "summary"
|
||||||
)
|
)
|
||||||
)
|
));
|
||||||
)
|
|
||||||
->add("chapo", "text", array())
|
if (! in_array('description', $exclude))
|
||||||
->add("description", "text", array())
|
$this->formBuilder
|
||||||
->add("postscriptum", "text", array())
|
->add("description", "text", array(
|
||||||
;
|
"label" => Translator::getInstance()->trans("Detailed description"),
|
||||||
|
"label_attr" => array(
|
||||||
|
"for" => "detailed_description"
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
if (! in_array('postscriptum', $exclude))
|
||||||
|
$this->formBuilder
|
||||||
|
->add("postscriptum", "text", array(
|
||||||
|
"label" => Translator::getInstance()->trans("Conclusion"),
|
||||||
|
"label_attr" => array(
|
||||||
|
"for" => "conclusion"
|
||||||
|
)
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
{* -- Bootstrap CSS section --------------------------------------------- *}
|
{* -- Bootstrap CSS section --------------------------------------------- *}
|
||||||
|
|
||||||
{block name="before-bootstrap-css"}{/block}
|
{block name="before-bootstrap-css"}{/block}
|
||||||
|
|
||||||
{stylesheets file='assets/less/*' filters='less,cssembed'}
|
{stylesheets file='assets/less/*' filters='less,cssembed'}
|
||||||
<link rel="stylesheet" href="{$asset_url}">
|
<link rel="stylesheet" href="{$asset_url}">
|
||||||
{/stylesheets}
|
{/stylesheets}
|
||||||
@@ -47,15 +47,15 @@
|
|||||||
|
|
||||||
<div class="topbar">
|
<div class="topbar">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="version-info">{intl l='Version %ver' ver="{$THELIA_VERSION}"}</div>
|
<div class="version-info">{intl l='Version %ver' ver="{$THELIA_VERSION}"}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{module_include location='inside_topbar'}
|
{module_include location='inside_topbar'}
|
||||||
|
|
||||||
<div class="col-md-6 clearfix">
|
<div class="col-md-6 clearfix">
|
||||||
|
|
||||||
<div class="btn-group pull-right">
|
<div class="btn-group pull-right">
|
||||||
<a href="{navigate to="index"}" title="{intl l='View site'}" target="_blank" class="btn btn-default"><span class="glyphicon glyphicon-eye-open"></span> {intl l="View shop"}</a>
|
<a href="{navigate to="index"}" title="{intl l='View site'}" target="_blank" class="btn btn-default"><span class="glyphicon glyphicon-eye-open"></span> {intl l="View shop"}</a>
|
||||||
@@ -64,14 +64,14 @@
|
|||||||
<span class="caret"></span>
|
<span class="caret"></span>
|
||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li><a class="profile" href="{url path='admin/edit_profile'}"><span class="glyphicon glyphicon-edit"></span> {intl l="Profil"}</a></li>
|
<li><a class="profile" href="{url path='admin/edit_profile'}"><span class="glyphicon glyphicon-edit"></span> {intl l="Profil"}</a></li>
|
||||||
<li><a class="logout" href="{url path='admin/logout'}" title="{intl l='Close administation session'}"><span class="glyphicon glyphicon-off"></span> {intl l="Logout"}</a></li>
|
<li><a class="logout" href="{url path='admin/logout'}" title="{intl l='Close administation session'}"><span class="glyphicon glyphicon-off"></span> {intl l="Logout"}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
{module_include location='before_top_menu'}
|
{module_include location='before_top_menu'}
|
||||||
|
|
||||||
<nav class="navbar navbar-default" role="navigation">
|
<nav class="navbar navbar-default" role="navigation">
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
||||||
<div class="navbar-header">
|
<div class="navbar-header">
|
||||||
@@ -91,7 +91,7 @@
|
|||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="collapse navbar-collapse navbar-collapse">
|
<div class="collapse navbar-collapse navbar-collapse">
|
||||||
@@ -163,13 +163,13 @@
|
|||||||
|
|
||||||
{/loop}
|
{/loop}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{loop name="top-bar-search" type="auth" roles="ADMIN" permissions="admin.search"}
|
{loop name="top-bar-search" type="auth" roles="ADMIN" permissions="admin.search"}
|
||||||
<form class="navbar-form pull-right" action="{url path='/admin/search'}">
|
<form class="navbar-form pull-right" action="{url path='/admin/search'}">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="text" class="form-control" id="search_term" name="search_term" placeholder="{intl l='Search'}">
|
<input type="text" class="form-control" id="search_term" name="search_term" placeholder="{intl l='Search'}">
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
|
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
|
||||||
</form>
|
</form>
|
||||||
{/loop}
|
{/loop}
|
||||||
|
|
||||||
|
|||||||
@@ -331,7 +331,6 @@
|
|||||||
{form name="thelia.admin.category.creation"}
|
{form name="thelia.admin.category.creation"}
|
||||||
|
|
||||||
{* Capture the dialog body, to pass it to the generic dialog *}
|
{* Capture the dialog body, to pass it to the generic dialog *}
|
||||||
|
|
||||||
{capture "category_creation_dialog"}
|
{capture "category_creation_dialog"}
|
||||||
|
|
||||||
{form_hidden_fields form=$form}
|
{form_hidden_fields form=$form}
|
||||||
@@ -346,26 +345,26 @@
|
|||||||
{/form_field}
|
{/form_field}
|
||||||
|
|
||||||
{form_field form=$form field='title'}
|
{form_field form=$form field='title'}
|
||||||
<div class="form-group {if $error}has-error{/if}">
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
|
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
|
||||||
|
|
||||||
{loop type="lang" name="default-lang" default_only="1"}
|
{loop type="lang" name="default-lang" default_only="1"}
|
||||||
|
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Currency name'}" placeholder="{intl l='Name'}">
|
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Currency name'}" placeholder="{intl l='Name'}">
|
||||||
<span class="input-group-addon"><img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="$TITLE" /></span>
|
<span class="input-group-addon"><img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="$TITLE" /></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="help-block">{intl l='Enter here the category name in the default language (%title)' title="$TITLE"}</div>
|
<div class="help-block">{intl l='Enter here the category name in the default language (%title)' title="$TITLE"}</div>
|
||||||
|
|
||||||
{* Switch edition to the current locale *}
|
{* Switch edition to the current locale *}
|
||||||
<input type="hidden" name="edit_language_id" value="{$ID}" />
|
<input type="hidden" name="edit_language_id" value="{$ID}" />
|
||||||
|
|
||||||
{form_field form=$form field='locale'}
|
{form_field form=$form field='locale'}
|
||||||
<input type="hidden" name="{$name}" value="{$LOCALE}" />
|
<input type="hidden" name="{$name}" value="{$LOCALE}" />
|
||||||
{/form_field}
|
{/form_field}
|
||||||
{/loop}
|
{/loop}
|
||||||
</div>
|
</div>
|
||||||
{/form_field}
|
{/form_field}
|
||||||
{/capture}
|
{/capture}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<div class="catalog edit-category">
|
<div class="catalog edit-category">
|
||||||
<div id="wrapper" class="container">
|
<div id="wrapper" class="container">
|
||||||
|
|
||||||
{include file="includes/categories-breadcrumb.html"}
|
{include file="includes/catalog-breadcrumb.html"}
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{loop name="category_edit" type="category" visible="*" id="{$current_category_id}" backend_context="1" lang="$edit_language_id"}
|
{loop name="category_edit" type="category" visible="*" id="{$current_category_id}" backend_context="1" lang="$edit_language_id"}
|
||||||
@@ -26,6 +26,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form method="post">
|
<form method="post">
|
||||||
|
|
||||||
<div class="tabbable">
|
<div class="tabbable">
|
||||||
<ul class="nav nav-tabs admin-tabs" id="tabbed_menu">
|
<ul class="nav nav-tabs admin-tabs" id="tabbed_menu">
|
||||||
<li class="active">
|
<li class="active">
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.currencies.create"}
|
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.currencies.create"}
|
||||||
<span class="pull-right">
|
<span class="pull-right">
|
||||||
<button class="btn btn-default btn-info" title="{intl l='Update rates'}">{intl l='Update rates'} <span class="glyphicon glyphicon-globe"></span></button>
|
<button class="btn btn-default btn-info" title="{intl l='Update rates'}">{intl l='Update rates'} <span class="glyphicon glyphicon-globe"></span></button>
|
||||||
<a class="btn btn-default btn-primary" title="{intl l='Add a new currency'}" href="#add_currency_dialog" data-toggle="modal">
|
<a class="btn btn-default btn-primary" title="{intl l='Add a new currency'}" href="#creation_dialog" data-toggle="modal">
|
||||||
<span class="glyphicon glyphicon-plus-sign"></span>
|
<span class="glyphicon glyphicon-plus-sign"></span>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
@@ -163,7 +163,7 @@
|
|||||||
{/loop}
|
{/loop}
|
||||||
|
|
||||||
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.configuration.currencies.delete"}
|
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.configuration.currencies.delete"}
|
||||||
<a class="btn btn-default btn-xs currency-delete" title="{intl l='Delete this currency'}" href="#delete_currency_dialog" data-id="{$ID}" data-toggle="modal">
|
<a class="btn btn-default btn-xs currency-delete" title="{intl l='Delete this currency'}" href="#delete_dialog" data-id="{$ID}" data-toggle="modal">
|
||||||
<span class="glyphicon glyphicon-trash"></span>
|
<span class="glyphicon glyphicon-trash"></span>
|
||||||
</a>
|
</a>
|
||||||
{/loop}
|
{/loop}
|
||||||
@@ -199,116 +199,96 @@
|
|||||||
|
|
||||||
{* Adding a new currency *}
|
{* Adding a new currency *}
|
||||||
|
|
||||||
<div class="modal fade" id="add_currency_dialog" tabindex="-1" role="dialog" aria-hidden="true">
|
{form name="thelia.admin.currency.creation"}
|
||||||
|
|
||||||
<div class="modal-dialog">
|
{* Capture the dialog body, to pass it to the generic dialog *}
|
||||||
<div class="modal-content">
|
{capture "creation_dialog"}
|
||||||
|
{form_hidden_fields form=$form}
|
||||||
|
|
||||||
<div class="modal-header">
|
{form_field form=$form field='success_url'}
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
{* on success, redirect to the edition page, _ID_ is replaced with the created currency ID, see controller *}
|
||||||
<h3>{intl l="Create a new currency"}</h3>
|
<input type="hidden" name="{$name}" value="{url path='/admin/configuration/currencies/update' currency_id='_ID_'}" />
|
||||||
</div>
|
{/form_field}
|
||||||
|
|
||||||
{form name="thelia.admin.currency.creation"}
|
{form_field form=$form field='name'}
|
||||||
<form method="POST" action="{url path='/admin/configuration/currencies/create'}" {form_enctype form=$form}>
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
|
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||||
|
|
||||||
{form_hidden_fields form=$form}
|
{loop type="lang" name="default-lang" default_only="1"}
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Currency name'}" placeholder="{intl l='Name'}">
|
||||||
|
<span class="input-group-addon"><img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="{intl l=$TITLE}" /></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
{form_field form=$form field='success_url'}
|
<div class="help-block">{intl l="Enter here the currency name in the default language ($TITLE)"}</div>
|
||||||
{* on success, redirect to the edition page, _ID_ is replaced with the created currency ID, see controller *}
|
|
||||||
<input type="hidden" name="{$name}" value="{url path='/admin/configuration/currencies/update' currency_id='_ID_'}" />
|
|
||||||
{/form_field}
|
|
||||||
|
|
||||||
<div class="modal-body">
|
{* Switch edition to the current locale *}
|
||||||
|
<input type="hidden" name="edit_language_id" value="{$ID}" />
|
||||||
|
|
||||||
{if $form_error}<div class="alert alert-block alert-error" id="add_currency_dialog_error">{$form_error_message}</div>{/if}
|
{form_field form=$form field='locale'}
|
||||||
|
<input type="hidden" name="{$name}" value="{$LOCALE}" />
|
||||||
|
{/form_field}
|
||||||
|
{/loop}
|
||||||
|
</div>
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
{form_field form=$form field='name'}
|
{form_field form=$form field='code'}
|
||||||
<div class="form-group {if $error}has-error{/if}">
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||||
|
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='ISO 4217 code'}" placeholder="{intl l='Code'}">
|
||||||
|
<span class="help-block"><a href="http://fr.wikipedia.org/wiki/ISO_4217" target="_blank">{intl l='More information about ISO 4217'}</a></span>
|
||||||
|
</div>
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
{loop type="lang" name="default-lang" default_only="1"}
|
{form_field form=$form field='symbol'}
|
||||||
<div class="input-group">
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Currency name'}" placeholder="{intl l='Name'}">
|
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||||
<span class="input-group-addon"><img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="{intl l=$TITLE}" /></span>
|
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Currency symbol'}" placeholder="{intl l='Symbol'}">
|
||||||
</div>
|
</div>
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
<div class="help-block">{intl l="Enter here the currency name in the default language ($TITLE)"}</div>
|
{form_field form=$form field='rate'}
|
||||||
|
<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}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Currency rate'}" placeholder="{intl l='Rate'}">
|
||||||
|
<span class="help-block">{intl l="The rate from Euro (Price in Euro * rate = Price in this currency)"}</span>
|
||||||
|
</div>
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
{* Switch edition to the current locale *}
|
{/capture}
|
||||||
<input type="hidden" name="edit_language_id" value="{$ID}" />
|
|
||||||
|
|
||||||
{form_field form=$form field='locale'}
|
{include
|
||||||
<input type="hidden" name="{$name}" value="{$LOCALE}" />
|
file = "includes/generic-create-dialog.html"
|
||||||
{/form_field}
|
|
||||||
{/loop}
|
|
||||||
</div>
|
|
||||||
{/form_field}
|
|
||||||
|
|
||||||
{form_field form=$form field='code'}
|
dialog_id = "creation_dialog"
|
||||||
<div class="form-group {if $error}has-error{/if}">
|
dialog_title = {intl l="Create a new currency"}
|
||||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
dialog_body = {$smarty.capture.creation_dialog nofilter}
|
||||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='ISO 4217 code'}" placeholder="{intl l='Code'}">
|
|
||||||
<span class="help-block"><a href="http://fr.wikipedia.org/wiki/ISO_4217" target="_blank">{intl l='More information about ISO 4217'}</a></span>
|
|
||||||
</div>
|
|
||||||
{/form_field}
|
|
||||||
|
|
||||||
{form_field form=$form field='symbol'}
|
dialog_ok_label = {intl l="Create this currency"}
|
||||||
<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}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Currency symbol'}" placeholder="{intl l='Symbol'}">
|
|
||||||
</div>
|
|
||||||
{/form_field}
|
|
||||||
|
|
||||||
{form_field form=$form field='rate'}
|
form_action = {url path='/admin/configuration/currencies/create'}
|
||||||
<div class="form-group {if $error}has-error{/if}">
|
form_enctype = {form_enctype form=$form}
|
||||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
form_error_message = $form_error_message
|
||||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Currency rate'}" placeholder="{intl l='Rate'}">
|
}
|
||||||
<span class="help-block">{intl l="The rate from Euro (Price in Euro * rate = Price in this currency)"}</span>
|
{/form}
|
||||||
</div>
|
|
||||||
{/form_field}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {intl l="Create this currency"}</button>
|
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span> {intl l="Cancel"}</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
{/form}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
{* Delete confirmation dialog *}
|
{* Delete confirmation dialog *}
|
||||||
|
|
||||||
<div class="modal fade" id="delete_currency_dialog" tabindex="-1" role="dialog" aria-hidden="true">
|
{capture "delete_dialog"}
|
||||||
<div class="modal-dialog">
|
<input type="hidden" name="currency_id" id="currency_delete_id" value="" />
|
||||||
<div class="modal-content">
|
{/capture}
|
||||||
|
|
||||||
<div class="modal-header">
|
{include
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
file = "includes/generic-confirm-dialog.html"
|
||||||
<h3>{intl l="Delete a currency"}</h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="modal-body">
|
dialog_id = "delete_dialog"
|
||||||
<p>{intl l="Do you really want to delete this currency ?"}</p>
|
dialog_title = {intl l="Delete currency"}
|
||||||
</div>
|
dialog_message = {intl l="Do you really want to delete this currency ?"}
|
||||||
|
|
||||||
<form method="post" action="{url path='/admin/configuration/currencies/delete'}">
|
form_action = {url path='/admin/configuration/currencies/delete'}
|
||||||
<input type="hidden" name="currency_id" id="currency_delete_id" value="" />
|
form_content = {$smarty.capture.delete_dialog nofilter}
|
||||||
|
}
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {intl l="Yes"}</button>
|
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span> {intl l="No"}</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
{block name="javascript-initialization"}
|
{block name="javascript-initialization"}
|
||||||
@@ -329,27 +309,12 @@
|
|||||||
$('#currency_delete_id').val($(this).data('id'));
|
$('#currency_delete_id').val($(this).data('id'));
|
||||||
});
|
});
|
||||||
|
|
||||||
{* display the form creation dialog if it contains errors *}
|
// JS stuff for creation form
|
||||||
|
{include
|
||||||
{form name="thelia.admin.currency.creation"}
|
file = "includes/generic-js-dialog.html"
|
||||||
{if #form_error}
|
dialog_id = "creation_dialog"
|
||||||
$('#add_currency_dialog').modal();
|
form_name = "thelia.admin.currency.creation"
|
||||||
{/if}
|
}
|
||||||
{/form}
|
|
||||||
|
|
||||||
{* Always reset create dialog on close *}
|
|
||||||
|
|
||||||
$('#add_currency_dialog').on('hidden',function() {
|
|
||||||
|
|
||||||
// Hide error currency
|
|
||||||
$('#add_currency_dialog_error').remove();
|
|
||||||
|
|
||||||
// Clear error status
|
|
||||||
$("#add_currency_dialog .error").removeClass('error');
|
|
||||||
|
|
||||||
// Empty field values
|
|
||||||
$("#add_currency_dialog input[type=text]").val('');
|
|
||||||
});
|
|
||||||
|
|
||||||
{* Inline editing of object position using bootstrap-editable *}
|
{* Inline editing of object position using bootstrap-editable *}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<caption>
|
<caption>
|
||||||
{intl l='Thelia mailing templates'}
|
{intl l='Thelia mailing templates'}
|
||||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.messages.create"}
|
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.messages.create"}
|
||||||
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new mailing template'}" href="#add_message_dialog" data-toggle="modal">
|
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new mailing template'}" href="#creation_dialog" data-toggle="modal">
|
||||||
<span class="glyphicon glyphicon-plus-sign"></span>
|
<span class="glyphicon glyphicon-plus-sign"></span>
|
||||||
</a>
|
</a>
|
||||||
{/loop}
|
{/loop}
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
<th> </th>
|
<th> </th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
{loop name="mailing-templates" type="message" secured="*" backend_context="1" lang="$lang_id"}
|
{loop name="mailing-templates" type="message" secured="*" backend_context="1" lang="$lang_id"}
|
||||||
<tr>
|
<tr>
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
{/loop}
|
{/loop}
|
||||||
|
|
||||||
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.configuration.messages.delete"}
|
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.configuration.messages.delete"}
|
||||||
<a class="btn btn-default btn-xs message-delete" title="{intl l='Delete this mailing template'}" href="#delete_message_dialog" data-id="{$ID}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
|
<a class="btn btn-default btn-xs message-delete" title="{intl l='Delete this mailing template'}" href="#delete_dialog" data-id="{$ID}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
|
||||||
{/loop}
|
{/loop}
|
||||||
</div>
|
</div>
|
||||||
{else}
|
{else}
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/loop}
|
{/loop}
|
||||||
{elseloop rel="mailing-templates"}
|
{elseloop rel="mailing-templates"}
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="3">
|
<td colspan="3">
|
||||||
@@ -102,110 +102,89 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{* Adding a new message *}
|
{* Adding a new message *}
|
||||||
|
|
||||||
<div class="modal fade" id="add_message_dialog" tabindex="-1" role="dialog" aria-hidden="true">
|
|
||||||
|
|
||||||
<div class="modal-dialog">
|
|
||||||
<div class="modal-content">
|
|
||||||
|
|
||||||
<div class="modal-header">
|
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
||||||
<h3>{intl l="Create a new mailing template"}</h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{form name="thelia.admin.message.creation"}
|
|
||||||
<form method="POST" action="{url path='/admin/configuration/messages/create'}" {form_enctype form=$form}>
|
|
||||||
|
|
||||||
{form_hidden_fields form=$form}
|
|
||||||
|
|
||||||
{form_field form=$form field='success_url'}
|
|
||||||
{* on success, redirect to the edition page, _ID_ is replaced with the created message ID, see controller *}
|
|
||||||
<input type="hidden" name="{$name}" value="{url path='/admin/configuration/messages/update' message_id='_ID_'}" />
|
|
||||||
{/form_field}
|
|
||||||
|
|
||||||
{* We do not allow users to create secured messages from here *}
|
|
||||||
|
|
||||||
{form_field form=$form field='secured'}
|
|
||||||
<input type="hidden" name="{$name}" value="0" />
|
|
||||||
{/form_field}
|
|
||||||
|
|
||||||
<div class="modal-body">
|
|
||||||
|
|
||||||
{if #form_error}<div class="alert alert-danger" id="add_message_dialog_error">#form_error_message</div>{/if}
|
|
||||||
|
|
||||||
{form_field form=$form field='name'}
|
|
||||||
<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}" required="required" name="{$name}" value="{$value}" title="{intl l='Mailing template name'}" placeholder="{intl l='Mailing template name'}" class="form-control">
|
|
||||||
</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>
|
|
||||||
|
|
||||||
{loop type="lang" name="default-lang" default_only="1"}
|
|
||||||
|
|
||||||
{* Switch edition to the current locale *}
|
|
||||||
<input type="hidden" name="edit_language_id" value="{$ID}" />
|
|
||||||
|
|
||||||
<div class="input-group">
|
|
||||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value}" title="{intl l='Mailing template purpose'}" placeholder="{intl l='Mailing template purpose'}" class="form-control">
|
|
||||||
<span class="input-group-addon"><img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="{intl l=$TITLE}" /></span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="help-block">{intl l="Enter here the mailing template purpose in the default language ($TITLE)"}</div>
|
|
||||||
|
|
||||||
{form_field form=$form field='locale'}
|
|
||||||
<input type="hidden" name="{$name}" value="{$LOCALE}" />
|
|
||||||
{/form_field}
|
|
||||||
{/loop}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
{/form_field}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span> {intl l="Cancel"}</button>
|
|
||||||
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {intl l="Create this mailing template"}</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
{/form}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
{* Delete confirmation dialog *}
|
{form name="thelia.admin.message.creation"}
|
||||||
|
|
||||||
<div class="modal fade" id="delete_message_dialog" tabindex="-1" role="dialog" aria-hidden="true">
|
{* Capture the dialog body, to pass it to the generic dialog *}
|
||||||
<div class="modal-dialog">
|
{capture "creation_dialog"}
|
||||||
<div class="modal-content">
|
{form_hidden_fields form=$form}
|
||||||
|
|
||||||
<div class="modal-header">
|
{form_field form=$form field='success_url'}
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
{* on success, redirect to the edition page, _ID_ is replaced with the created message ID, see controller *}
|
||||||
<h3>{intl l="Delete a mailing template"}</h3>
|
<input type="hidden" name="{$name}" value="{url path='/admin/configuration/messages/update' message_id='_ID_'}" />
|
||||||
</div>
|
{/form_field}
|
||||||
|
|
||||||
<div class="modal-body">
|
{* We do not allow users to create secured messages from here *}
|
||||||
<p>{intl l="Do you really want to delete this mailing template ?"}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form method="post" action="{url path='/admin/configuration/messages/delete'}">
|
{form_field form=$form field='secured'}
|
||||||
<input type="hidden" name="message_id" id="message_delete_id" value="" />
|
<input type="hidden" name="{$name}" value="0" />
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
<div class="modal-footer">
|
{form_field form=$form field='name'}
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span> {intl l="No"}</button>
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {intl l="Yes"}</button>
|
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||||
</div>
|
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value}" title="{intl l='Mailing template name'}" placeholder="{intl l='Mailing template name'}" class="form-control">
|
||||||
</form>
|
</div>
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
</div>
|
{form_field form=$form field='title'}
|
||||||
</div>
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
</div>
|
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||||
|
|
||||||
|
{loop type="lang" name="default-lang" default_only="1"}
|
||||||
|
|
||||||
|
{* Switch edition to the current locale *}
|
||||||
|
<input type="hidden" name="edit_language_id" value="{$ID}" />
|
||||||
|
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value}" title="{intl l='Mailing template purpose'}" placeholder="{intl l='Mailing template purpose'}" class="form-control">
|
||||||
|
<span class="input-group-addon"><img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="{intl l=$TITLE}" /></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="help-block">{intl l="Enter here the mailing template purpose in the default language ($TITLE)"}</div>
|
||||||
|
|
||||||
|
{form_field form=$form field='locale'}
|
||||||
|
<input type="hidden" name="{$name}" value="{$LOCALE}" />
|
||||||
|
{/form_field}
|
||||||
|
{/loop}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
{/form_field}
|
||||||
|
{/capture}
|
||||||
|
|
||||||
|
{include
|
||||||
|
file = "includes/generic-create-dialog.html"
|
||||||
|
|
||||||
|
dialog_id = "creation_dialog"
|
||||||
|
dialog_title = {intl l="Create a new mailing template"}
|
||||||
|
dialog_body = {$smarty.capture.creation_dialog nofilter}
|
||||||
|
|
||||||
|
dialog_ok_label = {intl l="Create this mailing template"}
|
||||||
|
|
||||||
|
form_action = {url path='/admin/configuration/messages/create'}
|
||||||
|
form_enctype = {form_enctype form=$form}
|
||||||
|
form_error_message = $form_error_message
|
||||||
|
}
|
||||||
|
{/form}
|
||||||
|
|
||||||
|
{* Delete confirmation dialog *}
|
||||||
|
|
||||||
|
{capture "delete_dialog"}
|
||||||
|
<input type="hidden" name="message_id" id="message_delete_id" value="" />
|
||||||
|
{/capture}
|
||||||
|
|
||||||
|
{include
|
||||||
|
file = "includes/generic-confirm-dialog.html"
|
||||||
|
|
||||||
|
dialog_id = "delete_dialog"
|
||||||
|
dialog_title = {intl l="Delete mailing template"}
|
||||||
|
dialog_message = {intl l="Do you really want to delete this mailing template ?"}
|
||||||
|
|
||||||
|
form_action = {url path='/admin/configuration/messages/delete'}
|
||||||
|
form_content = {$smarty.capture.delete_dialog nofilter}
|
||||||
|
}
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
{block name="javascript-initialization"}
|
{block name="javascript-initialization"}
|
||||||
@@ -217,26 +196,12 @@
|
|||||||
$('#message_delete_id').val($(this).data('id'));
|
$('#message_delete_id').val($(this).data('id'));
|
||||||
});
|
});
|
||||||
|
|
||||||
{* display the form creation dialog if it contains errors *}
|
// JS stuff for creation form
|
||||||
|
{include
|
||||||
{form name="thelia.admin.message.creation"}
|
file = "includes/generic-js-dialog.html"
|
||||||
{if #form_error}
|
dialog_id = "creation_dialog"
|
||||||
$('#add_message_dialog').modal();
|
form_name = "thelia.admin.message.creation"
|
||||||
{/if}
|
}
|
||||||
{/form}
|
|
||||||
|
|
||||||
{* Always reset create dialog on close *}
|
|
||||||
|
|
||||||
$('#add_message_dialog').on('hidden',function() {
|
|
||||||
// Hide error message
|
|
||||||
$('#add_message_dialog_error').remove();
|
|
||||||
|
|
||||||
// Clear error status
|
|
||||||
$("#add_message_dialog .error").removeClass('error');
|
|
||||||
|
|
||||||
// Empty field values
|
|
||||||
$("#add_message_dialog input[type=text]").val('');
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{/block}
|
{/block}
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
{intl l='Thelia system variables'}
|
{intl l='Thelia system variables'}
|
||||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.variables.create"}
|
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.variables.create"}
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new variable'}" href="#add_variable_dialog" data-toggle="modal">
|
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new variable'}" href="#creation_dialog" data-toggle="modal">
|
||||||
<span class="glyphicon glyphicon-plus-sign"></span>
|
<span class="glyphicon glyphicon-plus-sign"></span>
|
||||||
</a>
|
</a>
|
||||||
<button class="btn btn-default btn-primary" title="{intl l='Save chages'}"><span class="glyphicon glyphicon-ok"></span> {intl l='Save changes'}</button>
|
<button class="btn btn-default btn-primary" title="{intl l='Save chages'}"><span class="glyphicon glyphicon-ok"></span> {intl l='Save changes'}</button>
|
||||||
@@ -135,10 +135,10 @@
|
|||||||
|
|
||||||
{* Adding a new variable *}
|
{* Adding a new variable *}
|
||||||
|
|
||||||
{* Capture the dialog body, to pass it to the generic dialog *}
|
|
||||||
|
|
||||||
{form name="thelia.admin.config.creation"}
|
{form name="thelia.admin.config.creation"}
|
||||||
|
|
||||||
|
{* Capture the dialog body, to pass it to the generic dialog *}
|
||||||
{capture "creation_dialog"}
|
{capture "creation_dialog"}
|
||||||
|
|
||||||
{form_hidden_fields form=$form}
|
{form_hidden_fields form=$form}
|
||||||
@@ -199,7 +199,7 @@
|
|||||||
{include
|
{include
|
||||||
file = "includes/generic-create-dialog.html"
|
file = "includes/generic-create-dialog.html"
|
||||||
|
|
||||||
dialog_id = "add_variable_dialog"
|
dialog_id = "creation_dialog"
|
||||||
dialog_title = {intl l="Create a new variable"}
|
dialog_title = {intl l="Create a new variable"}
|
||||||
dialog_body = {$smarty.capture.creation_dialog nofilter}
|
dialog_body = {$smarty.capture.creation_dialog nofilter}
|
||||||
|
|
||||||
@@ -236,7 +236,7 @@
|
|||||||
// JS stuff for creation form
|
// JS stuff for creation form
|
||||||
{include
|
{include
|
||||||
file = "includes/generic-js-dialog.html"
|
file = "includes/generic-js-dialog.html"
|
||||||
dialog_id = "add_variable_dialog"
|
dialog_id = "creation_dialog"
|
||||||
form_name = "thelia.admin.config.creation"
|
form_name = "thelia.admin.config.creation"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user