add crud index template
This commit is contained in:
parent
40782e56ab
commit
3d60fc99fd
|
@ -181,7 +181,7 @@ tr.table-primary-light {
|
|||
}
|
||||
|
||||
.body {
|
||||
padding-top: 71px;
|
||||
padding-top: 60px;
|
||||
|
||||
.nav {
|
||||
padding-left: 10px;
|
||||
|
@ -213,12 +213,12 @@ table.table-fixed, .table-fixed > table {
|
|||
height: 500px;
|
||||
}
|
||||
|
||||
thead, tbody, tr, td, th{
|
||||
thead, tbody, tr, td, th {
|
||||
display: block;
|
||||
}
|
||||
|
||||
tbody {
|
||||
td {
|
||||
td, th {
|
||||
float: left;
|
||||
min-height: 60px;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import '../css/admin.scss';
|
|||
|
||||
require('../../node_modules/bootstrap/dist/js/bootstrap.min.js');
|
||||
// require('./addons/table-selectable.js')();
|
||||
// require('./addons/table-fixed.js')();
|
||||
require('./addons/table-fixed.js')();
|
||||
// require('./addons/document-selector.js')();
|
||||
require('./addons/form-confirm.js')();
|
||||
require('./addons/form.js')();
|
||||
|
|
43
src/Command/TestCommand.php
Normal file
43
src/Command/TestCommand.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
namespace App\Command;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use App\Repository\UserRepositoryQuery;
|
||||
use App\Criteria\CriteriaMap;
|
||||
|
||||
class TestCommand extends Command
|
||||
{
|
||||
protected static $defaultName = 'app:test';
|
||||
protected static $defaultDescription = 'Test';
|
||||
|
||||
protected $userRepositoryQuery;
|
||||
|
||||
public function __construct(UserRepositoryQuery $userRepositoryQuery)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->userRepositoryQuery = $userRepositoryQuery;
|
||||
}
|
||||
|
||||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setDescription(self::$defaultDescription)
|
||||
->addArgument('arg1', InputArgument::OPTIONAL, 'Argument description')
|
||||
->addOption('option1', null, InputOption::VALUE_NONE, 'Option description')
|
||||
;
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$query = $this->userRepositoryQuery->create();
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
|
@ -18,33 +18,4 @@ class CategoryRepository extends ServiceEntityRepository
|
|||
{
|
||||
parent::__construct($registry, Category::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Category[] Returns an array of Category objects
|
||||
// */
|
||||
/*
|
||||
public function findByExampleField($value)
|
||||
{
|
||||
return $this->createQueryBuilder('c')
|
||||
->andWhere('c.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->orderBy('c.id', 'ASC')
|
||||
->setMaxResults(10)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
public function findOneBySomeField($value): ?Category
|
||||
{
|
||||
return $this->createQueryBuilder('c')
|
||||
->andWhere('c.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->getQuery()
|
||||
->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ use App\Repository\RepositoryQuery;
|
|||
*/
|
||||
class CategoryRepositoryQuery extends RepositoryQuery
|
||||
{
|
||||
public function __construct(CategoryRepositoryQuery $repository, PaginatorInterface $paginator)
|
||||
public function __construct(CategoryRepository $repository, PaginatorInterface $paginator)
|
||||
{
|
||||
parent::__construct($repository, 'c', $paginator);
|
||||
}
|
||||
|
|
|
@ -18,33 +18,4 @@ class PostRepository extends ServiceEntityRepository
|
|||
{
|
||||
parent::__construct($registry, Post::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Post[] Returns an array of Post objects
|
||||
// */
|
||||
/*
|
||||
public function findByExampleField($value)
|
||||
{
|
||||
return $this->createQueryBuilder('p')
|
||||
->andWhere('p.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->orderBy('p.id', 'ASC')
|
||||
->setMaxResults(10)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
public function findOneBySomeField($value): ?Post
|
||||
{
|
||||
return $this->createQueryBuilder('p')
|
||||
->andWhere('p.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->getQuery()
|
||||
->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -35,33 +35,4 @@ class UserRepository extends ServiceEntityRepository implements PasswordUpgrader
|
|||
$this->_em->persist($user);
|
||||
$this->_em->flush();
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return User[] Returns an array of User objects
|
||||
// */
|
||||
/*
|
||||
public function findByExampleField($value)
|
||||
{
|
||||
return $this->createQueryBuilder('u')
|
||||
->andWhere('u.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->orderBy('u.id', 'ASC')
|
||||
->setMaxResults(10)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
public function findOneBySomeField($value): ?User
|
||||
{
|
||||
return $this->createQueryBuilder('u')
|
||||
->andWhere('u.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->getQuery()
|
||||
->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<body>
|
||||
{{ include('admin/module/flashes.html.twig') }}
|
||||
|
||||
<nav class="navbar fixed-top navbar-expand-md navbar-light bg-white border-bottom">
|
||||
<nav class="navbar fixed-top navbar-expand-md navbar-light bg-light border-bottom">
|
||||
<a class="navbar-brand" href="{{ path('admin_dashboard_index') }}">
|
||||
<img id="logo" src="{{ asset('build/images/logo.png') }}" alt="Tinternet & cie" title="Tinternet & cie">
|
||||
|
||||
|
|
|
@ -1 +1,68 @@
|
|||
{% extends 'admin/layout.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<div class="bg-light pl-5 pr-4 pt-5">
|
||||
<div class="d-flex">
|
||||
<div class="mr-auto">
|
||||
<h1 class="display-8">Articles</h1>
|
||||
</div>
|
||||
|
||||
<div class="ml-auto">
|
||||
<button type="button" class="btn btn-primary">Nouveau</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<ul class="pagination ml-auto">
|
||||
<li class="page-item disabled">
|
||||
<a class="page-link" href="#" tabindex="-1" aria-disabled="true">Previous</a>
|
||||
</li>
|
||||
<li class="page-item"><a class="page-link" href="#">1</a></li>
|
||||
<li class="page-item active" aria-current="page">
|
||||
<a class="page-link" href="#">2</a>
|
||||
</li>
|
||||
<li class="page-item"><a class="page-link" href="#">3</a></li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="#">Next</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
|
||||
<table class="table" data-table-fixed>
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th class="col-3">Titre</th>
|
||||
<th class="col-2">Auteur</th>
|
||||
<th class="col-2">Catégorie</th>
|
||||
<th class="col-2">Statut</th>
|
||||
<th class="col-3"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in range(1, 20) %}
|
||||
<tr>
|
||||
<td class="col-3">
|
||||
Titre de l'article {{ item }} <br>
|
||||
</td>
|
||||
<td class="col-2">
|
||||
Mark
|
||||
</td>
|
||||
<td class="col-2">
|
||||
<a href="">Nom de la catégorie</a>
|
||||
</td>
|
||||
<td class="col-2">
|
||||
En ligne
|
||||
</td>
|
||||
<td class="col-3 text-right">
|
||||
<button type="button" class="btn btn-sm btn-primary mr-1">Publier</button>
|
||||
<button type="button" class="btn btn-sm btn-dark mr-1">Éditer</button>
|
||||
<button type="button" class="btn btn-sm btn-danger">Supprimer</button>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue