Browse Source

backports murph-skeleton

develop
Simon Vieille 3 weeks ago
parent
commit
719e97f20b
  1. 103
      assets/css/admin.scss
  2. 92
      assets/images/core/logo.svg
  3. 7
      assets/js/admin.js
  4. 1
      core/Resources/translations/messages.fr.yaml
  5. 16
      core/Resources/views/admin/layout.html.twig
  6. 116
      core/Resources/views/site/navigation_admin/index.html.twig
  7. 4
      core/Resources/views/site/page_admin/_form.html.twig
  8. 107
      core/Resources/views/site/page_admin/index.html.twig
  9. 188
      core/Resources/views/site/tree_admin/navigation.html.twig
  10. 92
      core/Resources/views/user/user_admin/index.html.twig

103
assets/css/admin.scss

@ -14,6 +14,16 @@ $pagination-active-bg: #343a40;
@import "~bootstrap/scss/bootstrap.scss";
@import "~@fortawesome/fontawesome-free/css/all.css";
@for $i from 1 through 100 {
.miw-#{$i*5} {
min-width: $i * 5px;
}
}
body {
overflow-x: hidden;
}
#logo {
width: 30px;
}
@ -116,6 +126,9 @@ tr.table-primary-light {
.sidebar {
width: 260px;
display: inline-block;
.nav-link {
font-weight: 500;
color: #333;
@ -142,32 +155,6 @@ tr.table-primary-light {
text-transform: uppercase;
display: flex;
}
@media screen and (max-width: 1130px) {
.nav-link {
font-size: 14px;
}
}
@media screen and (max-width: 770px) {
.nav {
padding-left: 0;
}
.nav-link {
padding-left: 10px;
}
.nav-item-label {
display: none;
}
.sidebar-heading {
display: none;
}
width: 50px;
}
}
*[data-selectable-selector] {
@ -194,15 +181,19 @@ tr.table-primary-light {
.body {
padding-top: 60px;
width: calc(100vw - 260px);
margin-left: 260px;
display: inline-block;
.nav {
padding-left: 10px;
}
}
@media screen and (max-width: 580px) {
@media screen and (max-width: 770px) {
.body {
margin-left: 45px;
margin-left: 50px;
width: calc(100vw - 50px);
}
.sidebar {
@ -213,51 +204,41 @@ tr.table-primary-light {
width: 50px;
max-width: 100% !important;
}
}
}
table.table-fixed, .table-fixed > table {
width: 100%;
tbody {
overflow: auto;
width: 100%;
height: 500px;
}
.nav {
padding-left: 0;
}
thead, tbody, tr, td, th {
display: block;
}
.nav-link {
padding-left: 10px;
}
tbody {
td, th {
float: left;
min-height: 60px;
.nav-item-label {
display: none;
}
tr {
clear: left;
.sidebar-heading {
display: none;
}
}
}
thead {
tr {
th {
float: left;
&.sorted {
&::before {
content: '\f0dc';
font-family: 'FontAwesome';
color: #aaa;
margin-right: 3px;
}
}
}
th {
&.sorted {
&::before {
content: '\f0dc';
font-family: 'FontAwesome';
color: #aaa;
margin-right: 3px;
}
}
}
.table-responsive {
max-width: 100%;
overflow-y: hidden;
}
.toast-container {
display: flex;
position: relative;

92
assets/images/core/logo.svg

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="92.5"
height="92.500008"
viewBox="0 0 24.473958 24.473961"
version="1.1"
id="svg2782"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="logo.svg">
<defs
id="defs2776" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="3.959798"
inkscape:cx="144.24896"
inkscape:cy="62.558177"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1918"
inkscape:window-height="1017"
inkscape:window-x="0"
inkscape:window-y="41"
inkscape:window-maximized="0" />
<metadata
id="metadata2779">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-93.596354,-136.59635)">
<g
transform="translate(14.977383,9.0140333)"
id="g2760">
<path
inkscape:connector-curvature="0"
id="rect2455"
d="m 80.981321,127.58232 h 19.749259 c 1.30874,0 2.36235,1.05361 2.36235,2.36235 v 19.74926 c 0,1.30874 -1.05361,2.36235 -2.36235,2.36235 H 80.981321 c -1.30874,0 -2.36235,-1.05361 -2.36235,-2.36235 v -19.74926 c 0,-1.30874 1.05361,-2.36235 2.36235,-2.36235 z"
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;vector-effect:none;fill:#1e2430;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10.58333302;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:stroke fill markers;enable-background:accumulate" />
<g
transform="translate(-28.224115,84.535074)"
id="text2474-5"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:24.23528671px;line-height:125%;font-family:Tahoma;-inkscape-font-specification:'Tahoma, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffcc00;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
aria-label="M">
<path
inkscape:connector-curvature="0"
id="path2522"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:'Trebuchet MS';-inkscape-font-specification:'Trebuchet MS';fill:#ffcc00;fill-opacity:1;stroke-width:0.26458332px"
d="m 125.90001,62.475697 h -2.98208 l -1.79871,-9.348573 -3.49093,9.573412 h -1.10052 l -3.49093,-9.573412 -1.86971,9.348573 h -2.97024 l 3.49092,-17.34811 h 1.63304 l 3.75126,11.679798 3.66843,-11.679798 h 1.62121 z" />
</g>
<path
inkscape:connector-curvature="0"
id="rect2455-3-6"
d="m 102.39375,128.26496 -23.092649,23.09213 c 0.427643,0.43204 1.021784,0.69919 1.680519,0.69919 h 19.74918 c 1.30874,0 2.36213,-1.05339 2.36213,-2.36213 v -19.74918 c 0,-0.65861 -0.26729,-1.25238 -0.69918,-1.68001 z"
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;vector-effect:none;fill:#19b4db;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:10.58333302;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:stroke fill markers;enable-background:accumulate" />
<path
inkscape:connector-curvature="0"
id="path2525-9-7"
d="m 94.723251,132.53384 -4.531505,4.53151 -1.343589,4.27726 -0.713134,-2.22054 -2.044319,2.04432 2.213301,6.0694 h 1.10019 l 3.491262,-9.57306 1.798338,9.34826 h 2.982249 z m -11.105782,11.10527 -3.371887,3.37188 h 2.697509 z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:24.23528481px;line-height:125%;font-family:'Trebuchet MS';-inkscape-font-specification:'Trebuchet MS';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#1e2430;fill-opacity:1;stroke:#1e2430;stroke-width:0.26458332;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</g>
</svg>

7
assets/js/admin.js

@ -1,3 +1,10 @@
/*const imagesContext = require.context(
'../images',
true, /\.(png|jpg|jpeg|gif|ico|svg|webp)$/
);
imagesContext.keys().forEach(imagesContext);*/
import '../css/admin.scss';
require('../../node_modules/bootstrap/dist/js/bootstrap.min.js');

1
core/Resources/translations/messages.fr.yaml

@ -85,6 +85,7 @@
"Add a menu": "Ajouter un menu"
"Actions": "Actions"
"Remove": "Supprimer"
"Move": "Déplacer"
"Hidden": "Caché"
"Show": "Voir"
"No result": "Aucun résultat"

16
core/Resources/views/admin/layout.html.twig

@ -27,16 +27,14 @@
{% block body_container %}
<div class="container-fluid">
<div class="row">
<nav class="col-md-2 col-1 d-md-block bg-dark-blue sidebar">
<div class="sidebar-sticky">
{{ include('@Core/admin/module/menu.html.twig') }}
</div>
</nav>
<div class="col-11 col-md-10 ml-sm-auto col-lg-10 body">
{% block body %}
{% endblock %}
<nav class="bg-dark-blue sidebar">
<div class="sidebar-sticky">
{{ include('@Core/admin/module/menu.html.twig') }}
</div>
</nav>
<div class="body">
{% block body %}
{% endblock %}
</div>
</div>
{% endblock %}

116
core/Resources/views/site/navigation_admin/index.html.twig

@ -24,64 +24,64 @@
{{ knp_pagination_render(pager) }}
</div>
<table class="table" data-table-fixed>
<thead class="thead-light">
<tr>
<th class="col-5">
{{ 'Label'|trans }}
</th>
<th class="col-5">
{{ 'Domain'|trans }}
</th>
<th class="col-2 text-right">
{{ 'Actions'|trans }}
</th>
</tr>
</thead>
<tbody>
{% for item in pager %}
{% set edit = path('admin_site_navigation_edit', {entity: item.id}) %}
{% set show = path('admin_site_navigation_show', {entity: item.id}) %}
<tr data-dblclick="{{ edit }}">
<td class="col-5">
<a href="{{ show }}" class="font-weight-bold text-body d-block">
{{ item.label }}
</a>
{{ item.code }}
</td>
<td class="col-5">
<a href="" class="btn btn-sm btn-light">
{{ item.domain }}
</a>
</td>
<td class="col-2 text-right">
<a href="{{ edit }}" class="btn btn-sm btn-primary mr-1">
<span class="fa fa-edit"></span>
</a>
<button type="submit" form="form-delete-{{ item.id }}" class="btn btn-sm btn-danger">
<span class="fa fa-trash"></span>
</button>
<form method="post" action="{{ path('admin_site_navigation_delete', {entity: item.id}) }}" id="form-delete-{{ item.id }}" data-form-confirm>
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ item.id) }}">
</form>
</td>
</tr>
{% else %}
<div class="table-responsive">
<table class="table">
<thead class="thead-light">
<tr>
<td class="col-12 text-center p-4 text-black-50">
<div class="display-1">
<span class="fa fa-search"></span>
</div>
<div class="display-5 mt-3">
{{ 'No result'|trans }}
</div>
</td>
<th class="col-5 miw-150">
{{ 'Label'|trans }}
</th>
<th class="col-5 miw-200">
{{ 'Domain'|trans }}
</th>
<th class="col-2 miw-100 text-right">
{{ 'Actions'|trans }}
</th>
</tr>
{% endfor %}
</tbody>
</table>
</thead>
<tbody>
{% for item in pager %}
{% set edit = path('admin_site_navigation_edit', {entity: item.id}) %}
{% set show = path('admin_site_navigation_show', {entity: item.id}) %}
<tr data-dblclick="{{ edit }}">
<td class="col-5 miw-150">
<a href="{{ show }}" class="font-weight-bold text-body d-block">
{{ item.label }}
</a>
</td>
<td class="col-5 miw-200">
<a href="" class="btn btn-sm btn-light">
{{ item.domain }}
</a>
</td>
<td class="col-2 miw-100 text-right">
<a href="{{ edit }}" class="btn btn-sm btn-primary mr-1">
<span class="fa fa-edit"></span>
</a>
<button type="submit" form="form-delete-{{ item.id }}" class="btn btn-sm btn-danger">
<span class="fa fa-trash"></span>
</button>
<form method="post" action="{{ path('admin_site_navigation_delete', {entity: item.id}) }}" id="form-delete-{{ item.id }}" data-form-confirm>
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ item.id) }}">
</form>
</td>
</tr>
{% else %}
<tr>
<td class="col-12 text-center p-4 text-black-50">
<div class="display-1">
<span class="fa fa-search"></span>
</div>
<div class="display-5 mt-3">
{{ 'No result'|trans }}
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}

4
core/Resources/views/site/page_admin/_form.html.twig

@ -20,10 +20,10 @@
{% endset %}
<div class="row">
<div class="col-8 p-2">
<div class="col-md-8 p-2">
{{ form_widget(form) }}
</div>
<div class="col-4 p-3">
<div class="col-md-4 p-3">
<ul class="nav nav-pills">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#form-page-metas">{{ 'Meta datas'|trans }}</a>

107
core/Resources/views/site/page_admin/index.html.twig

@ -13,59 +13,62 @@
{{ knp_pagination_render(pager) }}
</div>
<table class="table" data-table-fixed>
<thead class="thead-light">
<tr>
<th class="col-10">{{ 'Name'|trans }}</th>
<th class="col-2 text-right">{{ 'Actions'|trans }}</th>
</tr>
</thead>
<tbody>
{% for item in pager %}
{% set edit = path('admin_site_page_edit', {entity: item.id}) %}
<div class="table-responsive">
<table class="table">
<thead class="thead-light">
<tr>
<th class="col-5">{{ 'Name'|trans }}</th>
<th class="col-5"></th>
<th class="col-2 miw-100 text-right">{{ 'Actions'|trans }}</th>
</tr>
</thead>
<tbody>
{% for item in pager %}
{% set edit = path('admin_site_page_edit', {entity: item.id}) %}
<tr data-dblclick="{{ edit }}">
<td class="col-5">
<a href="{{ edit }}" class="font-weight-bold text-body d-block">
{{ item.name }}
</a>
</td>
<td class="col-5">
{% for node in item.nodes %}
<a href="{{ path('admin_site_tree_navigation', {
navigation: node.menu.navigation.id,
'data-modal': path('admin_site_node_edit', {entity: node.id}),
}) }}" class="btn btn-sm btn-light mr-1">
{{ node.label }}
<tr data-dblclick="{{ edit }}">
<td class="col-5">
<a href="{{ edit }}" class="font-weight-bold text-body d-block">
{{ item.name }}
</a>
{% endfor %}
</td>
<td class="col-2 text-right">
<a href="{{ edit }}" class="btn btn-sm btn-primary mr-1">
<span class="fa fa-edit"></span>
</a>
<button type="submit" form="form-delete-{{ item.id }}" class="btn btn-sm btn-danger">
<span class="fa fa-trash"></span>
</button>
</td>
<td class="col-5">
{% for node in item.nodes %}
<a href="{{ path('admin_site_tree_navigation', {
navigation: node.menu.navigation.id,
'data-modal': path('admin_site_node_edit', {entity: node.id}),
}) }}" class="btn btn-sm btn-light mr-1">
{{ node.label }}
</a>
{% endfor %}
</td>
<td class="col-2 miw-100 text-right">
<a href="{{ edit }}" class="btn btn-sm btn-primary mr-1">
<span class="fa fa-edit"></span>
</a>
<button type="submit" form="form-delete-{{ item.id }}" class="btn btn-sm btn-danger">
<span class="fa fa-trash"></span>
</button>
<form method="post" action="{{ path('admin_site_page_delete', {entity: item.id}) }}" id="form-delete-{{ item.id }}" data-form-confirm>
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ item.id) }}">
</form>
</td>
</tr>
{% else %}
<tr>
<td class="col-12 text-center p-4 text-black-50">
<div class="display-1">
<span class="fa fa-search"></span>
</div>
<div class="display-5 mt-3">
{{ 'No result'|trans }}
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<form method="post" action="{{ path('admin_site_page_delete', {entity: item.id}) }}" id="form-delete-{{ item.id }}" data-form-confirm>
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ item.id) }}">
</form>
</td>
</tr>
{% else %}
<tr>
<td class="col-12 text-center p-4 text-black-50">
<div class="display-1">
<span class="fa fa-search"></span>
</div>
<div class="display-5 mt-3">
{{ 'No result'|trans }}
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}

