Skip to content

Commit

Permalink
Fixed issue #10282: Make proper spacing between icons
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Feb 3, 2016
1 parent 6b6eaff commit 00fc29f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 8 deletions.
29 changes: 21 additions & 8 deletions application/controllers/admin/tokens.php
Expand Up @@ -459,49 +459,62 @@ function getTokens_json($iSurveyId, $search = null)

$action="";
$action .= "<div class='inputbuttons'>"; // so we can hide this when edit is clicked

// Check is we have an answer
if (in_array($token['token'], $answeredTokens) && $bReadPermission) {
// @@TODO change link
$url = $this->getController()->createUrl("admin/responses/sa/browse/surveyid/{$iSurveyId}", array('token'=>$token['token']));
$title = gT("View response details");
$action .= CHtml::link(
'<span class="glyphicon glyphicon-list-alt text-success" title="'.$title.'"></span>',
'<span class="inputbuttons-square glyphicon glyphicon-list-alt text-success" title="'.$title.'"></span>',
$url,
array('class'=>'imagelink'));
} else {
$action .= '<div style="width: 20px; height: 16px; float: left;"></div>';
}

// Check if the token can be taken
if ($token['token'] != "" && ($token['completed'] == "N" || $token['completed'] == "" || $aSurveyInfo['alloweditaftercompletion']=="Y") && $bCreatePermission) {
$action .= viewHelper::getIconLink('icon-do text-success', "survey/index/sid/{$iSurveyId}/token/{$token['token']}/lang/{$token['language']}/newtest/Y", gT("Do survey"), '_blank');
$action .= viewHelper::getIconLink('inputbuttons-square icon-do text-success', "survey/index/sid/{$iSurveyId}/token/{$token['token']}/lang/{$token['language']}/newtest/Y", gT("Do survey"), '_blank');
} else {
$action .= '<div style="width: 20px; height: 16px; float: left;"></div>';
}

// Add delete icon
if($bTokenDeletePermission){
$attribs = array('onclick' => 'if (confirm("' . gT("Are you sure you want to delete this entry?") . ' (' . $token['tid'] . ')")) {$("#displaytokens").delRowData(' . $token['tid'] . ');$.post(delUrl,{tid:' . $token['tid'] . '});}');
$action .= viewHelper::getIconLink('glyphicon glyphicon-trash text-warning', null, gT("Delete token entry"), null, 'imagelink btnDelete', $attribs);
$action .= viewHelper::getIconLink('inputbuttons-square glyphicon glyphicon-trash text-warning', null, gT("Delete token entry"), null, 'imagelink btnDelete', $attribs);
}

// Add email button
if (strtolower($token['emailstatus']) == 'ok' && $token['email'] && $bTokenUpdatePermission) {
if ($token['completed'] == 'N' && $token['usesleft'] > 0) {
if ($token['sent'] == 'N') {
$action .= viewHelper::getIconLink('icon-invite text-success', "admin/tokens/sa/email/surveyid/{$iSurveyId}/tokenids/" . $token['tid'], gT("Send invitation email to this person (if they have not yet been sent an invitation email)"), "_blank");
$action .= viewHelper::getIconLink('inputbuttons-square icon-invite text-success', "admin/tokens/sa/email/surveyid/{$iSurveyId}/tokenids/" . $token['tid'], gT("Send invitation email to this person (if they have not yet been sent an invitation email)"), "_blank");
} else {
$action .= viewHelper::getIconLink('icon-remind text-success', "admin/tokens/sa/email/action/remind/surveyid/{$iSurveyId}/tokenids/" . $token['tid'], gT("Send reminder email to this person (if they have already received the invitation email)"), "_blank");
$action .= viewHelper::getIconLink('inputbuttons-square icon-remind text-success', "admin/tokens/sa/email/action/remind/surveyid/{$iSurveyId}/tokenids/" . $token['tid'], gT("Send reminder email to this person (if they have already received the invitation email)"), "_blank");
}
} else {
$action .= '<div style="width: 20px; height: 16px; float: left;"></div>';
}
} else {
$action .= '<div style="width: 20px; height: 16px; float: left;"></div>';
}
if($bTokenUpdatePermission)
$action .= viewHelper::getIconLink('glyphicon glyphicon-pencil text-success', null, gT("Edit token entry"), null, 'imagelink token_edit');

// Add edit button
if($bTokenUpdatePermission) {
$action .= viewHelper::getIconLink('inputbuttons-square glyphicon glyphicon-pencil text-success', null, gT("Edit token entry"), null, 'imagelink token_edit');
}

// Add view button?
if(!empty($token['participant_id']) && $token['participant_id'] != "" && $bGlobalPanelReadPermission) {
$action .= viewHelper::getIconLink('icon-cpdb text-success', null, gT("View this person in the central participants database"), null, 'imagelink cpdb',array('onclick'=>"sendPost('".$this->getController()->createUrl('admin/participants/sa/displayParticipants')."','',['searchcondition'],['participant_id||equal||{$token['participant_id']}']);"));
$action .= viewHelper::getIconLink('inputbuttons-square icon-cpdb text-success', null, gT("View this person in the central participants database"), null, 'imagelink cpdb',array('onclick'=>"sendPost('".$this->getController()->createUrl('admin/participants/sa/displayParticipants')."','',['searchcondition'],['participant_id||equal||{$token['participant_id']}']);"));
} else {
$action .= '<div style="width: 20px; height: 16px; float: left;"></div>';
}

$action .= '</div>';

$aRowToAdd['cell'] = array($token['tid'],
$action,
htmlspecialchars($token['firstname'],ENT_QUOTES),
Expand Down
1 change: 1 addition & 0 deletions styles/Sea_Green/config.xml
Expand Up @@ -19,6 +19,7 @@
<filename>statistics.css</filename>
<filename>bootstrap-switch.min.css</filename>
<filename>jcarousel.responsive.css</filename>
<filename>lime-admin-misc.css</filename>
</css>
<js>
<filename>notify.js</filename>
Expand Down
13 changes: 13 additions & 0 deletions styles/Sea_Green/css/lime-admin-misc.css
@@ -0,0 +1,13 @@
/**
* OBS! NO COLOURS IN THIS FILE.
*/

.inputbuttons {
width: 100px;
}

.inputbuttons-square {
width: 20px;
height: 16px;
float: left;
}

0 comments on commit 00fc29f

Please sign in to comment.