Changeset 27 for trunk

Show
Ignore:
Timestamp:
12/11/05 09:04:38 (7 years ago)
Author:
fabien
Message:

day 11 modifications

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/frontend/config/app.yml

    r23 r27  
    66    users_max:    10 
    77 
     8  feed: 
     9    max_questions: 10 
  • trunk/frontend/config/routing.yml

    r23 r27  
    5555  param: { module: user, action: logout } 
    5656 
     57# feeds 
     58feed_recent_answers: 
     59  url:   /feed/recent_answers 
     60  param: { module: feed, action: recentAnswers } 
     61 
     62feed_recent_questions: 
     63  url:   /feed/recent 
     64  param: { module: feed, action: recent } 
     65 
     66feed_question: 
     67  url:   /feed/question/:stripped_title 
     68  param: { module: feed, action: question } 
     69 
    5770# default rules 
    5871homepage: 
  • trunk/frontend/lib/helper/GlobalHelper.php

    r25 r27  
    11<?php 
     2 
     3function link_to_rss($name, $uri) 
     4{ 
     5  return link_to(image_tag('rss.gif', array('alt' => $name, 'title' => $name)), $uri); 
     6} 
    27 
    38function link_to_login($name, $uri = null) 
  • trunk/frontend/modules/answer/actions/actions.class.php

    r25 r27  
    2727      $question = QuestionPeer::retrieveByPk($this->getRequestParameter('question_id')); 
    2828      $this->forward404Unless($question); 
    29    
     29 
    3030      // user or anonymous coward 
    3131      $user = $this->getUser()->isAuthenticated() ? $this->getUser()->getSubscriber() : UserPeer::getUserFromNickname('anonymous'); 
    32    
     32 
    3333      // create answer 
    3434      $this->answer = new Answer(); 
     
    3737      $this->answer->setUser($user); 
    3838      $this->answer->save(); 
    39    
     39 
    4040      return sfView::SUCCESS; 
    4141    } 
    42    
     42 
    4343    $this->forward404(); 
    4444  } 
  • trunk/frontend/modules/answer/templates/recentSuccess.php

    r23 r27  
    33<h1>recent answers</h1> 
    44 
    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> 
    612 
    713<?php if ($answer_pager->haveToPaginate()): ?> 
  • trunk/frontend/modules/question/templates/showSuccess.php

    r25 r27  
    1111</div> 
    1212 
     13<p><?php echo link_to_rss('this question feed', '@feed_question?stripped_title='.$question->getStrippedTitle()) ?></p> 
     14 
    1315<?php include_partial('answer/list', array('question' => $question, 'answers' => $answers)) ?> 
  • trunk/frontend/modules/sidebar/templates/defaultSuccess.php

    r25 r27  
    44 
    55<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> 
    99</ul> 
  • trunk/frontend/templates/layout.php

    r23 r27  
    1010<?php echo include_stylesheets() ?> 
    1111<?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') ?> 
    1216 
    1317<link rel="shortcut icon" href="/favicon.ico">