| 22 | | <script type="text/javascript"> |
| 23 | | $(function () { |
| 24 | | $('#a-admin-form').change(function() { |
| 25 | | jQuery.ajax({ |
| 26 | | type:'POST', |
| 27 | | dataType:'html', |
| 28 | | data:jQuery(this).serialize(), |
| 29 | | success:function(data, textStatus){ |
| 30 | | jQuery('#a-admin-blog-post-form').html(data); |
| 31 | | }, |
| 32 | | url: '<?php echo url_for('@a_event_admin_update?slug='.$a_event['slug']) ?>' |
| 33 | | }); |
| 34 | | }); |
| | 19 | |
| | 20 | <?php // Huge Publish Button and Publish Date ?> |
| | 21 | <div class="published section"> |
| | 22 | <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"> |
| | 23 | <span class="publish"><?php echo __('Publish', array(), 'apostrophe_blog') ?></span> |
| | 24 | <span class="unpublish"><?php echo __('Unpublish', array(), 'apostrophe_blog') ?></span> |
| | 25 | </a> |
| | 26 | <div id="a-blog-post-update" class="a-btn big a-publish-post">Saved</div> |
| | 27 | |
| | 28 | <div class="post-status option"> |
| | 29 | <?php echo $form['status']->renderRow() ?> |
| | 30 | </div> |
| | 31 | |
| | 32 | <?php echo __('Publish now or', array(), 'apostrophe_blog') ?> <a href="#" onclick="return false;" class="post-date-toggle a-sidebar-toggle"><?php echo __('set a date', array(), 'apostrophe_blog') ?></a> |
| | 33 | |
| | 34 | <div class="post-published-at option"> |
| | 35 | <?php echo $form['published_at']->render() ?> |
| | 36 | <?php echo $form['published_at']->renderError() ?> |
| | 37 | |
| | 38 | <?php |
| | 39 | // Dan: |
| | 40 | // All of a sudden we have save and cancel buttons now. |
| | 41 | // So apparently when you click save it makes this change |
| | 42 | // If you click cancel it some how restores it to 'Publish Now' â It doesn't just simply hide this options pane |
| | 43 | ?> |
| | 44 | <ul class="a-controls published_at"> |
| | 45 | <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> |
| | 46 | <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> |
| | 47 | </ul> |
| | 48 | </div> |
| | 49 | </div> |
| | 50 | |
| | 51 | |
| | 52 | |
| | 53 | <?php // Author & Editors Section ?> |
| | 54 | <hr /> |
| | 55 | <div class="author section"> |
| | 56 | |
| | 57 | <div class="post-author"> |
| | 58 | <h4><?php echo __('Author', array(), 'apostrophe_blog') ?>: |
| | 59 | <?php if ($sf_user->hasCredential('admin')): ?> |
| | 60 | </h4> |
| | 61 | <div class="author_id option"> |
| | 62 | <?php echo $form['author_id']->render() ?> |
| | 63 | <?php echo $form['author_id']->renderError() ?> |
| | 64 | </div> |
| | 65 | <?php else: ?> |
| | 66 | <span><?php echo $a_blog_post->Author ?></span></h4> |
| | 67 | <?php endif ?> |
| | 68 | |
| | 69 | </div> |
| | 70 | |
| | 71 | <div class="post-editors"> |
| | 72 | |
| | 73 | <?php if (!count($a_blog_post->Editors)): ?> |
| | 74 | <a href="#" onclick="return false;" class="post-editors-toggle a-sidebar-toggle"><?php echo __('allow others to edit this post', array(), 'apostrophe_blog') ?></a> |
| | 75 | <div class="post-editors-options option" id="editors-section"> |
| | 76 | <?php else: ?> |
| | 77 | <hr/> |
| | 78 | <div class="post-editors-options option show-editors" id="editors-section"> |
| | 79 | <?php endif ?> |
| | 80 | |
| | 81 | <h4><?php echo __('Editors', array(), 'apostrophe_blog') ?>: </h4> |
| | 82 | <?php echo $form['editors_list']->render()?> |
| | 83 | <?php echo $form['editors_list']->renderError() ?> |
| | 84 | |
| | 85 | </div> |
| | 86 | </div> |
| | 87 | </div> |
| | 88 | |
| | 89 | |
| | 90 | |
| | 91 | <?php // Blog Post Categories ?> |
| | 92 | <hr /> |
| | 93 | <div class="categories section" id="categories-section"> |
| | 94 | <h4><?php echo __('Categories', array(), 'apostrophe_blog') ?></h4> |
| | 95 | <?php echo $form['categories_list']->render() ?> |
| | 96 | <?php echo $form['categories_list']->renderError() ?> |
| | 97 | </div> |
| | 98 | |
| | 99 | |
| | 100 | |
| | 101 | <?php // Blog Post Tags ?> |
| | 102 | <hr /> |
| | 103 | <div class="tags section"> |
| | 104 | <h4><?php echo __('Tags', array(), 'apostrophe_blog') ?></h4> |
| | 105 | |
| | 106 | <?php echo $form['tags']->render() ?> |
| | 107 | <?php echo $form['tags']->renderError() ?> |
| | 108 | |
| | 109 | <script src='/sfDoctrineActAsTaggablePlugin/js/pkTagahead.js'></script> |
| | 110 | <script type="text/javascript" charset="utf-8"> |
| | 111 | $(function() { |
| | 112 | pkTagahead(<?php echo json_encode(url_for("taggableComplete/complete")) ?>); |
| | 113 | }); |
| | 114 | </script> |
| | 115 | <?php include_component('aBlogAdmin','tagList', array('a_blog_post' => $form->getObject())) ?> |
| | 116 | </div> |
| | 117 | |
| | 118 | |
| | 119 | |
| | 120 | <?php // Blog Post Templates ?> |
| | 121 | <?php if(isset($form['template'])): ?> |
| | 122 | <hr /> |
| | 123 | <div class="template section"> |
| | 124 | <h4><?php echo __('Template', array(), 'apostrophe_blog') ?></h4> |
| | 125 | |
| | 126 | <?php echo $form['template']->render() ?> |
| | 127 | <?php echo $form['template']->renderError() ?> |
| | 128 | </div> |
| | 129 | <?php endif ?> |
| | 130 | |
| | 131 | |
| | 132 | |
| | 133 | <?php if(isset($form['allow_comments'])): ?> |
| | 134 | <hr /> |
| | 135 | <div class="comments section"> |
| | 136 | <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> |
| | 137 | <div class="allow_comments option"> |
| | 138 | <?php echo $form['allow_comments']->render() ?> |
| | 139 | <?php echo $form['allow_comments']->renderError() ?> |
| | 140 | </div> |
| | 141 | |
| | 142 | </div> |
| | 143 | <?php endif ?> |
| | 144 | |
| | 145 | <script type="text/javascript" charset="utf-8"> |
| | 146 | function updateBlogMulti() |
| | 147 | { |
| | 148 | updateBlogForm('<?php echo url_for('a_blog_admin_update',$a_blog_post) ?>'); |
| | 149 | } |
| | 150 | |
| | 151 | $(document).ready(function(){ |
| | 152 | |
| | 153 | $('#a-admin-form').change(function(event) { |
| | 154 | updateBlog(event); |