From 353282c5b079c879af998149dcdb9e994edaec87 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 1 Sep 2020 16:48:57 -0400 Subject: [PATCH] Revert #18005 Fix buggy placement of icons --- CRM/Core/Controller.php | 4 +- CRM/Core/Smarty/plugins/block.crmButton.php | 2 +- ang/crmMailingAB/EditCtrl/report.html | 2 +- ang/crmUi.js | 2 +- css/civicrm.css | 73 ++++++++++++++----- js/crm.ajax.js | 2 +- .../CRM/Admin/Form/Preferences/Display.tpl | 4 +- templates/CRM/Admin/Page/APIExplorer.tpl | 4 +- .../Contact/Form/Search/Custom/FullText.tpl | 14 ++-- .../Event/Form/ParticipantFeeSelection.tpl | 2 +- templates/CRM/Event/Page/DashBoard.tpl | 2 +- templates/CRM/Report/Form/Actions.tpl | 2 +- templates/CRM/Tag/Page/Tag.tpl | 20 ++--- templates/CRM/common/formButtons.tpl | 6 +- 14 files changed, 91 insertions(+), 48 deletions(-) diff --git a/CRM/Core/Controller.php b/CRM/Core/Controller.php index 68c6531858..4a4254c255 100644 --- a/CRM/Core/Controller.php +++ b/CRM/Core/Controller.php @@ -568,8 +568,8 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { public function addWizardStyle(&$wizard) { $wizard['style'] = [ 'barClass' => '', - 'stepPrefixCurrent' => ' ', - 'stepPrefixPast' => ' ', + 'stepPrefixCurrent' => ' ', + 'stepPrefixPast' => ' ', 'stepPrefixFuture' => ' ', 'subStepPrefixCurrent' => '  ', 'subStepPrefixPast' => '  ', diff --git a/CRM/Core/Smarty/plugins/block.crmButton.php b/CRM/Core/Smarty/plugins/block.crmButton.php index 64543d5957..390a8e7303 100644 --- a/CRM/Core/Smarty/plugins/block.crmButton.php +++ b/CRM/Core/Smarty/plugins/block.crmButton.php @@ -47,7 +47,7 @@ function smarty_block_crmButton($params, $text, &$smarty) { if (strpos($icon, 'fa-') !== 0) { $icon = "fa-$icon"; } - $iconMarkup = " "; + $iconMarkup = "  "; } // All other params are treated as html attributes CRM_Utils_Array::remove($params, 'icon', 'p', 'q', 'a', 'f', 'h', 'fb', 'fe'); diff --git a/ang/crmMailingAB/EditCtrl/report.html b/ang/crmMailingAB/EditCtrl/report.html index 5e97ae964a..18380923c1 100644 --- a/ang/crmMailingAB/EditCtrl/report.html +++ b/ang/crmMailingAB/EditCtrl/report.html @@ -83,7 +83,7 @@ class="crm-hover-button action-item" ng-href="{{statUrl(am.mailing, statType, 'report')}}" title="{{ts('Reports for \'%1\'', {1: statType.title})}}" - crm-icon="fa-clipboard" + crm-icon="clipboard" > diff --git a/ang/crmUi.js b/ang/crmUi.js index 355939c2dc..c6ba58b146 100644 --- a/ang/crmUi.js +++ b/ang/crmUi.js @@ -908,7 +908,7 @@ }) // Example for Font Awesome: - // Example for jQuery UI (deprecated): + // Example for jQuery UI (deprecated): .directive('crmIcon', function() { return { restrict: 'EA', diff --git a/css/civicrm.css b/css/civicrm.css index 70e5a0ef01..a3264938b0 100644 --- a/css/civicrm.css +++ b/css/civicrm.css @@ -1835,6 +1835,8 @@ input.crm-form-entityref { .crm-container .crm-button input { background: none; + _background: #6C6C6C; + /* IE6 only */ border: medium none; color: #FFF; cursor: pointer; @@ -1849,12 +1851,6 @@ input.crm-form-entityref { margin-left: 20px; } -/* Reset WP backend min-height for buttons */ - -.wp-core-ui .crm-container .button { - min-height: 0; -} - .crm-container a.button, .crm-container a.button:link, .crm-container a.button:visited, @@ -1874,19 +1870,11 @@ input.crm-form-entityref { border: 1px solid #3e3e3e; } -.crm-container a.button, -.crm-container a.button:link, -.crm-container a.button:visited, .crm-container span.crm-button { display: block; - float: left; - overflow: hidden; - line-height: 135%; -} - -/* Preserving the important but not sure why */ -.crm-container span.crm-button { float: left !important; + overflow: hidden; + padding: 1px; } .crm-container button.crm-button { @@ -1904,12 +1892,22 @@ input.crm-form-entityref { .crm-container .crm-button input[type=button], .crm-container .crm-button input.crm-form-submit { - padding: 0; + padding: 3px 5px 2px; margin: 0; background: none; + _background: #6C6C6C; + /* IE6 only */ border: none; } +.crm-container a.button, +.crm-container a.button:link, +.crm-container a.button:visited { + display: block; + float: left; + line-height: 135%; +} + .crm-container .crm-button:hover, .crm-container .crm-button:focus, .crm-container input[type=submit]:hover, @@ -2048,6 +2046,31 @@ input.crm-form-entityref { margin-left: 3px; } +.crm-container .crm-button.crm-icon-button { + padding: 2px 2px 1px 4px; +} + +.crm-container .crm-button.crm-icon-button input { + padding-left: 18px; +} + +.crm-container .crm-button.button-crm-i { + padding: 2px 0 1px 5px; +} + +.crm-container .crm-button.button-crm-i input { + padding-left: 0; +} + +.crm-container .crm-button-icon { + background-image: url("../i/icons/jquery-ui-FFFFFF.png"); + height: 16px; + width: 16px; + display: block; + position: absolute; + pointer-events: none; +} + .crm-container .delete-icon { background-position: -176px -96px; } @@ -2094,6 +2117,22 @@ a.crm-i:hover { color: #86c661; } +.crm-i-button { + position: relative; +} + +.crm-i-button>.crm-i { + position: absolute; + pointer-events: none; + top: .4em; + left: .4em; +} + +.crm-container .crm-button.crm-i-button input[type="button"], +.crm-container .crm-button.crm-i-button input.crm-form-submit { + padding-left: 1.6em; +} + .crm-container a.helpicon { opacity: .8; } diff --git a/js/crm.ajax.js b/js/crm.ajax.js index e65bd7b2a2..9a3c3f1ce5 100644 --- a/js/crm.ajax.js +++ b/js/crm.ajax.js @@ -517,7 +517,7 @@ added.push(identifier); } // display:none causes the form to not submit when pressing "enter" - $el.parents(buttonContainers).css({height: 0, padding: 0, margin: 0, overflow: 'hidden'}); + $el.parents(buttonContainers).css({height: 0, padding: 0, margin: 0, overflow: 'hidden'}).find('.crm-button-icon').hide(); }); $el.dialog('option', 'buttons', buttons); } diff --git a/templates/CRM/Admin/Form/Preferences/Display.tpl b/templates/CRM/Admin/Form/Preferences/Display.tpl index 44ff0ba7aa..049a5ebf99 100644 --- a/templates/CRM/Admin/Form/Preferences/Display.tpl +++ b/templates/CRM/Admin/Form/Preferences/Display.tpl @@ -161,8 +161,8 @@ {$form.editor_id.html}   - - + + {$form.ckeditor_config.html} diff --git a/templates/CRM/Admin/Page/APIExplorer.tpl b/templates/CRM/Admin/Page/APIExplorer.tpl index 9c127fcb6f..1e1b8eb497 100644 --- a/templates/CRM/Admin/Page/APIExplorer.tpl +++ b/templates/CRM/Admin/Page/APIExplorer.tpl @@ -285,8 +285,8 @@
- - + +
diff --git a/templates/CRM/Contact/Form/Search/Custom/FullText.tpl b/templates/CRM/Contact/Form/Search/Custom/FullText.tpl index 51a3c91956..6a7d8b516a 100644 --- a/templates/CRM/Contact/Form/Search/Custom/FullText.tpl +++ b/templates/CRM/Contact/Form/Search/Custom/FullText.tpl @@ -62,7 +62,7 @@ {if !$table and $summary.addShowAllLink.Contact}
{ts}View all results for contacts{/ts} + title="{ts}View all results for contacts{/ts}"> {ts}View all results for contacts{/ts}
{/if} {* note we using location="below" because we don't want to use rows per page for now. And therefore don't put location="bottom" for now. *} {if $table}{include file="CRM/common/pager.tpl" location="below"}{/if} @@ -125,7 +125,7 @@ {if !$table and $summary.addShowAllLink.Activity}
{ts}View all results for activities{/ts} + title="{ts}View all results for activities{/ts}"> {ts}View all results for activities{/ts}
{/if} {if $table}{include file="CRM/common/pager.tpl" location="below"}{/if} @@ -182,7 +182,7 @@ {if !$table and $summary.addShowAllLink.Case}
{ts}View all results for cases{/ts} + title="{ts}View all results for cases{/ts}"> {ts}View all results for cases{/ts}
{/if} {if $table}{include file="CRM/common/pager.tpl" location="below"}{/if} @@ -236,7 +236,7 @@ {if !$table and $summary.addShowAllLink.Contribution}
{ts}View all results for contributions{/ts} + title="{ts}View all results for contributions{/ts}"> {ts}View all results for contributions{/ts}
{/if} {if $table}{include file="CRM/common/pager.tpl" location="below"}{/if} @@ -293,7 +293,7 @@ {if !$table and $summary.addShowAllLink.Participant}
{ts}View all results for participants{/ts} + title="{ts}View all results for participants{/ts}"> {ts}View all results for participants{/ts}
{/if} {if $table}{include file="CRM/common/pager.tpl" location="below"}{/if} {* END Actions/Results section *} @@ -349,7 +349,7 @@ {if !$table and $summary.addShowAllLink.Membership}
{ts}View all results for memberships{/ts} + title="{ts}View all results for memberships{/ts}"> {ts}View all results for memberships{/ts}
{/if} {if $table}{include file="CRM/common/pager.tpl" location="below"}{/if} @@ -395,7 +395,7 @@ {if !$table and $summary.addShowAllLink.File}
{ts}View all results for files{/ts} + title="{ts}View all results for files{/ts}"> {ts}View all results for files{/ts}
{/if} {if $table}{include file="CRM/common/pager.tpl" location="below"}{/if} {* END Actions/Results section *} diff --git a/templates/CRM/Event/Form/ParticipantFeeSelection.tpl b/templates/CRM/Event/Form/ParticipantFeeSelection.tpl index f9d3364dae..02246d54cb 100644 --- a/templates/CRM/Event/Form/ParticipantFeeSelection.tpl +++ b/templates/CRM/Event/Form/ParticipantFeeSelection.tpl @@ -87,7 +87,7 @@ CRM.$(function($) {
{include file="CRM/common/formButtons.tpl" location="bottom"}
{if !$email}
- {ts}You will not be able to send an automatic email receipt for this payment because there is no email address recorded for this contact. If you want a receipt to be sent when this payment is recorded, click Cancel and then click Edit from the Summary tab to add an email address before recording the payment.{/ts} +  {ts}You will not be able to send an automatic email receipt for this payment because there is no email address recorded for this contact. If you want a receipt to be sent when this payment is recorded, click Cancel and then click Edit from the Summary tab to add an email address before recording the payment.{/ts}
{/if} diff --git a/templates/CRM/Event/Page/DashBoard.tpl b/templates/CRM/Event/Page/DashBoard.tpl index d01250ee68..3ca364f093 100644 --- a/templates/CRM/Event/Page/DashBoard.tpl +++ b/templates/CRM/Event/Page/DashBoard.tpl @@ -87,7 +87,7 @@ {if $actionColumn} {include file="CRM/common/tasks.tpl" location="botton"} {if $instanceUrl} - + {/if}
{if $values.isMap} - {ts}Map{/ts} +  {ts}Map{/ts}  |  {/if} {if $values.configure} diff --git a/templates/CRM/Report/Form/Actions.tpl b/templates/CRM/Report/Form/Actions.tpl index 34690c1d91..9aee8f6695 100644 --- a/templates/CRM/Report/Form/Actions.tpl +++ b/templates/CRM/Report/Form/Actions.tpl @@ -20,7 +20,7 @@
   {ts}Existing report(s) from this template{/ts}   {ts}Existing report(s) from this template{/ts}
diff --git a/templates/CRM/Tag/Page/Tag.tpl b/templates/CRM/Tag/Page/Tag.tpl index e0ded1e4bc..e59f24246a 100644 --- a/templates/CRM/Tag/Page/Tag.tpl +++ b/templates/CRM/Tag/Page/Tag.tpl @@ -463,16 +463,16 @@ <% {rdelim} %> @@ -519,21 +519,21 @@
<% if(!tagset) {ldelim} %> " class="button crm-popup" title="{ts}Create new tag under this one{/ts}"> - {ts}Add Child{/ts} +   {ts}Add Child{/ts} <% {rdelim} %> " class="button crm-popup" title="{ts}Duplicate this tag{/ts}"> - {ts}Clone Tag{/ts} +   {ts}Clone Tag{/ts} <% if(!data.is_reserved || adminReserved) {ldelim} %> <% if(tagsetCount) {ldelim} %> - {ts}Move Tag{/ts} +   {ts}Move Tag{/ts} <% {rdelim} %> <% if(!hasChildren) {ldelim} %> " class="button crm-popup small-popup"> - {ts}Delete{/ts} +   {ts}Delete{/ts} <% {rdelim} %> <% {rdelim} %> @@ -551,16 +551,16 @@
<% if(!reserved || adminReserved) {ldelim} %> " class="button crm-popup small-popup" title="{ts}Combine tags into one{/ts}"> - {ts}Merge Tags{/ts} +   {ts}Merge Tags{/ts} <% if(tagsetCount) {ldelim} %> - {ts}Move Tags{/ts} +   {ts}Move Tags{/ts} <% {rdelim} %> <% if(!hasChildren) {ldelim} %> " class="button crm-popup small-popup"> - {ts}Delete All{/ts} +   {ts}Delete All{/ts} <% {rdelim} %> <% {rdelim} %> diff --git a/templates/CRM/common/formButtons.tpl b/templates/CRM/common/formButtons.tpl index 7af01e646b..92b41f4dff 100644 --- a/templates/CRM/common/formButtons.tpl +++ b/templates/CRM/common/formButtons.tpl @@ -41,10 +41,14 @@ {crmGetAttribute html=$html attr='crm-icon' assign='icon'} {capture assign=iconPrefix}{$icon|truncate:3:"":true}{/capture} {if $icon && $iconPrefix eq 'fa-'} + {assign var='buttonClass' value=' crm-i-button'} {capture assign=iconDisp}{/capture} + {elseif $icon} + {assign var='buttonClass' value=' crm-icon-button'} + {capture assign=iconDisp} {/capture} {/if} {crmGetAttribute html=$html attr='disabled' assign='disabled'} - + {$iconDisp} {$html} -- 2.25.1