Assembla home | Assembla project page
 

Changeset 3

Show
Ignore:
Timestamp:
04/27/07 10:35:17 (2 years ago)
Author:
digitalspaghetti
Message:

Changed post edit form to new type of layout.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/controllers/posts_controller.php

    r2 r3  
    1111        var $name = 'Posts'; 
    1212        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'); 
    1414         
    1515        //var $recursion = 0; 
     
    163163                        $subject = $this->Post->Subject->generateList(); 
    164164                        $this->set(compact('subject')); 
     165                         
     166                        $copyright_type = $this->Post->Copyright->generateList(); 
     167                        $this->set(compact('copyright_type')); 
    165168                } 
    166169        } 
  • trunk/views/posts/admin_edit.ctp

    r2 r3  
    33 
    44<div id="post"> 
     5        <h2>Edit Post</h2> 
    56        <?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> 
    1116                <?php e($form->input('subject_id', array('options' => $subject)));?> 
    1217                <?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> 
    1421                <?php if($othAuth->group('name') == "Site Admins") { 
    1522                                e($form->input('published', array('label'=>'Publish Story?'))); 
  • trunk/views/posts/admin_index.ctp

    r2 r3  
    3737                                <td> 
    3838                                        <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> 
    4141                                        </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 } ?> 
    4249                                </td> 
    4350                        </tr> 
  • trunk/webroot/css/shades.css

    r2 r3  
    257257.next {float:right; font-size:1.5em;} 
    258258.entry-title a {text-decoration:none;} 
     259 
     260/* Editor forms */ 
     261input[type=text].content-text{ 
     262        display:block; 
     263        width:99%; 
     264        height:25px; 
     265        font-size:2em; 
     266         
     267} 
    259268 
    260269 
     
    499508        color: #FFF; 
    500509} 
     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}