Show
Ignore:
Timestamp:
07/07/08 20:31:55 (5 months ago)
Author:
aarkerio
Message:

Adding annotations

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/views/lessons/view.ctp

    r312 r630  
    11<?php 
    2 echo '<h1>'  .$data['Lesson']['title']   . '</h1>'; 
    3 echo '<div>' .$data['Lesson']['body']    . '</div>'; 
    4 echo '<div>' .$data['Lesson']['created'] . '</div>'; 
     2  echo '<h1>'  .$data['Lesson']['title']   . '</h1>'; 
     3  echo $html->div(null, $data['Lesson']['body']); 
     4  echo $html->div(null, __('Last edition', true). ': '.$data['Lesson']['created']); 
     5   
     6  echo $form->create('CommentsLesson', array('onsubmit'=>'return chkForm()', 'action'=>'add')); 
     7  echo $form->hidden('CommentsLesson.redirect_to', array('value'=>'/lessons/view/'.$blog['User']['username'].'/'.$data['Lesson']['id'])); 
     8  echo $form->hidden('CommentsLesson.lesson_id', array('value'=>$data['Lesson']['id'])); 
     9        
     10  if ( $session->check('Auth.User') ): 
    511?> 
     12 <fieldset> 
     13 <legend id="new_comment"><?php __('New Comment'); ?></legend>  
     14 <?php 
     15   echo $session->read('Auth.User.username') . ' ' . __('writes', true); 
     16                  
     17   echo $form->label('CommentsLesson.comment', 'Comment'); 
     18   echo $form->textarea('CommentsLesson.comment', array('rows' => 10, 'cols' => 50)); 
     19   echo $form->error('CommentsLesson.comment', 'A comment is required.'); 
     20         
     21   echo $form->end(__('Send', true)); 
     22   echo '</fieldset>';        
     23 
     24else: 
     25    echo $html->para(null, $html->link('You must be logged in to write a comment', '/users/login')); 
     26endif; 
     27?> 
     28<script type="text/javascript"> 
     29/* <![CDATA[ */ 
     30 
     31 function chkForm() 
     32 { 
     33  var title   = document.getElementById("CommentsLessonCommentsLesson"); 
     34 
     35  if (title.value.length < 2) 
     36  { 
     37    alert('Comment too short'); 
     38    title.focus(); 
     39    return false; 
     40  } 
     41  return true; 
     42} 
     43 /* ]]> */ 
     44</script>