fix articles vides
This commit is contained in:
commit
22d0bd6548
@ -2,7 +2,7 @@
|
||||
<ul class="side-nav">
|
||||
<li class="heading"><?= __('Actions') ?></li>
|
||||
<li><?= $this->Html->link(__('Liste des Articles'), ['action' => 'index']) ?></li>
|
||||
|
||||
|
||||
<?php if($this->request->session()->read('Auth.User.id')): ?>
|
||||
|
||||
<li><?= $this->Html->link(__('Nouvel Article'), ['action' => 'add']) ?></li>
|
||||
@ -46,45 +46,3 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="articles index large-3 medium-9 columns content" >
|
||||
<h3 style="margin-top: 20px; margin-bottom: 20px;"><?= __('Articles') ?></h3>
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= $this->Paginator->sort('id', ['label' => 'ID']) ?></th>
|
||||
<th><?= $this->Paginator->sort('title', ['label' => 'Titre']) ?></th>
|
||||
<th><?= $this->Paginator->sort('created', ['label' => 'Créé le']) ?></th>
|
||||
<th><?= $this->Paginator->sort('modified', ['label' => 'Modifié le']) ?></th>
|
||||
<th><?= $this->Paginator->sort('user_id', ['label' => 'ID utilisateur']) ?></th>
|
||||
<th><?= $this->Paginator->sort('category', ['label' => 'Catégorie']) ?></th>
|
||||
<th class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($articles as $article): ?>
|
||||
<tr>
|
||||
<td><?= $this->Number->format($article->id) ?></td>
|
||||
<td><?= h($article->title) ?></td>
|
||||
<td><?= h($article->created) ?></td>
|
||||
<td><?= h($article->modified) ?></td>
|
||||
<td><?= $article->has('user') ? $this->Html->link($article->user->id, ['controller' => 'Users', 'action' => 'view', $article->user->id]) : '' ?></td>
|
||||
<td><?= h($article->category) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('Voir'), ['action' => 'view', $article->id]) ?>
|
||||
<?= $this->Html->link(__('Editer'), ['action' => 'edit', $article->id]) ?>
|
||||
<?= $this->Form->postLink(__('Supprimer'), ['action' => 'delete', $article->id], ['confirm' => __('Êtes-vous sûr de vouloir supprimer l\'article #{0} ?', $article->id)]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="paginator">
|
||||
<ul class="pagination">
|
||||
<?= $this->Paginator->prev('< ' . __('previous')) ?>
|
||||
<?= $this->Paginator->numbers() ?>
|
||||
<?= $this->Paginator->next(__('next') . ' >') ?>
|
||||
</ul>
|
||||
<p><?= $this->Paginator->counter() ?></p>
|
||||
</div>
|
||||
</div> -->
|
||||
|
@ -1,57 +1,4 @@
|
||||
<div class="row">
|
||||
<div class="crisis index large-12 medium-12 small-12 columns content">
|
||||
<h3><?= __('Crises') ?></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= $this->Paginator->sort('abstract') ?></th>
|
||||
<th><?= $this->Paginator->sort('severity') ?></th>
|
||||
<th><?= $this->Paginator->sort('state') ?></th>
|
||||
<th><?= $this->Paginator->sort('address') ?></th>
|
||||
<th class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($crisis as $crisi): ?>
|
||||
<tr>
|
||||
<td><?= h($crisi->abstract) ?></td>
|
||||
<td><?= $this->Number->format($crisi->severity) ?></td>
|
||||
<td><?= h($crisi->state) ?></td>
|
||||
<td><?= h($crisi->address) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['action' => 'view', $crisi->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $crisi->id]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $crisi->id], ['confirm' => __('Êtes-vous sûr de vouloir supprimer la crise # {0}?', $crisi->id)]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="paginator">
|
||||
<ul class="pagination">
|
||||
<?= $this->Paginator->prev('< ' . __('previous')) ?>
|
||||
<?= $this->Paginator->numbers() ?>
|
||||
<?= $this->Paginator->next(__('next') . ' >') ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 medium-12 small-12 columns">
|
||||
<?= $this->Html->link(__('Nouvelle crise'), ['action' => 'add']) ?>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="crisis index large-12 medium-12 columns content">
|
||||
<h3 style="margin-top: 20px; margin-bottom: 20px; text-align: center"><?= __('Consulter toutes les crises recensées') ?></h3>
|
||||
<table cellpadding="0" cellspacing="0" style="margin: 0px auto;" >
|
||||
|
@ -209,14 +209,27 @@
|
||||
<?= $articles->toArray()[0]->category; ?>
|
||||
</h5>
|
||||
<p class="home-article content">
|
||||
<?= $articles->toArray()[0]->body; ?>
|
||||
<?= $this->Text->truncate($articles->toArray()[0]->body,590); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $count += 1; ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<div class="articles index small-12 medium-6 large-4 columns content">
|
||||
<div class="panel">
|
||||
<h4 class="home-article title">
|
||||
<?= $articles->toArray()[1]->title; ?>
|
||||
</h4>
|
||||
<h5 class="home-article category subheader">
|
||||
<?= $articles->toArray()[1]->created; ?>
|
||||
in
|
||||
<?= $articles->toArray()[1]->category; ?>
|
||||
</h5>
|
||||
<p class="home-article content">
|
||||
<?= $this->Text->truncate($articles->toArray()[1]->body,590); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-6 large-4 columns text-center submit-form">
|
||||
<?= $this->Form->create($newCrisis, ['url' => ['controller' => 'Crisis', 'action' => 'add'], 'method' => 'post']); ?>
|
||||
@ -264,12 +277,15 @@
|
||||
<?= $article->category; ?>
|
||||
</h5>
|
||||
<p class="home-article content">
|
||||
<?= $article->body; ?>
|
||||
<?= $this->Text->truncate($article->body,256); ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php } else { ?>
|
||||
<div class="show-for-medium-up small-12 medium-3 large-4 columns">
|
||||
<br/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user