journalduhacker/app/views/messages/show.phtml
2012-06-16 20:15:46 -05:00

70 lines
1.9 KiB
PHTML

<div>
<?= $html->link_to("&laquo; Back to Messages",
array("controller" => "messages")); ?>
</div>
<p>
<div class="box noborder">
<label class="required">From:</label>
<?= $html->link_to(h($message->author->username),
array("controller" => "users", "action" => "show",
"id" => $message->author->username)); ?>
<br />
<label class="required">To:</label>
<?= $html->link_to(h($message->recipient->username),
array("controller" => "users", "action" => "show",
"id" => $message->recipient->username)); ?>
<br />
<label class="required">Date:</label>
<?= $message->created_at->format("D, j F Y \\a\\t H:i:s"); ?>
<br />
<label class="required">Subject:</label>
<? if ($message->item) { ?>
<?= $html->link_to(h($message->subject),
array("controller" => "items", "action" => "show",
"id" => $message->item_id)); ?>
<? } else { ?>
<?= h($message->subject); ?>
<? } ?>
<br />
<div>
<?= $message->sanitized_body(); ?>
</div>
<div class="clear"></div>
<div class="s"></div>
<p>
<strong><a href="#" onclick="Element.show('reply'); return false;">Send a
Reply</a></strong>
<div id="reply" style="display: none;">
<p>
<?= $html->error_messages_for($reply); ?>
<? $form->form_for($reply, array("controller" => "messages",
"action" => "reply", "id" => $message->random_hash), array(), function($f) use
($html, $controller) { ?>
<?= $f->label("recipient_user_id", "To:", array("class" => "required")); ?>
<?= $html->link_to(h($controller->message->recipient->username),
array("controller" => "users", "action" => "show", "id" =>
$controller->message->recipient->username)); ?>
<br />
<?= $f->label("subject", "Subject:", array("class" => "required")); ?>
<?= h($controller->reply->subject); ?>
<br />
<?= $f->text_area("body", array("size" => "70x5")); ?>
<br />
<p>
<?= $f->submit_tag("Send Reply"); ?>
</p>
<? }); ?>
</p>
</div>
</div>