forked from wallabag/wallabag
Move User templates to Core
This commit is contained in:
@ -67,7 +67,7 @@ class UserController extends AbstractController
|
||||
return $this->redirectToRoute('user_edit', ['id' => $user->getId()]);
|
||||
}
|
||||
|
||||
return $this->render('@WallabagUser/User/new.html.twig', [
|
||||
return $this->render('@WallabagCore/User/new.html.twig', [
|
||||
'user' => $user,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
@ -108,7 +108,7 @@ class UserController extends AbstractController
|
||||
return $this->redirectToRoute('user_edit', ['id' => $user->getId()]);
|
||||
}
|
||||
|
||||
return $this->render('@WallabagUser/User/edit.html.twig', [
|
||||
return $this->render('@WallabagCore/User/edit.html.twig', [
|
||||
'user' => $user,
|
||||
'edit_form' => $form->createView(),
|
||||
'delete_form' => $deleteForm->createView(),
|
||||
@ -173,7 +173,7 @@ class UserController extends AbstractController
|
||||
}
|
||||
}
|
||||
|
||||
return $this->render('@WallabagUser/User/index.html.twig', [
|
||||
return $this->render('@WallabagCore/User/index.html.twig', [
|
||||
'searchForm' => $form->createView(),
|
||||
'users' => $pagerFanta,
|
||||
]);
|
||||
|
||||
@ -78,7 +78,7 @@ class AuthCodeMailer implements AuthCodeMailerInterface
|
||||
*/
|
||||
public function sendAuthCode(TwoFactorInterface $user): void
|
||||
{
|
||||
$template = $this->twig->load('@WallabagUser/TwoFactor/email_auth_code.html.twig');
|
||||
$template = $this->twig->load('@WallabagCore/TwoFactor/email_auth_code.html.twig');
|
||||
|
||||
$subject = $template->renderBlock('subject', []);
|
||||
$bodyHtml = $template->renderBlock('body_html', [
|
||||
|
||||
@ -0,0 +1,39 @@
|
||||
{# Override `vendor/scheb/two-factor-bundle/Resources/views/Authentication/form.html.twig` #}
|
||||
{% extends "@FOSUser/layout.html.twig" %}
|
||||
|
||||
{% block fos_user_content %}
|
||||
<form class="form" action="{{ path("2fa_login_check") }}" method="post">
|
||||
<div class="card-content">
|
||||
<div class="row">
|
||||
|
||||
{% for flash_message in app.session.flashbag.get("two_factor") %}
|
||||
<p class="error">{{ flash_message|trans }}</p>
|
||||
{% endfor %}
|
||||
|
||||
{# Authentication errors #}
|
||||
{% if authenticationError %}
|
||||
<p class="error">{{ authenticationError|trans(authenticationErrorData, 'SchebTwoFactorBundle') }}</p>
|
||||
{% endif %}
|
||||
|
||||
<div class="input-field col s12">
|
||||
<label for="_auth_code">{{ "auth_code"|trans({}, 'SchebTwoFactorBundle') }}</label>
|
||||
<input id="_auth_code" type="text" autocomplete="off" name="{{ authCodeParameterName }}" />
|
||||
</div>
|
||||
|
||||
{% if displayTrustedOption %}
|
||||
<div class="input-field col s12">
|
||||
<input id="_trusted" type="checkbox" name="{{ trustedParameterName }}" />
|
||||
<label for="_trusted">{{ "trusted"|trans({}, 'SchebTwoFactorBundle') }}</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-action center">
|
||||
<a href="{{ path('fos_user_security_logout') }}" class="waves-effect waves-light grey btn">{{ 'security.login.cancel'|trans }}</a>
|
||||
<button class="btn waves-effect waves-light" type="submit" name="send">
|
||||
{{ "login"|trans({}, 'SchebTwoFactorBundle') }}
|
||||
<i class="material-icons right">send</i>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
@ -0,0 +1,11 @@
|
||||
{% extends "@FOSUser/layout.html.twig" %}
|
||||
|
||||
{% trans_default_domain 'FOSUserBundle' %}
|
||||
|
||||
{% block fos_user_content %}
|
||||
<div class="card-content">
|
||||
<div class="row">
|
||||
{{ 'resetting.password_already_requested'|trans }}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock fos_user_content %}
|
||||
@ -0,0 +1,117 @@
|
||||
{% block subject %}
|
||||
{{ "auth_code.mailer.subject"|trans({}, 'wallabag_user') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block body_text %}
|
||||
{{ "auth_code.mailer.body.hello"|trans({'%user%': user}, 'wallabag_user') }}
|
||||
|
||||
{{ "auth_code.mailer.body.first_para"|trans({}, 'wallabag_user') }}
|
||||
{{ "auth_code.mailer.body.second_para"|trans({}, 'wallabag_user') }} {{ code }}
|
||||
|
||||
{{ "auth_code.mailer.body.support"|trans({}, 'wallabag_user') }} {{ support_url }}
|
||||
|
||||
{{ "auth_code.mailer.body.signature"|trans({}, 'wallabag_user') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block body_html %}
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title>{{ "auth_code.mailer.subject"|trans({}, 'wallabag_user') }}</title>
|
||||
<style type="text/css">
|
||||
#outlook a {padding:0;}
|
||||
body{width:100% !important; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%; margin:0; padding:0; font-family: Helvetica, Arial, sans-serif; background: #c6d4e0;}
|
||||
.ExternalClass {width:100%;}
|
||||
.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {line-height: 100%;}
|
||||
#backgroundTable {margin:0; padding:0; width:100% !important; line-height: 100% !important; background: #c6d4e0;}
|
||||
img {outline:none; text-decoration:none; -ms-interpolation-mode: bicubic;}
|
||||
a img {border:none;}
|
||||
.image_fix {display:block;}
|
||||
p {margin: 1em 0;}
|
||||
h1, h2, h3, h4, h5, h6 {color: black !important;}
|
||||
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {color: blue !important;}
|
||||
h1 a:active, h2 a:active, h3 a:active, h4 a:active, h5 a:active, h6 a:active {
|
||||
color: red !important;
|
||||
}
|
||||
h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited {
|
||||
color: purple !important;
|
||||
}
|
||||
table td {border-collapse: collapse;}
|
||||
table {border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt; }
|
||||
a {color: #373737;}
|
||||
|
||||
#card {
|
||||
background: #ffffff;
|
||||
border: 1px solid #c5c5c5;
|
||||
width: 89%;
|
||||
margin: 5%;
|
||||
}
|
||||
#cell_desc h1, h5 {
|
||||
display: block;
|
||||
margin: 0;
|
||||
}
|
||||
#cell_desc h1 {
|
||||
line-height: 35px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
#bg {background: #f2f2f2}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- hidden text for preview -->
|
||||
<div style="display:none;font-size:1px;color:#333333;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;">
|
||||
{{ "auth_code.mailer.body.hello"|trans({'%user%': user}, 'wallabag_user') }}
|
||||
</div>
|
||||
|
||||
<table cellpadding="0" cellspacing="0" border="0" id="backgroundTable">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<table cellpadding="0" cellspacing="0" border="0" align="center" id="card">
|
||||
<tr>
|
||||
<td style="padding: 20px;" width="96px" valign="top"><img class="image_fix" src="{{ absolute_url(asset('img/logo-square.svg')) }}" alt="logo" title="{{ wallabag_url }}" style="width: 96px; height: 96px;" /></td>
|
||||
<td style="padding: 20px; padding-left: 0;" valign="top" id="cell_desc">
|
||||
<h1>wallabag</h1>
|
||||
<h5>{{ "auth_code.on"|trans({}, 'wallabag_user') }} {{ wallabag_url }}</h5>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="2" style="padding: 0;"><div style="height: 0; border-top: 1px solid #c5c5c5;"> </div></td></tr>
|
||||
<tr id="bg">
|
||||
<td style="padding: 20px;" colspan="2" valign="top">
|
||||
|
||||
<p><b>{{ "auth_code.mailer.body.hello"|trans({'%user%': user}, 'wallabag_user') }}</b></p>
|
||||
|
||||
<p>{{ "auth_code.mailer.body.first_para"|trans({}, 'wallabag_user') }}</p>
|
||||
<p>{{ "auth_code.mailer.body.second_para"|trans({}, 'wallabag_user') }} <b>{{ code }}</b></p>
|
||||
|
||||
<p>{{ "auth_code.mailer.body.support"|trans({}, 'wallabag_user') }} <a href="{{ support_url }}">{{ support_url }}</a></p>
|
||||
<p>{{ "auth_code.mailer.body.signature"|trans({}, 'wallabag_user') }}</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="2" style="padding: 0;"><div style="height: 0; border-top: 1px solid #c5c5c5;"> </div></td></tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td valign="top" style="padding: 20px; text-align: center"><a href="{{ wallabag_url }}">{{ wallabag_url }}</a></td>
|
||||
<td valign="top" style="padding: 20px; text-align: center">Powered by <a href="https://www.wallabag.org/">wallabag</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
||||
81
src/Wallabag/CoreBundle/Resources/views/User/edit.html.twig
Normal file
81
src/Wallabag/CoreBundle/Resources/views/User/edit.html.twig
Normal file
@ -0,0 +1,81 @@
|
||||
{% extends "@WallabagCore/layout.html.twig" %}
|
||||
|
||||
{% block title %}{{ 'user.page_title'|trans }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col s12">
|
||||
<div class="card-panel">
|
||||
<div class="row">
|
||||
<div class="input-field col s12">
|
||||
<h4>{{ 'user.edit_user'|trans }}</h4>
|
||||
|
||||
<div id="set6" class="col s12">
|
||||
{{ form_start(edit_form) }}
|
||||
{{ form_errors(edit_form) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="input-field col s12">
|
||||
{{ form_label(edit_form.name) }}
|
||||
{{ form_errors(edit_form.name) }}
|
||||
{{ form_widget(edit_form.name) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="input-field col s12">
|
||||
{{ form_label(edit_form.username) }}
|
||||
{{ form_errors(edit_form.username) }}
|
||||
{{ form_widget(edit_form.username) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="input-field col s12">
|
||||
{{ form_label(edit_form.email) }}
|
||||
{{ form_errors(edit_form.email) }}
|
||||
{{ form_widget(edit_form.email) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="input-field col s12">
|
||||
{{ form_widget(edit_form.enabled) }}
|
||||
{{ form_label(edit_form.enabled) }}
|
||||
{{ form_errors(edit_form.enabled) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="input-field col s12">
|
||||
{{ form_widget(edit_form.emailTwoFactor) }}
|
||||
{{ form_label(edit_form.emailTwoFactor) }}
|
||||
{{ form_errors(edit_form.emailTwoFactor) }}
|
||||
</div>
|
||||
<div class="input-field col s12">
|
||||
{{ form_widget(edit_form.googleTwoFactor) }}
|
||||
{{ form_label(edit_form.googleTwoFactor) }}
|
||||
{{ form_errors(edit_form.googleTwoFactor) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
{{ form_widget(edit_form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
|
||||
{{ form_widget(edit_form._token) }}
|
||||
</form>
|
||||
<p>
|
||||
{{ form_start(delete_form) }}
|
||||
<button {% if app.user.id == user.id %}disabled="disabled"{% endif %} onclick="return confirm('{{ 'user.form.delete_confirm'|trans|escape('js') }}')" type="submit" class="btn waves-effect waves-light red">{{ 'user.form.delete'|trans }}</button>
|
||||
{{ form_end(delete_form) }}
|
||||
</p>
|
||||
<p><a class="waves-effect waves-light btn blue-grey" href="{{ path('user_index') }}">{{ 'user.form.back_to_list'|trans }}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
69
src/Wallabag/CoreBundle/Resources/views/User/index.html.twig
Normal file
69
src/Wallabag/CoreBundle/Resources/views/User/index.html.twig
Normal file
@ -0,0 +1,69 @@
|
||||
{% extends "@WallabagCore/layout.html.twig" %}
|
||||
|
||||
{% block title %}{{ 'user.page_title'|trans }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col s12">
|
||||
<div class="card-panel">
|
||||
{% if users.getNbPages > 1 %}
|
||||
{{ pagerfanta(users, 'default_wallabag') }}
|
||||
{% endif %}
|
||||
<div class="row">
|
||||
<div class="col s6">
|
||||
<p class="help">{{ 'user.description'|trans|raw }}</p>
|
||||
</div>
|
||||
<div class="col s6">
|
||||
<div class="input-field">
|
||||
<form name="search_users" method="GET" action="{{ path('user_index') }}">
|
||||
{% if form_errors(searchForm) %}
|
||||
<span class="black-text">{{ form_errors(searchForm) }}</span>
|
||||
{% endif %}
|
||||
|
||||
{% if form_errors(searchForm.term) %}
|
||||
<span class="black-text">{{ form_errors(searchForm.term) }}</span>
|
||||
{% endif %}
|
||||
|
||||
{{ form_widget(searchForm.term, {'attr': {'autocomplete': 'off', 'placeholder': 'user.search.placeholder'}}) }}
|
||||
|
||||
{{ form_rest(searchForm) }}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ 'user.form.username_label'|trans }}</th>
|
||||
<th>{{ 'user.form.email_label'|trans }}</th>
|
||||
<th>{{ 'user.form.last_login_label'|trans }}</th>
|
||||
<th>{{ 'user.list.actions'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for user in users %}
|
||||
<tr>
|
||||
<td>{{ user.username }}</td>
|
||||
<td>{{ user.email }}</td>
|
||||
<td>{% if user.lastLogin %}{{ user.lastLogin|date('Y-m-d H:i:s') }}{% endif %}</td>
|
||||
<td>
|
||||
<a href="{{ path('user_edit', {'id': user.id}) }}">{{ 'user.list.edit_action'|trans }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<br />
|
||||
<p>
|
||||
<a href="{{ path('user_new') }}" class="waves-effect waves-light btn">{{ 'user.list.create_new_one'|trans }}</a>
|
||||
</p>
|
||||
{% if users.getNbPages > 1 %}
|
||||
{{ pagerfanta(users, 'default_wallabag') }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
61
src/Wallabag/CoreBundle/Resources/views/User/new.html.twig
Normal file
61
src/Wallabag/CoreBundle/Resources/views/User/new.html.twig
Normal file
@ -0,0 +1,61 @@
|
||||
{% extends "@WallabagCore/layout.html.twig" %}
|
||||
|
||||
{% block title %}{{ 'user.page_title'|trans }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col s12">
|
||||
<div class="card-panel">
|
||||
<div class="row">
|
||||
<div class="input-field col s12">
|
||||
<h4>{{ 'user.new_user'|trans }}</h4>
|
||||
|
||||
<div id="set6" class="col s12">
|
||||
{{ form_start(form) }}
|
||||
{{ form_errors(form) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="input-field col s12">
|
||||
{{ form_label(form.username) }}
|
||||
{{ form_errors(form.username) }}
|
||||
{{ form_widget(form.username) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="input-field col s12">
|
||||
{{ form_label(form.plainPassword.first) }}
|
||||
{{ form_errors(form.plainPassword.first) }}
|
||||
{{ form_widget(form.plainPassword.first) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="input-field col s12">
|
||||
{{ form_label(form.plainPassword.second) }}
|
||||
{{ form_errors(form.plainPassword.second) }}
|
||||
{{ form_widget(form.plainPassword.second) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="input-field col s12">
|
||||
{{ form_label(form.email) }}
|
||||
{{ form_errors(form.email) }}
|
||||
{{ form_widget(form.email) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ form_widget(form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
|
||||
{{ form_rest(form) }}
|
||||
</form>
|
||||
<p><a class="waves-effect waves-light btn blue-grey" href="{{ path('user_index') }}">{{ 'user.form.back_to_list'|trans }}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user