add show button only appears for admin users
This commit is contained in:
parent
718a039bcc
commit
ac86fc50e8
3 changed files with 8 additions and 26 deletions
|
@ -95,6 +95,10 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$this->view->repeats = $formRepeats;
|
||||
$this->view->who = $formWho;
|
||||
$this->view->style = $formStyle;
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$user = new User($userInfo->id);
|
||||
$this->view->isAdmin = $user->isAdmin();
|
||||
}
|
||||
|
||||
public function eventFeedAction()
|
||||
|
|
|
@ -1,27 +1,5 @@
|
|||
<form id="add-show-form" method="post" action="" style="display:none;">
|
||||
<div id="schedule-add-show" class="tabs ui-widget ui-widget-content block-shadow alpha-block padded">
|
||||
<div class="button-bar">
|
||||
<button id="add-show-submit" class="right-floated">Add this show</button>
|
||||
<button id="add-show-close" class="right-floated">Close</button>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div id="schedule-show-what">
|
||||
<?php echo $this->what ?>
|
||||
</div>
|
||||
<h3 class="collapsible-header"><span class="arrow-icon"></span>When</h3>
|
||||
<div id="schedule-show-when" class="collapsible-content">
|
||||
<?php echo $this->when ?>
|
||||
<?php echo $this->repeats ?>
|
||||
</div>
|
||||
<h3 class="collapsible-header"><span class="arrow-icon"></span>Who</h3>
|
||||
<div id="schedule-show-who" class="collapsible-content">
|
||||
<?php echo $this->who ?>
|
||||
</div>
|
||||
<h3 class="collapsible-header"><span class="arrow-icon"></span>Style</h3>
|
||||
<div id="schedule-show-style" class="collapsible-content">
|
||||
<?php echo $this->style ?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<?php if($this->isAdmin) : ?>
|
||||
<?php echo $this->render('schedule/add-show-form.phtml') ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div id='schedule_calendar' class="ui-widget-content block-shadow padded omega-block"></div>
|
||||
|
|
|
@ -53,7 +53,7 @@ function viewDisplay( view ) {
|
|||
|
||||
}
|
||||
|
||||
if($('.fc-header-left tbody td').length === 5) {
|
||||
if($("#add-show-form").length == 1 && $('.fc-header-left tbody td').length === 5) {
|
||||
$('.fc-header-left tbody tr:first')
|
||||
.append('<td><span class="fc-header-space"></span></td>')
|
||||
.append('<td><a href="#" class="add-button"><span class="add-icon"></span>Show</a></td>')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue