Skip to content

Commit

Permalink
Update success.tpl CSS (pre/post upgrade messages)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlutfy committed Mar 31, 2023
1 parent 3e87784 commit 989acd6
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 33 deletions.
7 changes: 3 additions & 4 deletions CRM/Upgrade/Incremental/General.php
Expand Up @@ -178,10 +178,9 @@ public static function updateMessageTemplate(&$message, $version) {
return sprintf("<li><em>%s</em> - %s</li>", htmlentities($k), htmlentities($v));
}, array_keys($messages), $messages);

$message .= '<br />' . ts("The default copies of the message templates listed below will be updated to handle new features or correct a problem. Your installation has customized versions of these message templates, and you will need to apply the updates manually after running this upgrade. <a href='%1' style='color:white; text-decoration:underline; font-weight:bold;' target='_blank'>Click here</a> for detailed instructions. %2", [
1 => 'https://docs.civicrm.org/user/en/latest/email/message-templates/#modifying-system-workflow-message-templates',
2 => '<ul>' . implode('', $messagesHtml) . '</ul>',
]);
$message .= '<br />' . ts("The default copies of the message templates listed below will be updated to handle new features or correct a problem. Your installation has customized versions of these message templates, and you will need to apply the updates manually after running this upgrade. <a %1>View detailed instructions</a>.", [
1 => 'href="https://docs.civicrm.org/user/en/latest/email/message-templates/#modifying-system-workflow-message-templates" target="_blank"',
]) . '<ul>' . implode('', $messagesHtml) . '</ul>';

$messageObj->updateTemplates();
}
Expand Down
104 changes: 75 additions & 29 deletions templates/CRM/common/success.tpl
Expand Up @@ -12,42 +12,88 @@
<h2>{$pageTitle}</h2>
{/if}
{if !$upgraded}
<div class="crm-container" style="margin-top: 2em; padding: 1em; background-color: #FFFFE3; border: 1px #F8FF00 solid; color: black;">
<form method="post">
<p>
<span class="crm-status-icon info"> </span>
{ts 1=$currentVersion 2=$newVersion}The database will be upgraded from %1 to %2.{/ts}
</p>
<div class="crm-container crm-upgrade-success-box-outer warning">
<div class="crm-upgrade-success-box-inner">
<form method="post">
{if $preUpgradeMessage}
<div style="border: 2px solid #E43D2B; background-color: rgba(228, 61, 43, 0.08); padding: 10px; margin-bottom: 15px;">
<span class="crm-status-icon"></span>
<strong style="vertical-align: middle; font-size: 1.2em;">{ts}Warning:{/ts}</strong>
{$preUpgradeMessage}
</div>
<div class="crm-success-flex">
<div><span class="crm-status-icon"></span></div>
<div class="crm-upgrade-large-text"><strong>{ts}Warning{/ts}</strong></div>
</div>
{$preUpgradeMessage}
{/if}
<p><strong>{ts}Back up your database before continuing.{/ts}</strong>
{ts}This process may change your database structure and values. In case of emergency you may need to revert to a backup.{/ts} {docURL page="sysadmin/upgrade"}</p>
<p>{ts 1=$currentVersion 2=$newVersion}The database will be upgraded from %1 to %2.{/ts}</p>
<input type="hidden" name="action" value="begin" />
<button type="submit" class="crm-button" name="upgrade" onclick="return confirm('{ts escape="js"}Are you sure you are ready to upgrade now?{/ts}');" >
<i class="crm-i fa-rocket" aria-hidden="true"></i>
{ts}Upgrade Now{/ts}
</button>&nbsp;&nbsp;
<a class="button cancel crm-form-submit" href="{$cancelURL}">
<i class="crm-i fa-times" aria-hidden="true"></i>
{ts}Cancel{/ts}
</a>
</form>
<div class="crm-submit-buttons">
<button type="submit" class="crm-button crm-form-submit" name="upgrade" onclick="return confirm('{ts escape="js"}Are you sure you are ready to upgrade now?{/ts}');" >
<i class="crm-i fa-rocket" aria-hidden="true"></i>
{ts}Upgrade Now{/ts}
</button>
</div>
</form>
</div>
</div>

