Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:bshaffer/Donate-Nashville
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer committed May 7, 2010
2 parents 312ffc2 + 45211c6 commit 2175eb6
Show file tree
Hide file tree
Showing 15 changed files with 72 additions and 20 deletions.
26 changes: 26 additions & 0 deletions apps/frontend/config/routing.yml
Expand Up @@ -151,13 +151,39 @@ stuff_show:
options: { type: object, model: StuffResource }
param: { module: stuff, action: show }

need_stuff_show:
class: sfDoctrineRoute
url: /need/stuff/:id
options: { type: object, model: StuffResource }
param: { module: stuff, action: show, section: need }


have_stuff_show:
class: sfDoctrineRoute
url: /have/stuff/:id
options: { type: object, model: StuffResource }
param: { module: stuff, action: show, section: have }

# The "show" page for TimeResource
time_show:
class: sfDoctrineRoute
url: /time/:id
options: { type: object, model: TimeResource }
param: { module: time, action: show }

need_time_show:
class: sfDoctrineRoute
url: /need/time/:id
options: { type: object, model: TimeResource }
param: { module: time, action: show, section: need }

have_time_show:
class: sfDoctrineRoute
url: /have/time/:id
options: { type: object, model: TimeResource }
param: { module: time, action: show, section: have }


new_message_match_found:
class: sfRequestRoute
url: /stuff/:id/message
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/modules/resource/actions/actions.class.php
Expand Up @@ -49,7 +49,7 @@ public function executeTimeList(sfWebRequest $request)

$results = $query->execute(array(), Doctrine::HYDRATE_ARRAY);

return $this->renderPartial('time/list', array('results' => $results));
return $this->renderPartial('time/list', array('results' => $results, 'transaction_type' => $type));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions apps/frontend/modules/resource/templates/_list_header.php
Expand Up @@ -4,6 +4,6 @@
<?php else: ?>
Volunteer Opportunities
<?php endif ?>
<?php else: ?>
<?php else: ?>
Available Items
<?php endif ?>
<?php endif ?>
@@ -0,0 +1,13 @@
<?php if ($transaction_type == 'have'): ?>
<?php if ($resource_type == 'stuff'): ?>
I need this!
<?php else: ?>
I want to help!
<?php endif ?>
<?php else: ?>
<?php if ($resource_type == 'stuff'): ?>
I have this!
<?php else: ?>
Please help me!
<?php endif ?>
<?php endif ?>
Expand Up @@ -3,7 +3,7 @@

<?php use_helper('dh') ?>

<h2>I <?php echo ucfirst(opposite_of($resource->transaction_type)) ?> This!</h2>
<h2><?php include_partial('resource/resource_contact_header', array('transaction_type' => $type, 'resource_type' => $resource_type)) ?></h2>
<?php echo $form->renderFormTag(url_for('new_message_match_found', array('id'=>$resource->id)), array('class'=>'async')) ?>
<fieldset>
<legend><span>*</span>Required Field</legend>
Expand Down
Expand Up @@ -25,12 +25,10 @@

use_stylesheet('/css/app/resource_list.css');



?>
<?php echo image_tag('icons/magnify-large.png', array('class'=>"left", 'width'=>"44", 'height'=>"41", 'alt'=>"Magnify Large")) ?>
<?php include_component('resource', $resource_type.'_filter_form', array('resource_action' => $resource_action)); ?>
<div class="clear">&nbsp;</div>
<div class="clear">&nbsp;<?php echo $resource_action ?></div>
<h2 class="half-margin"><?php include_partial('resource/list_header', array('type' => $resource_type, 'action' => $resource_action)) ?></h2>
<hr />
<div id="ResourceResultsList">
Expand Down
Expand Up @@ -2,7 +2,7 @@
<?php include_javascripts_for_form($form) ?>
<?php include_stylesheets_for_form($form) ?>

<form class="resourceFilter timeFilter search-large" action="<?php echo url_for('@time_list?type='.opposite_of($resource_action)); ?>" method="get" accept-charset="utf-8">
<form class="resourceFilter timeFilter" action="<?php echo url_for('@time_list?type='.opposite_of($resource_action)); ?>" method="get" accept-charset="utf-8">
<fieldset>

<ul>
Expand Down
1 change: 1 addition & 0 deletions apps/frontend/modules/stuff/actions/actions.class.php
Expand Up @@ -26,6 +26,7 @@ public function executeShow(sfWebRequest $request)
$this->resource = $this->getRoute()->getObject();
$this->type = $this->resource->getOppositeType();
$this->form = new ContactResourceOwnerForm();

