From 23ef22a94f9763e65a857bac28c8b47864040377 Mon Sep 17 00:00:00 2001 From: Corentin Mors <mikescops@pixelswap.fr> Date: Fri, 4 Dec 2015 00:28:03 +0100 Subject: [PATCH 01/15] Adding default template for info on crisis --- src/Template/Crisis/view.ctp | 58 ++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/src/Template/Crisis/view.ctp b/src/Template/Crisis/view.ctp index b353651..e775c27 100644 --- a/src/Template/Crisis/view.ctp +++ b/src/Template/Crisis/view.ctp @@ -3,15 +3,15 @@ <h2 class="main_degrade_title text-center"><?= h($crisi->type) ?> à <?= h($crisi->address) ?> - <?php if($crisi->state=='verified'): ?> - <i title="Verified by Staff" class="fi-checkbox verified_icon"></i> - <?php endif; ?> - <?php if($crisi->state=='over'): ?> - <i title="Crisis Ended" class="fi-x-circle"></i> - <?php endif; ?> - <?php if($crisi->state=='spotted'): ?> - <i title="Spotted by User" class="fi-sound spotted_icon"></i> - <?php endif; ?> + <?php if($crisi->state=='verified'): ?> + <i title="Verified by Staff" class="fi-checkbox verified_icon"></i> + <?php endif; ?> + <?php if($crisi->state=='over'): ?> + <i title="Crisis Ended" class="fi-x-circle"></i> + <?php endif; ?> + <?php if($crisi->state=='spotted'): ?> + <i title="Spotted by User" class="fi-sound spotted_icon"></i> + <?php endif; ?> </h2> @@ -20,30 +20,44 @@ <div class="row"> <div class="large-8 columns"> - <p>Créé le : <?= h($crisi->created) ?> </br> + <p><strong>Créé le : </strong><?= h($crisi->created) ?></br></br> - Description : <?= h($crisi->abstract) ?> + <strong>Description : </strong><?= h($crisi->abstract) ?> </p> <br> - <h4>Chat WebRTC ? </h4> - - + <h4>Informations à propos de cette crise :</h4> + <div class="panel"> + <h4 class="hide-for-small">Police municipale<hr></h4> + <h5 class="subheader">Fusce ullamcorper mauris in eros dignissim molestie posuere felis blandit. Aliquam erat volutpat. Mauris ultricies posuere vehicula. Sed sit amet posuere erat. Quisque in ipsum non augue euismod dapibus non et eros. Pellentesque consectetur tempus mi iaculis bibendum. Ut vel dolor sed eros tincidunt volutpat ac eget leo.</h5> + </div> - </div> - <div class="large-4 columns"> - - <h4>Ils en parlent...</h4> - <a class="twitter-timeline" href="https://twitter.com/hashtag/potus" data-widget-id="672517242656043008" data-screen-name="potus">Tweets sur #crise</a> - <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> + <div class="panel"> + <h4 class="hide-for-small">Ministère de la Défense<hr></h4> + <h5 class="subheader">Fuscel ullamcorper mauris in eros dignissim molestie posuere felis blandit. Aliquam erat volutpat. Mauris ultricies posuere vehicula. Sed sit amet posuere erat. Quisque in ipsum non augue euismod dapibus non et eros. Pellentesque consectetur tempus mi iaculis bibendum. Ut vel dolor sed eros tincidunt volutpat ac eget leo.</h5> + </div> - <p>Hashtags : <?= h($crisi->hashtags) ?></p> - </div> + +<h4>Chat WebRTC ? </h4> + + + +</div> +<div class="large-4 columns"> + + <h4>Ils en parlent...</h4> + <a class="twitter-timeline" href="https://twitter.com/hashtag/potus" data-widget-id="672517242656043008" data-screen-name="potus">Tweets sur #crise</a> + <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> + + + <p>Hashtags : <?= h($crisi->hashtags) ?></p> + +</div> </div> From 9af882cc4ea78dd9c71ae517ff9f29f476aa1db9 Mon Sep 17 00:00:00 2001 From: KansassCityShuffle <lisa.aubry@insa-cvl.fr> Date: Fri, 4 Dec 2015 00:32:26 +0100 Subject: [PATCH 02/15] Users > view.ctp --- src/Template/Users/view.ctp | 217 +++++++++--------------------------- 1 file changed, 50 insertions(+), 167 deletions(-) diff --git a/src/Template/Users/view.ctp b/src/Template/Users/view.ctp index 2a728f2..52acf64 100644 --- a/src/Template/Users/view.ctp +++ b/src/Template/Users/view.ctp @@ -1,168 +1,51 @@ -<nav class="large-3 medium-4 columns" id="actions-sidebar"> - <ul class="side-nav"> - <li class="heading"><?= __('Actions') ?></li> - <li><?= $this->Html->link(__('List Users'), ['action' => 'index']) ?> </li> - <li><?= $this->Html->link(__('New User'), ['action' => 'add']) ?> </li> - <li><?= $this->Html->link(__('Edit User'), ['action' => 'edit', $user->id]) ?> </li> - <li><?= $this->Form->postLink(__('Delete User'), ['action' => 'delete', $user->id], ['confirm' => __('Are you sure you want to delete # {0}?', $user->id)]) ?> </li> - <li><?= $this->Html->link(__('List Articles'), ['controller' => 'Articles', 'action' => 'index']) ?> </li> - <li><?= $this->Html->link(__('New Article'), ['controller' => 'Articles', 'action' => 'add']) ?> </li> - <li><?= $this->Html->link(__('List Crisis'), ['controller' => 'Crisis', 'action' => 'index']) ?> </li> - <li><?= $this->Html->link(__('New Crisis'), ['controller' => 'Crisis', 'action' => 'add']) ?> </li> - <li><?= $this->Html->link(__('List Infos'), ['controller' => 'Infos', 'action' => 'index']) ?> </li> - <li><?= $this->Html->link(__('New Info'), ['controller' => 'Infos', 'action' => 'add']) ?> </li> - </ul> -</nav> -<div class="users view large-9 medium-8 columns content"> - <h3><?= h($user->id) ?></h3> - <table class="vertical-table"> - <tr> - <th><?= __('Username') ?></th> - <td><?= h($user->username) ?></td> - </tr> - <tr> - <th><?= __('Password') ?></th> - <td><?= h($user->password) ?></td> - </tr> - <tr> - <th><?= __('Organisation') ?></th> - <td><?= h($user->organisation) ?></td> - </tr> - <tr> - <th><?= __('Id') ?></th> - <td><?= $this->Number->format($user->id) ?></td> - </tr> - <tr> - <th><?= __('Created') ?></th> - <td><?= h($user->created) ?></td> - </tr> - <tr> - <th><?= __('Modified') ?></th> - <td><?= h($user->modified) ?></td> - </tr> - </table> + <!-- this adds Foundation Icon Fonts!! --> + <link href="http://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.css" rel="stylesheet"> + <div class="row"> - <h4><?= __('Description') ?></h4> - <?= $this->Text->autoParagraph(h($user->description)); ?> - </div> - <div class="related"> - <h4><?= __('Related Articles') ?></h4> - <?php if (!empty($user->articles)): ?> - <table cellpadding="0" cellspacing="0"> - <tr> - <th><?= __('Id') ?></th> - <th><?= __('Title') ?></th> - <th><?= __('Body') ?></th> - <th><?= __('Created') ?></th> - <th><?= __('Modified') ?></th> - <th><?= __('User Id') ?></th> - <th><?= __('Category') ?></th> - <th class="actions"><?= __('Actions') ?></th> - </tr> - <?php foreach ($user->articles as $articles): ?> - <tr> - <td><?= h($articles->id) ?></td> - <td><?= h($articles->title) ?></td> - <td><?= h($articles->body) ?></td> - <td><?= h($articles->created) ?></td> - <td><?= h($articles->modified) ?></td> - <td><?= h($articles->user_id) ?></td> - <td><?= h($articles->category) ?></td> - <td class="actions"> - <?= $this->Html->link(__('View'), ['controller' => 'Articles', 'action' => 'view', $articles->id]) ?> - - <?= $this->Html->link(__('Edit'), ['controller' => 'Articles', 'action' => 'edit', $articles->id]) ?> - - <?= $this->Form->postLink(__('Delete'), ['controller' => 'Articles', 'action' => 'delete', $articles->id], ['confirm' => __('Are you sure you want to delete # {0}?', $articles->id)]) ?> - - </td> - </tr> - <?php endforeach; ?> - </table> - <?php endif; ?> - </div> - <div class="related"> - <h4><?= __('Related Crisis') ?></h4> - <?php if (!empty($user->crisis)): ?> - <table cellpadding="0" cellspacing="0"> - <tr> - <th><?= __('Id') ?></th> - <th><?= __('Abstract') ?></th> - <th><?= __('Severity') ?></th> - <th><?= __('Longitude') ?></th> - <th><?= __('Latitude') ?></th> - <th><?= __('State') ?></th> - <th><?= __('Address') ?></th> - <th><?= __('Type') ?></th> - <th><?= __('Hashtags') ?></th> - <th><?= __('Created') ?></th> - <th><?= __('Modified') ?></th> - <th><?= __('User Id') ?></th> - <th class="actions"><?= __('Actions') ?></th> - </tr> - <?php foreach ($user->crisis as $crisis): ?> - <tr> - <td><?= h($crisis->id) ?></td> - <td><?= h($crisis->abstract) ?></td> - <td><?= h($crisis->severity) ?></td> - <td><?= h($crisis->longitude) ?></td> - <td><?= h($crisis->latitude) ?></td> - <td><?= h($crisis->state) ?></td> - <td><?= h($crisis->address) ?></td> - <td><?= h($crisis->type) ?></td> - <td><?= h($crisis->hashtags) ?></td> - <td><?= h($crisis->created) ?></td> - <td><?= h($crisis->modified) ?></td> - <td><?= h($crisis->user_id) ?></td> - <td class="actions"> - <?= $this->Html->link(__('View'), ['controller' => 'Crisis', 'action' => 'view', $crisis->id]) ?> - - <?= $this->Html->link(__('Edit'), ['controller' => 'Crisis', 'action' => 'edit', $crisis->id]) ?> - - <?= $this->Form->postLink(__('Delete'), ['controller' => 'Crisis', 'action' => 'delete', $crisis->id], ['confirm' => __('Are you sure you want to delete # {0}?', $crisis->id)]) ?> - - </td> - </tr> - <?php endforeach; ?> - </table> - <?php endif; ?> - </div> - <div class="related"> - <h4><?= __('Related Infos') ?></h4> - <?php if (!empty($user->infos)): ?> - <table cellpadding="0" cellspacing="0"> - <tr> - <th><?= __('Id') ?></th> - <th><?= __('Title') ?></th> - <th><?= __('Body') ?></th> - <th><?= __('Crisis Id') ?></th> - <th><?= __('User Id') ?></th> - <th><?= __('Created') ?></th> - <th><?= __('Modified') ?></th> - <th><?= __('Type') ?></th> - <th class="actions"><?= __('Actions') ?></th> - </tr> - <?php foreach ($user->infos as $infos): ?> - <tr> - <td><?= h($infos->id) ?></td> - <td><?= h($infos->title) ?></td> - <td><?= h($infos->body) ?></td> - <td><?= h($infos->crisis_id) ?></td> - <td><?= h($infos->user_id) ?></td> - <td><?= h($infos->created) ?></td> - <td><?= h($infos->modified) ?></td> - <td><?= h($infos->type) ?></td> - <td class="actions"> - <?= $this->Html->link(__('View'), ['controller' => 'Infos', 'action' => 'view', $infos->id]) ?> - - <?= $this->Html->link(__('Edit'), ['controller' => 'Infos', 'action' => 'edit', $infos->id]) ?> - - <?= $this->Form->postLink(__('Delete'), ['controller' => 'Infos', 'action' => 'delete', $infos->id], ['confirm' => __('Are you sure you want to delete # {0}?', $infos->id)]) ?> - - </td> - </tr> - <?php endforeach; ?> - </table> - <?php endif; ?> - </div> -</div> + <div class="medium-4 columns"> + <div class="profile-card"> + <img src="http://zurb.com/ink/images/inky-computer.svg" alt="Inky"> + <div class="profile-info"> + <h4 class="subheader">Inky</h4> + <p>Inky or inking can substitute for any word having to do with cool or awesome.</p> + <p><strong>Used in a scentence -</strong> Yo man, Foundation for Emails is so inky. Coding emails doesn't suck anymore!</p> + <p><a href="http://foundation.zurb.com/forum">Forum</a> | <a href="http://zurb.com/ink/">Website</a></p> + <ul class="inline-list"> + <li><a href="https://www.facebook.com/ZURB"><i class="fi-social-facebook"></i></a></li> + <li><a href="https://twitter.com/zurbink"><i class="fi-social-twitter"></i></a></li> + <li><a href="https://github.com/zurb/ink"><i class="fi-social-github"></i></a></li> + </div> + </div> + </div> + <div class="medium-4 columns"> + <div class="profile-card"> + <img src="http://www.demacmedia.com/wp-content/uploads/2014/04/330x330xYeti-Feature-Small-2.png.pagespeed.ic.ASS9EY8apS.png" alt="Yeti"> + <div class="profile-info"> + <h4 class="subheader">O.G. Yeti</h4> + <p>O.G. stands for original gangsta.</p> + <p><strong>Used in a scentence - </strong>those tru gangstas from way back in the day that jacked ya and left nothing but you boxers and socks. Also, Biggie and Tupac were both O.G.'s</p> + <p><a href="http://foundation.zurb.com/forum">Forum</a> | <a href="http://foundation.zurb.com/">Website</a></p> + <ul class="inline-list"> + <li><a href="https://www.facebook.com/ZURB"><i class="fi-social-facebook"></i></a></li> + <li><a href="https://twitter.com/ZURBfoundation"><i class="fi-social-twitter"></i></a></li> + <li><a href="https://github.com/zurb/foundation"><i class="fi-social-github"></i></a></li> + </div> + </div> + </div> + <div class="medium-4 columns"> + <div class="profile-card"> + <img src="https://pbs.twimg.com/profile_images/540601078916452352/gIke9rjv_bigger.png" alt="Swoll Yeti"> + <div class="profile-info"> + <h4 class="subheader">Swoll Yeti</h4> + <p>Slang for "Swollen", as in getting "swollen" or "buff" at the gym.</p> + <p><strong>Used in a scentence -</strong> Yo, after a couple months at the Y, I'll be a swoll Yeti.</p> + <p><a href="http://zurb.com/patterntap">Patterns</a> | <a href="http://foundation.zurb.com/apps/">Website</a></p> + <ul class="inline-list"> + <li><a href="https://www.facebook.com/ZURB"><i class="fi-social-facebook"></i></a></li> + <li><a href="https://twitter.com/ZURBfoundation"><i class="fi-social-twitter"></i></a></li> + <li><a href="https://github.com/zurb/foundation-apps"><i class="fi-social-github"></i></a></li> + </ul> + </div> + </div> + </div> + </div> \ No newline at end of file From f0dee3cbcc07488941a9890e34bb796d6d7fcce6 Mon Sep 17 00:00:00 2001 From: kcohenta <kevin@cohen-tanugi.fr> Date: Fri, 4 Dec 2015 01:07:20 +0100 Subject: [PATCH 03/15] changement useless --- src/Template/Articles/add.ctp | 2 +- src/Template/Articles/edit.ctp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Template/Articles/add.ctp b/src/Template/Articles/add.ctp index 28ed36f..ee19389 100644 --- a/src/Template/Articles/add.ctp +++ b/src/Template/Articles/add.ctp @@ -7,7 +7,7 @@ <div class="articles form large-9 medium-8 columns content"> <?= $this->Form->create($article) ?> <fieldset> - <legend><?= __('Ajouter article') ?></legend> + <legend><?= __('Ajouter un article') ?></legend> <?php echo $this->Form->input('title', ['label' => 'Titre de l\'article :']); echo $this->Form->input('body', ['label' => 'Corps du texte :']); diff --git a/src/Template/Articles/edit.ctp b/src/Template/Articles/edit.ctp index c368616..9e6e636 100644 --- a/src/Template/Articles/edit.ctp +++ b/src/Template/Articles/edit.ctp @@ -2,7 +2,7 @@ <ul class="side-nav"> <li class="heading"><?= __('Actions') ?></li> <li><?= $this->Form->postLink( - __('Supprimer l\'Article'), + __('Supprimer l\'article'), ['action' => 'delete', $article->id], ['confirm' => __('Êtes-vous sûr de vouloir supprimer l\'Article #{0} ?', $article->id)] ) @@ -13,9 +13,9 @@ <div class="articles form large-9 medium-8 columns content"> <?= $this->Form->create($article) ?> <fieldset> - <legend><?= __('Éditer l\'Article') ?></legend> + <legend><?= __('Éditer l\'article') ?></legend> <?php - echo $this->Form->input('title', ['label' => 'Titre']); + echo $this->Form->input('title', ['label' => 'Titre de l\'article']); echo $this->Form->input('body', ['label' => 'Corps du texte']); // echo $this->Form->input('user_id', ['options' => $users, 'label' => 'Utilisateur']); echo "<br />"; From 29bc2ade671eee03ca8347c4250994b15e9ad617 Mon Sep 17 00:00:00 2001 From: linkzl <louis.boury@insa-cvl.fr> Date: Fri, 4 Dec 2015 01:15:55 +0100 Subject: [PATCH 04/15] first modif --- src/Template/Articles/view.ctp | 101 ++++++++++++++++++++------------- 1 file changed, 63 insertions(+), 38 deletions(-) diff --git a/src/Template/Articles/view.ctp b/src/Template/Articles/view.ctp index 6fdd3c6..3190c91 100644 --- a/src/Template/Articles/view.ctp +++ b/src/Template/Articles/view.ctp @@ -1,42 +1,67 @@ -<nav class="large-3 medium-4 columns" id="actions-sidebar"> +<br/> +<?php $this->set('css','css_view.css');?> +<nav class="large-2 medium-2 columns" id="actions-sidebar"> <ul class="side-nav"> - <li class="heading"><?= __('Actions') ?></li> - <li><?= $this->Html->link(__('List Articles'), ['action' => 'index']) ?> </li> - <li><?= $this->Html->link(__('New Article'), ['action' => 'add']) ?> </li> - <li><?= $this->Html->link(__('Edit Article'), ['action' => 'edit', $article->id]) ?> </li> - <li><?= $this->Form->postLink(__('Supprimer l\'Article'), ['action' => 'delete', $article->id], ['confirm' => __('Êtes-vous sûr de vouloir supprimer l\'Article # {0}?', $article->id)]) ?> </li> + + <center><li class="heading"><?= __('Actions') ?></li></center> + <li class="menu_impair"><?= $this->Html->link(__('Edit Article'), ['action' => 'edit', $article->id]) ?> </li> + <li class="menu_pair"><?= $this->Form->postLink(__('Delete Article'), ['action' => 'delete', $article->id], ['confirm' => __('Are you sure you want to delete # {0}?', $article->id)]) ?> </li> + <li class="menu_impair"><?= $this->Html->link(__('List Articles'), ['action' => 'index']) ?> </li> + <li class="menu_pair"><?= $this->Html->link(__('New Article'), ['action' => 'add']) ?> </li> + <li class="menu_impair"><?= $this->Html->link(__('List Users'), ['controller' => 'Users', 'action' => 'index']) ?> </li> + <li class="menu_pair"><?= $this->Html->link(__('New User'), ['controller' => 'Users', 'action' => 'add']) ?> </li> + + </ul> </nav> -<div class="articles view large-9 medium-8 columns content"> - <h3><?= h($article->title) ?></h3> - <table class="vertical-table"> - <tr> - <th><?= __('Title') ?></th> - <td><?= h($article->title) ?></td> - </tr> - <tr> - <th><?= __('User') ?></th> - <td><?= $article->has('user') ? $this->Html->link($article->user->id, ['controller' => 'Users', 'action' => 'view', $article->user->id]) : '' ?></td> - </tr> - <tr> - <th><?= __('Category') ?></th> - <td><?= h($article->category) ?></td> - </tr> - <tr> - <th><?= __('Id') ?></th> - <td><?= $this->Number->format($article->id) ?></td> - </tr> - <tr> - <th><?= __('Created') ?></th> - <td><?= h($article->created) ?></td> - </tr> - <tr> - <th><?= __('Modified') ?></th> - <td><?= h($article->modified) ?></td> - </tr> - </table> - <div class="row"> - <h4><?= __('Body') ?></h4> - <?= $this->Text->autoParagraph(h($article->body)); ?> - </div> + + + + + +<div class="articles view large-10 medium-9 columns content"> + + + <div class="crisis-panel red radius"> + <div class="crisis-panel-label"> + + </div> + <div class="crisis-panel-content"> + + <p> + <h2 class="crisis-panel-title"><?= h($article->title) ?></h2> + <h4 class="crisis-panel-date subheader"><?= h($article->category) ?></h4> + </p> + + + <p> + <?= $this->Text->autoParagraph(h($article->body)); ?> + </p> + + + </div> + + </div> + + <div class="row"> + + <div class="small-9 large-9 medium columns"><?= __('User') ?>: <?= $article->has('user') ? $this->Html->link($article->user->id, ['controller' => 'Users', 'action' => 'view', $article->user->id]) : '' ?></div> + <div class="small-3 large-3 columns"><?= __('Created') ?>: <?= h($article->created) ?><br/> + <?= __('Modified') ?>: <?= h($article->modified) ?> + </div> + + + + + + + + + + + + + + + </div> From ecd3bc632c87b620602b9e9f57f58816b9a7802d Mon Sep 17 00:00:00 2001 From: kcohenta <kevin@cohen-tanugi.fr> Date: Fri, 4 Dec 2015 01:15:59 +0100 Subject: [PATCH 05/15] Retrait edition text --- src/Template/Layout/default.ctp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Template/Layout/default.ctp b/src/Template/Layout/default.ctp index 556b9e6..e98dd18 100644 --- a/src/Template/Layout/default.ctp +++ b/src/Template/Layout/default.ctp @@ -116,8 +116,8 @@ <?= $this->Html->script("foundation/foundation.js") ?> <?= $this->Html->script("foundation/foundation.alert.js") ?> <?= $this->Html->script("foundation/foundation.topbar.js") ?> - <script src="//cdn.tinymce.com/4/tinymce.min.js"></script> - <script>tinymce.init({ selector:'textarea' });</script> + <!-- <script src="//cdn.tinymce.com/4/tinymce.min.js"></script> + <script>tinymce.init({ selector:'textarea' });</script> --> <!-- Own script --> <!-- Topbar --> <?= $this->Html->script('foundation/foundation.offcanvas.js') ?> From ca76061c483698e814c384fb7ee797757ae84a0e Mon Sep 17 00:00:00 2001 From: Corentin Mors <mikescops@pixelswap.fr> Date: Fri, 4 Dec 2015 01:21:06 +0100 Subject: [PATCH 06/15] Crisis information update --- src/Template/Crisis/view.ctp | 2 +- src/Template/Layout/default.ctp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Template/Crisis/view.ctp b/src/Template/Crisis/view.ctp index e775c27..aba25b2 100644 --- a/src/Template/Crisis/view.ctp +++ b/src/Template/Crisis/view.ctp @@ -63,4 +63,4 @@ <!-- GEOLOCALISATION / URL GOOGLE MAP == http://google.com/maps/bylatlng?lat=' + lat + '&lng=' + lng --> -<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script><div style="overflow:hidden;height:500px;width:100%;"><div id="gmap_canvas" style="height:500px;width:100%;"></div><style>#gmap_canvas img{max-width:none!important;background:none!important}</style><a class="google-map-code" href="http://www.themecircle.net" id="get-map-data">themecircle.net</a></div><script type="text/javascript"> function init_map(){var myOptions = {zoom:14,center:new google.maps.LatLng(<?= $this->Number->format($crisi->longitude) ?>,<?= $this->Number->format($crisi->latitude) ?>),mapTypeId: google.maps.MapTypeId.ROADMAP};map = new google.maps.Map(document.getElementById("gmap_canvas"), myOptions);marker = new google.maps.Marker({map: map,position: new google.maps.LatLng(<?= $this->Number->format($crisi->longitude) ?>, <?= $this->Number->format($crisi->latitude) ?>)});infowindow = new google.maps.InfoWindow({content:"Geolocalisation du signalement (approximation)" });google.maps.event.addListener(marker, "click", function(){infowindow.open(map,marker);});infowindow.open(map,marker);}google.maps.event.addDomListener(window, 'load', init_map);</script> \ No newline at end of file +<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script><div style="overflow:hidden;height:500px;width:100%;"><div id="gmap_canvas" style="height:500px;width:100%;"></div><style>#gmap_canvas img{max-width:none!important;background:none!important}</style><a class="google-map-code" href="http://www.themecircle.net" id="get-map-data">themecircle.net</a></div><script type="text/javascript"> function init_map(){var myOptions = {zoom:14,center:new google.maps.LatLng(<?= $this->Number->format($crisi->longitude) ?>,<?= $this->Number->format($crisi->latitude) ?>),mapTypeId: google.maps.MapTypeId.ROADMAP};map = new google.maps.Map(document.getElementById("gmap_canvas"), myOptions);marker = new google.maps.Marker({map: map,position: new google.maps.LatLng(<?= $this->Number->format($crisi->longitude) ?>, <?= $this->Number->format($crisi->latitude) ?>)});infowindow = new google.maps.InfoWindow({content:"Géolocalisation du signalement (approximation)" });google.maps.event.addListener(marker, "click", function(){infowindow.open(map,marker);});infowindow.open(map,marker);}google.maps.event.addDomListener(window, 'load', init_map);</script> \ No newline at end of file diff --git a/src/Template/Layout/default.ctp b/src/Template/Layout/default.ctp index 51325f1..f97c78e 100644 --- a/src/Template/Layout/default.ctp +++ b/src/Template/Layout/default.ctp @@ -117,8 +117,7 @@ <?= $this->Html->script("foundation/foundation.js") ?> <?= $this->Html->script("foundation/foundation.alert.js") ?> <?= $this->Html->script("foundation/foundation.topbar.js") ?> - <script src="//cdn.tinymce.com/4/tinymce.min.js"></script> - <script>tinymce.init({ selector:'textarea' });</script> + <!-- Own script --> <!-- Topbar --> <?= $this->Html->script('foundation/foundation.offcanvas.js') ?> From 1bc7caa75e26c1e3ef48f801da2d997bed6ba9b9 Mon Sep 17 00:00:00 2001 From: HorlogeSkynet <sam.forestier@gmail.com> Date: Fri, 4 Dec 2015 01:40:16 +0100 Subject: [PATCH 07/15] edit info Coco' --- src/Controller/InfosController.php | 27 +++++++++++++-------------- src/Model/Table/CrisisTable.php | 4 ++++ src/Model/Table/InfosTable.php | 5 +++++ src/Template/Crisis/add.ctp | 6 +++--- src/Template/Crisis/edit.ctp | 6 +++--- 5 files changed, 28 insertions(+), 20 deletions(-) diff --git a/src/Controller/InfosController.php b/src/Controller/InfosController.php index ae57d76..d7f6db2 100644 --- a/src/Controller/InfosController.php +++ b/src/Controller/InfosController.php @@ -116,23 +116,22 @@ class InfosController extends AppController public function isAuthorized($user) { - // A logged user can do an action about infos - - if($this->request->action === 'add' && $user['id'] > 0) - { - return true; - } - - if(in_array($this->request->action, ['edit', 'delete'])) - { - $infoId = (int)$this->request->params['pass'][0]; - - if($this->Articles->isOwnedBy($infoId, $user['id'])) + // A logged user can do an action about infos + if($this->request->action === 'add' && $user['id'] > 0) { return true; } - } - return parent::isAuthorized($user); + if(in_array($this->request->action, ['edit', 'delete'])) + { + $infoId = (int)$this->request->params['pass'][0]; + + if($this->Infos->isOwnedBy($infoId, $user['id'])) + { + return true; + } + } + + return parent::isAuthorized($user); } } diff --git a/src/Model/Table/CrisisTable.php b/src/Model/Table/CrisisTable.php index 151c95b..237cf5a 100644 --- a/src/Model/Table/CrisisTable.php +++ b/src/Model/Table/CrisisTable.php @@ -76,6 +76,10 @@ class CrisisTable extends Table $validator ->requirePresence('state', 'create') ->notEmpty('state'); + $validator + ->add('state', 'inList', ['rule' => ['inList', [ + 'spotted', 'verified', 'over']], + 'message' => 'Merci de rentrer un role valide']); $validator ->requirePresence('address', 'create') diff --git a/src/Model/Table/InfosTable.php b/src/Model/Table/InfosTable.php index c4de234..9724e68 100644 --- a/src/Model/Table/InfosTable.php +++ b/src/Model/Table/InfosTable.php @@ -82,4 +82,9 @@ class InfosTable extends Table $rules->add($rules->existsIn(['user_id'], 'Users')); return $rules; } + + public function isOwnedBy($infoId, $userId) + { + return $this->exists(['id' => $infoId, 'user_id' => $userId]); + } } diff --git a/src/Template/Crisis/add.ctp b/src/Template/Crisis/add.ctp index a5af12e..73ef544 100644 --- a/src/Template/Crisis/add.ctp +++ b/src/Template/Crisis/add.ctp @@ -11,9 +11,9 @@ <?php echo $this->Form->input('abstract', ['label' => 'Résumé']); echo $this->Form->input('severity', ['label' => 'Gravité']); - echo $this->Form->input('longitude', ['label' => 'Longitude', 'minLongi' => -180.0000, 'maxLongi' => 180.0000]); - echo $this->Form->input('latitude', ['label' => 'Latitude', 'minLati' => -90.0000, 'maxLati' => 90.0000]); - echo $this->Form->input('state', ['label' => 'Etat']); + echo $this->Form->input('longitude', ['label' => 'Longitude']); + echo $this->Form->input('latitude', ['label' => 'Latitude']); + 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('type', ['label' => 'Type']); echo $this->Form->input('hashtags', ['label' => 'Hashtags']); diff --git a/src/Template/Crisis/edit.ctp b/src/Template/Crisis/edit.ctp index 51e9a11..d3550d1 100644 --- a/src/Template/Crisis/edit.ctp +++ b/src/Template/Crisis/edit.ctp @@ -17,9 +17,9 @@ <?php echo $this->Form->input('abstract', ['label' => 'Résumé']); echo $this->Form->input('severity', ['label' => 'Gravité']); - echo $this->Form->input('longitude', ['label' => 'Longitude', 'minLongi' => -180.0000, 'maxLongi' => 180.0000]); - echo $this->Form->input('latitude', ['label' => 'Latitude', 'minLati' => -90.0000, 'maxLati' => 90.0000]); - echo $this->Form->input('state', ['label' => 'Etat']); + echo $this->Form->input('longitude', ['label' => 'Longitude']); + echo $this->Form->input('latitude', ['label' => 'Latitude']); + 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('type', ['label' => 'Type']); echo $this->Form->input('hashtags', ['label' => 'Hashtags']); From 64d1bb9ffd1fa80b2f37884fc836176a9eae2e16 Mon Sep 17 00:00:00 2001 From: Corentin Mors <mikescops@pixelswap.fr> Date: Fri, 4 Dec 2015 01:40:53 +0100 Subject: [PATCH 08/15] Information connect to db --- src/Template/Crisis/view.ctp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Template/Crisis/view.ctp b/src/Template/Crisis/view.ctp index aba25b2..f651a29 100644 --- a/src/Template/Crisis/view.ctp +++ b/src/Template/Crisis/view.ctp @@ -29,17 +29,14 @@ <br> <h4>Informations à propos de cette crise :</h4> + <?php + foreach($crisi->infos as $info): ?> <div class="panel"> - <h4 class="hide-for-small">Police municipale<hr></h4> - <h5 class="subheader">Fusce ullamcorper mauris in eros dignissim molestie posuere felis blandit. Aliquam erat volutpat. Mauris ultricies posuere vehicula. Sed sit amet posuere erat. Quisque in ipsum non augue euismod dapibus non et eros. Pellentesque consectetur tempus mi iaculis bibendum. Ut vel dolor sed eros tincidunt volutpat ac eget leo.</h5> + <h4 class="hide-for-small"><?= $info->title ?><hr></h4> + <h5 class="subheader"><?= $info->body ?></h5> + <em>Tagged : <?= $info->type ?></em> </div> - - - <div class="panel"> - <h4 class="hide-for-small">Ministère de la Défense<hr></h4> - <h5 class="subheader">Fuscel ullamcorper mauris in eros dignissim molestie posuere felis blandit. Aliquam erat volutpat. Mauris ultricies posuere vehicula. Sed sit amet posuere erat. Quisque in ipsum non augue euismod dapibus non et eros. Pellentesque consectetur tempus mi iaculis bibendum. Ut vel dolor sed eros tincidunt volutpat ac eget leo.</h5> - </div> - + <?php endforeach; ?> From 147e367feebe2f307a70b06e862b71be43b02607 Mon Sep 17 00:00:00 2001 From: HorlogeSkynet <sam.forestier@gmail.com> Date: Fri, 4 Dec 2015 01:46:19 +0100 Subject: [PATCH 09/15] traduction --- src/Controller/InfosController.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Controller/InfosController.php b/src/Controller/InfosController.php index d7f6db2..f0fe389 100644 --- a/src/Controller/InfosController.php +++ b/src/Controller/InfosController.php @@ -56,10 +56,10 @@ class InfosController extends AppController if ($this->request->is('post')) { $info = $this->Infos->patchEntity($info, $this->request->data); if ($this->Infos->save($info)) { - $this->Flash->success(__('The info has been saved.')); + $this->Flash->success(__('L\'Information a bien été enregistrée.')); return $this->redirect(['action' => 'index']); } else { - $this->Flash->error(__('The info could not be saved. Please, try again.')); + $this->Flash->error(__('L\'Information n\'a pas pu être enregistrée.')); } } $Crisis = $this->Infos->Crisis->find('list', ['limit' => 200]); @@ -83,10 +83,10 @@ class InfosController extends AppController if ($this->request->is(['patch', 'post', 'put'])) { $info = $this->Infos->patchEntity($info, $this->request->data); if ($this->Infos->save($info)) { - $this->Flash->success(__('The info has been saved.')); + $this->Flash->success(__('L\'Information a bien été enregistrée.')); return $this->redirect(['action' => 'index']); } else { - $this->Flash->error(__('The info could not be saved. Please, try again.')); + $this->Flash->error(__('L\'Information n\'a pas pu être enregistrée.')); } } $Crisis = $this->Infos->Crisis->find('list', ['limit' => 200]); @@ -107,9 +107,9 @@ class InfosController extends AppController $this->request->allowMethod(['post', 'delete']); $info = $this->Infos->get($id); if ($this->Infos->delete($info)) { - $this->Flash->success(__('The info has been deleted.')); + $this->Flash->success(__('L\'Information a bien été supprimée.')); } else { - $this->Flash->error(__('The info could not be deleted. Please, try again.')); + $this->Flash->error(__('L\'Information n\'a pas pu être supprimée.')); } return $this->redirect(['action' => 'index']); } From 2ce2cb7573d15243e5924465199beb3e9276d1b6 Mon Sep 17 00:00:00 2001 From: HorlogeSkynet <sam.forestier@gmail.com> Date: Fri, 4 Dec 2015 01:49:21 +0100 Subject: [PATCH 10/15] traduction --- src/Controller/CrisisController.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Controller/CrisisController.php b/src/Controller/CrisisController.php index d945b8d..f05fdd8 100644 --- a/src/Controller/CrisisController.php +++ b/src/Controller/CrisisController.php @@ -57,10 +57,10 @@ class CrisisController extends AppController if ($this->request->is('post')) { $crisi = $this->Crisis->patchEntity($crisi, $this->request->data); if ($this->Crisis->save($crisi)) { - $this->Flash->success(__('The crisis has been saved.')); + $this->Flash->success(__('La Crise a bien été enregistrée.')); return $this->redirect(['action' => 'index']); } else { - $this->Flash->error(__('The crisis could not be saved. Please, try again.')); + $this->Flash->error(__('La Crise n\'a pas pu être enregistrée.')); } } $users = $this->Crisis->Users->find('list', ['limit' => 200]); @@ -83,10 +83,10 @@ class CrisisController extends AppController if ($this->request->is(['patch', 'post', 'put'])) { $crisi = $this->Crisis->patchEntity($crisi, $this->request->data); if ($this->Crisis->save($crisi)) { - $this->Flash->success(__('The crisis has been saved.')); + $this->Flash->success(__('La Crise a bien été enregistrée.')); return $this->redirect(['action' => 'index']); } else { - $this->Flash->error(__('The crisis could not be saved. Please, try again.')); + $this->Flash->error(__('La Crise n\'a pas pu être enregistrée.')); } } $users = $this->Crisis->Users->find('list', ['limit' => 200]); @@ -106,9 +106,9 @@ class CrisisController extends AppController $this->request->allowMethod(['post', 'delete']); $crisi = $this->Crisis->get($id); if ($this->Crisis->delete($crisi)) { - $this->Flash->success(__('The crisis has been deleted.')); + $this->Flash->success(__('La Crise a bien été supprimée.')); } else { - $this->Flash->error(__('The crisis could not be deleted. Please, try again.')); + $this->Flash->error(__('La Crise n\'a pas pu être supprimée.')); } return $this->redirect(['action' => 'index']); } From 2b605011828f0c48b089640254e57e75b5330786 Mon Sep 17 00:00:00 2001 From: HorlogeSkynet <sam.forestier@gmail.com> Date: Fri, 4 Dec 2015 01:52:06 +0100 Subject: [PATCH 11/15] layout + '/' --- src/Template/Layout/default.ctp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Template/Layout/default.ctp b/src/Template/Layout/default.ctp index cf15bf8..231147d 100644 --- a/src/Template/Layout/default.ctp +++ b/src/Template/Layout/default.ctp @@ -65,11 +65,11 @@ </div> </nav> -<!-- Topbar --> + <!-- Topbar --> <nav class="left-off-canvas-menu"> <ul class="off-canvas-list"> <li><label>Menu</label></li> - <li><?= $this->Html->link(__('Home'), ['controller'=>'Homes', 'action' => '/']) ?></li> + <li><?= $this->Html->link(__('Home'), '/') ?></li> <li><?= $this->Html->link(__('Articles'), ['controller'=>'Articles', 'action' => 'index']) ?></li> <li><?= $this->Html->link(__('Crisis'), ['controller'=>'Crisis', 'action' => 'index']) ?></li> <li><?= $this->Html->link(__('Infos'), ['controller'=>'Infos', 'action' => 'index']) ?></li> @@ -81,8 +81,7 @@ </ul> </nav> - -<!-- /Topbar --> + <!-- /Topbar --> <?= $this->Flash->render() ?> @@ -91,7 +90,7 @@ </section> -<!-- Footer --> + <!-- Footer --> <footer class="footer"> <div class="row"> <div class="small-12 columns"> @@ -104,7 +103,7 @@ </div> </div> </footer> -<!-- /Footer --> + <!-- /Footer --> </div> </div> From 81161b588b3cfdc76ace1660a42efc8f7f214f9c Mon Sep 17 00:00:00 2001 From: Anthony Gourd <anthonygourd@gmail.com> Date: Fri, 4 Dec 2015 01:55:39 +0100 Subject: [PATCH 12/15] home controller --- src/Controller/ArticlesController.php | 5 ++++- src/Controller/HomesController.php | 1 - src/Template/Layout/default.ctp | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Controller/ArticlesController.php b/src/Controller/ArticlesController.php index 86d80e2..61dca89 100644 --- a/src/Controller/ArticlesController.php +++ b/src/Controller/ArticlesController.php @@ -60,8 +60,11 @@ class ArticlesController extends AppController */ public function add() { + $user_id = $this->Auth->user()['id']; $article = $this->Articles->newEntity(); - if ($this->request->is('post')) { + if ($this->request->is('post')) + { + $article->user_id = $user_id; $article = $this->Articles->patchEntity($article, $this->request->data); $article->user_id = $this->Auth->user('id'); if ($this->Articles->save($article)) { diff --git a/src/Controller/HomesController.php b/src/Controller/HomesController.php index 89e740f..f3f8123 100644 --- a/src/Controller/HomesController.php +++ b/src/Controller/HomesController.php @@ -35,7 +35,6 @@ class HomesController extends AppController if($verifiedCrises->count() != 0) { $home_type = 'active'; - } else { diff --git a/src/Template/Layout/default.ctp b/src/Template/Layout/default.ctp index 556b9e6..1c58412 100644 --- a/src/Template/Layout/default.ctp +++ b/src/Template/Layout/default.ctp @@ -116,8 +116,8 @@ <?= $this->Html->script("foundation/foundation.js") ?> <?= $this->Html->script("foundation/foundation.alert.js") ?> <?= $this->Html->script("foundation/foundation.topbar.js") ?> - <script src="//cdn.tinymce.com/4/tinymce.min.js"></script> - <script>tinymce.init({ selector:'textarea' });</script> + <!--<script src="//cdn.tinymce.com/4/tinymce.min.js"></script> + <script>tinymce.init({ selector:'textarea' });</script>--> <!-- Own script --> <!-- Topbar --> <?= $this->Html->script('foundation/foundation.offcanvas.js') ?> From 330e22e9fc2b6cc78ca3542bba31fa6c3d7ee592 Mon Sep 17 00:00:00 2001 From: Anthony Gourd <anthonygourd@gmail.com> Date: Fri, 4 Dec 2015 02:03:36 +0100 Subject: [PATCH 13/15] Info controller add method --- src/Controller/InfosController.php | 8 ++++++-- src/Template/Layout/default.ctp | 4 +--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Controller/InfosController.php b/src/Controller/InfosController.php index f0fe389..bd4b9e1 100644 --- a/src/Controller/InfosController.php +++ b/src/Controller/InfosController.php @@ -50,10 +50,14 @@ class InfosController extends AppController * * @return void Redirects on successful add, renders view otherwise. */ - public function add() + public function add($crisis_id) { + $user_id = $this->Auth->user()['id']; $info = $this->Infos->newEntity(); - if ($this->request->is('post')) { + if ($this->request->is('post')) + { + $info->crisis_id = $crisis_id; + $info->user_id = $user_id; $info = $this->Infos->patchEntity($info, $this->request->data); if ($this->Infos->save($info)) { $this->Flash->success(__('L\'Information a bien été enregistrée.')); diff --git a/src/Template/Layout/default.ctp b/src/Template/Layout/default.ctp index 5621937..d3570fd 100644 --- a/src/Template/Layout/default.ctp +++ b/src/Template/Layout/default.ctp @@ -115,12 +115,10 @@ <?= $this->Html->script("foundation/foundation.js") ?> <?= $this->Html->script("foundation/foundation.alert.js") ?> <?= $this->Html->script("foundation/foundation.topbar.js") ?> -<<<<<<< HEAD + <!--<script src="//cdn.tinymce.com/4/tinymce.min.js"></script> <script>tinymce.init({ selector:'textarea' });</script>--> -======= ->>>>>>> 2b605011828f0c48b089640254e57e75b5330786 <!-- Own script --> <!-- Topbar --> <?= $this->Html->script('foundation/foundation.offcanvas.js') ?> From 8229cabfc8250201b5fa82fbc3dfb9e042162d61 Mon Sep 17 00:00:00 2001 From: kcohenta <kevin@cohen-tanugi.fr> Date: Fri, 4 Dec 2015 02:04:33 +0100 Subject: [PATCH 14/15] Traduction index + ajout margin --- src/Template/Articles/index.ctp | 22 +++++++++++----------- src/Template/Crisis/index.ctp | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Template/Articles/index.ctp b/src/Template/Articles/index.ctp index 4366709..b8a2767 100644 --- a/src/Template/Articles/index.ctp +++ b/src/Template/Articles/index.ctp @@ -4,17 +4,17 @@ <li><?= $this->Html->link(__('Nouvel Article'), ['action' => 'add']) ?></li> </ul> </nav> -<div class="articles index large-9 medium-8 columns content"> - <h3><?= __('Articles') ?></h3> +<div class="articles index large-9 medium-8 columns content" > + <h3 style="margin-top: 20px; margin-bottom: 20px;"><?= __('Articles') ?></h3> <table cellpadding="0" cellspacing="0"> <thead> <tr> - <th><?= $this->Paginator->sort('id') ?></th> - <th><?= $this->Paginator->sort('title') ?></th> - <th><?= $this->Paginator->sort('created') ?></th> - <th><?= $this->Paginator->sort('modified') ?></th> - <th><?= $this->Paginator->sort('user_id') ?></th> - <th><?= $this->Paginator->sort('category') ?></th> + <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> @@ -28,9 +28,9 @@ <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(__('View'), ['action' => 'view', $article->id]) ?> - <?= $this->Html->link(__('Edit'), ['action' => 'edit', $article->id]) ?> - <?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $article->id], ['confirm' => __('Are you sure you want to delete # {0}?', $article->id)]) ?> + <?= $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; ?> diff --git a/src/Template/Crisis/index.ctp b/src/Template/Crisis/index.ctp index f176cd4..4818763 100644 --- a/src/Template/Crisis/index.ctp +++ b/src/Template/Crisis/index.ctp @@ -5,7 +5,7 @@ </ul> </nav> <div class="crisis index large-9 medium-8 columns content"> - <h3><?= __('Crisis') ?></h3> + <h3 style="margin-top: 20px; margin-bottom: 20px;"><?= __('Crisis') ?></h3> <table cellpadding="0" cellspacing="0"> <thead> <tr> From 77d724ca3e14fd807f0932f1acf4aca2bb7cf670 Mon Sep 17 00:00:00 2001 From: dibi <alban.chazot@insa-cvl-fr> Date: Fri, 4 Dec 2015 02:07:08 +0100 Subject: [PATCH 15/15] mise en forme de homepage version urgent --- src/Template/Homes/index.ctp | 86 ++++++++++++++++++++++-------- webroot/css/home_crisisdisplay.css | 40 ++++++++++++++ 2 files changed, 104 insertions(+), 22 deletions(-) diff --git a/src/Template/Homes/index.ctp b/src/Template/Homes/index.ctp index 068aad2..fcc14ec 100644 --- a/src/Template/Homes/index.ctp +++ b/src/Template/Homes/index.ctp @@ -30,29 +30,26 @@ <div class="crisis-panel red radius"> <div class="crisis-panel-label"> <div class="label-text"> - <?= $spottedCrises->first->severity ?> + <?= $verifiedCrises->first()->severity ?> </div> </div> <div class="crisis-panel-content"> - <p> - <h3 class="crisis-panel-title">Crisis location</h3> - <h4 class="crisis-panel-date subheader">Crisis date</h3> + <h3 class="crisis-panel-title"><?= $verifiedCrises->first()->address ?></h3> + <h4 class="crisis-panel-date subheader"><?= $verifiedCrises->first()->created ?></h3> </p> <p> - <h5 class="crisis-panel-state subheader">Crisis type</h5> - <h5 class="crisis-panel-state subheader">Crisis state</h5> + <h5 class="crisis-panel-state subheader"><?= $verifiedCrises->first()->type ?>:</h5> + <h5 class="crisis-panel-state subheader"><?= $verifiedCrises->first()->state ?></h5> </p> <p> - <span class="label secondary round radius">tag 1</span> - <span class="label secondary round radius">tag 2</span> - <span class="label secondary round radius">tag 3</span> - <span class="label secondary round radius">tag 4</span> - <span class="label secondary round radius">tag 5</span> + <?php $HTagsArray = explode(';', $verifiedCrises->first()->hashtags);?> + <?php foreach ($HTagsArray as $hashtag): ?> + <span class="label secondary round radius">#<?= $hashtag?></span> + <?php endforeach; ?> </p> - <p> - Crisis description. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + <?= $verifiedCrises->first()->abstract ?> </p> </div> @@ -64,21 +61,66 @@ <div class="row"> <div class="small-6 large-8 columns"> <!-- Dernières crises --> - <ul> - <?php foreach ($spottedCrises as $crisis): ?> - <li> - <?= $crisis->abstract ?> - </li> + <div class="panel callout radius spotted-panel"> + <?php foreach ($spottedCrises as $crisis): ?> + <div class="row text-left"> + <div class="medium-12 large-12 small-12 columns"> + <div class="crisis-panel red radius small"> + <div class="crisis-panel-label"> + <div class="label-text"> + <?= $crisis->severity ?> + </div> + </div> + <div class="small-crisis-panel-content"> + <span class="small crisis-panel-title"><?= $crisis->address ?></span> + <span class="small crisis-panel-date subheader"><?= $crisis->created ?></span> + <span class="small crisis-panel-state subheader"><?= $crisis->type ?>:</span> + <span class="small crisis-panel-state subheader"><?= $crisis->state ?></span> + <br/> + <span class="small crisis-panel-abstract"><?php + $string = $crisis->abstract; + $string = (strlen($string) > 64) ? substr($string,0,64).'...' : $string; echo $string ?></span> + </div> + </div> + </div> + </div> <?php endforeach; ?> - - </ul> + </div> + <div class="panel radius verified-panel"> + <?php foreach ($verifiedCrises as $crisis): ?> + <div class="row text-left"> + <div class="medium-12 large-12 small-12 columns"> + <div class="crisis-panel red radius small"> + <div class="crisis-panel-label"> + <div class="label-text"> + <?= $crisis->severity ?> + </div> + </div> + <div class="small-crisis-panel-content"> + <span class="small crisis-panel-title"><?= $crisis->address ?></span> + <span class="small crisis-panel-date subheader"><?= $crisis->created ?></span> + <span class="small crisis-panel-state subheader"><?= $crisis->type ?>:</span> + <span class="small crisis-panel-state subheader"><?= $crisis->state ?></span> + <br/> + <span class="small crisis-panel-abstract"><?php + $string = $crisis->abstract; + $string = (strlen($string) > 64) ? substr($string,0,64).'...' : $string; echo $string ?></span> + </div> + </div> + </div> + </div> + <?php endforeach; ?> + </div> </div> <div class="small-6 large-4 columns text-center submit-form"> - <!-- Formulaire --> - <?= $this->Form->create($crisi) ?> + <!-- Formulaire TODO:vraie variable crisis--> + + <?= $this->Form->create($newCrisis, [ + 'url' => ['controller' => 'Crisis', 'action' => 'add'] +]); ?> <legend><?= __('Submit crisis') ?></legend> <?= $this->Form->input('abstract'); ?> <label class='form-label'>Location:</label> diff --git a/webroot/css/home_crisisdisplay.css b/webroot/css/home_crisisdisplay.css index a9849e2..2fcf4d7 100644 --- a/webroot/css/home_crisisdisplay.css +++ b/webroot/css/home_crisisdisplay.css @@ -41,6 +41,46 @@ font-weight: normal; display:inline; margin-right: 10px} + .crisis-panel-abstract { + font-weight: normal; + display:inline; + margin-right: 10px} + + + .crisis-panel-title.small { + font-weight: bold; + font-size: 1rem; + display:inline; + margin-bottom: 1px; + margin-right: 10px; + margin-left: 10px} + .crisis-panel-date.small { + font-weight: normal; + font-size: 0.9rem; + display:inline; + margin-bottom: 1px; + margin-right: 10px} + .crisis-panel-state.small { + font-weight: normal; + font-size: 0.9rem; + display:inline; + margin-bottom: 1px; + margin-right: 10px} + .crisis-panel-abstract.small { + font-weight: normal; + font-size: 0.75rem; + margin-right: 10px; + margin-left: 10px; + margin-top: 1px; + margin-bottom: 1px} + + + + + .spotted-panel{ + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);} + .verified-panel{ + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);} .submit-form {