Merge branch 'develop' of github.com:/dev-fsociety/DFS-2016 into develop
This commit is contained in:
commit
0df0ef0d3c
@ -112,7 +112,7 @@ class ItemsController extends AppController
|
||||
}
|
||||
|
||||
/**
|
||||
* List method
|
||||
* byCategory method
|
||||
*
|
||||
* @param string|null $id Item id.
|
||||
* @return \Cake\Network\Response|null Redirects to index.
|
||||
@ -126,5 +126,20 @@ class ItemsController extends AppController
|
||||
$this->set(compact('items', 'category'));
|
||||
}
|
||||
|
||||
public function process($id = null){
|
||||
$r = $this->Items->Offers->find()->where(['item_id' => $id])->toArray() ;
|
||||
if( empty($r) ){
|
||||
//No result we have to create the needs
|
||||
// add a needs for the item indentified by $id
|
||||
return $this->redirect(['controller' => 'needs','action' => 'add', $id]);
|
||||
}else{
|
||||
//redirect the user to the needs view
|
||||
//$r[0]->id is the id of the offer
|
||||
return $this->redirect(['controller' => 'offers','action' => 'view', $r[0]->id]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,26 +7,24 @@
|
||||
<?php foreach ($items as $item): ?>
|
||||
<!-- if right camp -->
|
||||
<?php $sclass = "square square-color" . (string)($counter%4) ?>
|
||||
<div class="row">
|
||||
<?php $rclass = "row bycat row-color" . (string)($counter%4) ?>
|
||||
<a href="#">
|
||||
<div class="<?php echo $rclass; ?>" style="background-color: #DEDEDE;">
|
||||
<div class="column large-3 medium-3 small-3 text-center square-container">
|
||||
<div class="<?php echo $sclass; ?>">
|
||||
<div class="square-content"><?= h($item->name) ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column large-3 medium-3 small-3 text-center">
|
||||
<div class="column large-3 medium-3 small-3"></div>
|
||||
<div class="column large-6 medium-6 small-6">
|
||||
<div class="cat-desc">
|
||||
<?= h($item->category) ?>
|
||||
<?= $this->Text->autoParagraph(h($item->description)); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column large-3 medium-3 small-3 text-center">
|
||||
<div class="cat-desc">
|
||||
<a href="#" class="button large radius">Hot+1</a>
|
||||
<br> <?= $this->Number->format($item->hot) ?> <br>
|
||||
<a href="#" class="button large radius">Get some <?= h($item->name) ?> !</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<br>
|
||||
<?php $counter++;?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
@ -46,14 +46,17 @@ $cakeDescription = 'CampCare';
|
||||
<span data-responsive-toggle="responsive-menu" data-hide-for="medium">
|
||||
<button class="menu-icon dark" type="button" data-toggle></button>
|
||||
</span>
|
||||
<a href=""><?= $this->Html->image('long_logo.png', ['class'=>'topbar_logo', 'url' => '/']); ?></a>
|
||||
<a href="<?= $this->Url->build('/', true); ?>"><?= $this->Html->image('long_logo.png', ['class'=>'topbar_logo', 'url' => '/']); ?></a>
|
||||
</div>
|
||||
<div id="responsive-menu">
|
||||
<div class="top-bar-left">
|
||||
</div>
|
||||
<div class="top-bar-right">
|
||||
<ul class="menu">
|
||||
<li><a href="#" class="profile_icon"><i class="fi-torso"></i></a></li>
|
||||
<?php if($this->request->session()->read('Auth.User.id') != null): ?>
|
||||
<li><a href="<?= $this->Url->build('/users', true); ?>" class="profile_icon"><i class="fi-torso"></i></a></li>
|
||||
<li><a href="<?= $this->Url->build('/users/logout', true); ?>" class="profile_icon"><i class="fi-power"></i></a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@ -61,7 +64,6 @@ $cakeDescription = 'CampCare';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?= $this->Flash->render() ?>
|
||||
<div class="container clearfix">
|
||||
<?= $this->fetch('content') ?>
|
||||
|
@ -122,6 +122,7 @@ h1 {
|
||||
background: #53777A;
|
||||
}
|
||||
|
||||
|
||||
.square-color0:hover {
|
||||
background: #a8243a;
|
||||
}
|
||||
@ -230,9 +231,15 @@ div.message.hidden {
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.bycat .square-container {
|
||||
margin-top: 0%!important;
|
||||
}
|
||||
|
||||
.cat-desc {
|
||||
margin-top: 20%;
|
||||
font-size: 2em;
|
||||
|
||||
}
|
||||
|
||||
.column {
|
||||
padding: 0px;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user