User details, edit, delete.

This commit is contained in:
umpirsky 2013-06-13 06:48:24 +02:00
parent 5a73acbacc
commit 5a0ca69d51
18 changed files with 465 additions and 211 deletions

View file

@ -5,12 +5,15 @@ Feature: Users management
Background:
Given I am logged in as administrator
And the following zones are defined:
| name | type | members |
| German lands | country | Germany, Austria, Switzerland |
And there are following users:
| email | enabled |
| beth@foo.com | no |
| martha@foo.com | yes |
| rick@foo.com | no |
| dale@foo.com | yes |
| email | enabled | address |
| beth@foo.com | no | Klaus Schmitt, Heine-Straße 12, 99734, Berlin, Germany |
| martha@foo.com | yes | Lars Meine, Fun-Straße 1, 90032, Vienna, Austria |
| rick@foo.com | no | Klaus Schmitt, Heine-Straße 12, 99734, Berlin, Germany |
| dale @foo.com | yes | Lars Meine, Fun-Straße 1, 90032, Vienna, Austria |
And the following zones are defined:
| name | type | members |
| Poland | country | Poland |
@ -35,3 +38,41 @@ Feature: Users management
When I click "details" near "john"
Then I should be on the page of user with username "john"
And I should see 1 orders in the list
Scenario: Accessing the user editing form
Given I am on the page of user with username "rick"
When I follow "edit"
Then I should be editing user with username "rick"
Scenario: Accessing the editing form from the list
Given I am on the user index page
When I click "edit" near "rick"
Then I should be editing user with username "rick"
Scenario: Updating the user
Given I am editing user with username "rick"
When I fill in "Username" with "umpirsky"
And I fill in "Email" with "umpirsky@gmail.com"
And I press "Save changes"
Then I should be on the page of user with username "umpirsky"
And "User has been successfully updated." should appear on the page
And "umpirsky@gmail.com" should appear on the page
Scenario: Deleting user
Given I am on the page of user with username "rick"
When I press "delete"
Then I should be on the user index page
And I should see "User has been successfully deleted."
Scenario: Deleted user disappears from the list
Given I am on the page of user with username "rick"
When I press "delete"
Then I should be on the user index page
And I should not see user with username "rick" in that list
Scenario: Deleting user from the list
Given I am on the user index page
When I click "delete" near "rick"
Then I should still be on the user index page
And "User has been successfully deleted." should appear on the page
But I should not see user with username "rick" in that list

View file

@ -28,6 +28,8 @@ class LoadUsersData extends DataFixture
{
$user = new User();
$user->setFirstname($this->faker->firstName);
$user->setLastname($this->faker->lastName);
$user->setEmail('sylius@example.com');
$user->setPlainPassword('sylius');
$user->setEnabled(true);
@ -43,6 +45,8 @@ class LoadUsersData extends DataFixture
$username = $this->faker->username;
$user->setFirstname($this->faker->firstName);
$user->setLastname($this->faker->lastName);
$user->setEmail($username.'@example.com');
$user->setPlainPassword($username);
$user->setEnabled($this->faker->boolean());

View file

@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Bundle\CoreBundle\Form\Type;
use Sylius\Bundle\TaxonomiesBundle\Form\Type\TaxonType as BaseTaxonType;
@ -7,11 +16,9 @@ use Symfony\Component\Form\FormBuilderInterface;
/**
* Taxon form type.
*
*/
class TaxonType extends BaseTaxonType
{
/**
* {@inheritdoc}
*/
@ -27,5 +34,4 @@ class TaxonType extends BaseTaxonType
)
);
}
}

View file

@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Bundle\CoreBundle\Form\Type;
use Sylius\Bundle\TaxonomiesBundle\Form\Type\TaxonomyType as BaseTaxonomyType;
@ -7,11 +16,9 @@ use Symfony\Component\Form\FormBuilderInterface;
/**
* Taxonomy form type.
*
*/
class TaxonomyType extends BaseTaxonomyType
{
/**
* {@inheritdoc}
*/
@ -28,5 +35,4 @@ class TaxonomyType extends BaseTaxonomyType
)
);
}
}

View file

