Minor template tweaks
Minor template tweaks
Just finished with upgrading to latest Polls and would like to share some template improvements with you.
1. In poll_charts.php a minor change is required. This piece of code:
Should be changed to this:
Otherwise is shows empty bordered block if end message is empty
2. In poll editing form category dropdown shows even when only one category exists. Would be much better to change this code:
To this:
3. Allowed poll types dropdown has the same behavior as category one. Also would be much better in terms of usability to replace it with hidden input similar to the above.
4. In default poll template there's a small typo: "sharing-accordin". Should be "sharing-accordion"
5. Also would be great to have name and email fields for guests on poll form similar to CA question form. I've added them in my template override, so autoregister plugin could create a user on new poll.
6. In admin Permissions tab COM_COMMUNITYPOLLS_JACTION_EDIT_OWN_STATE and COM_COMMUNITYPOLLS_JACTION_DELETE_OWN are missing along with their descriptions. I guess you already know that.
1. In poll_charts.php a minor change is required. This piece of code:
<div id="poll-end-message" class="panel panel-default">
<div class="panel-body">
<?php if(!$this->item->eligible):?>
<?php echo CJFunctions::process_html(
$this->item->end_message,
$this->params->get('default_editor') == 'bbcode',
$this->params->get('process_content_plugins', false) == 1);?>
<?php endif;?>
</div>
</div>
Should be changed to this:
<?php if(!$this->item->eligible && !empty($this->item->end_message)):?>
<div id="poll-end-message" class="panel panel-default">
<div class="panel-body">
<?php echo CJFunctions::process_html(
$this->item->end_message,
$this->params->get('default_editor') == 'bbcode',
$this->params->get('process_content_plugins', false) == 1);?>
</div>
</div>
<?php endif;?>
Otherwise is shows empty bordered block if end message is empty
2. In poll editing form category dropdown shows even when only one category exists. Would be much better to change this code:
<label><?php echo JText::_('LBL_CATEGORY');?>:</label>
<select name="poll_category" class="required">
<option value=""><?php echo JText::_('OPTION_SELECT_CATEGORY');?></option>
<?php foreach($this->categories as $id=>$title):?>
<option value="<?php echo $id;?>" <?php echo ($this->poll->catid == $id)?'selected="selected"':''?>>
<?php echo $this->escape($title);?>
</option>
<?php endforeach;?>
</select>
To this:
<?php if (count($this->categories) > 1) :?>
<label><?php echo JText::_('LBL_CATEGORY');?>:</label>
<select name="poll_category" class="required">
<option value=""><?php echo JText::_('OPTION_SELECT_CATEGORY');?></option>
<?php foreach($this->categories as $id=>$title):?>
<option value="<?php echo $id;?>" <?php echo ($this->poll->catid == $id)?'selected="selected"':''?>>
<?php echo $this->escape($title);?>
</option>
<?php endforeach;?>
</select>
<?php else :?>
<input type="hidden" name="poll_category" value="<?php echo key($this->categories); ?>" />
<?php endif;?>
3. Allowed poll types dropdown has the same behavior as category one. Also would be much better in terms of usability to replace it with hidden input similar to the above.
4. In default poll template there's a small typo: "sharing-accordin". Should be "sharing-accordion"
5. Also would be great to have name and email fields for guests on poll form similar to CA question form. I've added them in my template override, so autoregister plugin could create a user on new poll.
6. In admin Permissions tab COM_COMMUNITYPOLLS_JACTION_EDIT_OWN_STATE and COM_COMMUNITYPOLLS_JACTION_DELETE_OWN are missing along with their descriptions. I guess you already know that.
Access to viewing replies is restricted.
Showing 2 of 2 replies
You do not have permissions for replying to this topic.