From f62db3ac4636a74a46ee71d9390bc830227d1ebb Mon Sep 17 00:00:00 2001 From: Andrew Hunt Date: Tue, 13 Oct 2015 12:16:47 -0400 Subject: [PATCH] CRM-16415 Icons for standard save/cancel buttons ---------------------------------------- * CRM-16415: Implement Font Awesome icon font https://issues.civicrm.org/jira/browse/CRM-16415 --- CRM/Core/Form.php | 10 +++++----- css/civicrm.css | 1 + templates/CRM/Contact/Form/Merge.tpl | 8 ++++---- .../CRM/Event/Form/ManageEvent/ConfirmRepeatMode.tpl | 2 +- templates/CRM/PCP/Page/PCPInfo.tpl | 2 +- templates/CRM/UF/Page/Field.tpl | 4 ++-- templates/CRM/common/enableDisableApi.tpl | 2 +- templates/CRM/common/formButtons.tpl | 12 ++++++++++-- 8 files changed, 25 insertions(+), 16 deletions(-) diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index e22c212549..29d0dea97d 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -546,11 +546,11 @@ class CRM_Core_Form extends HTML_QuickForm_Page { if (in_array($button['type'], array('upload', 'next', 'submit', 'done', 'process', 'refresh'))) { $attrs['class'] .= ' validate'; - $defaultIcon = 'check'; + $defaultIcon = 'fa-check'; } else { $attrs['class'] .= ' cancel'; - $defaultIcon = $button['type'] == 'back' ? 'triangle-1-w' : 'close'; + $defaultIcon = $button['type'] == 'back' ? 'fa-chevron-left' : 'fa-times'; } if ($button['type'] === 'reset') { @@ -559,13 +559,13 @@ class CRM_Core_Form extends HTML_QuickForm_Page { else { if (!empty($button['subName'])) { if ($button['subName'] == 'new') { - $defaultIcon = 'plus'; + $defaultIcon = 'fa-plus-circle'; } if ($button['subName'] == 'done') { - $defaultIcon = 'circle-check'; + $defaultIcon = 'fa-check-circle'; } if ($button['subName'] == 'next') { - $defaultIcon = 'circle-triangle-e'; + $defaultIcon = 'fa-chevron-right'; } } diff --git a/css/civicrm.css b/css/civicrm.css index ca3d1f7d1e..975f437975 100644 --- a/css/civicrm.css +++ b/css/civicrm.css @@ -2247,6 +2247,7 @@ a.crm-i:hover { .crm-i-button>.crm-i { padding-left: 2px; + line-height: inherit; } .crm-container .ui-dialog-titlebar .ui-button .ui-icon[class*=" fa-"] { diff --git a/templates/CRM/Contact/Form/Merge.tpl b/templates/CRM/Contact/Form/Merge.tpl index cc6f57697f..1d6d3a45dd 100644 --- a/templates/CRM/Contact/Form/Merge.tpl +++ b/templates/CRM/Contact/Form/Merge.tpl @@ -30,20 +30,20 @@
{include file="CRM/common/formButtons.tpl" location="top"} - {if $prev} {ts}Previous{/ts}{/if} - {if $next}{ts}Next{/ts} {/if} + {if $prev} {ts}Previous{/ts}{/if} + {if $next}{ts}Next{/ts} {/if}
diff --git a/templates/CRM/Event/Form/ManageEvent/ConfirmRepeatMode.tpl b/templates/CRM/Event/Form/ManageEvent/ConfirmRepeatMode.tpl index e587c88886..55fba82584 100644 --- a/templates/CRM/Event/Form/ManageEvent/ConfirmRepeatMode.tpl +++ b/templates/CRM/Event/Form/ManageEvent/ConfirmRepeatMode.tpl @@ -41,7 +41,7 @@
{ts 1=$entity_type}Change applies to every %1 in the series.{/ts}
-
{ts}Changes to date or time will not be applied to others in the series.{/ts}
+
{ts}Changes to date or time will not be applied to others in the series.{/ts}
{literal} diff --git a/templates/CRM/PCP/Page/PCPInfo.tpl b/templates/CRM/PCP/Page/PCPInfo.tpl index eb162956f9..1bf0d7cf2a 100644 --- a/templates/CRM/PCP/Page/PCPInfo.tpl +++ b/templates/CRM/PCP/Page/PCPInfo.tpl @@ -47,7 +47,7 @@ {/foreach} -
+ {ts}Tip{/ts} - {ts}You must be logged in to your account to access the editing options above. (If you visit this page without logging in, you will be viewing the page in "live" mode - as your visitors and friends see it.){/ts} {/if} diff --git a/templates/CRM/UF/Page/Field.tpl b/templates/CRM/UF/Page/Field.tpl index 0a0c4cb841..20c5e51093 100644 --- a/templates/CRM/UF/Page/Field.tpl +++ b/templates/CRM/UF/Page/Field.tpl @@ -37,7 +37,7 @@
{if not ($action eq 2 or $action eq 1)} {/if} @@ -79,7 +79,7 @@ {/strip} {if not ($action eq 2 or $action eq 1)} {/if} diff --git a/templates/CRM/common/enableDisableApi.tpl b/templates/CRM/common/enableDisableApi.tpl index b5d033ecd4..83836f45bb 100644 --- a/templates/CRM/common/enableDisableApi.tpl +++ b/templates/CRM/common/enableDisableApi.tpl @@ -55,7 +55,7 @@ function checkResponse(e, response) { if (response.illegal) { $(this).dialog('option', 'buttons', [ - {text: {/literal}'{ts escape="js"}Close{/ts}'{literal}, click: function() {$(this).dialog('close');}, icons: {primary: 'ui-icon-close'}} + {text: {/literal}'{ts escape="js"}Close{/ts}'{literal}, click: function() {$(this).dialog('close');}, icons: {primary: 'fa-times'}} ]); } } diff --git a/templates/CRM/common/formButtons.tpl b/templates/CRM/common/formButtons.tpl index d8aa278ce5..b5e4692a13 100644 --- a/templates/CRM/common/formButtons.tpl +++ b/templates/CRM/common/formButtons.tpl @@ -36,9 +36,17 @@ {assign var='html' value=$form.buttons.$key.html} {/if} {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'} - - {if $icon} {/if} + + {$iconDisp} {$html} {/if} -- 2.25.1