@ -0,0 +1,82 @@
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Bundle\CoreBundle\Form\Type;
use FOS\UserBundle\Form\Type\ProfileFormType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormEvent;
class UserType extends ProfileFormType
{
private $dataClass;
public function __construct($dataClass)
{
$this->dataClass = $dataClass;
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->addEventListener(FormEvents::PRE_BIND, function (FormEvent $event) {
$data = $event->getData();
if (!array_key_exists('differentBillingAddress', $data) || false === $data['differentBillingAddress']) {
$data['billingAddress'] = $data['shippingAddress'];
$event->setData($data);
}
})
->add('firstName', 'text', array(
'label' => 'sylius.form.user.first_name'
))
->add('lastName', 'text', array(
'label' => 'sylius.form.user.last_name'
))
;
$this->buildUserForm($builder, $options);
$builder
->add('enabled', 'checkbox', array(
'label' => 'sylius.form.user.enabled'
))
->add('shippingAddress', 'sylius_address', array(
'label' => 'sylius.form.user.shipping_address'
))
->add('differentBillingAddress', 'checkbox', array(
'mapped' => false,
'label' => 'sylius.form.user.different_billing_address'
))
->add('billingAddress', 'sylius_address', array(
'label' => 'sylius.form.user.billing_address'
))
;
}
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => $this->dataClass,
'validation_groups' => array('Profile', 'sylius'),
'cascade_validation' => true,
'intention' => 'profile',
));
}
public function getName()
{
return 'sylius_user';
}
}

View file

@ -10,7 +10,11 @@
<id name="id" column="id" type="integer">
<generator strategy="AUTO" />
</id>
<one-to-many field="orders" target-entity="Sylius\Bundle\SalesBundle\Model\OrderInterface" mapped-by="user" />
<one-to-many field="orders" target-entity="Sylius\Bundle\SalesBundle\Model\OrderInterface" mapped-by="user">
<cascade>
<cascade-all />
</cascade>
</one-to-many>
<field name="firstName" column="first_name" type="string" nullable="true" />
<field name="lastName" column="last_name" type="string" nullable="true" />
<field name="createdAt" column="created_at" type="datetime">
@ -34,6 +38,9 @@
<join-column name="address_id" referenced-column-name="id" unique="true" />
</inverse-join-columns>
</join-table>
<cascade>
<cascade-all />
</cascade>
</many-to-many>
</entity>

View file

@ -28,6 +28,7 @@
<parameter key="sylius.listener.order_shipping.class">Sylius\Bundle\CoreBundle\EventListener\OrderShippingListener</parameter>
<parameter key="sylius.listener.order_promotion.class">Sylius\Bundle\CoreBundle\EventListener\OrderPromotionListener</parameter>
<parameter key="sylius.form.type.user.class">Sylius\Bundle\CoreBundle\Form\Type\UserType</parameter>
<parameter key="sylius.checkout_form.addressing.class">Sylius\Bundle\CoreBundle\Form\Type\Checkout\AddressingStepType</parameter>
<parameter key="sylius.checkout_form.shipping.class">Sylius\Bundle\CoreBundle\Form\Type\Checkout\ShippingStepType</parameter>
<parameter key="sylius.checkout_form.payment.class">Sylius\Bundle\CoreBundle\Form\Type\Checkout\PaymentStepType</parameter>
@ -99,6 +100,10 @@
</service>
<!-- checkout forms -->
<service id="sylius.form.type.user" class="%sylius.form.type.user.class%">
<argument>%sylius.model.user.class%</argument>
<tag name="form.type" alias="sylius_user" />
</service>
<service id="sylius.checkout_form.addressing" class="%sylius.checkout_form.addressing.class%">
<argument>%sylius.model.cart.class%</argument>
<tag name="form.type" alias="sylius_checkout_addressing" />

View file

@ -90,6 +90,30 @@
<source>sylius.form.taxonomy.file</source>
<target>Select image</target>
</trans-unit>
<trans-unit id="d24fae16bdb37258ae7a49da001cbb5b" resname="sylius.form.user.billing_address">
<source>sylius.form.user.billing_address</source>
<target>Billing address</target>
</trans-unit>
<trans-unit id="1a94897ae32dcbe5134f01c37660ef3d" resname="sylius.form.user.different_billing_address">
<source>sylius.form.user.different_billing_address</source>
<target>Use different address for billing?</target>
</trans-unit>
<trans-unit id="944cf6ef4aa78e99e44806e693c69a30" resname="sylius.form.user.enabled">
<source>sylius.form.user.enabled</source>
<target>Enabled</target>
</trans-unit>
<trans-unit id="51d1b3166647640229e7329940d07e58" resname="sylius.form.user.first_name">
<source>sylius.form.user.first_name</source>
<target>First name</target>
</trans-unit>
<trans-unit id="711db7c8e5f9a2f36ed531a7371ef32c" resname="sylius.form.user.last_name">
<source>sylius.form.user.last_name</source>
<target>Last name</target>
</trans-unit>
<trans-unit id="295b78c880d42247f2e64a9fdcaecbea" resname="sylius.form.user.shipping_address">
<source>sylius.form.user.shipping_address</source>
<target>Shipping address</target>
</trans-unit>
<trans-unit id="9ed17ac3646a409b6fc47330a247a445" resname="sylius.form.variant.available_on_demand">
<source>sylius.form.variant.available_on_demand</source>
<target>Available on demand</target>

View file

