Skip to content

Commit

Permalink
hotfix-21 added btn group for social networks login (link, unlink)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandr Yurchenko committed Mar 29, 2022
1 parent db3ed81 commit e33d6de
Show file tree
Hide file tree
Showing 7 changed files with 247 additions and 4 deletions.
44 changes: 42 additions & 2 deletions assets/css/section/front/main.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,49 @@
#select-language {
width: auto;
width: auto;

&:focus {
outline: none;
text-decoration: none;
box-shadow: none;
border: 1px solid #ced4da;
}
}
}

.social-group {
display: inline-block;
font-weight: 400;
color: #212529;
text-align: center;
vertical-align: middle;
user-select: none;
background-color: transparent;
border: 1px solid transparent;
padding: 0.375rem 0.75rem;
font-size: 1rem;
line-height: 1.5;
border-radius: 0.25rem;
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;

&--unlink {
color: #dc3545;
background-color: #f4f4f4;
border-color: #dc3545;
}

&--link {
color: #fff;
border-color: #28a745;
background-color: #28a745;

&:hover {
color: #fff;
cursor: pointer;
text-decoration: none;
}

&:focus {
color: #fff;
text-decoration: none;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% if socialName %}
<span class="social-group social-group--unlink">
{{ 'personal_account.social_group.link'|trans }}
</span>
<a class="social-group social-group--link" href="#">
{{ 'personal_account.social_group.unlink'|trans }}
</a>
{% else %}
<a class="social-group social-group--link" href="#">
{{ 'personal_account.social_group.link'|trans }}
</a>
<span class="social-group social-group--unlink">
{{ 'personal_account.social_group.unlink'|trans }}
</span>
{% endif %}
62 changes: 62 additions & 0 deletions templates/front/profile/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,68 @@
{{ 'personal_account.message'|trans }}
</div>
<hr/>
<div class="form-footer-buttons">
<table class="table table-borderless table-hover">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">{{ 'personal_account.social_group.integration_service'|trans }}</th>
<th scope="col">{{ 'personal_account.social_group.action'|trans }}</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 488 512" width="35" height="35">
<title>{{ 'personal_account.social_group.google'|trans }}</title>
<path d="M488 261.8C488 403.3 391.1 504 248 504 110.8 504 0 393.2 0 256S110.8 8 248 8c66.8 0 123 24.5 166.3 64.9l-67.5 64.9C258.5 52.6 94.3 116.6 94.3 256c0 86.5 69.1 156.6 153.7 156.6 98.2 0 135-70.4 140.8-106.9H248v-85.3h236.1c2.3 12.7 3.9 24.9 3.9 41.4z"/>
</svg>
</td>
<td>
{% include 'front/_embed/_utils/_social_network_link_unlink_btn.html.twig' with {'socialName': app.user.googleId} %}
</td>
</tr>
<tr>
<th scope="row">2</th>
<td>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512" width="35" height="35">
<title>{{ 'personal_account.social_group.yandex'|trans }}</title>
<path d="M153.1 315.8L65.7 512H2l96-209.8c-45.1-22.9-75.2-64.4-75.2-141.1C22.7 53.7 90.8 0 171.7 0H254v512h-55.1V315.8h-45.8zm45.8-269.3h-29.4c-44.4 0-87.4 29.4-87.4 114.6 0 82.3 39.4 108.8 87.4 108.8h29.4V46.5z"/>
</svg>
</td>
<td>
{% include 'front/_embed/_utils/_social_network_link_unlink_btn.html.twig' with {'socialName': app.user.yandexId} %}
</td>
</tr>
<tr>
<th scope="row">3</th>
<td>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" width="35" height="35">
<title>{{ 'personal_account.social_group.vkontakte'|trans }}</title>
<path d="M545 117.7c3.7-12.5 0-21.7-17.8-21.7h-58.9c-15 0-21.9 7.9-25.6 16.7 0 0-30 73.1-72.4 120.5-13.7 13.7-20 18.1-27.5 18.1-3.7 0-9.4-4.4-9.4-16.9V117.7c0-15-4.2-21.7-16.6-21.7h-92.6c-9.4 0-15 7-15 13.5 0 14.2 21.2 17.5 23.4 57.5v86.8c0 19-3.4 22.5-10.9 22.5-20 0-68.6-73.4-97.4-157.4-5.8-16.3-11.5-22.9-26.6-22.9H38.8c-16.8 0-20.2 7.9-20.2 16.7 0 15.6 20 93.1 93.1 195.5C160.4 378.1 229 416 291.4 416c37.5 0 42.1-8.4 42.1-22.9 0-66.8-3.4-73.1 15.4-73.1 8.7 0 23.7 4.4 58.7 38.1 40 40 46.6 57.9 69 57.9h58.9c16.8 0 25.3-8.4 20.4-25-11.2-34.9-86.9-106.7-90.3-111.5-8.7-11.2-6.2-16.2 0-26.2.1-.1 72-101.3 79.4-135.6z"/>
</svg>
</td>
<td>
{% include 'front/_embed/_utils/_social_network_link_unlink_btn.html.twig' with {'socialName': app.user.vkontakteId} %}
</td>
</tr>
<tr>
<th scope="row">4</th>
<td>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512" width="35" height="35">
<title>{{ 'personal_account.social_group.github'|trans }}</title>
<path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/>
</svg>
</td>
<td>
{% include 'front/_embed/_utils/_social_network_link_unlink_btn.html.twig' with {'socialName': app.user.githubId} %}
</td>
</tr>
</tbody>
</table>
</div>
<hr/>
<div class="form-footer-buttons">
{% if (is_granted('ROLE_ADMIN') or is_granted('ROLE_SUPER_ADMIN')) and app.user.verified %}
<a href="{{ path('admin_dashboard_show') }}" class="btn btn-link btn-dark">
Expand Down
54 changes: 54 additions & 0 deletions translations/messages.en.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1126,5 +1126,59 @@
<target>Edit</target>
</segment>
</unit>
<unit id="sVcu6kb" name="personal_account.social_group.name">
<segment>
<source>personal_account.social_group.name</source>
<target>Name</target>
</segment>
</unit>
<unit id="8d3i.6z" name="personal_account.social_group.action">
<segment>
<source>personal_account.social_group.action</source>
<target>Action</target>
</segment>
</unit>
<unit id="OlHpJ6k" name="personal_account.social_group.google">
<segment>
<source>personal_account.social_group.google</source>
<target>Google</target>
</segment>
</unit>
<unit id="cE4Odfx" name="personal_account.social_group.yandex">
<segment>
<source>personal_account.social_group.yandex</source>
<target>Yandex</target>
</segment>
</unit>
<unit id="KjhXQI8" name="personal_account.social_group.vkontakte">
<segment>
<source>personal_account.social_group.vkontakte</source>
<target>Vkontakte</target>
</segment>
</unit>
<unit id="Y4hPdqD" name="personal_account.social_group.github">
<segment>
<source>personal_account.social_group.github</source>
<target>Github</target>
</segment>
</unit>
<unit id="GIzLkL2" name="personal_account.social_group.integration_service">
<segment>
<source>personal_account.social_group.integration_service</source>
<target>Integration Service</target>
</segment>
</unit>
<unit id="I8Kt.td" name="personal_account.social_group.link">
<segment>
<source>personal_account.social_group.link</source>
<target>Link</target>
</segment>
</unit>
<unit id="LuEr.5y" name="personal_account.social_group.unlink">
<segment>
<source>personal_account.social_group.unlink</source>
<target>Unlink</target>
</segment>
</unit>
</file>
</xliff>
9 changes: 9 additions & 0 deletions translations/messages.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,12 @@ admin.user_list.from_github: 'From Github'
admin.user_list.verified: Verified
admin.user_list.not_verified: 'Not Verified'
admin.user_list.edit: Edit
personal_account.social_group.name: Name
personal_account.social_group.action: Action
personal_account.social_group.google: Google
personal_account.social_group.yandex: Yandex
personal_account.social_group.vkontakte: Vkontakte
personal_account.social_group.github: Github
personal_account.social_group.integration_service: 'Integration Service'
personal_account.social_group.link: Link
personal_account.social_group.unlink: Unlink
56 changes: 55 additions & 1 deletion translations/messages.ru.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
</notes>
<segment>
<source>login_social_network.google</source>
<target>Авторизоваться через Google</target>
<target>Авторизоваться через Гугл</target>
</segment>
</unit>
<unit id="gcS9qZH" name="similar_products.head">
Expand Down Expand Up @@ -1144,5 +1144,59 @@
<target>Github проверен</target>
</segment>
</unit>
<unit id="sVcu6kb" name="personal_account.social_group.name">
<segment>
<source>personal_account.social_group.name</source>
<target>Название</target>
</segment>
</unit>
<unit id="8d3i.6z" name="personal_account.social_group.action">
<segment>
<source>personal_account.social_group.action</source>
<target>Действия</target>
</segment>
</unit>
<unit id="OlHpJ6k" name="personal_account.social_group.google">
<segment>
<source>personal_account.social_group.google</source>
<target>Гугл</target>
</segment>
</unit>
<unit id="cE4Odfx" name="personal_account.social_group.yandex">
<segment>
<source>personal_account.social_group.yandex</source>
<target>Яндекс</target>
</segment>
</unit>
<unit id="KjhXQI8" name="personal_account.social_group.vkontakte">
<segment>
<source>personal_account.social_group.vkontakte</source>
<target>Вконтакте</target>
</segment>
</unit>
<unit id="Y4hPdqD" name="personal_account.social_group.github">
<segment>
<source>personal_account.social_group.github</source>
<target>Гитхаб</target>
</segment>
</unit>
<unit id="GIzLkL2" name="personal_account.social_group.integration_service">
<segment>
<source>personal_account.social_group.integration_service</source>
<target>Сервис интеграции</target>
</segment>
</unit>
<unit id="I8Kt.td" name="personal_account.social_group.link">
<segment>
<source>personal_account.social_group.link</source>
<target>Привязать</target>
</segment>
</unit>
<unit id="LuEr.5y" name="personal_account.social_group.unlink">
<segment>
<source>personal_account.social_group.unlink</source>
<target>Отвязать</target>
</segment>
</unit>
</file>
</xliff>
11 changes: 10 additions & 1 deletion translations/messages.ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ personal_account.edit.labels.phone: 'Введите телефон'
personal_account.edit.labels.address: 'Введите адрес'
personal_account.edit.labels.zipcode: 'Введите почтовый индекс'
personal_account.edit.save_changes: 'Сохранить изменения'
login_social_network.google: 'Авторизоваться через Google'
login_social_network.google: 'Авторизоваться через Гугл'
similar_products.head: 'Мы рекомендуем'
similar_products.new: Новинка
product.add_to_cart: 'Добавить в корзину'
Expand Down Expand Up @@ -131,3 +131,12 @@ admin.user_list.from_google: 'Google проверен'
admin.user_list.from_yandex: 'Яндекс проверен'
admin.user_list.from_vk: 'Вконтакте проверен'
admin.user_list.from_github: 'Github проверен'
personal_account.social_group.name: Название
personal_account.social_group.action: Действия
personal_account.social_group.google: Гугл
personal_account.social_group.yandex: Яндекс
personal_account.social_group.vkontakte: Вконтакте
personal_account.social_group.github: Гитхаб
personal_account.social_group.integration_service: 'Сервис интеграции'
personal_account.social_group.link: Привязать
personal_account.social_group.unlink: Отвязать

0 comments on commit e33d6de

Please sign in to comment.