188
core/Resources/views/site/tree_admin/navigation.html.twig

@ -33,7 +33,7 @@
<div class="row">
{% for menu in navigation.menus %}
<div class="col-12 p-3 m-0">
<div class="col-md-12 p-3 m-0">
<div class="d-flex">
<div class="mr-auto">
<div class="h4">
@ -63,7 +63,7 @@
</div>
</div>
<div class="col-12 pl-3 mb-4">
<div class="col-md-12 pl-3 mb-4">
<div class="list-group mr-3">
{% set rootNode = menu.rootNode %}
@ -74,95 +74,135 @@
{% set new = path('admin_site_node_new', {node: node.id}) %}
<div class="list-group-item">
<div class="float-right">
{% if node.page %}
<a href="{{ path('admin_site_page_edit', {entity: node.page.id}) }}" class="btn btn-sm btn-warning text-white mr-1">
<span class="fa fa-file-alt"></span>
{{ 'Page'|trans }}
</a>
{% endif %}
<button data-modal="{{ edit }}" type="submit" class="btn btn-sm btn-success mr-1">
<span data-modal="{{ edit }}" class="fa fa-pen"></span>
{{ 'Edit'|trans }}
</button>
<button type="submit" form="form-node-visibility-{{ node.id }}" class="btn btn-sm btn-light border-dark mr-1">
{% if node.isVisible %}
<span class="fa fa-eye"></span>
{{ 'Visible'|trans }}
{% else %}
<span class="fa fa-eye-slash"></span>
{{ 'Hidden'|trans }}
{% endif %}
</button>
<button data-modal="{{ move }}" type="submit" class="btn btn-sm btn-dark mr-1">
<span data-modal="{{ move }}" class="fa fa-arrows-alt"></span>
</button>
<button data-modal="{{ new }}" type="submit" class="btn btn-sm btn-primary mr-1">
<span data-modal="{{ new }}" class="fa fa-plus"></span>
</button>
<button type="submit" form="form-node-delete-{{ node.id }}" class="btn btn-sm btn-danger">
<span class="fa fa-trash"></span>
</button>
</div>
<div class="row">
<div class="col-6" style="padding-left: {{ (node.treeLevel - 1) * 30 }}px">
{{ node.label }}
<div class="d block" style="padding-left: {{ (node.treeLevel - 1) * 30 }}px">
{{ node.label }}
<span class="ml-3 btn-group">
{% if node.hasExternalUrl %}
<a href="{{ safe_node_url(node) }}" class="btn btn-sm border border-secondary btn-light">
<span class="fa fa-sign-out-alt text-muted"></span>
</a>
{% else %}
{% if node.parameters|length %}
<span class="btn btn-sm border border-secondary btn-light">
{{ node.url }}
</span>
<span class="ml-3 btn-group d-none d-md-inline-block">
{% if node.hasExternalUrl %}
<a href="{{ safe_node_url(node) }}" class="btn btn-sm border border-secondary btn-light">
<span class="fa fa-sign-out-alt text-muted"></span>
</a>
{% else %}
{% set url = safe_node_url(node) %}
{% if url %}
<a href="{{ url ? url : '#' }}" target="_blank" class="btn btn-sm border border-secondary btn-light">
{% if node.parameters|length %}
<span class="btn btn-sm border border-secondary btn-light">
{{ node.url }}
</a>
</span>
{% else %}
{% set url = safe_node_url(node) %}
{% if url %}
<a href="{{ url ? url : '#' }}" target="_blank" class="btn btn-sm border border-secondary btn-light">
{{ node.url }}
</a>
{% endif %}
{% if url is same as(null) %}
<span class="btn btn-sm border border-secondary btn-light" title="{{ 'Edit the routing'|trans }}">
<span class="fa fa-exclamation"></span>
</span>
{% endif %}
{% endif %}
{% if url is same as(null) %}
<span class="btn btn-sm border border-secondary btn-light" title="{{ 'Edit the routing'|trans }}">
<span class="fa fa-exclamation"></span>
{% if node.controller %}
<span title="{{ node.controller }}" data-toggle="tooltip" data-placement="top" class="btn btn-sm border border-secondary btn-light">
<span class="fa fa-dice-d6"></span>
</span>
{% endif %}
{% endif %}
</span>
</div>
<div class="col-6">
<div class="float-right">
<div class="d-none d-md-block">
{% if node.page %}
<a href="{{ path('admin_site_page_edit', {entity: node.page.id}) }}" class="btn btn-sm btn-warning text-white mr-1 mb-1">
<span class="fa fa-file-alt"></span>
{{ 'Page'|trans }}
</a>
{% endif %}
{% if node.controller %}
<span title="{{ node.controller }}" data-toggle="tooltip" data-placement="top" class="btn btn-sm border border-secondary btn-light">
<span class="fa fa-dice-d6"></span>
</span>
{% endif %}
{% endif %}
</span>
</div>
<button data-modal="{{ edit }}" type="submit" class="btn btn-sm btn-success mr-1 mb-1">
<span data-modal="{{ edit }}" class="fa fa-pen"></span>
{{ 'Edit'|trans }}
</button>
<form method="post" action="{{ path('admin_site_node_toggle_visibility', {entity: node.id}) }}" id="form-node-visibility-{{ node.id }}">
<input type="hidden" name="_token" value="{{ csrf_token('toggle_visibility' ~ node.id) }}">
</form>
<button form="form-node-visibility-{{ node.id }}" class="btn btn-sm btn-light border-dark mr-1 mb-1">
{% if node.isVisible %}
<span class="fa fa-eye"></span>
{{ 'Visible'|trans }}
{% else %}
<span class="fa fa-eye-slash"></span>
{{ 'Hidden'|trans }}
{% endif %}
</button>
<form method="post" action="{{ path('admin_site_node_delete', {entity: node.id}) }}" id="form-node-delete-{{ node.id }}" data-form-confirm>
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ node.id) }}">
</form>
<button data-modal="{{ move }}" class="btn btn-sm btn-dark mr-1 mb-1">
<span data-modal="{{ move }}" class="fa fa-arrows-alt"></span>
</button>
<button data-modal="{{ new }}" class="btn btn-sm btn-primary mr-1 mb-1">
<span data-modal="{{ new }}" class="fa fa-plus"></span>
</button>
<button type="submit" form="form-node-delete-{{ node.id }}" class="btn btn-sm btn-danger mb-1">
<span class="fa fa-trash"></span>
</button>
</div>
<div class="d-block d-md-none text-left">
<button type="button" class="btn btn-sm dropdown-toggle " data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ 'Actions'|trans }}
</button>
<div class="dropdown-menu dropdown-menu-right">
{% if node.page %}
<a href="{{ path('admin_site_page_edit', {entity: node.page.id}) }}" class="dropdown-item">
{{ 'Page'|trans }}
</a>
{% endif %}
<button data-modal="{{ edit }}" class="dropdown-item">
{{ 'Edit'|trans }}
</button>
<button form="form-node-visibility-{{ node.id }}" class="dropdown-item">
{% if node.isVisible %}
{{ 'Visible'|trans }}
{% else %}
{{ 'Hidden'|trans }}
{% endif %}
</button>
<button data-modal="{{ move }}" class="dropdown-item">
{{ 'Move'|trans }}
</button>
<button data-modal="{{ new }}" class="dropdown-item">
{{ 'New'|trans }}
</button>
<button type="submit" form="form-node-delete-{{ node.id }}" class="dropdown-item">
{{ 'Remove'|trans }}
</button>
</div>
</div>
</div>
</div>
<form method="post" action="{{ path('admin_site_node_toggle_visibility', {entity: node.id}) }}" id="form-node-visibility-{{ node.id }}">
<input type="hidden" name="_token" value="{{ csrf_token('toggle_visibility' ~ node.id) }}">
</form>
<form method="post" action="{{ path('admin_site_node_delete', {entity: node.id}) }}" id="form-node-delete-{{ node.id }}" data-form-confirm>
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ node.id) }}">
</form>
</div>
</div>
{% endfor %}
{% endif %}
</div>
</div>
{% else %}
<div class="col-12 text-center p-4 text-black-50">
<div class="col-md-12 text-center p-4 text-black-50">
<div class="display-1">
<span class="fa fa-search"></span>
</div>

