To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Show
Ignore:
Timestamp:
04/30/10 18:00:13 (2 years ago)
Author:
johnnyoffline
Message:

moving more things over to events. this is getting hairy/\!

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • plugins/apostropheBlogPlugin/trunk/modules/aEventAdmin/templates/_form.php

    r1108 r1117  
    11<?php use_helper('I18N','jQuery') ?> 
    22 
    3 <?php echo jq_form_remote_tag(array('url' => url_for('a_blog_admin_update',$a_blog_post) , 'update' => 'a-admin-blog-post-form'), array('id'=>'a-admin-form', 'class' => 'blog')) ?> 
     3<?php echo jq_form_remote_tag(array('url' => url_for('a_event_admin_update',$a_event) , 'update' => 'a-admin-blog-post-form'), array('id'=>'a-admin-form', 'class' => 'blog')) ?> 
    44 
    55<?php if (!$form->getObject()->isNew()): ?><input type="hidden" name="sf_method" value="PUT" /><?php endif; ?> 
     
    88 
    99 
    10  
    1110<?php // Title and Slug are hidden and handled with inputs in the editSuccess ?> 
    1211<div class="post-title post-slug option"> 
    1312  <?php echo $form['title']->renderRow() ?> 
    14   <?php echo $form['slug']->renderRow() ?> 
     13  <?php echo $form['slug']->getWidget()->render('a_event[slug]', $a_event['slug']) ?> 
    1514  <?php echo $form['slug']->renderError() ?> 
    1615</div> 
    1716 
     17 
    1818<?php // Huge Publish Button and Publish Date ?> 
    1919<div class="published section"> 
    20         <a href="#" class="a-btn big a-publish-post <?php echo ($a_blog_post['status'] == 'published')? 'published':'' ?>" onclick="return false;" id="a-blog-publish-button"> 
     20        <a href="#" class="a-btn big a-publish-post <?php echo ($a_event['status'] == 'published')? 'published':'' ?>" onclick="return false;" id="a-blog-publish-button"> 
    2121          <span class="publish"><?php echo __('Publish', array(), 'apostrophe_blog') ?></span> 
    2222          <span class="unpublish"><?php echo __('Unpublish', array(), 'apostrophe_blog') ?></span> 
    2323        </a> 
    2424        <div id="a-blog-post-update" class="a-btn big a-publish-post">Saved</div> 
    25  
     25         
    2626        <div class="post-status option"> 
    2727          <?php echo $form['status']->renderRow() ?> 
     
    3131 
    3232        <div class="post-published-at option"> 
    33           <?php echo $form['published_at']->render() ?> 
     33          <?php echo $form['published_at']->render(array('onClose' => 'updateBlogMulti')) ?> 
    3434          <?php echo $form['published_at']->renderError() ?> 
    35  
    36           <?php 
    37           // Dan: 
    38           // All of a sudden we have save and cancel buttons now. 
    39           // So apparently when you click save it makes this change 
    40           // If you click cancel it some how restores it to 'Publish Now' – It doesn't just simply hide this options pane 
    41           ?> 
    42           <ul class="a-controls published_at"> 
    43             <li><a href="#" onclick="checkAndSetPublish('<?php echo $blog_post_url ?>'); return false;" class="a-btn a-save"><?php echo __('Save', array(), 'apostrophe_blog') ?></a></li> 
    44             <li><a href="#" onclick="checkAndSetPublish('<?php echo $blog_post_url ?>'); return false;" class="a-btn a-cancel"><?php echo __('Cancel', array(), 'apostrophe_blog') ?></a></li> 
    45           </ul> 
    4635        </div> 
    4736</div> 
     
    5645                <h4><?php echo __('Author', array(), 'apostrophe_blog') ?>: 
    5746                        <?php if ($sf_user->hasCredential('admin')): ?> 
    58                                 </h4> 
     47                                </h4>    
    5948                                <div class="author_id option"> 
    6049                                <?php echo $form['author_id']->render() ?> 
    61                                 <?php echo $form['author_id']->renderError() ?> 
     50                                <?php echo $form['author_id']->renderError() ?>                          
    6251                                </div> 
    6352                        <?php else: ?> 
    64                                 <span><?php echo $a_blog_post->Author ?></span></h4> 
     53                                <span><?php echo $a_event->Author ?></span></h4>         
    6554                        <?php endif ?> 
    6655 
     
    6958        <div class="post-editors"> 
    7059 
    71                 <?php if (!count($a_blog_post->Editors)): ?> 
     60                <?php if (!count($a_event->Editors)): ?> 
    7261                  <a href="#" onclick="return false;" class="post-editors-toggle a-sidebar-toggle"><?php echo __('allow others to edit this post', array(), 'apostrophe_blog') ?></a> 
    7362                <div class="post-editors-options option" id="editors-section"> 
    7463                <?php else: ?> 
    7564                        <hr/> 
    76                 <div class="post-editors-options option show-editors" id="editors-section"> 
     65                <div class="post-editors-options option show-editors" id="editors-section">                      
    7766                <?php endif ?> 
    7867 
     
    8069            <?php echo $form['editors_list']->render()?> 
    8170            <?php echo $form['editors_list']->renderError() ?> 
    82  
     71         
    8372          </div> 
    8473        </div> 
     
    111100          }); 
    112101        </script> 
    113         <?php include_component('aBlogAdmin','tagList', array('a_blog_post' => $form->getObject())) ?> 
     102        <?php include_component('aEventAdmin','tagList', array('a_event' => $form->getObject())) ?> 
    114103</div> 
    115104 
     
    132121<hr /> 
    133122<div class="comments section"> 
    134         <h4><a href="#" class="allow_comments_toggle <?php echo ($a_blog_post['allow_comments'])? 'enabled' : 'disabled' ?>"><span class="enabled" title="<?php echo __('Click to disable comments', array(), 'apostrophe_blog') ?>"><?php echo __('Comments are enabled', array(), 'apostrophe_blog') ?></span><span class="disabled" title="<?php echo __('Click to enable comments', array(), 'apostrophe_blog') ?>"><?php echo __('Comments are disabled', array(), 'apostrophe_blog') ?></span></a></h4> 
     123        <h4><a href="#" class="allow_comments_toggle <?php echo ($a_event['allow_comments'])? 'enabled' : 'disabled' ?>"><span class="enabled" title="<?php echo __('Click to disable comments', array(), 'apostrophe_blog') ?>"><?php echo __('Comments are enabled', array(), 'apostrophe_blog') ?></span><span class="disabled" title="<?php echo __('Click to enable comments', array(), 'apostrophe_blog') ?>"><?php echo __('Comments are disabled', array(), 'apostrophe_blog') ?></span></a></h4>  
    135124        <div class="allow_comments option"> 
    136125        <?php echo $form['allow_comments']->render() ?> 
    137126        <?php echo $form['allow_comments']->renderError() ?> 
    138127        </div> 
    139  
     128         
    140129</div> 
    141130<?php endif ?> 
    142131 
    143 <script type="text/javascript" charset="utf-8"> 
    144   function updateBlogMulti() 
    145   { 
    146     updateBlogForm('<?php echo url_for('a_blog_admin_update',$a_blog_post) ?>'); 
    147   } 
    148  
    149   $(document).ready(function(){ 
    150  
    151     $('#a-admin-form').change(function(event) { 
    152       updateBlog(event); 
    153     }); 
    154  
    155     checkAndSetPublish('<?php echo $a_blog_post->status  ?>','<?php echo url_for('a_blog_admin_update',$a_blog_post) ?>'); 
    156  
    157     $('.a-sidebar-toggle').click(function(){ 
    158       $(this).toggleClass('open').next().toggle(); 
    159     }) 
    160  
    161     aMultipleSelect('#categories-section', { 'choose-one': '<?php echo __('Choose Categories', array(), 'apostrophe_blog') ?>', 'add': '<?php echo __('+ New Category', array(), 'apostrophe_blog') ?>', 'onChange': updateBlogMulti}); 
    162     aMultipleSelect('#editors-section', { 'choose-one': '<?php echo __('Choose Editors', array(), 'apostrophe_blog') ?>','onChange': updateBlogMulti }); 
    163  
    164  }); 
    165 </script> 
     132<?php include_partial('formScripts', array('a_event' => $a_event, 'form' => $form)) ?>