Adressed PR comment's

Fix tests

Add dot at end of senetences

Fix typo
This commit is contained in:
Nicolas Le Goff
2013-06-12 19:21:01 +02:00
parent 853477177b
commit f30bca91a9
17 changed files with 55 additions and 57 deletions

View File

@@ -12,6 +12,7 @@
namespace Alchemy\Phrasea\Command\Setup;
use Alchemy\Phrasea\Command\Command;
use Alchemy\Phrasea\Exception\RuntimeException;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Process\ProcessBuilder;
@@ -49,14 +50,13 @@ class LessCompiler extends Command
$output->writeln(sprintf('Building %s', basename($lessFile)));
if (!is_file($lessFile)) {
throw new \Exception(realpath($lessFile) . ' does not exists');
throw new RuntimeException(realpath($lessFile) . ' does not exists.');
}
if (!is_writable(dirname($buildFile))) {
throw new \Exception(realpath(dirname($buildFile)) . ' is not writable');
throw new RuntimeException(realpath(dirname($buildFile)) . ' is not writable.');
}
$builder = ProcessBuilder::create(array(
'recess',
'--compile',

View File

@@ -91,15 +91,10 @@ class Account implements ControllerProviderInterface
if ($form->isValid()) {
$data = $form->getData();
$password = $data['password'];
$user = $app['authentication']->getUser();
if (trim($password) != str_replace(array("\r\n", "\n", "\r", "\t", " "), "_", $password)) {
$app->addFlash('error', _('forms::la valeur donnee contient des caracteres invalides'));
} elseif ($app['auth.password-encoder']->isPasswordValid($user->get_password(), $data['oldPassword'], $user->get_nonce())) {
$user->set_password($password);
if ($app['auth.password-encoder']->isPasswordValid($user->get_password(), $data['oldPassword'], $user->get_nonce())) {
$user->set_password($data['password']);
$app->addFlash('success', _('login::notification: Mise a jour du mot de passe avec succes'));
return $app->redirectPath('account');

View File

@@ -175,7 +175,6 @@ class Login implements ControllerProviderInterface
$controllers->get('/language.json', 'login.controller:getLanguage')
->bind('login_language');
return $controllers;
}
@@ -183,11 +182,11 @@ class Login implements ControllerProviderInterface
{
$response = $app->json(array(
'validation_blank' => _('Please provide a value.'),
'validation_choice_min' => _('please select at least %s choice.'),
'validation_choice_min' => _('Please select at least %s choice.'),
'validation_email' => _('Please provide a valid email address.'),
'validation_ip' => _('Please provide a valid IP address.'),
'validation_length_min' => _('Please provide a longer value. It should have %s character or more'),
'password_match' => _('Please provide the same passwords'),
'validation_length_min' => _('Please provide a longer value. It should have %s character or more.'),
'password_match' => _('Please provide the same passwords.'),
'accept_tou' => _('You must accept the terms of use.'),
'none_selected' => _('None selected'),
'collections' => _('Collections'),

View File

@@ -41,15 +41,15 @@ class PhraseaRecoverPasswordForm extends AbstractType
$builder->add('password', 'repeated', array(
'type' => 'password',
'required' => true,
'constraints' => array(
new Assert\NotBlank(),
new Assert\Length(array('min' => 5)),
),
'invalid_message' => _('Please provide the same passwords'),
'invalid_message' => _('Please provide the same passwords.'),
'first_name' => 'password',
'second_name' => 'confirm',
'first_options' => array('label' => _('New password')),
'second_options' => array('label' => _('New password (confirmation)')),
'constraints' => array(
new Assert\NotBlank(),
new Assert\Length(array('min' => 5)),
),
));
}

View File

@@ -48,15 +48,15 @@ class PhraseaRegisterForm extends AbstractType
$builder->add('password', 'repeated', array(
'type' => 'password',
'required' => true,
'constraints' => array(
new Assert\NotBlank(),
new Assert\Length(array('min' => 5)),
),
'invalid_message' => _('Please provide the same passwords'),
'invalid_message' => _('Please provide the same passwords.'),
'first_name' => 'password',
'second_name' => 'confirm',
'first_options' => array('label' => _('Password')),
'second_options' => array('label' => _('Password (confirmation)')),
'constraints' => array(
new Assert\NotBlank(),
new Assert\Length(array('min' => 5)),
),
));
$builder->add('accept-tou', 'checkbox', array(
@@ -64,7 +64,7 @@ class PhraseaRegisterForm extends AbstractType
'mapped' => false,
"constraints" => array(
new Assert\True(array(
"message" => _("Please accept the Terms and conditions in order to register")
"message" => _("Please accept the Terms and conditions in order to register.")
))),
));

View File

@@ -33,15 +33,15 @@ class PhraseaRenewPasswordForm extends AbstractType
$builder->add('password', 'repeated', array(
'type' => 'password',
'required' => true,
'constraints' => array(
new Assert\NotBlank(),
new Assert\Length(array('min' => 5)),
),
'invalid_message' => _('Please provide the same passwords'),
'invalid_message' => _('Please provide the same passwords.'),
'first_name' => 'password',
'second_name' => 'confirm',
'first_options' => array('label' => _('New password')),
'second_options' => array('label' => _('New password (confirmation)')),
'constraints' => array(
new Assert\NotBlank(),
new Assert\Length(array('min' => 5)),
),
));
}

View File

@@ -54,5 +54,5 @@
{% block scripts %}
{{ parent() }}
<script type="text/javascript" src="/scripts/apps/login/home/renewPassword.js"></script>
<script type="text/javascript" src="{{ path('minifier', {'f': 'scripts/apps/login/home/renewPassword.js'}) }}"></script>
{% endblock %}

View File

@@ -55,5 +55,5 @@
{% block scripts %}
{{ parent() }}
<script type="text/javascript" src="/scripts/apps/login/home/forgotPassword.js"></script>
<script type="text/javascript" src="{{ path('minifier', {'f': 'scripts/apps/login/home/forgotPassword.js'}) }}"></script>
{% endblock %}

View File

@@ -130,5 +130,5 @@
{% block scripts %}
{{ parent() }}
<script type="text/javascript" src="/scripts/apps/login/home/login.js"></script>
<script type="text/javascript" src="{{ path('minifier', {'f': 'scripts/apps/login/home/login.js'}) }}"></script>
{% endblock %}

View File

@@ -124,5 +124,5 @@
{% block scripts %}
{{ parent() }}
<script type="text/javascript" src="/scripts/apps/login/home/oauthLogin.js"></script>
<script type="text/javascript" src="{{ path('minifier', {'f': 'scripts/apps/login/home/oauthLogin.js'}) }}"></script>
{% endblock %}

View File

@@ -88,5 +88,5 @@
{% block scripts %}
{{ parent() }}
<script type="text/javascript" src="/scripts/apps/login/home/bind.js"></script>
<script type="text/javascript" src="{{ path('minifier', {'f': 'scripts/apps/login/home/bind.js'}) }}"></script>
{% endblock %}

View File

@@ -120,5 +120,5 @@
{% block scripts %}
{{ parent() }}
<script type="text/javascript" src="/scripts/apps/login/home/mapping.js"></script>
<script type="text/javascript" src="{{ path('minifier', {'f': 'scripts/apps/login/home/mapping.js'}) }}"></script>
{% endblock %}

View File

@@ -101,5 +101,5 @@
{% block scripts %}
{{ parent() }}
<script type="text/javascript" src="/scripts/apps/login/home/register.js"></script>
<script type="text/javascript" src="{{ path('minifier', {'f': 'scripts/apps/login/home/register.js'}) }}"></script>
{% endblock %}

View File

@@ -86,3 +86,8 @@
</div>
</div>
{% endblock %}
{% block scripts %}
{{ parent() }}
<script type="text/javascript" src="{{ path('minifier', {'f': 'scripts/apps/login/home/registerProvider.js'}) }}"></script>
{% endblock %}

View File

@@ -50,5 +50,5 @@
{% block scripts %}
{{ parent() }}
<script type="text/javascript" src="/scripts/apps/login/home/recoverPassword.js"></script>
<script type="text/javascript" src="{{ path('minifier', {'f': 'scripts/apps/login/home/recoverPassword.js'}) }}"></script>
{% endblock %}

View File

@@ -475,7 +475,6 @@ class AccountTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
{
return array(
array(\random::generatePassword(), 'password', 'not_identical_password'),
array(\random::generatePassword(), "invalid\n", "invalid\n"),
);
}
}

View File

@@ -11,7 +11,7 @@
require.config({
baseUrl: "/scripts",
paths: {
jquery: "../include/jslibs/jquery-1.7.1",
jquery: "../assets/jquery/jquery",
jqueryui: "../include/jslibs/jquery-ui-1.8.17/js/jquery-ui-1.8.17.custom.min",
underscore: "../assets/underscore-amd/underscore",
backbone: "../assets/backbone-amd/backbone",