{else}
<div class="crm-container" style="margin-top: 2em; padding: 1em; background-color: #EEFFEE; border: 1px #070 solid; color: black;">
<div class="bold" style="padding: 1em; background-color: rgba(255, 255, 255, 0.76);">
<p>
<img style="display:block; float:left; width:40px; margin-right:10px;" src="{$config->resourceBase}i/logo_lg.png">
{ts 1="https://civicrm.org/core-team" 2="https://civicrm.org/contributors" 3="https://civicrm.org/members" 4="https://civicrm.org/partners" 5="https://civicrm.org/become-a-member?src=ug&sid=$sid" 6=$newVersion 7="https://civicrm.org/become-a-partner" 8="https://civicrm.org"}Thank you for upgrading to %6. This release was made possible by the <a href="%1" target="_blank">CiviCRM Core Team</a> and an <a href="%2" target="_blank">incredible group of CiviCRM Contributors</a>. The CiviCRM project could not exist without the continued financial support of <a href="%3" target="_blank">CiviCRM Members</a> and <a href="%4" target="_blank">CiviCRM Partners</a>. We invite you to support CiviCRM by becoming a <a href="%5" target="_blank">CiviCRM Member</a> or <a href="%7" target="_blank">CiviCRM Partner</a> today. Providing financial support ensures that the <a href="%8" target="_blank">CiviCRM project</a> can continue to provide the essential resources and services to support the <a href="%8" target="_blank">CiviCRM community</a>.{/ts}
</p>
<div class="crm-container crm-upgrade-success-box-outer success">
<div class="crm-upgrade-success-box-inner">
<p class="crm-upgrade-large-text">{ts 1=$newVersion}Thank you for upgrading to %1.{/ts}</p>
<p class="crm-upgrade-large-text">{ts 1="href='https://civicrm.org/core-team' target='_blank'" 2="href='https://civicrm.org/contributors' target='_blank'" 3="href='https://civicrm.org/civicrm/contribute/transact?reset=1&id=47&src=ug' target='_blank'"}This release was made possible by the <a %1>CiviCRM Core Team</a> and an <a %2>incredible group of CiviCRM Contributors</a>. We are committed to keeping CiviCRM free and open, forever. We depend on your support to help make that happen. <a %3>Support us by making a small donation today</a>.{/ts}</p>
<div class="crm-success-flex">
<div style="margin: 0 10px;"><span class="crm-status-icon success"></span></div>
<div>{$message}</div>
</div>
<div>
<p><a href="{crmURL p='civicrm/a/#/status'}" title="{ts}CiviCRM Status Check{/ts}" style="text-decoration: underline;">{ts}View the CiviCRM System Status{/ts}</a></p>
<p><a href="{crmURL p='civicrm/dashboard' q='reset=1'}" title="{ts}CiviCRM home page{/ts}" style="text-decoration: underline;">{ts}Return to CiviCRM home page.{/ts}</a></p>
</div>
</div>
<p><span class="crm-status-icon success"> </span>{$message}</p>
<p><a href="{crmURL p='civicrm/dashboard' q='reset=1'}" title="{ts}CiviCRM home page{/ts}" style="text-decoration: underline;">{ts}Return to CiviCRM home page.{/ts}</a></p>
</div>
{/if}
{literal}
<style>
.crm-upgrade-success-box-outer {
margin-top: 2rem;
border-radius: 5px;
color: black;
font-family: sans-serif;
font-size: 16px;
}
.crm-upgrade-success-box-outer.warning {
background-color: #FFFFE3;
border: 1px #F8FF00 solid;
}
.crm-upgrade-success-box-outer.success {
background-color: #EEFFEE;
border: 1px #44cb7e solid;
}
.crm-upgrade-success-box-inner {
padding: 1rem;
background-color: rgba(255, 255, 255, 0.5);
}
.crm-success-flex {
display: flex;
padding: 1rem;
}
.crm-success-flex > div:first-child {
width: 50px;
}
.crm-upgrade-large-text {
font-size: 120%;
line-height: 1.8rem;
}
/* Force link colors because of the success background */
.crm-container .crm-upgrade-success-box-inner a,
.crm-container .crm-upgrade-success-box-inner a:hover,
.crm-container .crm-upgrade-success-box-inner a:active,
.crm-container .crm-upgrade-success-box-inner a:visited {
color: #0071bd;
text-decoration: underline;
}
/* Fixes weird visual on Drupal9 */
.crm-container summary {
color: black;
}
</style>
{/literal}

0 comments on commit 989acd6

Please sign in to comment.