Assembla home | Assembla project page
 

Changeset 6

Show
Ignore:
Timestamp:
04/29/07 11:04:00 (2 years ago)
Author:
digitalspaghetti
Message:

Improvements to UI

Files:

Legend:

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

    r2 r6  
    44        var $name = 'menus'; 
    55        var $helpers = array('Html', 'Form' ); 
     6         
     7        var $uses = array('Menu','Group'); 
    68 
    79        var $recursion = 2; 
     
    8890 
    8991        function admin_add() { 
     92                 
     93                $sections = $this->Menu->Section->generateList(); 
     94                $this->set(compact('sections')); 
     95                 
     96                $access_levels = array('999'=>'999','900'=>'900','850'=>'850','800'=>'800','750'=>'750','700'=>'700','650'=>'650','600'=>'600','550'=>'550','500'=>'500'); 
     97                $this->set(compact('access_levels')); 
     98                 
     99                $data = $this->Menu->findAllThreaded(array(null, null, 'Menu.position')); 
     100                //$parents = array(); 
     101                //foreach ($data) 
     102                //$this->set(compact('parents')); 
    90103                if(!empty($this->data)) { 
    91104                        $this->cleanUpFields(); 
     
    98111                        } 
    99112                } 
    100                 $sections = $this->Menu->Section->generateList(); 
    101                 $this->set(compact('sections')); 
    102113        } 
    103114 
  • trunk/controllers/videos_controller.php

    r2 r6  
    33 
    44        var $name = 'Videos'; 
    5         var $uses = array('Video','Copyright'); 
     5        var $uses = array('Video','Copyright','Subject'); 
    66         
    77        // Default Settings 
     
    99        var $allowedTypes = array('video/mpeg'); 
    1010         
    11         var $paginate = array('fields'=>array('Video.id', 'Video.filename', 'Video.filesize', 'Video.mimetype','Video.copyright_owner','Video.copyright_id'),'limit'=>10, 'order'=>array('Video.created'=>'DESC')); 
     11        var $paginate = array('fields'=>array('Video.id', 'Video.filename', 'Video.filesize', 'Video.mimetype','Video.copyright_owner','Video.copyright_id','Video.created','Video.published'),'limit'=>10, 'order'=>array('Video.created'=>'DESC')); 
    1212 
    1313 
     
    9696                $this->set(compact('copyright_type')); 
    9797                 
     98                $subject_type = $this->Subject->generateList(); 
     99                $this->set(compact('subject_type')); 
     100                 
    98101                if(!empty($this->data) && $this->data['Video']['filename']['error'] == 0) 
    99102                { 
  • trunk/views/layouts/default.ctp

    r4 r6  
    1717        <!-- zero margin = wide layout --> 
    1818        <body style="margin: 0;">  
    19  
    2019                <div class="container"> 
    21  
     20                        <?php e($this->renderElement('userbar'));?> 
     21                        <div class="stripes"><span></span></div> 
    2222                        <div class="header"> 
    2323                                <a href="<?php e($siteurl);?>"><span><?php e($sitename); ?></span></a> 
     
    5151 
    5252                                        <div class="subnav"> 
    53                                                 <a onclick="$.FontSizer.IncreaseSize();">Increase</a> 
    54                                                 <a onclick="$.FontSizer.DecreaseSize();">Decrease</a> 
     53                                                 
    5554                                        </div> 
    5655 
  • trunk/views/menus/admin_add.ctp

    r2 r6  
    1 <div class="menu"> 
    2 <h2>New Menu</h2> 
    3         <?php echo $form->create('Menu');?> 
    4                 <?php echo $form->input('name');?> 
    5                 <?php echo $form->input('url');?> 
    6                 <?php echo $form->input('position');?> 
    7                 <?php echo $form->input('icon');?> 
    8                 <?php echo $form->input('parent_id');?> 
    9                 <?php echo $form->input('section_id', array('options' => $sections));?> 
    10                 <?php echo $form->input('access_level');?> 
    11                 <?php echo $form->submit('Add');?> 
    12         </form> 
     1<div id="post"> 
     2        <h2>Add New Menu</h2> 
     3        <?php e($form->create('Post'));?> 
     4                <fieldset id="post-main"> 
     5                        <legend>Menu Details:</legend> 
     6                        <?php echo $form->input('name');?> 
     7                        <?php echo $form->input('url');?> 
     8                        <?php echo $form->input('position');?> 
     9                        <?php echo $form->input('icon');?> 
     10                        <?php echo $form->input('parent_id'/*, array('options'=>$parents)*/);?> 
     11                        <?php echo $form->input('section_id', array('options' => $sections));?> 
     12                        <?php echo $form->input('access_level', array('options'=>$access_levels));?> 
     13                 
     14                </fieldset> 
     15                <?php e($form->submit('Save Menu'));?> <?php e($html->link('Cancel', '/admin/menus', array('class'=>'cancel')));?> 
     16        <?php e($form->end());?> 
    1317</div> 
    14 <div class="actions"> 
    15         <ul> 
    16                 <li><?php echo $html->link('List Menuses', array('action'=>'index')); ?></li> 
    17                 <li><?php echo $html->link('View Sections', array('controller'=> 'sections', 'action'=>'view'));?></li> 
    18                 <li><?php echo $html->link('Add Sections', array('controller'=> 'sections', 'action'=>'add')); ?></li> 
    19         </ul> 
    20 </div> 
  • trunk/views/menus/admin_index.ctp

    r2 r6  
    1 <div class="menus"> 
    2 <h2>List Menuses</h2> 
     1<?php e($javascript->codeBlock('$(document).ready(function(){$("#the-table").tableSorter();});'));?> 
    32 
    4 <table cellpadding="0" cellspacing="0"> 
    5         <tr> 
    6                 <th><?php echo $paginator->sort('id');?></th> 
    7                 <th><?php echo $paginator->sort('name');?></th> 
    8                 <th><?php echo $paginator->sort('url');?></th> 
    9                 <th><?php echo $paginator->sort('position');?></th> 
    10                 <th><?php echo $paginator->sort('icon');?></th> 
    11                 <th><?php echo $paginator->sort('parent_id');?></th> 
    12                 <th><?php echo $paginator->sort('section_id');?></th> 
    13                 <th><?php echo $paginator->sort('access_level');?></th> 
    14                 <th>Actions</th> 
    15         </tr> 
    16 <?php foreach ($menus as $menu): ?> 
    17         <tr> 
    18                 <td><?php echo $menu['Menu']['id']; ?></td> 
    19                 <td><?php echo $menu['Menu']['name']; ?></td> 
    20                 <td><?php echo $menu['Menu']['url']; ?></td> 
    21                 <td><?php echo $menu['Menu']['position']; ?></td> 
    22                 <td><?php echo $menu['Menu']['icon']; ?></td> 
    23                 <td><?php echo $menu['Menu']['parent_id']; ?></td> 
    24                 <td><?php echo $html->link($menu['Section']['name'], array('controller'=> 'sections', 'action'=>'view', $menu['Section']['id'])); ?></td> 
    25                 <td><?php echo $menu['Menu']['access_level']; ?></td> 
    26                 <td class="actions"> 
    27                         <?php echo $html->link('View', array('action'=>'view', $menu['Menu']['id'])); ?> 
    28                         <?php echo $html->link('Edit', array('action'=>'edit', $menu['Menu']['id'])); ?> 
    29                         <?php echo $html->link('Delete', array('action'=>'delete', $menu['Menu']['id']), null, 'Are you sure you want to delete #' . $menu['Menu']['id']); ?> 
    30                 </td> 
    31         </tr> 
    32 <?php endforeach; ?> 
    33 </table> 
     3<div id="paginate"> 
     4        <span class="previous"> 
     5                <?php e($paginator->prev('<< Previous', null, null, array('class' => 'disabled'))); ?> 
     6        </span> 
     7        <span class="next"> 
     8                <?php e($paginator->next('Next >>', null, null, array('class' => 'disabled'))); ?> 
     9        </span> 
     10        <br style="clear:both;" /> 
     11        </div> 
    3412 
     13<div id="post-admin"> 
     14         
     15        <div class="action-buttons"> 
     16                <?php e($html->link('Add New Menu', '/admin/menus/add', array('class'=>'add')));?> 
     17        </div> 
     18         
     19        <table id="the-table"> 
     20                <caption>Menus on <?php e($sitename);?></caption> 
     21                <colgroup> 
     22                        <col id="id" /> 
     23                        <col id="name" /> 
     24                        <col id="url" /> 
     25                        <col id="section" /> 
     26                        <col id="parent" /> 
     27                        <col id="position" /> 
     28                        <col id="access" /> 
     29                        <col id="icon" /> 
     30                        <col id="actions" /> 
     31                </colgroup> 
     32                <thead> 
     33                        <tr> 
     34                                <th scope="col">Menu ID</th> 
     35                                <th scope="col">Menu Name</th> 
     36                                <th scope="col">Menu URL</th> 
     37                                <th scope="col">Menu Section</th> 
     38                                <th scope="col">Menu Parent</th> 
     39                                <th scope="col">Menu Position</th> 
     40                                <th scope="col">Menu Access Level</th> 
     41                                <th scope="col">Menu Icon</th> 
     42                                <th scope="col">Actions</th> 
     43                        </tr> 
     44                </thead> 
     45                <tbody> 
     46                        <?php $row = 0; ?> 
     47                        <?php foreach ($menus as $menu) : ?> 
     48                        <tr class="<?php ($row % 2 ? e('even') : e('odd'));?>" id="menu-<?php e($menu['Menu']['id']);?>"> 
     49                                <td><?php echo $menu['Menu']['id']; ?></td> 
     50                                <td><?php echo $menu['Menu']['name']; ?></td> 
     51                                <td><?php echo $menu['Menu']['url']; ?></td> 
     52                                <td><?php echo $html->link($menu['Section']['name'], array('controller'=> 'sections', 'action'=>'view', $menu['Section']['id'])); ?></td> 
     53                                <td><?php echo $menu['Menu']['parent_id']; ?></td> 
     54                                <td><?php echo $menu['Menu']['position']; ?></td> 
     55                                <td><?php echo $menu['Menu']['access_level']; ?></td> 
     56                                <td><?php echo $menu['Menu']['icon']; ?></td> 
     57                                <td> 
     58                                        <ul> 
     59                                                <li><?php e($html->link('Edit', '/admin/menus/edit/' . $menu['Menu']['id'], array('class'=>'adminbutton edit')));?></li> 
     60                                                <li><?php e($html->link('Delete', '/admin/menus/delete/' . $menu['Menu']['id'], array('class'=>'adminbutton delete', 'rel'=> $menu['Menu']['id']),'Are you sure you wish to delete menu "' . $menu['Menu']['name'] . '"'));?></li> 
     61                                        </ul> 
     62                                </td> 
     63                        </tr> 
     64                        <?php $row++; ?> 
     65                        <?php endforeach; ?> 
     66                </tbody> 
     67        </table> 
    3568</div> 
    36 <div class="paging"> 
    37 <?php echo $paginator->prev('<< previous', array(), null, array('class'=>'disabled'));?> 
    38 | 
    39 <?php echo $paginator->next('next >>', array(), null, array('class'=>'disabled'));?> 
    40 </div> 
    41 <div class="actions"> 
    42         <ul> 
    43                 <li><?php echo $html->link('New Menu', array('action'=>'add')); ?></li> 
    44         </ul> 
    45 </div> 
  • trunk/views/videos/admin_add.ctp

    r2 r6  
    1 <div id="image"> 
    2 <h2>Video Upload</h2> 
     1<?php e($this->renderElement('tinymce'));?> 
     2<?php e($javascript->link('calendar'));?> 
     3 
     4<div id="post"> 
     5<h2>Post Video</h2> 
    36<?php e($form->create('Video', array('enctype'=>'multipart/form-data')));?> 
    4         <fieldset id="image-add"> 
    5                 <legend>Upload Video</legend> 
    6         <?php e($form->file('filename', array('class'=>'multi accept-jpg|gif|png')));?> 
    7         <?php e($form->input('copyright_owner'));?> 
    8         <?php e($form->input('copyright_id', array('options' => $copyright_type)));?> 
    9         <?php e($form->submit('Upload'));?> 
     7        <fieldset id="post-content"> 
     8                <legend>Video File</legend> 
     9                <?php e($form->file('filename'));?> 
     10        </fieldset> 
     11        <fieldset id="post-info"> 
     12                <legend>Video Information</legend> 
     13                <?php e($form->input('video_location'));?> 
     14                <?php e($form->input('video_date', array('type'=>'text','class'=>'calendarSelectDate')));?> 
     15                <?php e($form->input('video_notes'));?> 
     16        </fieldset> 
     17        <fieldset> 
     18                <legend>Meta Information</legend> 
     19                <?php e($form->input('subject_id', array('options'=>$subject_type)));?> 
     20                <?php e($form->input('copyright_owner'));?> 
     21                <?php e($form->input('copyright_id', array('options' => $copyright_type)));?> 
     22        </fieldset> 
     23                <?php e($form->submit('Upload'));?> 
    1024        </fieldset> 
    1125<?php e($form->end());?> 
  • trunk/views/videos/admin_index.ctp

    r2 r6  
    1 <div class="videos"> 
    2 <h2>List Videos</h2> 
     1<?php e($javascript->codeBlock('$(document).ready(function(){$("#the-table").tableSorter();});'));?> 
     2<div id="post-admin"> 
     3         
     4        <div class="action-buttons"> 
     5                <?php e($html->link('Upload Video', '/admin/videos/add', array('class'=>'add')));?> 
     6        </div> 
     7         
     8        <table id="the-table"> 
     9                <caption>Videos on <?php e($sitename);?></caption> 
     10                <colgroup> 
     11                        <col id="id" /> 
     12                        <col id="thumbnail" /> 
     13                        <col id="length" /> 
     14                        <col id="details" /> 
     15                        <col id="uploaded" /> 
     16                        <col id="published" 
     17                        <col id="actions" /> 
     18                </colgroup> 
     19                <thead> 
     20                        <tr> 
     21                                <th scope="col">Video ID</th> 
     22                                <th scope="col">Thumbnail</th> 
     23                                <th scope="col">Length</th> 
     24                                <th scope="col">Details</th> 
     25                                <th scope="col">Date Uploaded</th> 
     26                                <th scope="col">Published?</th> 
     27                                <th scope="col">Actions</th> 
     28                        </tr> 
     29                </thead> 
     30                <tbody> 
     31                        <?php $row = 0; ?> 
     32                        <?php foreach ($videos as $video) : ?> 
     33                        <tr class="<?php ($row % 2 ? e('even') : e('odd'));?>" id="post-<?php e($video['Video']['id']);?>"> 
     34                                <td><?php e($video['Video']['id']);?></td> 
     35                                <td><?php e($html->link('thumbnail', '/videos/view/' . $video['Video']['id']));?></td> 
     36                                <td><?php e($video['Video']['filesize']);?></td> 
     37                                <td><?php e($video['Video']['copyright_owner']);?></td> 
     38                                <td><?php e($video['Video']['created']);?></td> 
     39                                <td><?php ($video['Video']['published'] == 0 ? e('No') : e('Yes'));?></td> 
     40                                <td> 
     41                                        <ul> 
     42                                                <li><?php e($html->link('Edit', '/admin/videos/edit/' . $video['Video']['id'], array('class'=>'adminbutton edit')));?></li> 
     43                                                <li><?php e($html->link('Delete', '/admin/videos/delete/' . $video['Video']['id'], array('class'=>'adminbutton delete', 'rel'=> $video['Video']['id']),'Are you sure you wish to delete video "' . $video['Video']['id'] . '"'));?></li> 
     44                                        </ul> 
     45                                        <?php if($video['Video']['published'] != 1) {?> 
     46                                                <?php e($form->create('Video', array('action'=>'edit')));?> 
     47                                                <?php e($form->input('id', array('value'=>$video['Video']['id'])));?> 
     48                                                <?php e($form->input('published', array('value'=>1, 'type'=>'hidden')));?> 
     49                                                <?php e($form->submit('Publish', array('class'=>'adminbutton')));?> 
     50                                                <?php e($form->end());?> 
     51                                        <?php } ?> 
     52                                </td> 
     53                        </tr> 
     54                        <?php $row++; ?> 
     55                        <?php endforeach; ?> 
     56                </tbody> 
     57        </table> 
     58</div> 
    359 
    4 <table cellpadding="0" cellspacing="0"> 
    5         <tr> 
    6                 <th><?php echo $paginator->sort('id');?></th> 
    7                 <th><?php echo $paginator->sort('filename');?></th> 
    8                 <th><?php echo $paginator->sort('mimetype');?></th> 
    9                 <th><?php echo $paginator->sort('filesize');?></th> 
    10                 <th><?php echo $paginator->sort('copyright_owner');?></th> 
    11                 <th><?php echo $paginator->sort('copyright_id');?></th> 
    12                 <th>Actions</th> 
    13         </tr> 
    14 <?php foreach ($videos as $video): ?> 
    15         <tr> 
    16                 <td><?php echo $video['Video']['id']; ?></td> 
    17                 <td><?php echo $video['Video']['filename']; ?></td> 
    18                 <td><?php echo $video['Video']['mimetype']; ?></td> 
    19                 <td><?php echo $video['Video']['filesize']; ?></td> 
    20                 <td><?php echo $video['Video']['copyright_owner']; ?></td> 
    21                 <td><?php echo $html->link($video['Copyright']['name'], array('controller'=> 'copyrights', 'action'=>'view', $video['Copyright']['id'])); ?></td> 
    22                 <td class="actions"> 
    23                         <?php echo $html->link('View', array('action'=>'view', $video['Video']['id'])); ?> 
    24                         <?php echo $html->link('Edit', array('action'=>'edit', $video['Video']['id'])); ?> 
    25                         <?php echo $html->link('Delete', array('action'=>'delete', $video['Video']['id']), null, 'Are you sure you want to delete #' . $video['Video']['id']); ?> 
    26                 </td> 
    27         </tr> 
    28 <?php endforeach; ?> 
    29 </table> 
    30  
     60<div id="paginate"> 
     61        <span class="previous"> 
     62                <?php e($paginator->prev('<< Previous', null, null, array('class' => 'disabled'))); ?> 
     63        </span> 
     64        <span class="next"> 
     65                <?php e($paginator->next('Next >>', null, null, array('class' => 'disabled'))); ?> 
     66        </span> 
     67        <br style="clear" /> 
    3168</div> 
    32 <div class="paging"> 
    33 <?php echo $paginator->prev('<< previous', array(), null, array('class'=>'disabled'));?> 
    34 | 
    35 <?php echo $paginator->next('next >>', array(), null, array('class'=>'disabled'));?> 
    36 </div> 
    37 <div class="actions"> 
    38         <ul> 
    39                 <li><?php echo $html->link('New Video', array('action'=>'add')); ?></li> 
    40         </ul> 
    41 </div> 
  • trunk/webroot/css/shades.css

    r3 r6  
    240240/* Tables */ 
    241241table {border-collapse:collapse;width:99%; border:1px solid #ccc;} 
    242 th, td {padding: 0.1em, 1em;} 
     242/*th, td {padding: 0.1em, 1em;}*/ 
    243243caption {font-size:1.2em;font-weight:bold;margin:1em 0;} 
    244244col{border-right:1px solid #ccc;} 
     
    518518        /*background:#02f;*/     
    519519} 
     520 
     521/* User bar */ 
     522.userbar {background:#000; border-bottom:1px solid #fff;margin:0} 
     523.userbar ul {list-style:none} 
     524.userbar ul li {float:left; margin-right:15px;padding:0;}