@ -46,14 +46,6 @@
<source>fos_user.username.short</source>
<target>fos_user.username.short</target>
</trans-unit>
<trans-unit id="0348392867d5d3c7aba4e136ea48ffec" resname="sylius.checkout.payment_method.not_blank">
<source>sylius.checkout.payment_method.not_blank</source>
<target>Please select payment method.</target>
</trans-unit>
<trans-unit id="ddb27861aa157d5f22e90a4c51ad26fa" resname="sylius.checkout.shipping_method.not_blank">
<source>sylius.checkout.shipping_method.not_blank</source>
<target>Please select shipping method.</target>
</trans-unit>
<trans-unit id="a0bfd28ade710d07ff88637ec653a544" resname="sylius.product.description.min_length">
<source>sylius.product.description.min_length</source>
<target>sylius.product.description.min_length</target>
@ -122,6 +114,46 @@
<source>sylius.tax_rate.name.not_blank</source>
<target>sylius.tax_rate.name.not_blank</target>
</trans-unit>
<trans-unit id="05212abfc3e29e4b0fe5f6ab18f31da4" resname="sylius.taxon.name.max_length">
<source>sylius.taxon.name.max_length</source>
<target>sylius.taxon.name.max_length</target>
</trans-unit>
<trans-unit id="6b05cd6b996cfafd94c813a707d86fa5" resname="sylius.taxon.name.not_blank">
<source>sylius.taxon.name.not_blank</source>
<target>sylius.taxon.name.not_blank</target>
</trans-unit>
<trans-unit id="29428b426b591aad514fa68434a5dd8a" resname="sylius.taxonomy.name.max_length">
<source>sylius.taxonomy.name.max_length</source>
<target>sylius.taxonomy.name.max_length</target>
</trans-unit>
<trans-unit id="199bbac1dc5f668799b979d986e0746a" resname="sylius.taxonomy.name.not_blank">
<source>sylius.taxonomy.name.not_blank</source>
<target>sylius.taxonomy.name.not_blank</target>
</trans-unit>
<trans-unit id="0004066cb8a3ad8b40bc84c8131febcc" resname="sylius.user.first_name.max">
<source>sylius.user.first_name.max</source>
<target>First name must be not be longer than {{ limit }} characters.</target>
</trans-unit>
<trans-unit id="50b0ee1d48a8e08f2d4e14a3464df4d6" resname="sylius.user.first_name.min">
<source>sylius.user.first_name.min</source>
<target>First name must be at least {{ limit }} characters long.</target>
</trans-unit>
<trans-unit id="1a4e98b8754497fa3704c316c2510326" resname="sylius.user.first_name.not_blank">
<source>sylius.user.first_name.not_blank</source>
<target>Please enter a first name.</target>
</trans-unit>
<trans-unit id="60b6e5effce78494863245c780fde824" resname="sylius.user.last_name.max">
<source>sylius.user.last_name.max</source>
<target>Last name must be not be longer than {{ limit }} characters.</target>
</trans-unit>
<trans-unit id="d809d7775c184088481d5cb29ae9b760" resname="sylius.user.last_name.min">
<source>sylius.user.last_name.min</source>
<target>Last name must be at least {{ limit }} characters long.</target>
</trans-unit>
<trans-unit id="c159555909906bd5df37a0f2edd6a7cd" resname="sylius.user.last_name.not_blank">
<source>sylius.user.last_name.not_blank</source>
<target>Please enter a last name.</target>
</trans-unit>
<trans-unit id="8b543b113a901ba9cfeb2410c82fc16f" resname="sylius.variant.onHand.min">
<source>sylius.variant.onHand.min</source>
<target>On hand must be greater than {{ limit }}.</target>
@ -146,30 +178,6 @@
<source>sylius_taxation.rate.zone.not_blank</source>
<target>Please enter tax rate zone.</target>
</trans-unit>
<trans-unit id="8518dab2d5a4c2ec2a89fc045bf0a267" resname="sylius.user.first_name.max">
<source>sylius.user.first_name.max</source>
<target>First name must be not be longer than {{ limit }} characters.</target>
</trans-unit>
<trans-unit id="9b237441a6dceace1f56b9e2bfe5735a" resname="sylius.user.first_name.min">
<source>sylius.user.first_name.min</source>
<target>First name must be at least {{ limit }} characters long.</target>
</trans-unit>
<trans-unit id="0ae371e28b32eadde803aa94e5b33337" resname="sylius.user.first_name.not_blank">
<source>sylius.user.first_name.not_blank</source>
<target>Please enter a first name.</target>
</trans-unit>
<trans-unit id="cdea2e1de30b26a46367dd1d9b4427af" resname="sylius.user.last_name.max">
<source>sylius.user.last_name.max</source>
<target>Last name must be not be longer than {{ limit }} characters.</target>
</trans-unit>
<trans-unit id="1425fc2b4f6f68ff1a1a85f9eb7e3be3" resname="sylius.user.last_name.min">
<source>sylius.user.last_name.min</source>
<target>Last name must be at least {{ limit }} characters long.</target>
</trans-unit>
<trans-unit id="79171aa624a13deea0b33e585c46c588" resname="sylius.user.last_name.not_blank">
<source>sylius.user.last_name.not_blank</source>
<target>Please enter a last name.</target>
</trans-unit>
</body>
</file>
</xliff>

