1
0

Add placeholder for hashtag + fix some display problems + add some translation + add link to article on home page + add static counter to avoid same articles displayed two times + some truncate instead of strlen() + categories Articles + remove categories of articles on home page

This commit is contained in:
HorlogeSkynet 2015-12-04 19:16:35 +01:00
parent 22d0bd6548
commit 167b1d7b1a
16 changed files with 86 additions and 95 deletions

@ -10,6 +10,7 @@ use Cake\Event\Event;
*/ */
class ArticlesController extends AppController class ArticlesController extends AppController
{ {
public $categories = ['articlePresse' => 'Article de presse', 'news' => 'Nouveautés', 'edito' => 'Éditorial', 'conseil' => 'Conseil'];
/** /**
* beforeFilter method * beforeFilter method
@ -35,6 +36,7 @@ class ArticlesController extends AppController
]; ];
$this->set('articles', $this->paginate($this->Articles)); $this->set('articles', $this->paginate($this->Articles));
$this->set('_serialize', ['articles']); $this->set('_serialize', ['articles']);
$this->set('categories', $this->categories);
} }
/** /**
@ -51,6 +53,7 @@ class ArticlesController extends AppController
]); ]);
$this->set('article', $article); $this->set('article', $article);
$this->set('_serialize', ['article']); $this->set('_serialize', ['article']);
$this->set('categories', $this->categories);
} }
/** /**
@ -76,6 +79,7 @@ class ArticlesController extends AppController
} }
$this->set(compact('article', 'users')); $this->set(compact('article', 'users'));
$this->set('_serialize', ['article']); $this->set('_serialize', ['article']);
$this->set('categories', $this->categories);
} }
/** /**
@ -102,6 +106,7 @@ class ArticlesController extends AppController
$users = $this->Articles->Users->find('list', ['limit' => 200]); $users = $this->Articles->Users->find('list', ['limit' => 200]);
$this->set(compact('article', 'users')); $this->set(compact('article', 'users'));
$this->set('_serialize', ['article']); $this->set('_serialize', ['article']);
$this->set('categories', $this->categories);
} }
/** /**

@ -23,7 +23,7 @@ class CrisisController extends AppController
public function beforeFilter(Event $event) public function beforeFilter(Event $event)
{ {
parent::beforeFilter($event); parent::beforeFilter($event);
$this->Auth->allow(['add','view','index','test','severityIncrement','severityDecrement']); $this->Auth->allow(['add', 'view', 'index', 'test', 'severityIncrement', 'severityDecrement']);
} }
/** /**
@ -50,7 +50,7 @@ class CrisisController extends AppController
} }
else else
{ {
$this->Flash->error(__('Impossible de valider la crise')); $this->Flash->error(__('Impossible de valider la crise.'));
} }
return $this->redirect(['action' => 'view', $id_crise]); return $this->redirect(['action' => 'view', $id_crise]);
@ -66,7 +66,7 @@ class CrisisController extends AppController
} }
else else
{ {
$this->Flash->error(__('Impossible de terminer la crise')); $this->Flash->error(__('Impossible de terminer la crise.'));
} }
return $this->redirect(['action' => 'view', $id_crise]); return $this->redirect(['action' => 'view', $id_crise]);
@ -118,7 +118,7 @@ class CrisisController extends AppController
&& abs($crisi_db['latitude'] - $crisi['latitude'] ) < $delta_search ) { //1° lat/long-> 111 km && abs($crisi_db['latitude'] - $crisi['latitude'] ) < $delta_search ) { //1° lat/long-> 111 km
$crisi_db->severity += 1; $crisi_db->severity += 1;
$this->Crisis->save($crisi_db); $this->Crisis->save($crisi_db);
$this->Flash->success('Crisis Already notified so we are incrementing severity..'); $this->Flash->success('Cette crise a déjà été signalée, nous incrémentons sa gravité.');
return $this->redirect(['controller' => 'Homes', 'action' => 'index']); return $this->redirect(['controller' => 'Homes', 'action' => 'index']);
} }
} }
@ -134,9 +134,6 @@ class CrisisController extends AppController
return $this->redirect(['controller' => 'Homes', 'action' => 'index']); return $this->redirect(['controller' => 'Homes', 'action' => 'index']);
} }
/*$users = $this->Crisis->Users->find('list', ['limit' => 200]);
$this->set(compact('crisi', 'users'));
$this->set('_serialize', ['crisi']);*/
} }
/** /**
@ -197,9 +194,9 @@ class CrisisController extends AppController
$crisi = $this->Crisis->get($id); $crisi = $this->Crisis->get($id);
$crisi->severity += 1; $crisi->severity += 1;
if ($this->Crisis->save($crisi)) { if ($this->Crisis->save($crisi)) {
$this->Flash->success(__('Thanks for the information')); $this->Flash->success(__('Merci pour l\'information.'));
} else { } else {
$this->Flash->error(__('Sorry there was an error')); $this->Flash->error(__('Désolé, nous avons rencontré une erreur...'));
} }
return $this->redirect(['action' => 'view',$crisi->id]); return $this->redirect(['action' => 'view',$crisi->id]);
} }
@ -216,9 +213,9 @@ class CrisisController extends AppController
$crisi = $this->Crisis->get($id); $crisi = $this->Crisis->get($id);
$crisi->severity -= 1; $crisi->severity -= 1;
if ($this->Crisis->save($crisi)) { if ($this->Crisis->save($crisi)) {
$this->Flash->success(__('Thanks for the information')); $this->Flash->success(__('Merci pour l\'information.'));
} else { } else {
$this->Flash->error(__('Sorry there was an error')); $this->Flash->error(__('Désolé, nous avons rencontré une erreur...'));
} }
return $this->redirect(['action' => 'view',$crisi->id]); return $this->redirect(['action' => 'view',$crisi->id]);
} }
@ -237,7 +234,7 @@ class CrisisController extends AppController
&& abs($crisi_db['latitude'] - $crisi['latitude'] ) < $delta_search ) { //1° lat/long-> 111 km && abs($crisi_db['latitude'] - $crisi['latitude'] ) < $delta_search ) { //1° lat/long-> 111 km
$crisi_db->severity += 1; $crisi_db->severity += 1;
$this->Crisis->save($crisi_db); $this->Crisis->save($crisi_db);
$this->Flash->success('Crisis Already notified - Increment severity..'); $this->Flash->success('Cette crise a déjà été signalée, nous incrémentons sa gravité.');
} }
} }
@ -277,13 +274,11 @@ class CrisisController extends AppController
return false; return false;
} }
} }
else if(($this->request->action === 'validate' || $this->request->action === 'terminate') and isset($user))
return true;
//A logged user can delete a crisis //A logged user can delete, validate or terminate a crisis
if($this->request->action === 'delete' && $user['id'] > 0) else if(($this->request->action === 'delete' || $this->request->action === 'validate' || $this->request->action === 'terminate') && isset($user))
{ {
return true; return true;
} }
return parent::isAuthorized($user); return parent::isAuthorized($user);

@ -62,10 +62,10 @@ class InfosController extends AppController
$info->user_id = $user_id; $info->user_id = $user_id;
$info = $this->Infos->patchEntity($info, $this->request->data); $info = $this->Infos->patchEntity($info, $this->request->data);
if ($this->Infos->save($info)) { if ($this->Infos->save($info)) {
$this->Flash->success(__('L\information a bien été enregistrée.')); $this->Flash->success(__('L\'information a bien été enregistrée.'));
return $this->redirect(['controller' => 'crisis', 'action' => 'view', $crisis_id]); return $this->redirect(['controller' => 'crisis', 'action' => 'view', $crisis_id]);
} else { } else {
$this->Flash->error(__('L\information n\'a pas pu être enregistrée.')); $this->Flash->error(__('L\'information n\'a pas pu être enregistrée.'));
} }
} }
$Crisis = $this->Infos->Crisis->find('list', ['limit' => 200]); $Crisis = $this->Infos->Crisis->find('list', ['limit' => 200]);
@ -95,10 +95,10 @@ class InfosController extends AppController
if ($this->request->is(['patch', 'post', 'put'])) { if ($this->request->is(['patch', 'post', 'put'])) {
$info = $this->Infos->patchEntity($info, $this->request->data); $info = $this->Infos->patchEntity($info, $this->request->data);
if ($this->Infos->save($info)) { if ($this->Infos->save($info)) {
$this->Flash->success(__('L\information a bien été enregistrée.')); $this->Flash->success(__('L\'information a bien été enregistrée.'));
return $this->redirect(['action' => 'index']); return $this->redirect(['action' => 'index']);
} else { } else {
$this->Flash->error(__('L\information n\'a pas pu être enregistrée.')); $this->Flash->error(__('L\'information n\'a pas pu être enregistrée.'));
} }
} }
$Crisis = $this->Infos->Crisis->find('list', ['limit' => 200]); $Crisis = $this->Infos->Crisis->find('list', ['limit' => 200]);
@ -121,7 +121,7 @@ class InfosController extends AppController
if ($this->Infos->delete($info)) { if ($this->Infos->delete($info)) {
$this->Flash->success(__('L\'information a bien été supprimée.')); $this->Flash->success(__('L\'information a bien été supprimée.'));
} else { } else {
$this->Flash->error(__('L\information n\'a pas pu être supprimée.')); $this->Flash->error(__('L\'information n\'a pas pu être supprimée.'));
} }
return $this->redirect(['action' => 'index']); return $this->redirect(['action' => 'index']);
} }

@ -27,9 +27,7 @@ class UsersController extends AppController
if(in_array($this->request->action, ['edit', 'delete'])) if(in_array($this->request->action, ['edit', 'delete']))
{ {
$userId = (int)$this->request->params['pass'][0]; if((int)$this->request->params['pass'][0] === $user['id'])
if($userId === $user['id'])
{ {
return true; return true;
} }
@ -41,11 +39,13 @@ class UsersController extends AppController
if ($this->request->is('post')) if ($this->request->is('post'))
{ {
$user = $this->Auth->identify(); $user = $this->Auth->identify();
if ($user)
if($user)
{ {
$this->Auth->setUser($user); $this->Auth->setUser($user);
return $this->redirect($this->Auth->redirectUrl()); return $this->redirect($this->Auth->redirectUrl());
} }
$this->Flash->error(__('Identifiant et / ou mot de passe incorrect(s).')); $this->Flash->error(__('Identifiant et / ou mot de passe incorrect(s).'));
} }
} }

@ -14,7 +14,6 @@ use Cake\Validation\Validator;
*/ */
class ArticlesTable extends Table class ArticlesTable extends Table
{ {
/** /**
* Initialize method * Initialize method
* *

@ -12,7 +12,7 @@
echo $this->Form->input('title', ['label' => 'Titre de l\'article :']); echo $this->Form->input('title', ['label' => 'Titre de l\'article :']);
echo $this->Form->input('body', ['label' => 'Corps du texte :']); echo $this->Form->input('body', ['label' => 'Corps du texte :']);
echo "<br>"; echo "<br>";
echo $this->Form->input('category', ['label' => 'Catégorie :']); echo $this->Form->input('category', array('type' => 'select', 'options' => $categories, 'label' => 'Catégorie'));
?> ?>
</fieldset> </fieldset>
<?= $this->Form->button(__('Soumettre')) ?> <?= $this->Form->button(__('Soumettre')) ?>

@ -16,10 +16,8 @@
<legend><?= __('Éditer l\'article') ?></legend> <legend><?= __('Éditer l\'article') ?></legend>
<?php <?php
echo $this->Form->input('title', ['label' => 'Titre de l\'article']); echo $this->Form->input('title', ['label' => 'Titre de l\'article']);
echo $this->Form->input('body', ['label' => 'Corps du texte']); echo $this->Form->input('body', ['label' => 'Corps du texte']); echo "<br />";
// echo $this->Form->input('user_id', ['options' => $users, 'label' => 'Utilisateur']); echo $this->Form->input('category', array('type' => 'select', 'options' => $categories, 'label' => 'Catégorie'));
echo "<br />";
echo $this->Form->input('category', ['label' => 'Catégorie']);
?> ?>
</fieldset> </fieldset>
<?= $this->Form->button(__('Soumettre')) ?> <?= $this->Form->button(__('Soumettre')) ?>

@ -18,15 +18,14 @@
<div class="articles index medium-4 columns content"> <div class="articles index medium-4 columns content">
<div class="panel"> <div class="panel">
<h4 class="subheader"><?= $this->Html->link(__($article->title), ['action' => 'view', $article->id]) ?><hr></h4> <h4 class="subheader"><?= $this->Html->link(__($article->title), ['action' => 'view', $article->id]) ?><hr></h4>
<h5 class="subheader"><?php $string = $article->body; <h5 class="subheader">
$string = (strlen($string) > 50) ? substr($string,0,50).' (...)' : $string; echo $string <?php $this->Text->truncate($article->body, 50); ?>
?>
</h5> </h5>
<em>Catégorie : <?= h($article->category) ?><hr></em> <em>Catégorie : <?= h($categories[$article->category]) ?><hr></em>
<?php if($this->request->session()->read('Auth.User.id')): ?> <?php if($this->request->session()->read('Auth.User.id')): ?>
<?= $this->Html->link(__('Editer'), ['action' => 'edit', $article->id], array('class' => 'button secondary radius', 'style' => 'width: 49%;')) ?> <?= $this->Html->link(__('Éditer'), ['action' => 'edit', $article->id], array('class' => 'button secondary radius', 'style' => 'width: 49%;')) ?>
<?= $this->Form->postLink(__('Supprimer'), ['action' => 'delete', $article->id], array('class' => 'button secondary radius', 'style' => 'width: 49%;'), ['confirm' => __('Êtes-vous sûr de vouloir supprimer l\'article #{0} ?', $article->id)]) ?> <?= $this->Form->postLink(__('Supprimer'), ['action' => 'delete', $article->id], array('class' => 'button secondary radius', 'style' => 'width: 49%;'), ['confirm' => __('Êtes-vous sûr de vouloir supprimer l\'article #{0} ?', $article->id)]) ?>
<?php endif; ?> <?php endif; ?>

@ -14,7 +14,7 @@
<h3 style="text-align: center;"><?= __($article->title) ?></h3> <h3 style="text-align: center;"><?= __($article->title) ?></h3>
</div> </div>
<div class="panel panel_shadow"> <div class="panel panel_shadow">
<h7 style="font-size: 80%" class="subheader">Catégorie : <?= h($article->category) ?><hr></h7> <h7 style="font-size: 80%" class="subheader">Catégorie : <?= h($categories[$article->category]) ?><hr></h7>
<h5 class="subheader"><?= __($article->body) ?></h5> <h5 class="subheader"><?= __($article->body) ?></h5>
</div> </div>
</div> </div>

@ -16,7 +16,7 @@
echo $this->Form->input('state', ['options' => ['spotted' => 'Spotted', 'verified' => 'Verified', 'over' => 'Over'], 'label' => 'État']); echo $this->Form->input('state', ['options' => ['spotted' => 'Spotted', 'verified' => 'Verified', 'over' => 'Over'], 'label' => 'État']);
echo $this->Form->input('address', ['label' => 'Adresse']); echo $this->Form->input('address', ['label' => 'Adresse']);
echo $this->Form->input('type', ['label' => 'Type']); echo $this->Form->input('type', ['label' => 'Type']);
echo $this->Form->input('hashtags', ['label' => 'Hashtags']); echo $this->Form->input('hashtags', ['label' => 'Hashtags', 'placeholder' => '#']);
echo $this->Form->input('user_id', ['options' => $users, 'label' => 'ID utilisateur']); echo $this->Form->input('user_id', ['options' => $users, 'label' => 'ID utilisateur']);
?> ?>
</fieldset> </fieldset>

@ -6,7 +6,7 @@
<?php <?php
echo $this->Form->input('abstract', ['label' => 'Résumé']); echo $this->Form->input('abstract', ['label' => 'Résumé']);
echo $this->Form->input('type', array('type'=>'select', 'options'=>$categories, 'label'=>false, 'empty'=>'Categorie')); echo $this->Form->input('type', array('type'=>'select', 'options'=>$categories, 'label'=>false, 'empty'=>'Categorie'));
echo $this->Form->input('hashtags', ['label' => 'Hashtags']); echo $this->Form->input('hashtags', ['label' => 'Hashtags', 'placeholder' => '#']);
?> ?>
</fieldset> </fieldset>
<?= $this->Form->button(__('Mettre à jour')) ?> <?= $this->Form->button(__('Mettre à jour')) ?>

@ -1,6 +1,6 @@
<div class="row"> <div class="row">
<div class="crisis index large-12 medium-12 columns content"> <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> <h3 style="margin-top: 20px; margin-bottom: 20px; text-align: center"><?= __('Liste des crises recensées jusqu\'à aujourd\'hui:') ?></h3>
<table cellpadding="0" cellspacing="0" style="margin: 0px auto;" > <table cellpadding="0" cellspacing="0" style="margin: 0px auto;" >
<thead> <thead>
<tr> <tr>

@ -31,7 +31,7 @@
<?php if($crisi->state === 'spotted' || ($this->request->session()->read('Auth.User.id') && $crisi->state) === 'verified'): ?> <?php if($crisi->state === 'spotted' || ($this->request->session()->read('Auth.User.id') && $crisi->state) === 'verified'): ?>
<?= $this->Html->link(__('Editer la crise'), ['controller' => 'Crisis', 'action' => 'edit', $crisi->id], array('class' => 'small expanded button alert', 'style' => 'width: 100%;')) ?><br> <?= $this->Html->link(__('Éditer la crise'), ['controller' => 'Crisis', 'action' => 'edit', $crisi->id], array('class' => 'small expanded button alert', 'style' => 'width: 100%;')) ?><br>
<?php endif; ?> <?php endif; ?>

@ -22,7 +22,7 @@
<?php if ($home_type == 'active') { <?php if ($home_type == 'active') {
$frontCrisis=$verifiedCrises->first(); $frontCrisis=$verifiedCrises->first();
echo "<div class='medium-12 column text-center'>"; echo "<div class='medium-12 column text-center'>";
echo "<h2>Crise confirmée en cours!</h2>"; echo "<h2>Crise confirmée actuelle !</h2>";
echo "</div>"; echo "</div>";
} else if ($home_type=='spotted') { } else if ($home_type=='spotted') {
@ -95,9 +95,11 @@
<span class="small crisis-panel-state subheader"><?= $categories[$crisis->type] ?></span> <span class="small crisis-panel-state subheader"><?= $categories[$crisis->type] ?></span>
<span class="small crisis-panel-state subheader spotted-state"><?= $crisis->state ?></span> <span class="small crisis-panel-state subheader spotted-state"><?= $crisis->state ?></span>
<br/> <br/>
<span class="small crisis-panel-abstract"><?php <span class="small crisis-panel-abstract">
$string = $crisis->abstract; <?php
$string = (strlen($string) > 64) ? substr($string,0,64).'...' : $string; echo $string ?></span> $this->Text->truncate($crisis->abstract, 64);
?>
</span>
<br/> <br/>
<div class="small button-group"> <div class="small button-group">
<?= $this->Form->postLink(__('Yes'), ['controller' => 'Crisis','action' => 'severityIncrement', $crisis->id], ['class' => ' fi-arrow-up medium Success ']) ?> <?= $this->Form->postLink(__('Yes'), ['controller' => 'Crisis','action' => 'severityIncrement', $crisis->id], ['class' => ' fi-arrow-up medium Success ']) ?>
@ -133,9 +135,11 @@
<span class="small crisis-panel-state subheader"><?= $categories[$crisis->type] ?></span> <span class="small crisis-panel-state subheader"><?= $categories[$crisis->type] ?></span>
<span class="small crisis-panel-state subheader verified-state"><?= $crisis->state ?></span> <span class="small crisis-panel-state subheader verified-state"><?= $crisis->state ?></span>
<br/> <br/>
<span class="small crisis-panel-abstract"><?php <span class="small crisis-panel-abstract">
$string = $crisis->abstract; <?php
$string = (strlen($string) > 64) ? substr($string,0,64).'...' : $string; echo $string ?></span> $this->Text->truncate($crisis->abstract, 64);
?>
</span>
<br/> <br/>
<div class="small button-group"> <div class="small button-group">
<?= $this->Form->postLink(__('Yes'), ['controller' => 'Crisis','action' => 'severityIncrement', $crisis->id], ['class' => ' fi-arrow-up medium Success ']) ?> <?= $this->Form->postLink(__('Yes'), ['controller' => 'Crisis','action' => 'severityIncrement', $crisis->id], ['class' => ' fi-arrow-up medium Success ']) ?>
@ -188,70 +192,67 @@
<div class="row"> <div class="row">
<div class="row text-center"> <div class="row text-center">
<h2>Il n'y a pas d'évènements majeurs actuellement ! </h2> <h2><br>Il n'y a pas d'évènement majeur actuellement !</h2>
</div> </div>
<div class="row"> <div class="row">
<h3 style="margin-top: 20px; margin-bottom: 30px; text-align: center;"><?= __('Articles') ?></h3> <h3 style="margin-top: 20px; margin-bottom: 30px; text-align: center;"><?= __('Nous vous proposons de jeter un coup d\'œil à nos articles de sensibilisation:') ?></h3>
<?php $count = 0;?>
<?php foreach ($articles as $article): ?>
<?php if($count == 2) break; ?> <?php if($articles->count() != 0) : ?>
<div class="articles index small-12 medium-6 large-4 columns content"> <div class="articles index small-12 medium-6 large-4 columns content">
<div class="panel "> <div class="panel ">
<h4 class="home-article title"> <h4 class="home-article title">
<?= $articles->toArray()[0]->title; ?> <?= $this->Html->link(__($articles->toArray()[0]->title), ['controller' => 'articles', 'action' => 'view', $articles->toArray()[0]->id]); ?>
</h4> </h4>
<h5 class="home-article category subheader"> <h5 class="home-article category subheader">
<?= $articles->toArray()[0]->created; ?> <?= $articles->toArray()[0]->created; ?>
in
<?= $articles->toArray()[0]->category; ?>
</h5> </h5>
<p class="home-article content"> <p class="home-article content">
<?= $this->Text->truncate($articles->toArray()[0]->body,590); ?> <?= $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> </p>
</div> </div>
</div> </div>
<?php endif; if($articles->count() > 1) :?>
<div class="articles index small-12 medium-6 large-4 columns content">
<div class="panel">
<h4 class="home-article title">
<?= $this->Html->link(__($articles->toArray()[1]->title), ['controller' => 'articles', 'action' => 'view', $articles->toArray()[1]->id]); ?>
</h4>
<h5 class="home-article category subheader">
<?= $articles->toArray()[1]->created; ?>
</h5>
<p class="home-article content">
<?= $this->Text->truncate($articles->toArray()[1]->body, 590); ?>
</p>
</div>
</div>
<?php endif; ?>
<div class="small-12 medium-6 large-4 columns text-center submit-form"> <div class="small-12 medium-6 large-4 columns text-center submit-form">
<?= $this->Form->create($newCrisis, ['url' => ['controller' => 'Crisis', 'action' => 'add'], 'method' => 'post']); ?> <?= $this->Form->create($newCrisis, ['url' => ['controller' => 'Crisis', 'action' => 'add'], 'method' => 'post']); ?>
<fieldset> <fieldset>
<legend><?= __('Submit crisis') ?></legend> <legend><?= __('Soumettre une crise') ?></legend>
<!-- Hidden fields--> <!-- Hidden fields-->
<?php echo $this->Form->hidden('severity'); <?php echo $this->Form->hidden('severity');
echo $this->Form->hidden('longitude'); echo $this->Form->hidden('longitude');
echo $this->Form->hidden('latitude'); echo $this->Form->hidden('latitude');
echo $this->Form->hidden('state'); echo $this->Form->hidden('state');
?> ?>
<?= $this->Form->input('abstract'); ?> <?= $this->Form->input('abstract', ['label' => 'En quelques mots...']); ?>
<label class='form-label'>Location:</label> <label class='form-label'>Localisation:</label>
<?php $types = array('auto' => 'Auto-detect', 'manual' => 'Manual entry'); <?php $types = array('auto' => 'Auto-détection', 'manual' => 'Renseignement manuel');
$attributes = array( 'legend' => false,'label' => true,'class' => 'radio-loc', 'value'=>'auto'); $attributes = array( 'legend' => false,'label' => true,'class' => 'radio-loc', 'value'=>'auto');
echo $this->Form->radio('type', $types, $attributes); echo $this->Form->radio('type', $types, $attributes);
?> ?>
<a id="geolocate" class="button" ><i class="fi-arrow-right large"></i> GeoMe</a> <a id="geolocate" class="button" ><i class="fi-arrow-right large"></i> GeoMe</a>
<?= $this->Form->input('address'); ?> <?= $this->Form->input('address', ['label' => 'Adresse']); ?>
<?php $types = array('1' => 'Séisme', '2' => 'Zombies'); ?> <?php $types = array('1' => 'Séisme', '2' => 'Zombies'); ?>
<?= $this->Form->input('type', array('type'=>'select', 'options'=>$types, 'label'=>false, 'empty'=>'Category')); ?> <?= $this->Form->input('type', array('type'=>'select', 'options'=>$types, 'label'=>false, 'empty'=>'Category')); ?>
<?= $this->Form->input('hashtags'); ?> <?= $this->Form->input('hashtags', ['label' => 'Hashtags', 'placeholder' => '#']); ?>
</fieldset> </fieldset>
<div class="small button-group"> <div class="small button-group">
<?= $this->Form->button(__('Submit')) ?> <?= $this->Form->button(__('Submit')) ?>
@ -266,18 +267,16 @@
<div class="row"> <div class="row">
<div class="small-12 medium-12 large-12 columns"> <div class="small-12 medium-12 large-12 columns">
<?php foreach($articles as $article): ?> <?php $_k = -1; foreach($articles as $article): $_k++; if($_k < 2) : continue; endif; ?>
<div class="panel "> <div class="panel ">
<h4 class="home-article title"> <h4 class="home-article title">
<?= $article->title; ?> <?= $this->Html->link(__($article->title), ['controller' => 'articles', 'action' => 'view', $article->id]); ?>
</h4> </h4>
<h5 class="home-article category subheader"> <h5 class="home-article category subheader">
<?= $article->created; ?> <?= $article->created; ?>
in
<?= $article->category; ?>
</h5> </h5>
<p class="home-article content"> <p class="home-article content">
<?= $this->Text->truncate($article->body,256); ?> <?= $this->Text->truncate($article->body, 256); ?>
</p> </p>
</div> </div>
<?php endforeach;?> <?php endforeach;?>

@ -20,7 +20,7 @@
<?= $this->Html->charset() ?> <?= $this->Html->charset() ?>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> <title>
<?= 'Suivie de crise - ' . $this->fetch('title') ?> <?= 'CrisisFlag - ' . $this->fetch('title') ?>
</title> </title>
<?= $this->Html->meta('icon') ?> <?= $this->Html->meta('icon') ?>
@ -66,8 +66,8 @@
<ul class="off-canvas-list"> <ul class="off-canvas-list">
<li><label>Menu</label></li> <li><label>Menu</label></li>
<li class="topbar-separator"><?= $this->Html->link(__('Accueil'), '/') ?></li> <li class="topbar-separator"><?= $this->Html->link(__('Accueil'), '/') ?></li>
<li><?= $this->Html->link(__('Les articles'), ['controller'=>'Articles', 'action' => 'index']) ?></li>
<li><?= $this->Html->link(__('Les crises'), ['controller'=>'Crisis', 'action' => 'index']) ?></li> <li><?= $this->Html->link(__('Les crises'), ['controller'=>'Crisis', 'action' => 'index']) ?></li>
<li><?= $this->Html->link(__('Les articles'), ['controller'=>'Articles', 'action' => 'index']) ?></li>
<li class="topbar-separator"><?= $this->Html->link(__('Utilisateurs'), ['controller'=>'Users', 'action' => 'index']) ?></li> <li class="topbar-separator"><?= $this->Html->link(__('Utilisateurs'), ['controller'=>'Users', 'action' => 'index']) ?></li>
<?php if($this->request->session()->read("Auth.User")): ?> <?php if($this->request->session()->read("Auth.User")): ?>
<li><?= $this->Html->link(__('Se déconnecter'), ['controller'=>'Users', 'action' => 'logout']) ?></li> <li><?= $this->Html->link(__('Se déconnecter'), ['controller'=>'Users', 'action' => 'logout']) ?></li>
@ -92,10 +92,6 @@
<div class="small-12 columns"> <div class="small-12 columns">
<p><?php echo $this->Html->image('devfsociety.svg', array('alt' => 'CakePHP', 'class' => 'footer-logo'));?></p> <p><?php echo $this->Html->image('devfsociety.svg', array('alt' => 'CakePHP', 'class' => 'footer-logo'));?></p>
<p class="links">
<a href="http://book.cakephp.org/3.0/">Documentation</a>
<a href="http://api.cakephp.org/3.0/">API</a>
</p>
<p class="copywrite">Fsociety all rights reserved © 2015</p> <p class="copywrite">Fsociety all rights reserved © 2015</p>
</div> </div>

Binary file not shown.

Before

Width: 32px  |  Height: 32px  |  Size: 1.7 KiB

After

Width: 256px  |  Height: 256px  |  Size: 361 KiB