Merge branch 'frontend' of github.com:thelia/thelia into frontend

This commit is contained in:
badsuricate
2013-10-11 13:13:07 +02:00
5 changed files with 27 additions and 21 deletions

View File

@@ -36,7 +36,7 @@ class Assetic extends AbstractSmartyPlugin
{
$web_root = THELIA_WEB_DIR;
$asset_dir_from_web_root = ConfigQuery::read('asset_dir_from_web_root', 'assets');
$asset_dir_from_web_root = ConfigQuery::read('asset_dir_from_web_root', 'assets/');
$this->assetManager = new SmartyAssetsManager($web_root, $asset_dir_from_web_root, $developmentMode == 'dev');
}

View File

@@ -212,14 +212,14 @@ class SmartyParser extends Smarty implements ParserInterface
$templateDir = realpath(THELIA_TEMPLATE_DIR . rtrim($this->template, "/") . "/");
if (strpos($pathFileName, $templateDir) !== 0) {
throw new ResourceNotFoundException(sprintf("'%s' view does not exists", htmlspecialchars($file)));
throw new ResourceNotFoundException(sprintf("this view does not exists"));
}
if (!file_exists($fileName)) {
$fileName .= ".html";
if (!file_exists($fileName)) {
throw new ResourceNotFoundException(sprintf("'%s' file not found in %s template", htmlspecialchars($file), $this->template));
throw new ResourceNotFoundException(sprintf("file not found in %s template", $this->template));
}
}

View File

@@ -129,8 +129,9 @@ class URL
// If only a path is requested, be sure to remove the script name (index.php or index_dev.php), if any.
if ($path_only == self::PATH_TO_FILE) {
// As the base_url always ends with '/', if we don't find / at the end, we have a script.
if (substr($base_url, -1) != '/') $base_url = dirname($base_url);
if (substr($base_url, -3) == 'php') $base_url = dirname($base_url);
}
// Normalize the given path

View File

@@ -33,13 +33,10 @@ URL: http://www.thelia.net
{block name="meta"}{/block}
{* Stylesheets *}
{stylesheets file='assets/less/styles.less' filters='less,cssembed,cssrewrite'}
{stylesheets file='assets/less/styles.less' filters='less,cssembed'}
<link rel="stylesheet" href="{$asset_url}">
{/stylesheets}
<!--link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css"-->
{debugbar_rendercss}
{block name="stylesheet"}{/block}
</head>
@@ -79,20 +76,27 @@ URL: http://www.thelia.net
<li class="dropdown">
<a href="{url path="/login"}" class="login">{intl l="Log In!"}</a>
<div class="dropdown-menu">
<form id="form-login-mini" action="login.php" method="post" role="form">
<div class="form-group group-email-mini">
<label for="email-mini">Email address:</label>
<input type="email" name="email" id="email-mini" class="form-control" value="" aria-required="true" required>
</div>
{form name="thelia.customer.login"}
<form id="form-login-mini" action="{url path="/login"}" method="post" role="form" {form_enctype form=$form}>
{form_hidden_fields form=$form}
{form_field form=$form field="email"}
<div class="form-group group-email">
<label for="password-mini">Password</label>
<input type="password" name="password" id="password-mini" class="form-control" value="" aria-required="true" required>
<label for="{$label_attr.for}-mini">{$label}</label>
<input type="email" name="{$name}" id="{$label_attr.for}-mini" class="form-control"{if $required} aria-required="true" required{/if}>
</div>
{/form_field}
{form_field form=$form field="password"}
<div class="form-group group-password">
<label for="{$label_attr.for}-mini">Password</label>
<input type="password" name="{$name}" id="{$label_attr.for}-mini" class="form-control"{if $required} aria-required="true" required{/if}>
</div>
{/form_field}
<div class="group-btn">
<button type="submit" class="btn btn-login-mini">Sign In</button>
<a href="register.php" class="btn btn-register-mini">Register</a>
<button type="submit" class="btn btn-login-mini">{intl l="Sign In"}</button>
<a href="{url path="/register"}" class="btn btn-register-mini">{intl l="Register"}</a>
</div>
</form>
{/form}
</div>
</li>
{/elseloop}

View File

@@ -16,7 +16,7 @@
<article class="col-main" role="main" aria-labelledby="main-label">
<h1 id="main-label" class="page-header">{intl l="Login"}</h1>
{form name="thelia.customer.login"}
<form id="form-login" action="{url path="/customer/login"}" method="post" role="form" {form_enctype form=$form}>
<form id="form-login" action="{url path="/login"}" method="post" role="form" {form_enctype form=$form}>
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{navigate to="return_to"}"> {* the url the user is redirected to on login success *}
@@ -31,9 +31,10 @@
<div class="form-group group-email{if $error} has-error{/if}">
<label for="{$label_attr.for}">{$label}</label>
<div class="control-input">
<input type="email" name="{$name}" id="{$label_attr.for}" value="{$value}" class="form-control" {$attr} aria-required="true" autofocus required>
<input type="email" name="{$name}" id="{$label_attr.for}" value="{$value}" class="form-control" {$attr} {if $required}aria-required="true" required{/if}{if $error} autofocus{/if}>
{if $error}
<span class="help-block"><span class="icon-remove"></span> {$message}</span>
{assign var="error_email" value="true"}
{/if}
</div>
</div>
@@ -43,7 +44,7 @@
<legend>{intl l="Do you have an account?"}</legend>
<div class="radio radio-account0" >
<label for="account0">
<input type="radio" name="account" id="account0" data-toggle="password" value="0" > {intl l="No, I am a new customer."}
<input type="radio" name="account" id="account0" data-toggle="password" value="0"> {intl l="No, I am a new customer."}
</label>
</div>
<div class="radio radio-account1">
@@ -55,7 +56,7 @@
<div class="form-group group-password{if $error} has-error{/if}">
<label for="{$label_attr.for}" class="sr-only">{$label}</label>
<div class="control-input">
<input type="password" name="{$name}" id="{$label_attr.for}" class="form-control" autocomplete="off">
<input type="password" name="{$name}" id="{$label_attr.for}" class="form-control" autocomplete="off"{if !isset($error_email) && $error } autofocus{/if}>
{if $error}
<span class="help-block"><span class="icon-remove"></span> {$message}</span>
{/if}