View file

@ -136,18 +136,25 @@ class DataContext extends BehatContext implements KernelAwareInterface
$data['email'],
isset($data['password']) ? $data['password'] : $this->faker->word(),
'ROLE_USER',
isset($data['enabled']) ? $data['enabled'] : true
isset($data['enabled']) ? $data['enabled'] : true,
$data['address']
);
}
}
public function thereIsUser($email, $password, $role = null, $enabled = 'yes')
public function thereIsUser($username, $password, $role = null, $enabled = 'yes', $address = null)
{
$user = new User();
$user->setEmail($email);
$user->setFirstname($this->faker->firstName);
$user->setLastname($this->faker->lastName);
$user->setEmail($this->faker->email());
$user->setEnabled('yes' === $enabled);
$user->setPlainPassword($password);
if (null !== $address) {
$user->setShippingAddress($this->createAddress($address));
}
if (null !== $role) {
$user->addRole($role);
}

View file

@ -13,11 +13,22 @@ sylius_backend_user_index:
sorting:
id: desc
sylius_backend_user_update:
pattern: /{id}/edit
methods: [GET, PUT, POST]
defaults:
_controller: sylius.controller.user:updateAction
_sylius:
template: SyliusWebBundle:Backend/User:update.html.twig
redirect: sylius_backend_user_show
sylius_backend_user_delete:
pattern: /{id}
methods: [DELETE]
defaults:
_controller: sylius.controller.user:deleteAction
_sylius:
redirect: sylius_backend_user_index
sylius_backend_user_show:
pattern: /{id}

View file

@ -2,6 +2,26 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file source-language="en" datatype="plaintext" original="file.ext">
<body>
<trans-unit id="aa5d1d6b185c783bb19dc29190828a5e" resname="sylius.account.home.email">
<source>sylius.account.home.email</source>
<target>Email : </target>
</trans-unit>
<trans-unit id="6968e9427145cfed58f58e5a2a6bcf06" resname="sylius.account.home.id">
<source>sylius.account.home.id</source>
<target>Customer ID : </target>
</trans-unit>
<trans-unit id="5f81f7f249201ad12ab74f5a7da6afcd" resname="sylius.account.home.outline">
<source>sylius.account.home.outline</source>
<target>Enjoy all the features that are available on your personal space to view, track and manage all your data.</target>
</trans-unit>
<trans-unit id="c501f09ad630e9e77e7ba2d401a30656" resname="sylius.account.home.since">
<source>sylius.account.home.since</source>
<target>You are customer since</target>
</trans-unit>
<trans-unit id="4c4234eba4ccf272a578ae3161fd2456" resname="sylius.account.home.welcome">
<source>sylius.account.home.welcome</source>
<target>Welcome to your space</target>
</trans-unit>
<trans-unit id="94508ad78d6cdae4de43ed99efed1fc6" resname="sylius.add_to_cart">
<source>sylius.add_to_cart</source>
<target>Add to cart</target>
@ -10,14 +30,14 @@
<source>sylius.address.city</source>
<target>City</target>
</trans-unit>
<trans-unit id="36d1054361378200825465eaf80c5807" resname="sylius.address.company">
<source>sylius.address.company</source>
<target>Company</target>
</trans-unit>
<trans-unit id="13bb7a2428b440096560dc9f179b29e7" resname="sylius.address.country">
<source>sylius.address.country</source>
<target>Country</target>
</trans-unit>
<trans-unit id="41289d84073d3bca039e147207c78037" resname="sylius.address.edit.header">
<source>sylius.address.edit.header</source>
<target>sylius.address.edit.header</target>
</trans-unit>
<trans-unit id="1ee551ccff556f9d96bd0c07d3e6628c" resname="sylius.address.firstname">
<source>sylius.address.firstname</source>
<target>First name</target>
@ -346,6 +366,26 @@
<source>sylius.form.choose_file</source>
<target>Choose file</target>
</trans-unit>
<trans-unit id="737d82e384946e4946cfea34afb9b7d8" resname="sylius.form.frontend.password.confirmation">
<source>sylius.form.frontend.password.confirmation</source>
<target>Confirmation</target>
</trans-unit>
<trans-unit id="b771f518bbcb9c488ca04c3f823dc9d9" resname="sylius.form.frontend.password.current">
<source>sylius.form.frontend.password.current</source>
<target>Current password</target>
</trans-unit>
<trans-unit id="3081a42d6da5f25be3e47723f66bab9d" resname="sylius.form.frontend.password.new">
<source>sylius.form.frontend.password.new</source>
<target>New password</target>
</trans-unit>
<trans-unit id="f79f1f6a2584f1542be7e6a9bab5d988" resname="sylius.form.frontend.password.title">
<source>sylius.form.frontend.password.title</source>
<target>Change my password</target>
</trans-unit>
<trans-unit id="b41497d414e58dae641cf537989578b8" resname="sylius.form.frontend.profile.title">
<source>sylius.form.frontend.profile.title</source>
<target>Edit my personal information</target>
</trans-unit>
<trans-unit id="725075e6afc8a166392a2261d7880d37" resname="sylius.form.login.password">
<source>sylius.form.login.password</source>
<target>Password</target>
@ -354,6 +394,22 @@
<source>sylius.form.login.email</source>
<target>Email</target>
</trans-unit>
<trans-unit id="24a58cc80b3622348ed028ea8b9793ac" resname="sylius.form.profile.email">
<source>sylius.form.profile.email</source>
<target>Email</target>
</trans-unit>
<trans-unit id="d84fd73990d8cb5f31054749096220d7" resname="sylius.form.profile.firstName">
<source>sylius.form.profile.firstName</source>
<target>First name</target>
</trans-unit>
<trans-unit id="f434362fba3003af96b35062e2fc1c54" resname="sylius.form.profile.lastName">
<source>sylius.form.profile.lastName</source>
<target>Last name</target>
</trans-unit>
<trans-unit id="4b98ba240ca8c3cf96133a7b78d765f0" resname="sylius.form.profile.username">
<source>sylius.form.profile.username</source>
<target>Username</target>
</trans-unit>
<trans-unit id="25b6370883ff5b94aef1ceb697b6d3f6" resname="sylius.gallery.next">
<source>sylius.gallery.next</source>
<target>Next</target>
@ -1454,6 +1510,10 @@
<source>sylius.taxonomy.update_header</source>
<target>Editing taxonomy</target>
</trans-unit>
<trans-unit id="d4dd621e8d7998e4dcc0aa3093c024a1" resname="sylius.user.billing_address">
<source>sylius.user.billing_address</source>
<target>Billing address</target>
</trans-unit>
<trans-unit id="e4b61ff5e1add3eef1f9a5433aab958e" resname="sylius.user.email">
<source>sylius.user.email</source>
<target>E-Mail</target>
@ -1470,6 +1530,10 @@
<source>sylius.user.filter.unconfirmed</source>
<target>Unconfirmed accounts</target>
</trans-unit>
<trans-unit id="538e68a9b291a09e2bd0f48bf1db260d" resname="sylius.user.first_name">
<source>sylius.user.first_name</source>
<target>First name</target>
</trans-unit>
<trans-unit id="3da9dd6cb0fbafd069230df3f6ef9837" resname="sylius.user.general_info">
<source>sylius.user.general_info</source>
<target>User "%username%" general info</target>
@ -1486,6 +1550,14 @@
<source>sylius.user.last_login</source>
<target>Last login</target>
</trans-unit>
<trans-unit id="a891001243af49a114b41d2d430b96cf" resname="sylius.user.last_name">
<source>sylius.user.last_name</source>
<target>Last name</target>
</trans-unit>
<trans-unit id="35a2e8d0fe7103442cd041fc024a4e86" resname="sylius.user.manage">
<source>sylius.user.manage</source>
<target>manage users</target>
</trans-unit>
<trans-unit id="2fa67405e07e8ca4d30a3d6424b50940" resname="sylius.user.no_results">
<source>sylius.user.no_results</source>
<target>There are no users to display.</target>
@ -1496,16 +1568,24 @@
</trans-unit>
<trans-unit id="430a7b28909dfcb968875b3862593d6d" resname="sylius.user.orders">
<source>sylius.user.orders</source>
<target>sylius.user.orders</target>
<target>User orders</target>
</trans-unit>
<trans-unit id="b541c0a6d2177cb6764afd02a184e17b" resname="sylius.user.recent_header">
<source>sylius.user.recent_header</source>
<target>Recent users</target>
</trans-unit>
<trans-unit id="1cc3843529c72b288a252bcf91c12492" resname="sylius.user.shipping_address">
<source>sylius.user.shipping_address</source>
<target>Shipping address</target>
</trans-unit>
<trans-unit id="bffeb700587dcbddc8a1153e569a802f" resname="sylius.user.show_header">
<source>sylius.user.show_header</source>
<target>User details</target>
</trans-unit>
<trans-unit id="4724f9b5b450129ebaad98f2c8ab74b3" resname="sylius.user.update_header">
<source>sylius.user.update_header</source>
<target>Editing user</target>
</trans-unit>
<trans-unit id="28a2e95eafe4003ebc5d86a4d3ee2123" resname="sylius.user.username">
<source>sylius.user.username</source>
<target>Username</target>
@ -1606,82 +1686,6 @@
<source>sylius.zone_member.members</source>
<target>Members</target>
</trans-unit>
<trans-unit id="0f0f04f09c17d10081eb4993fa863550ecc9d33d" resname="change_password.flash.success">
<source>change_password.flash.success</source>
<target state="new">Your password has been changed.</target>
</trans-unit>
<trans-unit id="a067e7e04712aa036ad446379831d4a5fd00c27d" resname="profile.flash.updated">
<source>profile.flash.updated</source>
<target state="new">Your personal information have been updated.</target>
</trans-unit>
<trans-unit id="3d0bc274c189b6aa1385bfdd6b9067247ecec200" resname="sylius.account.home.email">
<source>sylius.account.home.email</source>
<target state="new">Email : </target>
</trans-unit>
<trans-unit id="9b3c46ca5d6573965c1992a9968109f53dc70cea" resname="sylius.account.home.id">
<source>sylius.account.home.id</source>
<target state="new">Customer ID : </target>
</trans-unit>
<trans-unit id="541928c0e4a54f16b91bf983e3eafd46928053aa" resname="sylius.account.home.outline">
<source>sylius.account.home.outline</source>
<target state="new">Enjoy all the features that are available on your personal space to view, track and manage all your data.</target>
</trans-unit>
<trans-unit id="77658adaa51262d9d500b4107908a1bbd18048a9" resname="sylius.account.home.since">
<source>sylius.account.home.since</source>
<target state="new">You are customer since</target>
</trans-unit>
<trans-unit id="ae8ba795bdbe353a378ea72e51194d2691a9338d" resname="sylius.account.home.welcome">
<source>sylius.account.home.welcome</source>
<target state="new">Welcome to your space</target>
</trans-unit>
<trans-unit id="a2fc8502b1fa534d9c312e5f3a6ffea4d12658d5" resname="sylius.account.title">
<source>sylius.account.title</source>
<target state="new">My account</target>
</trans-unit>
<trans-unit id="94916ad253d5fe678af936bfcc3ade235be465bf" resname="sylius.form.frontend.password.title">
<source>sylius.form.frontend.password.title</source>
<target state="new">Change my password</target>
</trans-unit>
<trans-unit id="e5c9560e26b4c561723653c88d4b6b1801c9eaf7" resname="sylius.form.frontend.profile.title">
<source>sylius.form.frontend.profile.title</source>
<target state="new">Edit my personal information</target>
</trans-unit>
<trans-unit id="df4e0ba47974427785ba76614a958af03e6741f6" resname="sylius.form.frontend.password.confirmation">
<source>sylius.form.frontend.password.confirmation</source>
<target state="new">Confirmation</target>
</trans-unit>
<trans-unit id="c8bf38f33bff9aa29dfc8321e2f9e6063f704b30" resname="sylius.form.frontend.password.current">
<source>sylius.form.frontend.password.current</source>
<target state="new">Current password</target>
</trans-unit>
<trans-unit id="89cef5f4148ead625041b9e94838ba8fba55a2ec" resname="sylius.form.frontend.password.new">
<source>sylius.form.frontend.password.new</source>
<target state="new">New password</target>
</trans-unit>
<trans-unit id="8aad64651dc162f2179df2eea7c03e345e88c1cc" resname="sylius.form.profile.email">
<source>sylius.form.profile.email</source>
<target state="new">Email</target>
</trans-unit>
<trans-unit id="c8487950ff3c39cb0f6d59262b0bef15f01a5254" resname="sylius.form.profile.firstName">
<source>sylius.form.profile.firstName</source>
<target state="new">First name</target>
</trans-unit>
<trans-unit id="9d74713fb46f9207b3de83fcbdc5cbe4811e0208" resname="sylius.form.profile.lastName">
<source>sylius.form.profile.lastName</source>
<target state="new">Last name</target>
</trans-unit>
<trans-unit id="beef4e8d02d014dbb6d5042f2e48d519d2b069bc" resname="sylius.form.profile.username">
<source>sylius.form.profile.username</source>
<target state="new">Username</target>
</trans-unit>
<trans-unit id="5d5cb1a5553b14920408b3dfa00348dab7cdac73" resname="sylius.user.order.no_results">
<source>sylius.user.order.no_results</source>
<target state="new">sylius.user.order.no_results</target>
</trans-unit>
<trans-unit id="ad9e02dd9c29bee32350f3b944f93af61d39bb61" resname="sylius.user.orders">
<source>sylius.user.orders</source>
<target state="new">sylius.user.orders</target>
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,45 @@
<table class="table table-bordered">
<thead>
<tr>
<th colspan="2">{{ title }}</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>{{ 'sylius.address.firstname'|trans }}</strong></td>
<td>{{ address.firstname }}</td>
</tr>
<tr>
<td><strong>{{ 'sylius.address.lastname'|trans }}</strong></td>
<td>{{ address.lastname }}</td>
</tr>
{% if address.company is not empty %}
<tr>
<td><strong>{{ 'sylius.address.company'|trans }}</strong></td>
<td>{{ address.company }}</td>
</tr>
{% endif %}
<tr>
<td><strong>{{ 'sylius.address.country'|trans }}</strong></td>
<td>{{ address.country }}</td>
</tr>
{% if address.province is not empty %}
<tr>
<td><strong>{{ 'sylius.address.province'|trans }}</strong></td>
<td>{{ address.province }}</td>
</tr>
{% endif %}
<tr>
<td><strong>{{ 'sylius.address.street'|trans }}</strong></td>
<td>{{ address.street }}</td>
</tr>
<tr>
<td><strong>{{ 'sylius.address.city'|trans }}</strong></td>
<td>{{ address.city }}</td>
</tr>
<tr>
<td><strong>{{ 'sylius.address.postcode'|trans }}</strong></td>
<td>{{ address.postcode }}</td>
</tr>
</tbody>
</table>

View file

@ -108,85 +108,10 @@
</div>
<div class="row-fluid">
<div class="span6">
<table class="table table-bordered">
<thead>
<tr>
<th colspan="2">{{ 'sylius.order.shipping_address'|trans }}</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>{{ 'sylius.address.firstname'|trans }}</strong></td>
<td>{{ order.shippingAddress.firstname }}</td>
</tr>
<tr>
<td><strong>{{ 'sylius.address.lastname'|trans }}</strong></td>
<td>{{ order.shippingAddress.lastname }}</td>
</tr>
<tr>
<td><strong>{{ 'sylius.address.country'|trans }}</strong></td>
<td>{{ order.shippingAddress.country }}</td>
</tr>
{% if order.shippingAddress.province is not empty %}
<tr>
<td><strong>{{ 'sylius.address.province'|trans }}</strong></td>
<td>{{ order.shippingAddress.province }}</td>
</tr>
{% endif %}
<tr>
<td><strong>{{ 'sylius.address.street'|trans }}</strong></td>
<td>{{ order.shippingAddress.street }}</td>
</tr>
<tr>
<td><strong>{{ 'sylius.address.city'|trans }}</strong></td>
<td>{{ order.shippingAddress.city }}</td>
</tr>
<tr>
<td><strong>{{ 'sylius.address.postcode'|trans }}</strong></td>
<td>{{ order.shippingAddress.postcode }}</td>
</tr>
</tbody>
</table>
{% include 'SyliusWebBundle:Backend/Address:_show.html.twig' with {'address': order.shippingAddress, 'title': 'sylius.order.shipping_address'|trans} %}
</div>
<div class="span6">
<table class="table table-bordered">
<thead>
<tr>
<th colspan="2">{{ 'sylius.order.billing_address'|trans }}</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>{{ 'sylius.address.firstname'|trans }}</strong></td>
<td>{{ order.billingAddress.firstname }}</td>
</tr>
<tr>
<td><strong>{{ 'sylius.address.lastname'|trans }}</strong></td>
<td>{{ order.billingAddress.lastname }}</td>
</tr>
<tr>
<td><strong>{{ 'sylius.address.country'|trans }}</strong></td>
<td>{{ order.billingAddress.country }}</td>
</tr>
{% if order.billingAddress.province is not empty %}
<tr>
<td><strong>{{ 'sylius.address.province'|trans }}</strong></td>
<td>{{ order.billingAddress.province }}</td>
</tr>
{% endif %}
<tr>
<td><strong>{{ 'sylius.address.street'|trans }}</strong></td>
<td>{{ order.billingAddress.street }}</td>
</tr>
<tr>
<td><strong>{{ 'sylius.address.city'|trans }}</strong></td>
<td>{{ order.billingAddress.city }}</td>
</tr>
<tr>
<td><strong>{{ 'sylius.address.postcode'|trans }}</strong></td>
<td>{{ order.billingAddress.postcode }}</td>
</tr>
</tbody>
{% include 'SyliusWebBundle:Backend/Address:_show.html.twig' with {'address': order.billingAddress, 'title': 'sylius.order.billing_address'|trans} %}
</table>
</div>
</div>

View file

@ -0,0 +1,24 @@
{{ form_errors(form) }}
<div class="row-fluid">
<fieldset>
{{ form_row(form.firstName) }}
{{ form_row(form.lastName) }}
{{ form_row(form.username) }}
{{ form_row(form.email) }}
{{ form_row(form.enabled) }}
</fieldset>
<div class="span5 well">
<fieldset>
<h4>{{ form.shippingAddress.vars.label|trans({}, form.shippingAddress.vars.translation_domain) }}</h4>
{% include 'SyliusWebBundle:Frontend/Form:_address.html.twig' with {'form': form.shippingAddress} %}
{{ form_row(form.differentBillingAddress) }}
</fieldset>
</div>
<div id="sylius-billing-address-container" class="span5 well">
<fieldset>
<h4>{{ form.billingAddress.vars.label|trans({}, form.billingAddress.vars.translation_domain) }}</h4>
{% include 'SyliusWebBundle:Frontend/Form:_address.html.twig' with {'form': form.billingAddress} %}
</fieldset>
</div>
</div>
{{ form_rest(form) }}

View file

@ -1,5 +1,8 @@
{% macro list(users) %}
{% import 'SyliusWebBundle:Backend/Macros:buttons.html.twig' as buttons %}
{% import 'SyliusWebBundle:Backend/Macros:alerts.html.twig' as alerts %}
{% if users|length > 0 %}
<table id="users" class="table table-bordered">
<thead>
@ -24,9 +27,9 @@
</td>
<td>
<div class="btn-group pull-right">
<a href="{{ path('sylius_backend_user_show', {'id': user.id}) }}" class="btn">
<i class="icon-book"></i> {{ 'sylius.show'|trans }}
</a>
{{ buttons.show(path('sylius_backend_user_show', {'id': user.id})) }}
{{ buttons.edit(path('sylius_backend_user_update', {'id': user.id})) }}
{{ buttons.delete(path('sylius_backend_user_delete', {'id': user.id})) }}
</div>
</td>
</tr>
@ -34,9 +37,7 @@
</tbody>
</table>
{% else %}
<div class="alert alert-info">
<h4 class="alert-heading">{{ 'sylius.alert.info'|trans }}</h4>
{{ 'sylius.user.no_results'|trans }}
{{ alerts.info('sylius.user.no_results'|trans) }}
</div>
{% endif %}

View file

@ -1,10 +1,18 @@
{% extends 'SyliusWebBundle:Backend:layout.html.twig' %}
{% import 'SyliusWebBundle:Backend/Macros:buttons.html.twig' as buttons %}
{% block content %}
<div class="page-header">
<h1>{{ 'sylius.user.show_header'|trans|raw }}</h1>
</div>
<div class="well well-small">
{{ buttons.manage(path('sylius_backend_user_index'), 'sylius.user.manage'|trans) }}
{{ buttons.edit(path('sylius_backend_user_update', {'id': user.id})) }}
{{ buttons.delete(path('sylius_backend_user_delete', {'id': user.id})) }}
</div>
<table class="table table-bordered">
<thead>
<tr>
@ -16,6 +24,18 @@
<td><strong>{{ 'sylius.user.id'|trans }}</strong></td>
<td>{{ user.id }}</td>
</tr>
{% if user.firstName %}
<tr>
<td><strong>{{ 'sylius.user.first_name'|trans }}</strong></td>
<td>{{ user.firstName }}</td>
</tr>
{% endif %}
{% if user.lastName %}
<tr>
<td><strong>{{ 'sylius.user.last_name'|trans }}</strong></td>
<td>{{ user.lastName }}</td>
</tr>
{% endif %}
<tr>
<td><strong>{{ 'sylius.user.username'|trans }}</strong></td>
<td>{{ user.username }}</td>
@ -41,6 +61,18 @@
</tbody>
</table>
<div class="row-fluid">
{% if user.shippingAddress %}
<div class="span6">
{% include 'SyliusWebBundle:Backend/Address:_show.html.twig' with {'address': user.shippingAddress, 'title': 'sylius.user.shipping_address'|trans} %}
</div>
{% endif %}
{% if user.billingAddress %}
<div class="span6">
{% include 'SyliusWebBundle:Backend/Address:_show.html.twig' with {'address': user.billingAddress, 'title': 'sylius.user.billing_address'|trans} %}
</div>
{% endif %}
</div>
<div class="row-fluid">
<div class="well">
<h3>{{ 'sylius.user.orders'|trans }}</h3>

View file

@ -0,0 +1,22 @@
{% extends 'SyliusWebBundle:Backend:layout.html.twig' %}
{% from 'SyliusWebBundle:Backend/Macros:actions.html.twig' import update %}
{% block javascripts %}
{{ parent() }}
{% javascripts '@SyliusWebBundle/Resources/assets/js/province-choices.js' %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
{% endblock %}
{% block content %}
<div class="page-header">
<h1>{{ 'sylius.user.update_header'|trans|raw }}</h1>
</div>
<form action="{{ path('sylius_backend_user_update', {'id': user.id}) }}" method="post" class="form-horizontal" novalidate>
<input type="hidden" name="_method" value="PUT">
{% include 'SyliusWebBundle:Backend/User:_form.html.twig' %}
{{ update() }}
</form>
{% endblock %}