Skip to content

Commit

Permalink
Merge pull request #538 from PROCERGS/dev
Browse files Browse the repository at this point in the history
Version 1.11.1
  • Loading branch information
guilhermednt authored Sep 23, 2016
2 parents 13849c1 + aad097c commit 3946dd7
Show file tree
Hide file tree
Showing 18 changed files with 208 additions and 105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ private function addField(
) {
$placeOfBirthLevel = '';
switch ($scope) {
case 'name':
case 'surname':
case 'full_name':
$this->addPersonField(
Expand Down Expand Up @@ -309,7 +310,11 @@ private function addField(
null,
array(
'required' => true,
'attr' => [ 'class' => 'form-control intl-tel' ],
'label' => 'person.form.mobile.label',
'attr' => [
'class' => 'form-control intl-tel',
'placeholder' => 'person.form.mobile.placeholder',
],
'label_attr' => ['class' => 'intl-tel-label'],
)
);
Expand Down
6 changes: 5 additions & 1 deletion src/LoginCidadao/CoreBundle/Entity/Person.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Person extends BaseUser implements PersonInterface, TwoFactorInterface, Ba

/**
* @JMS\Expose
* @JMS\Groups({"first_name","full_name","public_profile","given_name"})
* @JMS\Groups({"first_name","full_name","public_profile","given_name","name"})
* @ORM\Column(type="string", nullable=true)
* @Assert\NotBlank(message="Please enter your name.", groups={"Profile"})
* @Assert\Length(
Expand Down Expand Up @@ -147,6 +147,10 @@ class Person extends BaseUser implements PersonInterface, TwoFactorInterface, Ba
* @JMS\Groups({"mobile","phone_number"})
* @ORM\Column(type="string", nullable=true)
* @JMS\Since("1.0")
* @LCAssert\E164PhoneNumber(
* maxMessage="person.validation.mobile.length.max",
* groups={"Registration", "LoginCidadaoRegistration", "Dynamic", "Profile"}
* )
*/
protected $mobile;

Expand Down
8 changes: 5 additions & 3 deletions src/LoginCidadao/CoreBundle/Form/Type/ProfileFormType.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ public function buildForm(FormBuilderInterface $builder, array $options)
->add('mobile', null,
array(
'required' => false,
'label' => 'form.mobile',
'translation_domain' => 'FOSUserBundle',
'attr' => [ 'class' => 'form-control intl-tel' ],
'label' => 'person.form.mobile.label',
'attr' => [
'class' => 'form-control intl-tel',
'placeholder' => 'person.form.mobile.placeholder',
],
'label_attr' => ['class' => 'intl-tel-label'],
))
->add('image', 'Vich\UploaderBundle\Form\Type\VichFileType',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private function addDynamicField(FormBuilderInterface $builder, $scope)
'mobile',
null,
[
'required' => true,
'required' => false,
'label_attr' => ['class' => 'intl-tel-label'],
'attr' => [
'placeholder' => 'person.form.mobile.placeholder',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,10 @@ security.login.submit: 'Log in'
or: or
'Use your social networks': 'Use your social networks'
registration.email.click: 'click here to confirm your email'
'Upload another picture': 'Upload another picture'
'Do you really want to unlink <strong class="social-network-name"></strong>?': 'Do you really want to unlink <strong class="social-network-name"></strong>?'
Yes: Yes
'Use accounts from other services': 'Use accounts from other services'
'By clicking on create account, you agree to our <a href="%linkTerms%">Privacy and Terms of Service</a>, including our Use of Cookies.': 'By clicking on create account, you agree to our <a href="%linkTerms%">Privacy and Terms of Service</a>, including our Use of Cookies.'
Change: Change
Personal Information: Personal Information
Contact Information: Contact Information
Social Networks and other connections: Social Networks and other connections
Account Password: Account Password
Use your Facebook picture: Use your Facebook picture
Remove your picture: Remove your picture
Your profile picure will be changed to <strong></strong>: Your profile picure will be changed to <strong></strong>
Your Facebook profile picure will be used.: Your Facebook profile picure will be used.
form.register.call_to_action: I'm not registered yet
form.login.call_to_action: I'm alreay registered
person.form.birthdate.placeholder: dd/mm/yyyy
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ registration.email.subject: 'Confirmação de email para %username%!'
registration.email.message: "Olá, %username%!\n\nPara completar a validação da sua conta, clique no link: %confirmationUrl%\n\nAtenciosamente, A Equipe.\n"
registration.email.message.html: "Olá, %username%!<br><br>Para completar a validação da sua conta clique no botão a seguir."
registration.register: 'Registre-se aqui!'
profile.edit.submit: Salvar
profile.show.username: Usuário
profile.show.email: Email
layout.logged_in_as: 'Conectado como %username%'
Expand Down Expand Up @@ -77,7 +76,6 @@ registration.email.click: 'Confirmar Email'
'Log in using your Citizen''s Login': 'Acesse usando seu Login Cidadão'
'Upload another picture': 'Enviar outra foto'
'By clicking on create account, you agree to our <a href="%linkTerms%">Privacy and Terms of Service</a>, including our Use of Cookies.': 'Ao clicar em criar conta, você concorda com a <a href="%linkTerms%">Privacidade e Termos de uso</a> do serviço, incluindo nosso uso de cookies.'
'Do you really want to unlink <strong class="social-network-name"></strong>?': 'Tem certeza que deseja desvincular sua conta do <strong class="social-network-name"></strong>?'
Yes: Sim
'Continue Registration': 'Continuar Cadastro'
facebook.token.error: 'Aparentemente houve um erro na autenticação com o Facebook. Por favor, tente logar novamente!'
Expand All @@ -89,15 +87,7 @@ security.login.remember_me: 'Manter conectado'
'General': 'Geral'
'RG' : 'RG'
'add': 'Adicionar'
Change: Alterar
Personal Information: Informações Pessoais
Contact Information: Informações de Contato
Social Networks and other connections: Redes Sociais e outras conexões
Account Password: Senha da sua Conta
Use your Facebook picture: Usar sua foto do Facebook
Remove your picture: Remover foto do perfil
Your profile picure will be changed to <strong></strong>: Sua foto de perfil será trocada para <strong></strong>
Your Facebook profile picure will be used.: Sua foto de perfil do Facebook será usada.
form.register.call_to_action: Cadastre-se aqui
form.login.call_to_action: Entrar no Login Cidadão
person.form.birthdate.placeholder: dd/mm/aaaa
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,9 @@ person.form:
cpf:
placeholder: Type your CPF (brazilian taxpayer ID)
birthdate.placeholder: dd/mm/yyyy
mobile.placeholder: Type your mobile phone
mobile:
label: Mobile phone
placeholder: Type your mobile phone
tasks.confirm_email:
title: Confirm your email to continue
body: An email was sent to the address you registered. Open this email and click the confirmation button on the message.
Expand Down Expand Up @@ -481,3 +483,29 @@ contact:
label: Message
placeholder: Describe the technical problem you are having.
submit: Send message
profile:
title: Profile
picture:
change: Change
upload_another: Upload another picture
use_facebook: Use your Facebook picture
change_to:
template: Your profile picure will be changed to <strong></strong>
facebook: Your Facebook profile picure will be used
personal_info:
title: Personal Information
contact_info:
title: Contact Information
connections:
title: Social Networks and other connections
connect:
facebook: Connect with Facebook
twitter: Connect with Twitter
google: Connect with Google
disconnect:
confirm:
template: Do you really want to unlink <strong class="social-network-name"></strong>?
yes: Yes
no: No
submit: Save
scope_details.handle.title: What is this?
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,9 @@ person.form:
cpf:
placeholder: Digite seu CPF
birthdate.placeholder: dd/mm/aaaa
mobile.placeholder: Digite seu telefone celular
mobile:
label: Celular
placeholder: Digite seu telefone celular
tasks.confirm_email:
title: Confirme seu email para continuar
body: Um email foi enviado para o endereço informado em seu cadastro. Abra esse email e clique no botão de confirmação presente na mensagem.
Expand Down Expand Up @@ -890,3 +892,29 @@ contact:
label: Mensagem
placeholder: Descreva o problema técnico que você está tendo.
submit: Enviar
profile:
title: Perfil
picture:
change: Alterar
upload_another: Upload another picture
use_facebook: Usar sua foto do Facebook
change_to:
template: Sua foto de perfil será trocada para <strong></strong>
facebook: Sua foto de perfil do Facebook será usada.
personal_info:
title: Informações Pessoais
contact_info:
title: Informações de Contato
connections:
title: Redes Sociais e outras conexões
connect:
facebook: Conectar usando FacebookConectar usando Facebook
twitter: Conectar usando Twitter
google: Conectar usando Google
disconnect:
confirm:
template: Tem certeza que deseja desvincular sua conta do <strong class="social-network-name"></strong>?
yes: Sim
no: Não
submit: Salvar
scope_details.handle.title: O que é isso?
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ person.validation:
min: The password must have at least {{ limit }} characters
max: The password must have at most {{ limit }} characters
cpf.already_used: This CPF is already in use.
mobile.length:
max: This phone number is too long. The limit is 15 numbers including country and area codes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ person.validation:
min: A senha deve ter, ao menos, {{ limit }} caracteres
max: A senha deve ter, no máximo, {{ limit }} caracteres
cpf.already_used: Esse CPF já está cadastrado.
mobile.length:
max: O telefone informado é muito longo. O limite é de 15 números incluíndo os códigos de área de país.
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{% extends "LoginCidadaoCoreBundle::base.loggedIn.html.twig" %}

{% block title %}{{ 'Profile' | trans }} | {{ parent() }}{% endblock title %}
{% block title %}{{ 'profile.title' | trans }} | {{ parent() }}{% endblock title %}

{% block content %}
<div id="profile-edit" class="content profile-edit">

<h1 class="visible-xs">{% trans %}Profile{% endtrans %}</h1>

{% trans_default_domain 'FOSUserBundle' %}
<h1 class="visible-xs">{{ 'profile.title' | trans }}</h1>

{{ form_start(form, {'action': path('fos_user_profile_edit'), 'attr': {'role':'form' } }) }}
{{ form_errors(form) }}
Expand All @@ -21,10 +19,10 @@
<img src="{{ include("LoginCidadaoCoreBundle:Person:currentUserPicture.html.twig", {'targetPerson': app.user}) }}"
class="profile-picture">
<button type="button" class="btn btn-xs btn-link btn-block change-picture"
title="{% trans %}Upload another picture{% endtrans %}">{{ 'Change' | trans }}</button>
title="{{ 'profile.picture.upload_another' | trans }}">{{ 'profile.picture.change' | trans }}</button>
</div>
<div class="media-body">
<h2 class="media-heading personal-info">{{ 'Personal Information' | trans }}</h2>
<h2 class="media-heading personal-info">{{ 'profile.personal_info.title' | trans }}</h2>
{{ app.user.shortDisplayName }}
</div>
</div>
Expand All @@ -40,7 +38,7 @@
{% if app.user.socialNetworksPicture is not null %}
<label class="btn btn-lg btn-info btn-external-pic-preview"
data-toggle="tooltip" data-placement="bottom"
title="{{ 'Use your Facebook picture' | trans }}">
title="{{ 'profile.picture.use_facebook' | trans }}">
<input class="use-facebook" type="radio"
name="{{ form.image.delete.vars.full_name }}" autocomplete="off">
<img class="facebook-profile-pic-preview"
Expand All @@ -56,15 +54,15 @@
{% endif %}

<label class="btn btn-lg btn-success btn-upload" data-toggle="tooltip"
data-placement="bottom" title="{{ 'Upload another picture' | trans }}">
data-placement="bottom" title="{{ 'profile.picture.upload_another' | trans }}">
<input class="upload-picture" type="radio" name="{{ imageDeleteName }}" value="0">
<span class="glyphicon glyphicon-picture" aria-hidden="true"></span>
</label>
</div>

<div class="activity-desc">
<span class="upload">{{ 'Your profile picure will be changed to <strong></strong>' | trans | raw }}</span>
<span class="facebook-pic">{{ 'Your Facebook profile picure will be used.' | trans }}</span>
<span class="upload">{{ 'profile.picture.change_to.template' | trans | raw }}</span>
<span class="facebook-pic">{{ 'profile.picture.change_to.facebook' | trans }}</span>
</div>

{{ form_widget(form.image.file) }}
Expand All @@ -83,7 +81,7 @@

<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">{{ 'Contact Information' | trans }}</h2>
<h2 class="panel-title">{{ 'profile.contact_info.title' | trans }}</h2>
</div>
<div class="panel-body">
{{ form_row(form.email) }}
Expand All @@ -94,14 +92,14 @@
{% if third_party_login is not empty %}
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">{{ 'Social Networks and other connections' | trans }}</h2>
<h2 class="panel-title">{{ 'profile.connections.title' | trans }}</h2>
</div>
<div class="panel-body">
{% if third_party_login.facebook | default(false) %}
{% if app.user.facebookId is null %}
<div class="connect facebook disabled">
<a class="col-xs-11 col-xs-offset-1 username"
href="{{ path('lc_link_facebook') }}">{{ 'Connect with Facebook' | trans }}</a>
href="{{ path('lc_link_facebook') }}">{{ 'profile.connections.connect.facebook' | trans }}</a>
</div>
{% else %}
<div class="connect facebook">
Expand All @@ -123,7 +121,7 @@
{% if app.user.twitterId is null %}
<div class="connect twitter disabled">
<a href="{{ path('hwi_oauth_service_redirect', {'service': 'twitter'}) }}"
class="col-xs-11 col-xs-offset-1 username">{{ 'Connect with Twitter' | trans }}</a>
class="col-xs-11 col-xs-offset-1 username">{{ 'profile.connections.connect.twitter' | trans }}</a>
</div>
{% else %}
<div class="connect twitter">
Expand All @@ -145,7 +143,7 @@
{% if app.user.googleId is null %}
<div class="connect google disabled">
<a href="{{ path('hwi_oauth_service_redirect', {'service': 'google'}) }}"
class="col-xs-11 col-xs-offset-1 username">{{ 'Connect with Google' | trans }}</a>
class="col-xs-11 col-xs-offset-1 username">{{ 'profile.connections.connect.google' | trans }}</a>
</div>
{% else %}
<div class="connect google">
Expand All @@ -170,17 +168,18 @@

<div class="row unlink-confirmation">
<div class="alert alert-danger col-xs-10 col-xs-offset-1">
<p class="title">{% trans %}Do you really want to unlink <strong
class="social-network-name"></strong>?{% endtrans %}</p>
<p class="title">{{ 'profile.connections.disconnect.confirm.template' | trans | raw }}</p>

<div class="row">
<div class="col-xs-6">
<a href="#" class="btn btn-danger btn-sm btn-block confirm">{% trans %}
Yes{% endtrans %}</a>
<a href="#" class="btn btn-danger btn-sm btn-block confirm">
{{ 'profile.connections.disconnect.confirm.yes' | trans }}
</a>
</div>
<div class="col-xs-6 text-right">
<a role="button" class="btn btn-default btn-sm btn-block cancel">{% trans %}
Cancel{% endtrans %}</a>
<a role="button" class="btn btn-default btn-sm btn-block cancel">
{{ 'profile.connections.disconnect.confirm.no' | trans }}
</a>
</div>
</div>
</div>
Expand All @@ -203,7 +202,7 @@
</div>

<div class="form-bar text-right">
<input class="btn btn-success" type="submit" value="{{ 'profile.edit.submit'|trans }}"/>
<input class="btn btn-success" type="submit" value="{{ 'profile.submit'|trans }}"/>
</div>
{{ form_end(form) }}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<span class="glyphicon glyphicon-plus-sign" title="{{ 'What is this?' | trans }}"></span>
<span class="glyphicon glyphicon-plus-sign" title="{{ 'scope_details.handle.title' | trans }}"></span>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<li><a href="{{ path('lc_about') }}">{% trans %}About Citizen's Login{% endtrans %}</a></li>
<li><a href="{{ path('lc_privacy') }}">{% trans %}Privacy and Terms of Service{% endtrans %}</a></li>
<li><a href="https://github.com/PROCERGS/login-cidadao/" target="_blank">{% trans %}GitHub Repository{% endtrans %}</a></li>
<li><a href="{{ asset('humans.txt') }}" target="_blank">humans.txt</a></li>
</ul>
</div>

Expand Down
Loading

0 comments on commit 3946dd7

Please sign in to comment.