if($request->isMethod('POST'))
{
$this->form->bind($request->getParameter('resource_contact_owner'));
Expand Down
8 changes: 5 additions & 3 deletions apps/frontend/modules/stuff/templates/_list.php
@@ -1,15 +1,17 @@
<?php use_helper('dh') ?>

<?php if (count($results)): ?>
<ul class="results-list search-results clearfix">
<?php $i = 0; ?>
<?php foreach ($results as $result): ?>
<li <?php echo $i % 2 == 0 ? 'class="alt"' : '' ?>>
<div class="right">
<?php echo link_to('More Info', '@stuff_show?id='. $result['id'], array('class'=>'button')) ?>
<?php echo link_to('More Info', '@'.opposite_of($transaction_type).'_stuff_show?id='. $result['id'], array('class'=>'button')) ?>
</div>
<h3 class="no-margin"><?php echo link_to($result['title'], '@stuff_show?id='. $result['id']) ?></h3>
<h3 class="no-margin"><?php echo link_to($result['title'], '@'.opposite_of($transaction_type).'_stuff_show?id='. $result['id']) ?></h3>
<strong>Quantity <?php echo $transaction_type == 'have' ? 'Available' : 'Needed' ?>:</strong> 3&nbsp;&bull;&nbsp;<span class=""><strong>Added:</strong> May 5, 2010</span>&nbsp;&bull;&nbsp;<strong>Germantown</strong>
</li>
<?php $i++; ?>
<?php endforeach ?>
</ul>
</ul>
<?php endif ?>
2 changes: 1 addition & 1 deletion apps/frontend/modules/stuff/templates/showSuccess.php
Expand Up @@ -20,7 +20,7 @@
<hr />
<div>
<!-- call to action here, which depends on whether this is a "need" looking for a "have" or vice versa -->
<?php include_partial('resource/resource_contact_owner_form', array('form' => $form, 'resource' => $resource)) ?>
<?php include_partial('resource/resource_contact_owner_form', array('type' => $resource['transaction_type'], 'resource_type' => 'stuff', 'form' => $form, 'resource' => $resource)) ?>
</div>
<?php endif ?>
</div>
Expand Down
6 changes: 4 additions & 2 deletions apps/frontend/modules/time/templates/_list.php
@@ -1,12 +1,14 @@
<?php use_helper('dh') ?>

<?php if (count($results)): ?>
<ul class="results-list search-results clearfix">
<?php $i = 0; ?>
<?php foreach ($results as $result): ?>
<li <?php echo $i % 2 == 0 ? 'class="alt"' : '' ?>>
<div class="right">
<?php echo link_to('More Info', '@time_show?id='. $result['id'], array('class'=>'button')) ?>
<?php echo link_to('More Info', '@'.opposite_of($transaction_type).'_time_show?id='. $result['id'], array('class'=>'button')) ?>
</div>
<h3 class="no-margin"><?php echo link_to($result['title'], '@time_show?id='. $result['id']) ?> <?php if ($result['city']): ?><span>(<strong><?php echo $result['city'] ?></strong>)</span><?php endif ?></h3>
<h3 class="no-margin"><?php echo link_to($result['title'], '@'.opposite_of($transaction_type).'_time_show?id='. $result['id']) ?> <?php if ($result['city']): ?><span>(<strong><?php echo $result['city'] ?></strong>)</span><?php endif ?></h3>
<strong>Date:</strong> <?php echo date('M j', strtotime($result['resource_date'])) ?>, <?php echo date('g:ia', strtotime($result['start_time'])) ?> - <?php echo date('g:ia', strtotime($result['end_time'])) ?>
<?php if ($result['num_volunteers']): ?>&bull;&nbsp;<strong>Volunteers Needed:</strong> <?php echo $result['num_volunteers'] ?><?php endif ?>
</li>
Expand Down
3 changes: 0 additions & 3 deletions apps/frontend/modules/time/templates/haveSuccess.php
@@ -1,13 +1,10 @@
<div class="main-col">
<h1>I Have Time...</h1>

<form action="<?php echo url_for('@have_time_list') ?>" method="get" name="time_resource">
<?php
include_partial('resource/resource_filter', array('resource_type' => 'time', 'resource_action' => 'have'));
?>

</form>

<br />
<p class="text-large">
<strong>Can't find the right opportunity?</strong>
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/modules/time/templates/showSuccess.php
Expand Up @@ -29,7 +29,7 @@
<span class="fulfilled"><?php echo image_tag('/sfDoctrinePlugin/images/tick.png', array('alt' => 'fulfilled')) ?>&nbsp;Fulfilled</span>
<?php elseif(!$sf_user->isOwner($resource)): ?>
<!-- call to action here, which depends on whether this is a "need" looking for a "have" or vice versa -->
<?php include_partial('resource/resource_contact_owner_form', array('resource' => $resource, 'form' => $form, 'type' => $type)) ?>
<?php include_partial('resource/resource_contact_owner_form', array('resource_type' => 'time', 'resource' => $resource, 'form' => $form, 'type' => $type)) ?>
<?php endif ?>
</div>

Expand Down
4 changes: 2 additions & 2 deletions data/fixtures/fixtures.yml
Expand Up @@ -98,14 +98,14 @@ TimeResource:
time_resource3:
User: sgu_chayner
title: 5/4 from 12:00 to 8:00
transaction_type: want
transaction_type: have
resource_date: '2010-05-04'
start_time: '12:00'
end_time: '20:00'
time_resource4:
User: sgu_chayner
title: 5/4 to 5/5
transaction_type: want
transaction_type: have
resource_date: '2010-05-04'
start_time: '00:00'

Expand Down
13 changes: 13 additions & 0 deletions web/css/donatenashville.css
Expand Up @@ -403,6 +403,19 @@ ul.breadcrumbs {
font-size: 14px;
color: #6b8fb5;
}

#time-info {
font-size: 1.2em;
}

#time-info li {
margin-bottom: 0;
}

#time-info strong {
color: #6b8fb5;
font-size: 1.2em;
}
/* FOOTER
****************************************************************************************************/
#footer {
Expand Down

0 comments on commit 2175eb6

Please sign in to comment.