Changeset 3
- Timestamp:
- 04/27/07 10:35:17 (2 years ago)
- Files:
-
- trunk/controllers/posts_controller.php (modified) (2 diffs)
- trunk/views/posts/admin_edit.ctp (modified) (1 diff)
- trunk/views/posts/admin_index.ctp (modified) (1 diff)
- trunk/webroot/css/shades.css (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/controllers/posts_controller.php
r2 r3 11 11 var $name = 'Posts'; 12 12 var $uses = array('Post','Comment','Subject','Copyright'); 13 var $paginate = array('fields'=>array('Post.id', 'Post.title', 'Post.byline', 'Post.body', 'Post.user_id', 'Post.url' ,'Post.created' , 'Post.published' ,'User.id', 'User.username'),'limit'=>5, 'order'=>array('Post.created'=>'DESC') );13 var $paginate = array('fields'=>array('Post.id', 'Post.title', 'Post.byline', 'Post.body', 'Post.user_id', 'Post.url' ,'Post.created' , 'Post.published' ,'User.id', 'User.username'),'limit'=>5, 'order'=>array('Post.created'=>'DESC'),'Post.published = 1'); 14 14 15 15 //var $recursion = 0; … … 163 163 $subject = $this->Post->Subject->generateList(); 164 164 $this->set(compact('subject')); 165 166 $copyright_type = $this->Post->Copyright->generateList(); 167 $this->set(compact('copyright_type')); 165 168 } 166 169 } trunk/views/posts/admin_edit.ctp
r2 r3 3 3 4 4 <div id="post"> 5 <h2>Edit Post</h2> 5 6 <?php e($form->create('Post'));?> 6 <fieldset id="post-edit"> 7 <legend>Edit post:</legend> 8 <?php e($form->input('id', array('type'=>'hidden')));?> 9 <?php e($form->input('title'));?> 10 <?php e($form->input('byline'));?> 7 <fieldset id="post-main"> 8 <legend>Post Content:</legend> 9 <?php e($form->input('id', array('type'=>'hidden')));?> 10 <?php e($form->input('title', array('class'=>'content-text')));?> 11 <?php e($form->input('byline',array('class'=>'content-text')));?> 12 <?php e($form->input('body',array('class'=>'content-text')));?> 13 </fieldset> 14 <fieldset id="post-meta"> 15 <legend>Post Metadata</legend> 11 16 <?php e($form->input('subject_id', array('options' => $subject)));?> 12 17 <?php e($form->input('copyright_id', array('options' => $copyright_type)));?> 13 <?php e($form->input('body'));?> 18 </fieldset> 19 <fieldset> 20 <legend>Post Options</legend> 14 21 <?php if($othAuth->group('name') == "Site Admins") { 15 22 e($form->input('published', array('label'=>'Publish Story?'))); trunk/views/posts/admin_index.ctp
r2 r3 37 37 <td> 38 38 <ul> 39 <li><?php e($html->link('Edit', '/admin/posts/edit/' . $post['Post']['id'], array('class'=>' edit')));?></li>40 <li><?php e($html->link('Delete', '/admin/posts/delete/' . $post['Post']['id'], array('class'=>' delete', 'rel'=> $post['Post']['id']),'Are you sure you wish to delete post "' . $post['Post']['title'] . '"'));?></li>39 <li><?php e($html->link('Edit', '/admin/posts/edit/' . $post['Post']['id'], array('class'=>'adminbutton edit')));?></li> 40 <li><?php e($html->link('Delete', '/admin/posts/delete/' . $post['Post']['id'], array('class'=>'adminbutton delete', 'rel'=> $post['Post']['id']),'Are you sure you wish to delete post "' . $post['Post']['title'] . '"'));?></li> 41 41 </ul> 42 <?php if($post['Post']['published'] != 1) {?> 43 <?php e($form->create('Post', array('action'=>'edit')));?> 44 <?php e($form->input('id', array('value'=>$post['Post']['id'])));?> 45 <?php e($form->input('published', array('value'=>1, 'type'=>'hidden')));?> 46 <?php e($form->submit('Publish', array('class'=>'adminbutton')));?> 47 <?php e($form->end());?> 48 <?php } ?> 42 49 </td> 43 50 </tr> trunk/webroot/css/shades.css
r2 r3 257 257 .next {float:right; font-size:1.5em;} 258 258 .entry-title a {text-decoration:none;} 259 260 /* Editor forms */ 261 input[type=text].content-text{ 262 display:block; 263 width:99%; 264 height:25px; 265 font-size:2em; 266 267 } 259 268 260 269 … … 499 508 color: #FFF; 500 509 } 510 511 /* Admin Button*/ 512 .adminbutton { 513 display:block; 514 border: 2px solid #fff; 515 width:70%; 516 height:20px; 517 margin:4px 4px; 518 /*background:#02f;*/ 519 }