Changeset 27
- Timestamp:
- 12/11/05 09:04:38 (3 years ago)
- Files:
-
- trunk/frontend/config/app.yml (modified) (1 diff)
- trunk/frontend/config/routing.yml (modified) (1 diff)
- trunk/frontend/lib/helper/GlobalHelper.php (modified) (1 diff)
- trunk/frontend/modules/answer/actions/actions.class.php (modified) (2 diffs)
- trunk/frontend/modules/answer/templates/recentSuccess.php (modified) (1 diff)
- trunk/frontend/modules/feed (added)
- trunk/frontend/modules/feed/actions (added)
- trunk/frontend/modules/feed/actions/actions.class.php (added)
- trunk/frontend/modules/feed/config (added)
- trunk/frontend/modules/feed/config/.sf (added)
- trunk/frontend/modules/feed/config/view.yml (added)
- trunk/frontend/modules/feed/lib (added)
- trunk/frontend/modules/feed/lib/.sf (added)
- trunk/frontend/modules/feed/templates (added)
- trunk/frontend/modules/feed/templates/feedSuccess.php (added)
- trunk/frontend/modules/feed/validate (added)
- trunk/frontend/modules/feed/validate/.sf (added)
- trunk/frontend/modules/question/templates/showSuccess.php (modified) (1 diff)
- trunk/frontend/modules/sidebar/templates/defaultSuccess.php (modified) (1 diff)
- trunk/frontend/templates/layout.php (modified) (1 diff)
- trunk/test/frontend/feedActionsTest.php (added)
- trunk/web/images/rss.gif (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/frontend/config/app.yml
r23 r27 6 6 users_max: 10 7 7 8 feed: 9 max_questions: 10 trunk/frontend/config/routing.yml
r23 r27 55 55 param: { module: user, action: logout } 56 56 57 # feeds 58 feed_recent_answers: 59 url: /feed/recent_answers 60 param: { module: feed, action: recentAnswers } 61 62 feed_recent_questions: 63 url: /feed/recent 64 param: { module: feed, action: recent } 65 66 feed_question: 67 url: /feed/question/:stripped_title 68 param: { module: feed, action: question } 69 57 70 # default rules 58 71 homepage: trunk/frontend/lib/helper/GlobalHelper.php
r25 r27 1 1 <?php 2 3 function link_to_rss($name, $uri) 4 { 5 return link_to(image_tag('rss.gif', array('alt' => $name, 'title' => $name)), $uri); 6 } 2 7 3 8 function link_to_login($name, $uri = null) trunk/frontend/modules/answer/actions/actions.class.php
r25 r27 27 27 $question = QuestionPeer::retrieveByPk($this->getRequestParameter('question_id')); 28 28 $this->forward404Unless($question); 29 29 30 30 // user or anonymous coward 31 31 $user = $this->getUser()->isAuthenticated() ? $this->getUser()->getSubscriber() : UserPeer::getUserFromNickname('anonymous'); 32 32 33 33 // create answer 34 34 $this->answer = new Answer(); … … 37 37 $this->answer->setUser($user); 38 38 $this->answer->save(); 39 39 40 40 return sfView::SUCCESS; 41 41 } 42 42 43 43 $this->forward404(); 44 44 } trunk/frontend/modules/answer/templates/recentSuccess.php
r23 r27 3 3 <h1>recent answers</h1> 4 4 5 <?php include_partial('list', array('answer_pager' => $answer_pager)) ?> 5 <div id="answers"> 6 <?php foreach ($answer_pager->getResults() as $answer): ?> 7 <div class="answer"> 8 <?php include_partial('answer/answer', array('answer' => $answer)) ?> 9 </div> 10 <?php endforeach ?> 11 </div> 6 12 7 13 <?php if ($answer_pager->haveToPaginate()): ?> trunk/frontend/modules/question/templates/showSuccess.php
r25 r27 11 11 </div> 12 12 13 <p><?php echo link_to_rss('this question feed', '@feed_question?stripped_title='.$question->getStrippedTitle()) ?></p> 14 13 15 <?php include_partial('answer/list', array('question' => $question, 'answers' => $answers)) ?> trunk/frontend/modules/sidebar/templates/defaultSuccess.php
r25 r27 4 4 5 5 <ul> 6 <li><?php echo link_to('popular questions', '@homepage') ?> 7 <li><?php echo link_to('latest questions', '@recent_questions') ?> </li>8 <li><?php echo link_to('latest answers', '@recent_answers') ?> </li>6 <li><?php echo link_to('popular questions', '@homepage') ?> <?php echo link_to_rss('popular questions', 'feed/popular') ?></li> 7 <li><?php echo link_to('latest questions', '@recent_questions') ?> <?php echo link_to_rss('latest questions', '@feed_recent_questions') ?></li> 8 <li><?php echo link_to('latest answers', '@recent_answers') ?> <?php echo link_to_rss('latest answers', '@feed_recent_answers') ?></li> 9 9 </ul> trunk/frontend/templates/layout.php
r23 r27 10 10 <?php echo include_stylesheets() ?> 11 11 <?php echo include_javascripts() ?> 12 13 <?php echo auto_discovery_link_tag('rss', 'feed/popular') ?> 14 <?php echo auto_discovery_link_tag('rss', 'feed/recentQuestions') ?> 15 <?php echo auto_discovery_link_tag('rss', 'feed/recentAnswers') ?> 12 16 13 17 <link rel="shortcut icon" href="/favicon.ico">