92
core/Resources/views/user/user_admin/index.html.twig

@ -22,52 +22,54 @@
{{ knp_pagination_render(pager) }}
</div>
<table class="table" data-table-fixed>
<thead class="thead-light">
<tr>
<th class="col-10">{{ 'Username'|trans }}</th>
<th class="col-2 text-right">{{ 'Actions'|trans }}</th>
</tr>
</thead>
<tbody>
{% for item in pager %}
{% set edit = path('admin_user_edit', {entity: item.id}) %}
{% set show = path('admin_user_show', {entity: item.id}) %}
<div class="table-responsive">
<table class="table">
<thead class="thead-light">
<tr>
<th class="col-10 miw-200">{{ 'Username'|trans }}</th>
<th class="col-2 miw-100 text-right">{{ 'Actions'|trans }}</th>
</tr>
</thead>
<tbody>
{% for item in pager %}
{% set edit = path('admin_user_edit', {entity: item.id}) %}
{% set show = path('admin_user_show', {entity: item.id}) %}
<tr data-dblclick="{{ edit }}">
<td class="col-10">
<a href="{{ show }}" class="font-weight-bold text-body d-block">
{{ item.displayName }}
</a>
<tr data-dblclick="{{ edit }}">
<td class="col-10 miw-200">
<a href="{{ show }}" class="font-weight-bold text-body d-block">
{{ item.displayName }}
</a>
{{ item.email }}
</td>
<td class="col-2 text-right">
<a href="{{ edit }}" class="btn btn-sm btn-primary mr-1">
<span class="fa fa-edit"></span>
</a>
<button type="submit" form="form-delete-{{ item.id }}" class="btn btn-sm btn-danger">
<span class="fa fa-trash"></span>
</button>
{{ item.email }}
</td>
<td class="col-2 miw-100 text-right">
<a href="{{ edit }}" class="btn btn-sm btn-primary mr-1">
<span class="fa fa-edit"></span>
</a>
<button type="submit" form="form-delete-{{ item.id }}" class="btn btn-sm btn-danger">
<span class="fa fa-trash"></span>
</button>
<form method="post" action="{{ path('admin_user_delete', {entity: item.id}) }}" id="form-delete-{{ item.id }}" data-form-confirm>
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ item.id) }}">
</form>
</td>
</tr>
{% else %}
<tr>
<td class="col-12 text-center p-4 text-black-50">
<div class="display-1">
<span class="fa fa-search"></span>
</div>
<div class="display-5 mt-3">
{{ 'No result'|trans }}
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<form method="post" action="{{ path('admin_user_delete', {entity: item.id}) }}" id="form-delete-{{ item.id }}" data-form-confirm>
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ item.id) }}">
</form>
</td>
</tr>
{% else %}
<tr>
<td class="col-12 text-center p-4 text-black-50">
<div class="display-1">
<span class="fa fa-search"></span>
</div>
<div class="display-5 mt-3">
{{ 'No result'|trans }}
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}
Loading…
Cancel
Save