Skip to content

Commit

Permalink
create account and privacy page
Browse files Browse the repository at this point in the history
  • Loading branch information
saracamilo committed Jan 8, 2025
1 parent 25d2282 commit 3f0846a
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 45 deletions.
7 changes: 7 additions & 0 deletions config/routes/admin/user.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@ timeline:
path: /{id}/timeline
controller: App\Controller\Web\Admin\UserAdminController::timeline
methods: ['GET']

account_privacy:
path: /{id}/account-privacy
controller: App\Controller\Web\Admin\UserAdminController::accountPrivacy
methods: ['GET']


16 changes: 16 additions & 0 deletions src/Controller/Web/Admin/UserAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ public function __construct(
) {
}

/**
* Lista todos os usuários
*/
public function list(): Response
{
$users = $this->service->findAll();
Expand All @@ -35,4 +38,17 @@ public function timeline(Uuid $id): Response
'events' => $events,
]);
}

public function accountPrivacy(Uuid $id): Response
{
$user = $this->service->get($id);

if (!$user) {
return $this->redirectToRoute('login');
}

return $this->render('user/account-privacy.html.twig', [
'user' => $user,
]);
}
}
2 changes: 2 additions & 0 deletions src/EventSubscriber/ApiCustomResponseSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public function generateCustomError(ExceptionEvent $event): void
{
$exception = $event->getThrowable();

dd($exception);

if ($exception instanceof NotFoundHttpException || $exception instanceof ResourceNotFoundException) {
$this->generateNotFoundError($event);

Expand Down
17 changes: 17 additions & 0 deletions templates/_admin/user/account-privacy.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% extends "_layouts/base.html.twig" %}

{% block content %}
<h1>{{ 'account_privacy'|trans }}</h1>
<p>{{ user.name }}</p>
{% endblock %}


{#{% extends "_layouts/blank.html.twig" %}#}

{#{% block title %} conta e privacidade {% endblock %}#}

{#{% block content %}#}


{#{% endblock %}#}

74 changes: 37 additions & 37 deletions templates/_components/navbar.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -30,57 +30,57 @@
</li>

{% if (env.aurora.modules.opportunities != '' ) %}
<li class="nav-item">
<a class="nav-link opportunity" aria-current="page" href="{{ path('web_opportunity_list') }}">
<i class="material-icons navbar-icons">lightbulb</i>
<p>{{env.aurora.modules.opportunities ?? 'opportunities'|trans }}</p>
</a>
</li>
<li class="nav-item">
<a class="nav-link opportunity" aria-current="page" href="{{ path('web_opportunity_list') }}">
<i class="material-icons navbar-icons">lightbulb</i>
<p>{{env.aurora.modules.opportunities ?? 'opportunities'|trans }}</p>
</a>
</li>
{% endif %}

{% if (env.aurora.modules.agents != '' ) %}
<li class="nav-item">
<a class="nav-link agent" aria-current="page" href="{{ path('web_agent_list') }}">
<i class="material-icons navbar-icons">group</i>
<p>{{ env.aurora.modules.agents ?? 'agents'|trans }}</p>
</a>
</li>
<li class="nav-item">
<a class="nav-link agent" aria-current="page" href="{{ path('web_agent_list') }}">
<i class="material-icons navbar-icons">group</i>
<p>{{ env.aurora.modules.agents ?? 'agents'|trans }}</p>
</a>
</li>
{% endif %}

{% if (env.aurora.modules.organizations != '' ) %}
<li class="nav-item">
<a class="nav-link organization" aria-current="page" href="{{ path('web_organization_list') }}">
<i class="material-icons navbar-icons">corporate_fare</i>
<p>{{ env.aurora.modules.organizations ?? 'organizations'|trans }}</p>
</a>
</li>
<li class="nav-item">
<a class="nav-link organization" aria-current="page" href="{{ path('web_organization_list') }}">
<i class="material-icons navbar-icons">corporate_fare</i>
<p>{{ env.aurora.modules.organizations ?? 'organizations'|trans }}</p>
</a>
</li>
{% endif %}

{% if (env.aurora.modules.events != '' ) %}
<li class="nav-item">
<a class="nav-link event" aria-current="page" href="{{ path('web_event_list') }}">
<i class="material-icons navbar-icons">event</i>
<p>{{ env.aurora.modules.events ?? 'events'|trans }}</p>
</a>
</li>
<li class="nav-item">
<a class="nav-link event" aria-current="page" href="{{ path('web_event_list') }}">
<i class="material-icons navbar-icons">event</i>
<p>{{ env.aurora.modules.events ?? 'events'|trans }}</p>
</a>
</li>
{% endif %}

{% if (env.aurora.modules.spaces != '' ) %}
<li class="nav-item">
<a class="nav-link space" aria-current="page" href="{{ path('web_space_list') }}">
<i class="material-icons navbar-icons">domain</i>
<p>{{ env.aurora.modules.spaces ?? 'spaces'|trans }}</p>
</a>
</li>
<li class="nav-item">
<a class="nav-link space" aria-current="page" href="{{ path('web_space_list') }}">
<i class="material-icons navbar-icons">domain</i>
<p>{{ env.aurora.modules.spaces ?? 'spaces'|trans }}</p>
</a>
</li>
{% endif %}

{% if (env.aurora.modules.initiatives != '' ) %}
<li class="nav-item">
<a class="nav-link project" aria-current="page" href="{{ path('web_initiative_list') }}">
<i class="material-icons navbar-icons">article</i>
<p>{{ env.aurora.modules.initiatives ?? 'initiatives'|trans }}</p>
</a>
</li>
<li class="nav-item">
<a class="nav-link project" aria-current="page" href="{{ path('web_initiative_list') }}">
<i class="material-icons navbar-icons">article</i>
<p>{{ env.aurora.modules.initiatives ?? 'initiatives'|trans }}</p>
</a>
</li>
{% endif %}
</ul>

Expand Down Expand Up @@ -123,7 +123,7 @@
</div>
<div class="menu-column">
<div class="dropdown-header">{{ 'other_options' | trans }}</div>
<a class="dropdown-item" href="#">
<a class="dropdown-item" href="{{ path('admin_account_privacy', {id: app.user.id}) }}">
<i class="material-icons">settings</i> {{ 'account_privacy' | trans }}
</a>
<a class="dropdown-item" href="{{ path('admin_dashboard') }}">
Expand Down
8 changes: 4 additions & 4 deletions var/translations/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,10 @@ export declare const VIEW_OPPORTUNITY_QUANTITY_OPENED: Message<{ 'messages': { p
export declare const VIEW_OPPORTUNITY_QUANTITY_LAST_DAYS: Message<{ 'messages': { parameters: NoParametersType } }, 'en'|'pt-br'|'es'>;
export declare const VIEW_OPPORTUNITY_PERIOD: Message<{ 'messages': { parameters: NoParametersType } }, 'en'|'pt-br'|'es'>;
export declare const VIEW_OPPORTUNITY_TYPE_OF: Message<{ 'messages': { parameters: NoParametersType } }, 'en'|'pt-br'|'es'>;
export declare const VIEW_OPPORTUNITY_ADMIN_INSCRIPTIONS_SECTION: Message<{ 'messages': { parameters: NoParametersType } }, 'en'|'pt-br'|'es'>;
export declare const VIEW_OPPORTUNITY_ADMIN_INSCRIPTIONS_STATUS_ACTIVE: Message<{ 'messages': { parameters: NoParametersType } }, 'en'|'pt-br'|'es'>;
export declare const VIEW_OPPORTUNITY_ADMIN_INSCRIPTIONS_STATUS_INACTIVE: Message<{ 'messages': { parameters: NoParametersType } }, 'en'|'pt-br'|'es'>;
export declare const VIEW_OPPORTUNITY_ADMIN_INSCRIPTIONS_SEE_INSCRIPTION: Message<{ 'messages': { parameters: NoParametersType } }, 'en'|'pt-br'|'es'>;
export declare const VIEW_ORGANIZATION_DATE: Message<{ 'messages': { parameters: NoParametersType } }, 'en'|'pt-br'|'es'>;
export declare const VIEW_ORGANIZATION_MESSAGE_DELETED: Message<{ 'messages': { parameters: NoParametersType } }, 'en'|'pt-br'|'es'>;
export declare const VIEW_ORGANIZATION_QUANTITY_TOTAL: Message<{ 'messages': { parameters: NoParametersType } }, 'en'|'pt-br'|'es'>;
Expand Down Expand Up @@ -650,7 +654,3 @@ export declare const VIEW_NOT_FOUND_ERROR_TEXT_SECOND: Message<{ 'messages': { p
export declare const VIEW_NOT_FOUND_ERROR_TEXT_THIRD: Message<{ 'messages': { parameters: NoParametersType } }, 'en'|'pt-br'|'es'>;
export declare const VIEW_NOT_FOUND_ERROR_HOMEPAGE: Message<{ 'messages': { parameters: NoParametersType } }, 'en'|'pt-br'|'es'>;
export declare const VIEW_NOT_FOUND_ERROR_IMAGE: Message<{ 'messages': { parameters: NoParametersType } }, 'en'|'pt-br'|'es'>;
export declare const VIEW_OPPORTUNITY_ADMIN_INSCRIPTIONS_SECTION: Message<{ 'messages': { parameters: NoParametersType } }, 'pt-br'>;
export declare const VIEW_OPPORTUNITY_ADMIN_INSCRIPTIONS_STATUS_ACTIVE: Message<{ 'messages': { parameters: NoParametersType } }, 'pt-br'>;
export declare const VIEW_OPPORTUNITY_ADMIN_INSCRIPTIONS_STATUS_INACTIVE: Message<{ 'messages': { parameters: NoParametersType } }, 'pt-br'>;
export declare const VIEW_OPPORTUNITY_ADMIN_INSCRIPTIONS_SEE_INSCRIPTION: Message<{ 'messages': { parameters: NoParametersType } }, 'pt-br'>;
8 changes: 4 additions & 4 deletions var/translations/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3f0846a

Please sign in to comment.