Commit: a525987b6702b2dca7980836198da82315fa9866

Author: Jon Adams | Date: 2009-11-02 01:43:22 -0800
views to utilize helpers, need to figure out how to generate full uri for anonymous avatar to pass to gravatar...
diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..0ed8662 --- /dev/null +++ b/.htaccess @@ -0,0 +1,5 @@ +<IfModule mod_rewrite.c> + RewriteEngine on + RewriteRule ^$ webroot/ [L] + RewriteRule (.*) webroot/$1 [L] + </IfModule> \ No newline at end of file diff --git a/controllers/AnologueController.php b/controllers/AnologueController.php index ea02a5f..07fb5d7 100644 --- a/controllers/AnologueController.php +++ b/controllers/AnologueController.php @@ -3,6 +3,7 @@ namespace app\controllers; use \app\models\Anologue; +use \lithium\http\Media; class AnologueController extends \lithium\action\Controller { @@ -29,6 +30,7 @@ class AnologueController extends \lithium\action\Controller { } public function view() { + $anonymousAvatar = Media::asset('anonymous.png', 'image'); if (!empty($this->request->params['id'])) { $anologue = Anologue::findById($this->request->params['id']); $this->set(compact('anologue')); diff --git a/views/anologue/index.html.php b/views/anologue/index.html.php index a05e65d..8880a3b 100644 --- a/views/anologue/index.html.php +++ b/views/anologue/index.html.php @@ -1,9 +1,9 @@ -<div id="anologue-new"><a href="/new">start an anologue &raquo;</a></div> +<div id="anologue-new"><?php echo $this->html->link('start an anologue &raquo;', array('controller' => 'anologue', 'action' => 'add'), array('escape' => false)); ?></div> <div class="header"> <header> <div class="width-constraint"> - <img id="anologue-logo" src="/img/anologue.png" alt="a" /> + <?php echo $this->html->image('/img/anologue.png', array('id' => 'anologue-logo')); ?> <h1 class="title">anologue</h1> </div> </header> @@ -24,26 +24,27 @@ <div class="aside excellence"> <aside> - <img id="anologue-excellent" src="/img/excellent.jpg" alt="sixty-nine, dudes!" /> + <?php echo $this->html->image('/img/excellent.jpg', array('alt' => 'sixty-nine, dudes!', 'id' => 'anologue-excellent')); ?> <span>your future us's use anologue!</span> </aside> </div> - <p><strong>anologue</strong> is like comments, meets im, meets irc, meets <a href="http://pastium.org">your favorite paste app</a>, meets instant coffee.</p> + <p><strong>anologue</strong> is like comments, meets im, meets irc, meets <?php echo $this->html->link('your favorite paste app', 'http://pastium.org'); ?>, meets instant coffee.</p> <p>actually, instant coffee sucks.</p> <p>with anologue you can quickly and easily engage in an anonymous (or not) linear dialogue with any number of people (within reason).</p> <p><strong>no accounts. no installations. no way?! <em>yes, way!</em></strong></p> - <p><a href="/new">your "chat room" is created by the time this link loads</a>. invite whoever you want by giving them your unique link, and chat away.</p> + <p><?php echo $this->html->link('your "chat room" is created by the time this link loads', array('controller' => 'anologue', 'action' => 'add')); ?>. invite whoever you want by giving them your unique link, and chat away.</p> <h2 class="sub">let's make this better, together</h2> - <p>perhaps best of all: <a href="http://rad-dev.org/projects/lithium_anologue">this is open source</a>. built with <a href="http://php.net" target="_php">php 5.3</a>, using the most non-heinous, totally rad <a href="http://li3.rad-dev.org" target="_li3">lithium framework</a>, <a href="http://couchdb.apache.org" target="_couch">couchdb</a>, <a href="http://jquery.com" target="_jquery">jquery</a> and a few other scripts; all coming together for the creamy goodness you're about to experience.</p> + <p>perhaps best of all: <?php echo $this->html->link('this is open source', 'http://rad-dev.org/lithium_anologue'); ?>. built with <?php echo $this->html->link('php 5.3', 'http://php.net'); ?>, using the most non-heinous, totally rad <?php echo $this->html->link('lithium framework', 'http://li3.rad-dev.org'); ?>, <?php echo $this->html->link('couchdb', 'http://couchdb.apache.org'); ?>, <?php echo $this->html->link('jquery', 'http://jquery.com'); ?> and a few other scripts; all coming together for the creamy goodness you're about to experience.</p> <p class="last">contribute to the core or download the source and setup your own. this one's for you, internets.</p> </article> </div> <div class="footer"> <footer> - <a href="http://li3.rad-dev.org" target="_li3"><img src="http://imgur.com/6eddU.gif" alt="powered by lithium" border="0" /></a> + <?php echo $this->html->link($this->html->image('http://imgur.com/6eddU.gif', array('border' => 0, 'alt' => 'powered by lithium')), 'http://li3.rad-dev.org', array('escape' => false)); ?> + <?php echo $this->html->script('http://www.ohloh.net/p/471008/widgets/project_users_logo.js'); ?> </footer> </div> diff --git a/views/anologue/view.html.php b/views/anologue/view.html.php index 9a55fbc..38a5125 100644 --- a/views/anologue/view.html.php +++ b/views/anologue/view.html.php @@ -1,4 +1,4 @@ -<h1 class="smaller-title"><a href="/">anologue</a></h1> +<h1 class="smaller-title"><?php echo $this->html->link('anologue', array('controller' => 'anologue', 'action' => 'index')); ?></h1> <form id="anologue-form"> @@ -22,7 +22,7 @@ <div class="anologue-help"> <p><strong>hello.</strong></p> <p>to get started, type your text in the grey box at the very bottom and press &lt;enter&gt;. <br />markdown is supported, to an extent.</p> - <p><strong>for your privacy,</strong> your email is only used to generate your <a href="http://gravatar.com" target="_gravatar">gravatar</a> and is stored in an unreadable, encoded format.</p> + <p><strong>for your privacy,</strong> your email is only used to generate your <?php echo $this->html->link('gravatar', 'http://gravatar.com'); ?> and is stored in an unreadable, encoded format.</p> </div> <h3 class="hash"><?php echo $this->html->link($anologue->_id, array('action' => 'view', 'id' => $anologue->_id), array('title' => 'Copy this url and give it to others')); ?></h3> @@ -30,16 +30,15 @@ <ul id="anologue" class="anologue"> <?php if (!empty($anologue->messages)) { ?> <?php foreach ($anologue->messages as $key => $message) { ?> - <li class="message" id="message-<?=md5($message->timestamp . $message->author);?>"> + <li class="message" id="message-<?php echo md5($message->timestamp . $message->author);?>"> <ul class="data"> - <li class="time"><?=date('G:i:s', $message->timestamp);?></li> - <li class="ip"><?=$message->ip;?></li> + <li class="time"><?php echo date('G:i:s', $message->timestamp);?></li> + <li class="ip"><?php echo $message->ip;?></li> <li class="author"> - - <img class="gravatar" src="http://gravatar.com/avatar/<?=$message->email;?>?s=16&d=http://<?php echo $_SERVER['HTTP_HOST']; ?>/img/anonymous.png" border="0" /> - &laquo; <?=$message->author;?> &raquo; + <?php echo $this->html->image('http://gravatar.com/avatar/<?php echo $message->email;?>?s=16&d=http://'.$_SERVER['HTTP_HOST'].'/img/anonymous.png'); ?> + &laquo; <?php echo $message->author;?> &raquo; </li> - <li class="text"><div class="markdown"><?=$message->text;?></div></li> + <li class="text"><div class="markdown"><?php echo $message->text; ?></div></li> </ul> </li> <?php } ?> @@ -51,7 +50,7 @@ <label for="anologue-text">you say: </label> </span> <span class="label about"> - <a href="/">what is anologue?</a> + <?php echo $this->html->link('what is anologue?', array('controller' => 'anologue', 'action' => 'index')); ?> </span> <div class="text"> <textarea name="anologue-text" id="anologue-text"></textarea> diff --git a/webroot/css/anologue.css b/webroot/css/anologue.css index 179ef21..e0ebd10 100644 --- a/webroot/css/anologue.css +++ b/webroot/css/anologue.css @@ -24,7 +24,7 @@ p.last { padding:.5em 0 4em 0; } .header { background:#4c2c59 url(/img/bg.png); padding:2em 1em; margin:0 0 1em 0; } .header .aside { text-align:right; vertical-align:bottom; } .footer { text-align:center; padding:0 0 2em 0; } - .footer a { border:none; } + .footer a { border:none; margin:0 auto; } #anologue-new a { display:block; font-weight:bold; padding:1em; font-size:2em; float:right; background:black; background:rgba(0,0,0,.35); color:white; border:none; } #anologue-logo { padding:0 2.75em; display:block; }