Changeset 38

Show
Ignore:
Timestamp:
12/15/05 09:24:51 (7 years ago)
Author:
fabien
Message:

new design + some more features + some refactoring

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/data/fixtures/test_data.yml

    r31 r38  
    4646      I have a very swell blog that talks  
    4747      about my class and mates and pets and favorite movies. 
     48 
     49  q4: 
     50    title: Test4 
     51    user_id: anonymous 
     52    body: Test 
     53 
     54  q5: 
     55    title: Test4 
     56    user_id: anonymous 
     57    body: Test 
     58 
     59  q6: 
     60    title: Test4 
     61    user_id: anonymous 
     62    body: Test 
    4863 
    4964Interest: 
  • trunk/data/sql/schema.sql

    r23 r38  
    108108) 
    109109Type=InnoDB; 
     110# ----------------------------------------------------------------------- 
     111# ask_question_tag  
     112# ----------------------------------------------------------------------- 
     113DROP TABLE IF EXISTS `ask_question_tag`; 
     114 
     115CREATE TABLE `ask_question_tag`( 
     116    `question_id` INTEGER ,  
     117    `user_id` INTEGER ,  
     118    `created_at` DATETIME ,  
     119    `tag` VARCHAR(100) ,  
     120    `normalized_tag` VARCHAR(100) ,   
     121    KEY `normalized_tag_index` (`normalized_tag`),   
     122    INDEX `ask_question_tag_FI_1` (`question_id`),  
     123    CONSTRAINT `ask_question_tag_FK_1`  
     124      FOREIGN KEY (`question_id`) 
     125      REFERENCES `ask_question` (`id`) 
     126,  
     127    INDEX `ask_question_tag_FI_2` (`user_id`),  
     128    CONSTRAINT `ask_question_tag_FK_2`  
     129      FOREIGN KEY (`user_id`) 
     130      REFERENCES `ask_user` (`id`) 
     131) 
     132Type=InnoDB; 
     133   
    110134   
    111135   
  • trunk/frontend/config/app.yml

    r27 r38  
    22all: 
    33  pager: 
    4     homepage_max: 2 
    5     answers_max:  1 
     4    homepage_max: 5 
     5    answers_max:  5 
    66    users_max:    10 
    77 
  • trunk/frontend/config/routing.yml

    r34 r38  
    4444add_account: 
    4545  url:   /add_user 
    46   param: { module: user, action: new
     46  param: { module: user, action: add
    4747 
    4848user_require_password: 
     
    7676  param: { module: tag, action: popular } 
    7777 
     78tag_remove: 
     79  url:   /question/:stripped_title/tag/remove/:tag 
     80  param: { module: tag, action: remove } 
     81 
    7882# feeds 
    7983feed_recent_answers: 
     
    8892  url:   /feed/question/:stripped_title 
    8993  param: { module: feed, action: question } 
     94 
     95# content 
     96about: 
     97  url:   /about 
     98  param: { module: content, action: about } 
    9099 
    91100# default rules 
  • trunk/frontend/lib/helper/AnswerHelper.php

    r25 r38  
    2222  use_helper('Javascript'); 
    2323 
     24  $img = image_tag('thumb_'.$name.'.gif'); 
     25 
    2426  if ($user->isAuthenticated()) 
    2527  { 
     
    2830    { 
    2931      // already interested 
    30       return $name
     32      return $img
    3133    } 
    3234    else 
    3335    { 
    3436      // didn't declare interest yet 
    35       return link_to_remote($name, array( 
     37      return link_to_remote($img, array( 
    3638        'url'      => 'user/vote?id='.$answer->getId().'&score='.($name == 'up' ? 1 : -1), 
    3739        'update'   => array('success' => 'vote_'.$answer->getId()), 
     
    4345  else 
    4446  { 
    45     return link_to_login($name); 
     47    return link_to_login($img); 
    4648  } 
    4749} 
  • trunk/frontend/lib/helper/GlobalHelper.php

    r29 r38  
    33function link_to_rss($name, $uri) 
    44{ 
    5   return link_to(image_tag('rss.gif', array('alt' => $name, 'title' => $name)), $uri); 
     5  return link_to(image_tag('rss.gif', array('alt' => $name, 'title' => $name, 'align' => 'absmiddle')), $uri); 
    66} 
    77 
     
    2929 
    3030    // First and previous page 
    31     $navigation .= link_to('«', $uri.'1'); 
    32     $navigation .= link_to('<', $uri.$pager->getPreviousPage())
     31    $navigation .= link_to(image_tag('first.gif', 'align=absmiddle'), $uri.'1'); 
     32    $navigation .= link_to(image_tag('previous.gif', 'align=absmiddle'), $uri.$pager->getPreviousPage()).' '
    3333 
    3434    // Pages one by one 
     
    3838      $links[] = link_to_unless($page == $pager->getPage(), $page, $uri.$page); 
    3939    } 
    40     $navigation .= join(' - ', $links); 
     40    $navigation .= join('  ', $links); 
    4141 
    4242    // Next and last page 
    43     $navigation .= link_to('>', $uri.$pager->getNextPage()); 
    44     $navigation .= link_to('»', $uri.$pager->getLastPage()); 
     43    $navigation .= ' '.link_to(image_tag('next.gif', 'align=absmiddle'), $uri.$pager->getNextPage()); 
     44    $navigation .= link_to(image_tag('last.gif', 'align=absmiddle'), $uri.$pager->getLastPage()); 
    4545  } 
    4646 
  • trunk/frontend/lib/helper/QuestionHelper.php

    r31 r38  
    1313} 
    1414 
     15function link_to_question($question) 
     16{ 
     17  return link_to($question->getTitle(), '@question?stripped_title='.$question->getStrippedTitle()); 
     18} 
     19 
    1520?> 
  • trunk/frontend/lib/helper/UserHelper.php

    r25 r38  
    2020        'update'   => array('success' => 'block_'.$question->getId()), 
    2121        'loading'  => "Element.show('indicator')", 
    22         'complete' => "Element.hide('indicator');".visual_effect('highlight', 'mark_'.$question->getId()), 
     22        'complete' => "Element.hide('indicator');".visual_effect('pulsate', 'mark_'.$question->getId()), 
    2323      )); 
    2424    } 
     
    3030} 
    3131 
     32function link_to_profile($user) 
     33{ 
     34  if ($user->getNickname() == 'anonymous') 
     35  { 
     36    return 'anonymous'; 
     37  } 
     38  else 
     39  { 
     40    return link_to($user->__toString(), '@user_profile?nickname='.$user->getNickname()); 
     41  } 
     42} 
     43 
    3244?> 
  • trunk/frontend/modules/answer/actions/actions.class.php

    r27 r38  
    1414  { 
    1515    $this->answer_pager = AnswerPeer::getRecentPager($this->getRequestParameter('page', 1)); 
     16 
     17    $this->setTitle('askeet! » recent answers'); 
    1618  } 
    1719 
  • trunk/frontend/modules/answer/templates/_answer.php

    r25 r38  
    1 <?php use_helper('Date') ?> 
     1<?php use_helpers('Date', 'User') ?> 
    22 
    33<div class="vote_block" id="vote_<?php echo $answer->getId() ?>"> 
    44  <?php echo include_partial('answer/vote_user', array('answer' => $answer)) ?> 
    55</div> 
    6 posted by <?php echo $answer->getUser() ?> 
    7 on <?php echo format_date($answer->getCreatedAt(), 'p') ?> 
    8 <div> 
     6 
     7<div class="answer_body"> 
    98  <?php echo $answer->getHtmlBody() ?> 
     9  <div class="subtitle">answered by <?php echo link_to_profile($answer->getUser()) ?> on <?php echo format_date($answer->getCreatedAt(), 'f') ?></div> 
    1010</div> 
     11 
     12<br class="clearleft" /> 
  • trunk/frontend/modules/answer/templates/_list.php

    r25 r38  
    22 
    33<div id="answers"> 
    4 <?php foreach ($answers as $answer): ?> 
    5   <div class="answer"> 
    6   <?php include_partial('answer/answer', array('answer' => $answer)) ?> 
    7   </div> 
    8 <?php endforeach ?> 
    94 
    10 <div class="answer" id="add_answer"> 
    11   <?php echo form_remote_tag(array( 
    12     'url'      => '@add_answer', 
    13     'update'   => array('success' => 'add_answer'), 
    14     'loading'  => "Element.show('indicator')", 
    15     'complete' => "Element.hide('indicator');".visual_effect('highlight', 'add_answer'), 
    16   )) ?> 
    17     <fieldset> 
     5  <?php foreach ($answers as $answer): ?> 
     6    <div class="answer"> 
     7      <?php include_partial('answer/answer', array('answer' => $answer)) ?> 
     8    </div> 
     9  <?php endforeach ?> 
    1810 
    19     <div class="form-row"> 
     11  <div class="answer" id="add_answer"> 
     12    <?php echo form_remote_tag(array( 
     13      'url'      => '@add_answer', 
     14      'update'   => array('success' => 'add_answer'), 
     15      'loading'  => "Element.show('indicator')", 
     16      'complete' => "Element.hide('indicator');".visual_effect('highlight', 'add_answer'), 
     17    ), 'class=form') ?> 
     18      <fieldset> 
     19 
     20      <label for="author">author:</label> 
     21      <div style="display: inline; float: left"> 
    2022      <?php if ($user->isAuthenticated()): ?> 
    2123        <?php echo $user->getNickname() ?> 
    2224      <?php else: ?> 
    23         <?php echo 'Anonymous Coward' ?> 
    24         <?php echo link_to_login('login') ?> 
     25        <?php echo 'anonymous coward' ?> 
     26        <?php echo link_to_login('[login]') ?> 
    2527      <?php endif ?> 
    26     </div> 
     28      </div> 
     29      <br class="clearleft" /> 
    2730 
    28     <div class="form-row"
    29       <label for="label">Your answer:</label
    30       <?php echo textarea_tag('body', $params->get('body')) ?
    31     </div
     31      <label for="body">your answer:</label
     32      <?php echo textarea_tag('body', $params->get('body'), 'size=40x10') ?
     33      <br class="clearleft" /
     34      <?php echo include_partial('content/markdown_help') ?
    3235 
    33     </fieldset> 
     36      </fieldset> 
    3437 
    35     <div class="submit-row"> 
    3638      <?php echo input_hidden_tag('question_id', $question->getId()) ?> 
    37       <?php echo submit_tag('answer it') ?> 
    38     </div> 
    39   </form> 
    40 </div> 
     39      <div class="right"> 
     40        <?php echo submit_tag('answer it') ?> 
     41      </div> 
     42    </form> 
     43  </div> 
    4144 
    4245</div> 
  • trunk/frontend/modules/answer/templates/_vote_user.php

    r20 r38  
    11<?php use_helper('Answer') ?> 
    22 
    3 <span class="vote_up_mark" id="vote_up_<?php echo $answer->getId() ?>"> 
     3<div class="vote_up_mark"><?php echo link_to_user_relevancy_up($user, $answer) ?></div> 
     4<div class="vote_down_mark"><?php echo link_to_user_relevancy_down($user, $answer) ?></div> 
     5 
     6<br class="clearleft" /> 
     7 
     8<div class="vote_up_mark" id="vote_up_<?php echo $answer->getId() ?>"> 
    49  <?php echo $answer->getRelevancyUpPercent() ?>% 
    5 </span> <?php echo link_to_user_relevancy_up($user, $answer) ?> 
    6  
    7 <span class="vote_down_mark" id="vote_down_<?php echo $answer->getId() ?>"> 
     10</div> 
     11<div class="vote_down_mark" id="vote_down_<?php echo $answer->getId() ?>"> 
    812  <?php echo $answer->getRelevancyDownPercent() ?>% 
    9 </span> <?php echo link_to_user_relevancy_down($user, $answer) ?
     13</div
  • trunk/frontend/modules/answer/templates/recentSuccess.php

    r27 r38  
    1 <?php use_helpers('Date', 'Answer') ?> 
     1<?php use_helpers('Date', 'Answer', 'Question') ?> 
    22 
    33<h1>recent answers</h1> 
     
    66<?php foreach ($answer_pager->getResults() as $answer): ?> 
    77  <div class="answer"> 
    8   <?php include_partial('answer/answer', array('answer' => $answer)) ?> 
     8    <h2><?php echo link_to_question($answer->getQuestion()) ?></h2> 
     9    <?php include_partial('answer/answer', array('answer' => $answer)) ?> 
    910  </div> 
    1011<?php endforeach ?> 
  • trunk/frontend/modules/question/actions/actions.class.php

    r25 r38  
    2323    $c = new Criteria(); 
    2424    $c->add(AnswerPeer::QUESTION_ID, $this->question->getId()); 
     25    $c->addDescendingOrderByColumn(AnswerPeer::RELEVANCY_UP); 
    2526    $this->answers = AnswerPeer::doSelect($c); 
     27 
     28    $this->setTitle('askeet! &raquo; '.$this->question->getTitle()); 
    2629  } 
    2730 
     
    2932  { 
    3033    $this->question_pager = QuestionPeer::getRecentPager($this->getRequestParameter('page', 1)); 
     34 
     35    $this->setTitle('askeet! &raquo; recent questions'); 
    3136  } 
    3237 
     
    4651      $user->isInterestedIn($question); 
    4752 
     53      $question->addTagsForUser($this->getRequestParameter('tag'), $user->getId()); 
     54 
    4855      return $this->redirect('@question?stripped_title='.$question->getStrippedTitle()); 
    4956    } 
  • trunk/frontend/modules/question/templates/_interested_user.php

    r20 r38  
    11<?php use_helper('User') ?> 
    22 
    3 <div class="interested_mark" id="mark_<?php echo $question->getId() ?>"> 
    4   <?php echo $question->getInterestedUsers() ?> 
     3<?php 
     4  $class = 'few_interests'; 
     5  if ($question->getInterestedUsers() > 1000) 
     6  { 
     7    $class = 'many_interests'; 
     8  } 
     9  else if ($question->getInterestedUsers() > 100) 
     10  { 
     11    $class = 'some_interests'; 
     12  } 
     13?> 
     14 
     15<div class="interested_mark <?php echo $class ?>" id="mark_<?php echo $question->getId() ?>"> 
     16  <?php echo $question->getInterestedUsers().'&nbsp;' ?> 
    517</div> 
    618 
    7 <?php echo link_to_user_interested($user, $question) ?> 
     19<div class="interested_link"><?php echo link_to_user_interested($user, $question) ?></div> 
     20 
  • trunk/frontend/modules/question/templates/_question_list.php

    r31 r38  
    1 <?php use_helpers('Text', 'Global', 'Question') ?> 
     1<?php use_helpers('Text', 'Global', 'Question', 'Date') ?> 
    22 
    33<?php foreach($question_pager->getResults() as $question): ?> 
     4<div class="question"> 
    45  <div class="interested_block" id="block_<?php echo $question->getId() ?>"> 
    56    <?php echo include_partial('question/interested_user', array('question' => $question)) ?> 
    67  </div> 
    78 
    8   <h2><?php echo link_to($question->getTitle(), '@question?stripped_title='.$question->getStrippedTitle()) ?></h2> 
     9  <h2><?php echo link_to_question($question) ?></h2> 
     10 
     11  <div class="subtitle">asked by <?php echo link_to_profile($question->getUser()) ?> on <?php echo format_date($question->getCreatedAt(), 'f') ?></div> 
    912 
    1013  <div class="question_body"> 
    1114    <?php echo truncate_text(strip_tags($question->getHtmlBody()), 200) ?> 
     15 
     16    <div class="tags"> 
     17 
     18    <?php if ($question->getAnswers()): ?> 
     19      <?php echo link_to(count($question->getAnswers()).' answer'.(count($question->getAnswers()) > 1 ? 's' : ''), '@question?stripped_title='.$question->getStrippedTitle()) ?> 
     20    <?php else: ?> 
     21      <?php echo link_to('answer it', '@question?stripped_title='.$question->getStrippedTitle()) ?> 
     22    <?php endif ?> 
     23 
     24    &nbsp;-&nbsp; 
     25 
     26    <?php if ($question->getTags()): ?> 
     27      tags: <?php echo tags_for_question($question) ?> 
     28    <?php endif ?> 
     29 
     30    </div> 
     31 
    1232  </div> 
    13   tags: <?php echo tags_for_question($question) ?
     33</div
    1434<?php endforeach ?> 
    1535 
    16 <div id="question_pager"
    17 <?php echo pager_navigation($question_pager, '@popular_questions') ?> 
     36<div id="question_pager" class="right"
     37  <?php echo pager_navigation($question_pager, '@popular_questions') ?> 
    1838</div> 
  • trunk/frontend/modules/question/templates/addSuccess.php

    r25 r38  
    1 <?php echo form_tag('@add_question') ?> 
     1<?php use_helper('Javascript') ?> 
     2 
     3<h1>ask a question</h1> 
     4 
     5<div class="in_form"> 
     6  <p> 
     7  Have you looked for similar questions? Check if a related question already exists: The more interesting a 
     8  question is, the more people will be willing to answer it. 
     9  </p> 
     10 
     11  <p> 
     12  Be as accurate as you can when giving a title to your question. Keep it short and put the details 
     13  in the question body. 
     14  </p> 
     15</div> 
     16 
     17<?php echo form_tag('@add_question', 'class=form') ?> 
    218 
    319  <fieldset> 
    420 
    5   <div class="form-row"> 
    6     <?php echo form_error('title') ?> 
    7     <label for="title">Question title:</label> 
    8     <?php echo input_tag('title', $params->get('title')) ?> 
    9   </div> 
     21  <?php echo form_error('title') ?> 
     22  <label for="title">question:</label> 
     23  <?php echo input_tag('title', $params->get('title'), 'size=40') ?> 
     24  <br class="clearleft" /> 
    1025 
    11   <div class="form-row"> 
    12     <?php echo form_error('body') ?> 
    13     <label for="label">Your question in details:</label> 
    14     <?php echo textarea_tag('body', $params->get('body')) ?> 
    15   </div> 
     26  <?php echo form_error('body') ?> 
     27  <label for="label">describe it:</label> 
     28  <?php echo textarea_tag('body', $params->get('body'), 'size=40x10') ?> 
     29  <br class="clearleft" /> 
     30  <?php echo include_partial('content/markdown_help') ?> 
     31 
     32  <?php echo form_error('tag') ?> 
     33  <label for="tag">tags:</label> 
     34  <?php echo input_auto_complete_tag('tag', '', '@tag_autocomplete', 'autocomplete=off', 'use_style=true') ?> 
     35  <br class="clearleft" /> 
     36  <div class="small in_form">example: askeet "how to"</div> 
    1637 
    1738  </fieldset> 
    1839 
    19   <div class="submit-row"> 
     40  <div class="right"> 
    2041    <?php echo submit_tag('ask it') ?> 
    2142  </div> 
  • trunk/frontend/modules/question/templates/showSuccess.php

    r27 r38  
    11<?php use_helpers('Date', 'Answer') ?> 
    22 
    3 <div class="interested_block"> 
    4   <?php echo include_partial('interested_user', array('question' => $question)) ?> 
    5 </div> 
    6      
    7 <h2><?php echo $question->getTitle() ?></h2> 
    8      
    9 <div class="question_body"> 
    10   <?php echo $question->getHtmlBody() ?> 
     3<h1></h1> 
     4 
     5<div class="question"> 
     6  <div class="interested_block"> 
     7    <?php echo include_partial('interested_user', array('question' => $question)) ?> 
     8  </div> 
     9 
     10  <h2><?php echo $question->getTitle() ?>&nbsp;<?php echo link_to_rss('this question feed', '@feed_question?stripped_title='.$question->getStrippedTitle()) ?></h2> 
     11 
     12  <div class="subtitle">asked by <?php echo link_to_profile($question->getUser()) ?> on <?php echo format_date($question->getCreatedAt(), 'f') ?></div> 
     13 
     14  <div class="question_body"> 
     15    <?php echo $question->getHtmlBody() ?> 
     16  </div> 
    1117</div> 
    1218 
    13 <p><?php echo link_to_rss('this question feed', '@feed_question?stripped_title='.$question->getStrippedTitle()) ?></p
     19<h2>Answers</h2
    1420 
    1521<?php include_partial('answer/list', array('question' => $question, 'answers' => $answers)) ?> 
  • trunk/frontend/modules/question/validate/add.yml

    r25 r38  
    11methods: 
    2   post: [title, body
     2  post: [title, body, tag
    33 
    44names: 
     
    99  body: 
    1010    required:     Yes 
    11     required_msg: You must provide a brief context for your question 
     11    required_msg: you must provide a brief context for your question 
    1212    validators:   bodyValidator 
     13 
     14  tag: 
     15    required:     Yes 
     16    required_msg: you must provide some tags for your question 
    1317 
    1418bodyValidator: 
  • trunk/frontend/modules/sidebar/templates/defaultSuccess.php

    r27 r38  
    11<?php use_helper('Global') ?> 
    22 
    3 <?php echo link_to_login('ask a new question', '@add_question') ?> 
     3<div id="add_question"> 
     4  <?php echo link_to_login('ask a new question', '@add_question') ?> 
     5</div> 
    46 
    5 <ul> 
    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 </ul> 
     7<h2>popular tags</h2> 
     8<?php echo include_partial('tag/tag_cloud', array('tags' => QuestionTagPeer::getPopularTags(20))) ?> 
     9<div class="right" style="padding-top: 5px"><?php echo link_to('more popular tags &raquo;', '@popular_tags') ?></div> 
     10 
     11<h2>browse askeet</h2> 
     12<?php echo include_partial('rss_links') ?> 
  • trunk/frontend/modules/sidebar/templates/questionSuccess.php

    r34 r38  
    1 <?php use_helper('Javascript') ?> 
     1<?php use_helper('Global', 'Javascript') ?> 
    22 
    3 <?php echo link_to('ask a new question', 'question/new') ?> 
     3<div id="add_question"> 
     4  <?php echo link_to_login('ask a new question', '@add_question') ?> 
     5</div> 
    46 
    5 <ul> 
    6   <li><?php echo link_to('popular questions', 'question/list') ?> 
    7   <li><?php echo link_to('latest questions', 'question/recent') ?></li> 
    8   <li><?php echo link_to('latest answers', 'answer/recent') ?></li> 
    9 </ul> 
     7<h2>browse askeet</h2> 
     8<?php echo include_partial('rss_links') ?> 
    109 
    1110<h2>question tags</h2> 
     
    1615 
    1716<?php if ($user->isAuthenticated()): ?> 
    18   <div>Add your own: 
    19     <?php echo form_remote_tag(array( 
    20       'url'    => '@tag_add', 
    21       'update' => 'question_tags', 
    22     )) ?> 
    23       <?php echo input_hidden_tag('question_id', $question->getId()) ?> 
    24       <?php echo input_auto_complete_tag('tag', '', '@tag_autocomplete', 'autocomplete=off', 'use_style=true') ?> 
    25       <?php echo submit_tag('Tag') ?> 
    26     </form> 
     17  <div>add your own: 
     18  <?php echo form_remote_tag(array( 
     19    'url'      => '@tag_add', 
     20    'update'   => 'question_tags', 
     21    'loading'  => "Element.show('indicator'); \$('tag').value = ''", 
     22    'complete' => "Element.hide('indicator');".visual_effect('highlight', 'question_tags'), 
     23  )) ?> 
     24    <?php echo input_hidden_tag('question_id', $question->getId()) ?> 
     25    <?php echo input_auto_complete_tag('tag', '', '@tag_autocomplete', 'autocomplete=off', 'use_style=true') ?> 
     26    <?php echo submit_tag('tag') ?> 
     27  </form> 
    2728  </div> 
    2829<?php endif ?> 
  • trunk/frontend/modules/tag/actions/actions.class.php

    r34 r38  
    1414  { 
    1515    $this->question_pager = QuestionPeer::getPopularByTag($this->getRequestParameter('tag'), $this->getRequestParameter('page', 1)); 
     16 
     17    $this->setTitle('askeet! &raquo; question tagged '.Tag::normalize($this->getRequestParameter('tag'))); 
    1618  } 
    1719 
     
    6769  } 
    6870 
     71  public function executeRemove() 
     72  { 
     73    // disable web debug toolbar 
     74    $this->getRequest()->setAttribute('disable_web_debug', true, 'debug/web'); 
     75 
     76    $this->question = QuestionPeer::getQuestionFromTitle($this->getRequestParameter('stripped_title')); 
     77    $this->forward404Unless($this->question); 
     78 
     79    // remove tag for this user and question 
     80    $user = $this->getUser()->getSubscriber(); 
     81    $tag  = $this->getRequestParameter('tag'); 
     82 
     83    $user->removeTag($this->question, $tag); 
     84 
     85    $this->tags = $this->question->getTags(); 
     86  } 
     87 
    6988  public function executePopular() 
    7089  { 
    7190    $this->tags = QuestionTagPeer::getPopularTags(40); 
     91 
     92    $this->setTitle('askeet! &raquo; popular tags'); 
    7293  } 
    7394} 
  • trunk/frontend/modules/tag/config/view.yml

    r34 r38  
    66  has_layout: off 
    77  slots:      [] 
     8 
     9removeSuccess: 
     10  has_layout: off 
     11  slots:      [] 
  • trunk/frontend/modules/tag/templates/_question_tags.php

    r32 r38  
    1 <?php foreach($tags as $tag): ?> 
    2   <li><?php echo link_to($tag, '@tag?tag='.$tag, 'rel=tag') ?></li> 
    3 <?php endforeach ?> 
     1<?php use_helper('Javascript') ?> 
     2 
     3<?php if ($user->isAuthenticated()): ?> 
     4  <?php $user_tags = $user->getSubscriber()->getTagsFor($question) ?> 
     5  <ul> 
     6  <?php foreach ($question->getPopularTags(20) as $tag => $count): ?> 
     7    <li> 
     8      <?php if (isset($user_tags[$tag])): ?> 
     9        <?php echo link_to($user_tags[$tag], '@tag?tag='.$tag, 'rel=tag') ?> 
     10        &nbsp;<?php echo link_to_remote('[x]', array( 
     11          'url'      => '@tag_remove?stripped_title='.$question->getStrippedTitle().'&tag='.$tag, 
     12          'update'   => 'question_tags', 
     13          'loading'  => "Element.show('indicator')", 
     14          'complete' => "Element.hide('indicator');".visual_effect('highlight', 'question_tags'), 
     15        )) ?> 
     16      <?php else: ?> 
     17        <?php echo link_to($tag, '@tag?tag='.$tag, 'rel=tag') ?> 
     18      <?php endif ?> 
     19    </li> 
     20  <?php endforeach ?> 
     21  </ul> 
     22<?php else: ?> 
     23  <?php echo include_partial('tag/tag_cloud', array('tags' => QuestionTagPeer::getPopularTagsFor($question))) ?> 
     24<?php endif ?> 
  • trunk/frontend/modules/tag/templates/popularSuccess.php

    r34 r38  
    1 <h2>Popular tags</h2> 
    2 <ul id="tag_cloud"> 
    3   <?php foreach($tags as $tag => $count): ?> 
    4   <li class="tag_popularity_<?php echo $count ?>"><?php echo link_to($tag, '@tag?tag='.$tag, 'rel=tag') ?></li> 
    5   <?php endforeach ?> 
    6 </ul> 
     1<h1>Popular tags</h1> 
     2 
     3<?php echo include_partial('tag/tag_cloud', array('tags' => $tags)) ?> 
  • trunk/frontend/modules/tag/templates/showSuccess.php

    r31 r38  
     1<h1>popular questions for tag '<?php echo $request->getParameter('tag') ?>'</h1> 
     2 
    13<?php echo include_partial('question/question_list', array('question_pager' => $question_pager)) ?> 
    24<?php echo pager_navigation($question_pager, '@tag?tag='.$request->getParameter('tag')) ?> 
  • trunk/frontend/modules/user/actions/actions.class.php

    r29 r38  
    5858    $this->answers   = $this->subscriber->getAnswersJoinQuestion(); 
    5959    $this->questions = $this->subscriber->getQuestions(); 
     60 
     61    $this->setTitle('askeet! &raquo; '.$this->subscriber->__toString().'\'s profile'); 
    6062  } 
    6163 
    6264  public function executeLogin() 
    6365  { 
     66    $this->getRequest()->setAttribute('newaccount', false); 
     67 
    6468    if ($this->getRequest()->getMethod() != sfRequest::POST) 
    6569    { 
    6670      // display the form 
    67       $this->getRequest()->getParameterHolder()->set('referer', $this->getRequest()->getReferer()); 
     71      $this->setTitle('askeet! &raquo; sign in / register'); 
     72      $this->getRequest()->getAttributeHolder()->set('referer', $this->getRequest()->getReferer()); 
    6873      return sfView::SUCCESS; 
    6974    } 
     
    122127  } 
    123128 
     129  public function executeAdd() 
     130  { 
     131    // process only POST requests 
     132    if ($this->getRequest()->getMethod() == sfRequest::POST) 
     133    { 
     134      $user = new User(); 
     135      $user->setNickname($this->getRequestParameter('nickname')); 
     136      $user->setEmail($this->getRequestParameter('email')); 
     137      $user->setPassword($this->getRequestParameter('password')); 
     138 
     139      $user->save(); 
     140 
     141      $this->forward('user', 'login'); 
     142    } 
     143 
     144    $this->getRequest()->setAttribute('newaccount', true); 
     145    $this->forward('user', 'login'); 
     146  } 
     147 
    124148  public function handleErrorLogin() 
    125149  { 
    126150    return sfView::SUCCESS; 
     151  } 
     152 
     153  public function handleErrorAdd() 
     154  { 
     155    $this->getRequest()->setAttribute('newaccount', true); 
     156 
     157    return array('user', 'loginSuccess'); 
    127158  } 
    128159 
  • trunk/frontend/modules/user/templates/loginSuccess.php

    r29 r38  
    1 <?php use_helper('Validation') ?> 
    2 <?php echo form_tag('user/login') ?> 
    3   
     1<?php use_helpers('Validation', 'Javascript') ?> 
     2 
     3<h1>sign in / register</h1> 
     4 
     5<div class="in_form"> 
     6  <p>Registration is free and required only to create a new question or rate an answer.</p> 
     7</div> 
     8 
     9<?php echo form_tag($request->getAttribute('newaccount', false) ? '@add_account' : '@login', 'id=login_form class=form') ?> 
     10 
    411  <fieldset> 
    512 
    6   <div class="form-row"> 
    7     <?php echo form_error('nickname') ?> 
    8     <label for="nickname">nickname:</label> 
    9     <?php echo input_tag('nickname', $params->get('nickname')) ?> 
     13  <?php echo form_error('nickname') ?> 
     14  <label for="nickname">nickname:</label> 
     15  <?php echo input_tag('nickname', $params->get('nickname')) ?> 
     16  <br class="clearleft"/> 
     17 
     18  <?php echo form_error('password') ?> 
     19  <label for="password">password:</label> 
     20  <?php echo input_password_tag('password') ?>&nbsp;<?php echo link_to('forgot your password?', '@user_require_password') ?> 
     21  <br class="clearleft"/> 
     22 
     23  <div class="in_form"> 
     24  <?php echo checkbox_tag('new', 1, $request->getAttribute('newaccount', false) ? 1 : 0, array('onclick' => 'toggleForm()')) ?> 
     25  &nbsp;<label for="new" style="display: inline; float: none">click here to create a new account</label> 
    1026  </div> 
    11    
    12   <div class="form-row"> 
    13     <?php echo form_error('password') ?> 
    14     <label for="password">password:</label> 
    15     <?php echo input_password_tag('password') ?> 
     27  <br class="clearleft"/> 
     28 
     29  <div id="new_account"<?php echo $request->getAttribute('newaccount', false) ? '' : ' style="display: none"' ?>> 
     30 
     31    <label for="password_bis">confirm your password:</label> 
     32    <?php echo input_password_tag('password_bis') ?> 
     33    <br class="clearleft"/> 
     34 
     35    <?php echo form_error('email') ?> 
     36    <label for="email">your email:</label> 
     37    <?php echo input_tag('email', $params->get('email')) ?> 
     38    <br class="clearleft"/> 
     39    <div class="small in_form">askeet will never disclose this address to a third party</div> 
     40 
    1641  </div> 
    1742 
     
    1944 
    2045  <?php echo input_hidden_tag('referer', $request->getAttribute('referer')) ?> 
    21   <?php echo submit_tag('sign in') ?> 
    22   <?php echo link_to('Forgot your password?', '@user_require_password') ?> 
     46  <div class="right"> 
     47    <?php echo submit_tag('sign in') ?> 
     48  </div> 
    2349 
    2450</form> 
     51 
     52<?php echo javascript_tag("function toggleForm() 
     53{ 
     54  if (Element.visible('new_account')) 
     55  { 
     56    Effect.BlindUp('new_account'); 
     57    $('login_form').action = '".url_for('@login')."'; 
     58  } 
     59  else 
     60  { 
     61    Effect.BlindDown('new_account'); 
     62    $('login_form').action = '".url_for('@add_account')."'; 
     63  } 
     64 
     65  return false; 
     66}") ?> 
  • trunk/frontend/modules/user/templates/passwordRequestSuccess.php

    r29 r38  
    1 <h2>Receive your login details by email</h2> 
    2 <p>Did you forget your password? Enter your email no receive your login details:</p> 
    3 <?php echo form_tag('@user_require_password') ?> 
     1<h1>Receive your login details by email</h1> 
     2 
     3<div class="in_form"> 
     4  <p>Did you forget your password? 
     5  <br />Enter your email no receive your login details:</p> 
     6</div> 
     7 
     8<?php echo form_tag('@user_require_password', 'class=form') ?> 
    49  <?php echo form_error('email') ?> 
    510  <label for="email">email:</label> 
    6   <?php echo input_tag('email', $params->get('email'), 'style=width:150px') ?><br /> 
    7   <?php echo submit_tag('Send') ?> 
     11  <?php echo input_tag('email', $params->get('email'), 'style=width:150px') ?> 
     12  <br class="clearleft" /> 
     13 
     14  <div class="right"> 
     15    <?php echo submit_tag('send it') ?> 
     16  </div> 
    817</form> 
  • trunk/frontend/modules/user/templates/showSuccess.php

    r18 r38  
    1 <?php echo $subscriber ?> 
     1<?php use_helpers('Date', 'Question', 'Text') ?> 
    22 
    3 <h2>Interests</h2
     3<h1><?php echo $subscriber ?>'s profile</h1
    44 
    5 <ul> 
     5<h3>tags</h3> 
     6 
     7<ul id="question_tags"> 
     8  <?php echo include_partial('tag/tag_cloud', array('tags' => $subscriber->getPopularTags())) ?> 
     9</ul> 
     10 
     11<h3>contributions</h3> 
     12 
     13<?php foreach ($answers as $answer): $question = $answer->getQuestion() ?> 
     14 
     15<div class="vote_block" id="vote_<?php echo $answer->getId() ?>"> 
     16  <?php echo include_partial('answer/vote_user', array('answer' => $answer)) ?> 
     17</div> 
     18 
     19<div class="answer_body"> 
     20  <h2><?php echo link_to_question($answer->getQuestion()) ?></h2> 
     21  <?php echo $answer->getHtmlBody() ?> 
     22  <div class="subtitle">posted on <?php echo format_date($answer->getCreatedAt(), 'f') ?></div> 
     23</div> 
     24 
     25<br class="clearleft" /> 
     26 
     27<?php endforeach ?> 
     28 
     29<h3>questions</h3> 
     30 
     31<?php foreach ($questions as $question): ?> 
     32<div class="question"> 
     33  <div class="interested_block" id="block_<?php echo $question->getId() ?>"> 
     34    <?php echo include_partial('question/interested_user', array('question' => $question)) ?> 
     35  </div> 
     36 
     37  <h2><?php echo link_to_question($question) ?></h2> 
     38 
     39  <div class="subtitle">submitted on <?php echo format_date($question->getCreatedAt(), 'f') ?></div> 
     40 
     41  <div class="question_body"> 
     42    <?php echo truncate_text(strip_tags($question->getHtmlBody()), 200) ?> 
     43    <?php if ($question->getTags()): ?> 
     44      <div class="tags">tags: <?php echo tags_for_question($question) ?></div> 
     45    <?php endif ?> 
     46  </div> 
     47</div> 
     48<?php endforeach ?> 
     49 
     50<h3>interests</h3> 
     51 
     52<ul class="plain_list"> 
    653<?php foreach ($interests as $interest): $question = $interest->getQuestion() ?> 
    7   <li><?php echo link_to($question->getTitle(), $question->getId()) ?></li> 
     54  <li><?php echo link_to($question->getTitle(), '@question?stripped_title='.$question->getStrippedTitle()) ?></li> 
    855<?php endforeach ?> 
    956</ul> 
    10  
    11 <h2>Contributions</h2> 
    12  
    13 <ul> 
    14 <?php foreach ($answers as $answer): $question = $answer->getQuestion() ?> 
    15   <li> 
    16     <?php echo link_to($question->getTitle(), $question->getId()) ?><br /> 
    17     <?php echo $answer->getBody() ?> 
    18   </li> 
    19 <?php endforeach ?> 
    20 </ul> 
    21  
    22 <h2>Questions</h2> 
    23  
    24 <ul> 
    25 <?php foreach ($questions as $question): ?> 
    26   <li><?php echo link_to($question->getTitle(), $question->getId()) ?></li> 
    27 <?php endforeach ?> 
    28 </ul> 
  • trunk/frontend/templates/layout.php

    r29 r38  
    3232        <li><?php echo link_to('sign in/register', '@login') ?></li> 
    3333      <?php endif ?> 
    34       <li><?php echo link_to('about', 'question/list') ?></li> 
     34      <li class="last"><?php echo link_to('about', '@about') ?></li> 
    3535    </ul> 
    36     <h1><?php echo link_to(image_tag('askeet_logo.gif', 'alt=askeet'), '@homepage') ?></h1> 
     36    <h1> 
     37    <?php echo link_to(image_tag('askeet_logo.gif', 'alt=askeet align=middle'), '@homepage') ?> 
     38    ask <strong>it</strong> - find <strong>it</strong> - answer <strong>it</strong> 
     39    </h1> 
    3740  </div> 
    3841 
    3942  <div id="login" style="display: none"> 
    40     <h2>Please sign-in first</h2> 
    41      
    42     <?php echo link_to_function('cancel', visual_effect('blind_up', 'login', array('duration' => 0.5))) ?> 
    43      
     43    <h2>please sign-in first</h2> 
    4444    <?php echo form_tag('@login', 'id=loginform') ?> 
    45       nickname: <?php echo input_tag('nickname') ?><br /
    46       password: <?php echo input_password_tag('password') ?><br /
     45      <label for="nickname">nickname:</label><?php echo input_tag('nickname') ?
     46      <label for="password">password:</label><?php echo input_password_tag('password') ?
    4747      <?php echo input_hidden_tag('referer', $params->get('referer') ? $params->get('referer') : $request->getUri()) ?> 
    4848      <?php echo submit_tag('login') ?> 
    49       <?php echo link_to('Forgot your password?','@user_require_password') ?> 
     49      <?php echo link_to_function('cancel', visual_effect('blind_up', 'login', array('duration' => 0.5))) ?> 
    5050    </form> 
    5151  </div> 
     
    5858 
    5959    <div id="content_bar"> 
     60      <div class="topbar"></div> 
    6061      <?php echo $sidebar ?> 
    6162      <div class="verticalalign"></div> 
     
    6364  </div> 
    6465 
     66  <div id="footer"> 
     67  powered by <?php echo link_to(image_tag('symfony.gif', 'align=absmiddle'), 'http://www.symfony-project.com/') ?> 
     68  </div> 
     69 
    6570</body> 
    6671</html> 
  • trunk/lib/model/QuestionPeer.php

    r31 r38  
    3636    $c = new Criteria(); 
    3737    $c->addDescendingOrderByColumn(self::INTERESTED_USERS); 
     38/* 
     39    if (1) 
     40    { 
     41      $c->addJoin(self::ID, QuestionTagPeer::QUESTION_ID, Criteria::LEFT_JOIN); 
     42      $c->add(QuestionTagPeer::NORMALIZED_TAG, 'perl'); 
     43      $c->setDistinct(); 
     44    } 
     45*/ 
    3846    $pager->setCriteria($c); 
    3947    $pager->setPage($page); 
  • trunk/lib/model/QuestionTagPeer.php

    r34 r38  
    2929      SELECT '.QuestionTagPeer::NORMALIZED_TAG.' AS tag, 
    3030      COUNT('.QuestionTagPeer::NORMALIZED_TAG.') AS count 
    31       FROM '.QuestionTagPeer::TABLE_NAME.' 
     31      FROM '.QuestionTagPeer::TABLE_NAME; 
     32 
     33    if (1) 
     34    { 
     35/* 
     36      $query .= ' 
     37        LEFT JOIN '.QuestionPeer::TABLE_NAME.' 
     38        GROUP BY '.QuestionTagPeer::NORMALIZED_TAG; 
     39*/ 
     40    } 
     41 
     42    $query .= ' 
    3243      GROUP BY '.QuestionTagPeer::NORMALIZED_TAG.' 
    3344      ORDER BY count DESC'; 
     
    5162    return $tags; 
    5263  } 
     64 
     65  public static function getPopularTagsFor($question, $max = 10) 
     66  { 
     67    $tags = array(); 
     68 
     69    $con = Propel::getConnection(); 
     70 
     71    // get popular tags 
     72    $query = ' 
     73      SELECT '.QuestionTagPeer::NORMALIZED_TAG.' AS tag, COUNT('.QuestionTagPeer::NORMALIZED_TAG.') AS count 
     74      FROM '.QuestionTagPeer::TABLE_NAME; 
     75    if ($question !== null) 
     76    { 
     77      $query .= '  WHERE '.QuestionTagPeer::QUESTION_ID.' = ?'; 
     78    } 
     79    $query .= ' 
     80      GROUP BY '.QuestionTagPeer::NORMALIZED_TAG.' 
     81      ORDER BY count DESC 
     82    '; 
     83 
     84    $stmt = $con->prepareStatement($query); 
     85    if ($question !== null) 
     86    { 
     87      $stmt->setInt(1, $question->getId()); 
     88    } 
     89    $stmt->setLimit($max); 
     90    $rs = $stmt->executeQuery(); 
     91    $max_popularity = 0; 
     92    while ($rs->next()) 
     93    { 
     94      if (!$max_popularity) 
     95      { 
     96        $max_popularity = $rs->getInt('count'); 
     97      } 
     98 
     99      $tags[$rs->getString('tag')] = floor(($rs->getInt('count') / $max_popularity * 3) + 1); 
     100    } 
     101 
     102    ksort($tags); 
     103 
     104    return $tags; 
     105  } 
    53106} 
    54107 
  • trunk/lib/model/User.php

    r25 r38  
    1919  public function __toString() 
    2020  { 
    21     return $this->getFirstName().' '.$this->getLastName(); 
     21    if ($this->getLastName()) 
     22    { 
     23      return ucfirst(strtolower($this->getFirstName())).' '.strtoupper($this->getLastName()); 
     24    } 
     25    else 
     26    { 
     27      return $this->getNickname(); 
     28    } 
    2229  } 
    2330 
     
    3643    $this->setSha1Password(sha1($salt.$password)); 
    3744  } 
     45 
     46  public function getTagsFor($question, $max = 10) 
     47  { 
     48    $tags = array(); 
     49 
     50    $con = Propel::getConnection(); 
     51    $query = ' 
     52      SELECT %s AS tag, %s AS raw_tag, COUNT(%s) AS count 
     53      FROM %s 
     54      WHERE %s = ? AND %s = ? 
     55      GROUP BY %s 
     56      ORDER BY count DESC 
     57    '; 
     58 
     59    $query = sprintf($query, 
     60      QuestionTagPeer::NORMALIZED_TAG, 
     61      QuestionTagPeer::TAG, 
     62      QuestionTagPeer::NORMALIZED_TAG, 
     63      QuestionTagPeer::TABLE_NAME, 
     64      QuestionTagPeer::QUESTION_ID, 
     65      QuestionTagPeer::USER_ID, 
     66      QuestionTagPeer::NORMALIZED_TAG 
     67    ); 
     68 
     69    $stmt = $con->prepareStatement($query); 
     70    $stmt->setInt(1, $question->getId()); 
     71    $stmt->setInt(2, $this->getId()); 
     72    $stmt->setLimit($max); 
     73    $rs = $stmt->executeQuery(); 
     74    while ($rs->next()) 
     75    { 
     76      $tags[$rs->getString('tag')] = $rs->getString('raw_tag'); 
     77    } 
     78 
     79    return $tags; 
     80  } 
     81 
     82  public function removeTag($question, $tag) 
     83  { 
     84    $c = new Criteria(); 
     85    $c->add(QuestionTagPeer::QUESTION_ID, $question->getId()); 
     86    $c->add(QuestionTagPeer::USER_ID, $this->getId()); 
     87    $c->add(QuestionTagPeer::NORMALIZED_TAG, Tag::normalize($tag)); 
     88 
     89    QuestionTagPeer::doDelete($c); 
     90  } 
     91 
     92  public function getPopularTags($max = 40) 
     93  { 
     94    $tags = array(); 
     95 
     96    $con = Propel::getConnection(); 
     97 
     98    // get popular tags 
     99    $query = ' 
     100      SELECT '.QuestionTagPeer::NORMALIZED_TAG.' AS tag, COUNT('.QuestionTagPeer::NORMALIZED_TAG.') AS count 
     101      FROM '.QuestionTagPeer::TABLE_NAME.' 
     102      WHERE '.QuestionTagPeer::USER_ID.' = ? 
     103      GROUP BY '.QuestionTagPeer::NORMALIZED_TAG.' 
     104      ORDER BY count DESC 
     105    '; 
     106 
     107    $stmt = $con->prepareStatement($query); 
     108    $stmt->setInt(1, $this->getId()); 
     109    $stmt->setLimit($max); 
     110    $rs = $stmt->executeQuery(); 
     111    $max_popularity = 0; 
     112    while ($rs->next()) 
     113    { 
     114      if (!$max_popularity) 
     115      { 
     116        $max_popularity = $rs->getInt('count'); 
     117      } 
     118 
     119      $tags[$rs->getString('tag')] = floor(($rs->getInt('count') / $max_popularity * 3) + 1); 
     120    } 
     121 
     122    ksort($tags); 
     123 
     124    return $tags; 
     125  } 
    38126} 
    39127 
  • trunk/web/css/layout.css

    r8 r38  
    44{ 
    55  float: left; 
    6   width: 530px; 
     6  width: 480px; 
    77  margin-right: 10px; 
    88} 
     
    1010{ 
    1111  float: left; 
    12   width: 240px; 
     12  width: 220px; 
     13  padding:10px; 
    1314} 
    1415/* Start Mac IE5 filter \*/ 
  • trunk/web/css/main.css

    r34 r38  
    55a:link, a:visited 
    66{ 
     7  text-decoration: underline; 
     8  color:#9C4797; 
     9} 
     10 
     11a:hover 
     12{ 
    713  text-decoration: none; 
    8   color:#6E3291; 
    9 } 
    10  
    11 a:hover 
    12 { 
    13   text-decoration: underline; 
    1414} 
    1515 
     
    2020  font-family: Arial, sans-serif; 
    2121  font-size: 12px; 
    22   background-color: #fff
     22  background: #F2ECF2
    2323} 
    2424 
     
    3232  margin-left: auto; 
    3333  margin-right: auto; 
     34  margin-bottom: 10px; 
    3435  text-align: left; 
    3536  width: 780px; 
    36   height: 46px; 
     37  height: 102px; 
     38  background:url(/images/header_background.gif) no-repeat top left; 
     39
     40 
     41div#header h1 
     42
     43  padding:30px; 
     44  font-family: Verdana, sans-serif; 
     45  font-size: 17px; 
     46  font-weight: bold; 
     47  color: #c8c8c8; 
     48
     49 
     50div#header h1 strong 
     51
     52  color: #999; 
    3753} 
    3854 
     
    4258  display:inline; 
    4359  float:right; 
     60  padding: 5px 5px; 
     61  background: #d8732f url(/images/menu_left.gif) no-repeat left bottom; 
     62  font-size: 11px; 
    4463} 
    4564 
     
    5473  padding: 0 7px; 
    5574  font-weight: bold; 
    56   border-right: solid 1px #0066CC
     75  border-right: solid 1px #fff
    5776} 
    5877 
     
    7897div#header li :link, div#header li :visited 
    7998{ 
    80   color:#0066CC
     99  color:#fff
    81100} 
    82101 
    83102div#content_main 
    84103{ 
    85   background-color:white; 
     104  background-color: white; 
     105  padding:25px; 
    86106} 
    87107 
    88108div#content_main h1 
    89109{ 
    90   padding: 5px; 
     110  margin: -25px; 
    91111  font-size:14px; 
    92   margin-bottom:10px; 
    93   color: #B59D7A; 
    94   border-bottom: 1px solid #B59D7A; 
     112  font-family:Verdana, Arial, sans-serif; 
     113  padding:20px 25px 40px 25px; 
     114  color: #7E7E7E; 
     115  background: url(/images/content_top.gif) no-repeat top left; 
    95116} 
    96117 
     
    98119{ 
    99120  font-size:14px; 
     121} 
     122 
     123div#content_main h3 
     124{ 
     125  font-size:14px; 
     126  padding: 10px 0; 
    100127} 
    101128 
     
    109136div#content_main .interested_mark 
    110137{ 
    111   font-size: 2em;  
    112   font-weight: bold;  
    113   width: 30px;  
    114   height: 30px;  
    115   background-color: #FFE56F;  
    116   border: 1px solid #ddd;  
     138  font-size: 2em; 
     139  font-weight: bold; 
     140  width: 40px; 
     141  height: 26px; 
     142  background: url(/images/interested_bubble.gif) no-repeat top left; 
     143  text-align: right; 
     144  margin-left:10px; 
     145  color: #fff; 
     146
     147 
     148div#content_main .few_interests 
     149
     150  font-size: 20px; 
     151  line-height: 26px; 
     152  margin-right:10px; 
     153
     154 
     155div#content_main .some_interests 
     156
     157  font-size: 16px; 
     158  line-height: 27px; 
     159
     160 
     161div#content_main .many_interests 
     162
     163  font-size: 13px; 
     164  line-height: 25px; 
     165
     166 
     167div#content_main .interested_link 
     168
    117169  text-align: center; 
    118   margin-left:10px; 
     170  font-size: 9px; 
     171
     172 
     173div#content_main .interested_link :link, div#content_main .interested_link :visited 
     174
     175  color: #f3b335; 
     176
     177 
     178div#content_main .question 
     179
     180  margin-bottom: 25px; 
    119181} 
    120182 
     
    122184{ 
    123185  margin-top:6px; 
     186  padding-left:70px; 
     187} 
     188 
     189div#content_main .question_body li 
     190{ 
     191  list-style-position: outside; 
     192} 
     193 
     194.vote_block 
     195{ 
     196  width: 70px; 
     197  float: left; 
     198} 
     199 
     200.answer 
     201{ 
     202  padding-bottom: 10px; 
     203} 
     204 
     205 
     206div#content_main .vote_up_mark 
     207{ 
     208  display:inline; 
     209  float:left; 
     210  width:35px; 
     211  text-align:center; 
     212  font-size: 10px; 
     213} 
     214 
     215div#content_main .vote_down_mark 
     216{ 
     217  display:inline; 
     218  float:left; 
     219  width:35px; 
     220  text-align:center; 
     221  font-size: 10px; 
     222} 
     223 
     224div#content_main .answer_body 
     225{ 
     226  padding-left:80px; 
     227} 
     228 
     229div#content_main .answer_body ul 
     230{ 
     231  margin-left: 15px; 
    124232} 
    125233 
     
    133241} 
    134242 
     243div#content_main p 
     244{ 
     245  padding-bottom: 10px; 
     246} 
     247 
     248div#content_bar 
     249{ 
     250  background-color: white; 
     251} 
     252 
     253div#content_bar div.topbar 
     254{ 
     255  background:url(/images/side_top.gif) no-repeat top left; 
     256  height:15px; 
     257  margin:-10px; 
     258} 
     259 
     260div#content_bar li 
     261{ 
     262  list-style:none; 
     263} 
     264 
     265div#content_bar h2 
     266{ 
     267  font-size:14px; 
     268  font-family:Verdana, Arial, sans-serif; 
     269  padding:5px 0; 
     270  color: #7E7E7E; 
     271} 
     272 
    135273div#footer 
    136274{ 
    137   padding-top: 5px; 
    138275  margin-left: auto; 
    139276  margin-right: auto; 
    140   text-align: left; 
    141   width: 780px; 
    142   background-color: #bbb; 
     277  height:80px; 
     278  padding-top:40px; 
     279  background:url(/images/footer_background.gif) no-repeat top left; 
     280  text-align: right; 
    143281} 
    144282 
    145283.form_error 
    146284{ 
    147   color: #f00; 
     285  padding-left: 85px; 
     286  color: #d8732f; 
    148287} 
    149288 
     
    159298} 
    160299 
     300.subtitle 
     301{ 
     302  color: #9c4797; 
     303  font-size: 11px; 
     304} 
     305 
     306.subtitle :link, .subtitle :visited 
     307{ 
     308  font-weight: bold; 
     309} 
     310 
     311.clearleft 
     312{ 
     313  clear: left; 
     314} 
     315 
     316.form input 
     317{ 
     318  display: block; 
     319  float: left; 
     320  margin-bottom: 10px; 
     321} 
     322 
     323.form .right input 
     324{ 
     325  display: inline; 
     326  float: none; 
     327  text-align: right; 
     328} 
     329 
     330.form label 
     331{ 
     332  display: block; 
     333  width: 75px; 
     334  padding-right: 10px; 
     335  margin-bottom: 10px; 
     336  float: left; 
     337  text-align: right; 
     338} 
     339 
     340fieldset 
     341{ 
     342  border: none; 
     343} 
     344 
     345#login 
     346{ 
     347  margin-bottom: 10px; 
     348} 
     349 
     350#login h2 
     351{ 
     352  font-size: 14px; 
     353  margin-bottom: 5px; 
     354} 
     355 
    161356ul#tag_cloud 
    162357{ 
    163358  list-style: none; 
    164359} 
    165   
     360 
    166361ul#tag_cloud li 
    167362{ 
    168363  list-style: none; 
    169364  display: inline; 
    170 
    171   
     365  padding: 5px; 
     366
     367 
    172368ul#tag_cloud li.tag_popularity_1 
    173369{ 
    174370  font-size: 60%; 
    175371} 
    176   
     372 
    177373ul#tag_cloud li.tag_popularity_2 
    178374{ 
    179375  font-size: 100%; 
    180376} 
    181   
     377 
    182378ul#tag_cloud li.tag_popularity_3 
    183379{ 
    184380  font-size: 130%; 
    185381} 
    186   
     382 
    187383ul#tag_cloud li.tag_popularity_4 
    188384{ 
    189385  font-size: 160%; 
    190386} 
     387 
     388#answers 
     389{ 
     390  padding-top: 10px; 
     391} 
     392 
     393#rss_links li 
     394{ 
     395  padding: 0 0 5px 5px; 
     396} 
     397 
     398#add_question 
     399{ 
     400  padding: 10px; 
     401  margin: 7px 0 5px 0; 
     402  text-align: center; 
     403  font-size: 16px; 
     404  font-weight: bold; 
     405  background: url(/images/add_background.gif) no-repeat left 7px; 
     406} 
     407 
     408#add_question :link, #add_question :visited 
     409{ 
     410  color: #fff; 
     411} 
     412 
     413.tags 
     414{ 
     415  color: #aaa; 
     416} 
     417 
     418.right 
     419{ 
     420  text-align: right; 
     421} 
     422 
     423.small 
     424{ 
     425  font-size: 10px; 
     426} 
     427 
     428.in_form 
     429{ 
     430  padding-left: 85px; 
     431} 
     432 
     433ul.plain_list 
     434{ 
     435  margin-left: 15px; 
     436}