Skip to content

Commit

Permalink
Fixed issue #11103: Design: Blacklist breaks gui consistancy
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed May 11, 2016
1 parent 057e7e5 commit 959d32e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 18 deletions.
49 changes: 31 additions & 18 deletions application/views/admin/participants/blacklist_view.php
Expand Up @@ -11,51 +11,64 @@
<?php
if (Permission::model()->hasGlobalPermission('superadmin','read'))
{
$attribute = array('class' => 'col-md-6 col-md-offset-3');
$attribute = array('class' => 'col-md-6 col-md-offset-1 form-horizontal');
echo CHtml::beginForm($this->createUrl('/admin/participants/sa/storeBlacklistValues'), 'post', $attribute);
$options = array('Y' => gT('Yes','unescaped'), 'N' => gT('No','unescaped'));
?>
<div class="form-group">
<label for='blacklistallsurveys' id='blacklistallsurveys'>
<label class='control-label col-sm-8' for='blacklistallsurveys' id='blacklistallsurveys'>
<?php eT('Blacklist all current surveys for participant once the global field is set:'); ?>
</label>
<?php echo CHtml::dropDownList('blacklistallsurveys', $blacklistallsurveys, $options, array('class' => 'form-control' )); ?>
<div class='col-sm-3'>
<?php echo CHtml::dropDownList('blacklistallsurveys', $blacklistallsurveys, $options, array('class' => 'form-control' )); ?>
</div>
</div>
<div class="form-group">
<label for='blacklistnewsurveys' id='blacklistnewsurveys'>
<label class='control-label col-sm-8' for='blacklistnewsurveys' id='blacklistnewsurveys'>
<?php eT('Blacklist participant for any new added survey once the global field is set:'); ?>
</label>
<?php echo CHtml::dropDownList('blacklistnewsurveys', $blacklistnewsurveys, $options, array('class' => 'form-control' ) ); ?>
<div class='col-sm-3'>
<?php echo CHtml::dropDownList('blacklistnewsurveys', $blacklistnewsurveys, $options, array('class' => 'form-control' ) ); ?>
</div>
</div>
<div class="form-group">
<label for='blockaddingtosurveys' id='blockaddingtosurveys'>
<label class='control-label col-sm-8' for='blockaddingtosurveys' id='blockaddingtosurveys'>
<?php eT('Allow blacklisted participants to be added to a survey:'); ?>
</label>
<?php echo CHtml::dropDownList('blockaddingtosurveys', $blockaddingtosurveys, $options, array('class' => 'form-control' ) ); ?>
<div class='col-sm-3'>
<?php echo CHtml::dropDownList('blockaddingtosurveys', $blockaddingtosurveys, $options, array('class' => 'form-control' ) ); ?>
</div>
</div>
<div class="form-group">
<label for='hideblacklisted' id='hideblacklisted'>
<label class='control-label col-sm-8' for='hideblacklisted' id='hideblacklisted'>
<?php eT('Hide blacklisted participants:'); ?>
</label>
<?php echo CHtml::dropDownList('hideblacklisted', $hideblacklisted, $options, array('class' => 'form-control' ) ); ?>
<div class='col-sm-3'>
<?php echo CHtml::dropDownList('hideblacklisted', $hideblacklisted, $options, array('class' => 'form-control' ) ); ?>
</div>
</div>
<div class="form-group">
<label for='deleteblacklisted' id='deleteblacklisted'>
<label class='control-label col-sm-8' for='deleteblacklisted' id='deleteblacklisted'>
<?php eT('Delete globally blacklisted participant from the database:'); ?>
</label>
<?php echo CHtml::dropDownList('deleteblacklisted', $deleteblacklisted, $options, array('class' => 'form-control' ) ); ?>
<div class='col-sm-3'>
<?php echo CHtml::dropDownList('deleteblacklisted', $deleteblacklisted, $options, array('class' => 'form-control' ) ); ?>
</div>
</div>
<div class="form-group">
<label for='allowunblacklist' id='allowunblacklist'>
<label class='control-label col-sm-8' for='allowunblacklist' id='allowunblacklist'>
<?php eT('Allow participant to unblacklist himself/herself:'); ?>
</label>
<?php echo CHtml::dropDownList('allowunblacklist', $allowunblacklist, $options, array('class' => 'form-control' ) ); ?>
<div class='col-sm-3'>
<?php echo CHtml::dropDownList('allowunblacklist', $allowunblacklist, $options, array('class' => 'form-control' ) ); ?>
</div>
</div>
<div class="form-group">
<div class='col-sm-8'></div>
<div class='col-sm-3'>
<?php echo CHtml::submitButton('submit', array('value' => gT('Save'), 'class'=>'btn btn-default')); ?>
</div>
</div>
<p>
<?php
echo CHtml::submitButton('submit', array('value' => gT('Save'), 'class'=>'btn btn-default'));
?>
</p>
<?php
echo CHtml::endForm();
}
Expand Down
5 changes: 5 additions & 0 deletions scripts/admin/subquestions.js
Expand Up @@ -175,6 +175,7 @@ function deleteinput()
*/
function addinput()
{
console.log('addinput');
$that = $(this); // The "add" button
$currentRow = $that.parents('.row-container'); // The row containing the "add" button
$commonId = $currentRow.data('common-id'); // The common id of this row in the other languages
Expand All @@ -200,6 +201,8 @@ function addinput()
$datas += '&codes='+$codes;
$datas += '&languages='+$languages;

console.log('$datas', $datas);

// We get the HTML of the different rows to insert (one by language)
$.ajax({
type: "GET",
Expand All @@ -211,6 +214,7 @@ function addinput()
// eg: {"en":"{the html of the en row}", "fr":{the html of the fr row}}

$arrayOfHtml = JSON.parse(arrayofhtml); // Convert the JSON to a javascript object
console.log('$arrayOfHtml', $arrayOfHtml);

// We insert each row for each language
$.each($arrayOfHtml, function(lang, htmlRow){
Expand Down Expand Up @@ -749,6 +753,7 @@ function transferlabels()
*/
function quickaddlabels(scale_id, addOrReplace)
{
console.log('quickaddlabels');
var sID=$('input[name=sid]').val();
var gID=$('input[name=gid]').val();
var qID=$('input[name=qid]').val();
Expand Down

0 comments on commit 959d32e

Please sign in to comment.