Commit 7b1ad46f authored by webchick's avatar webchick

Issue #478994 by valthebald, sushantpaste, LewisNyman, InternetDevels, Xano,...

Issue #478994 by valthebald, sushantpaste, LewisNyman, InternetDevels, Xano, lucastockmann, alansaviolobo, mgifford, emmajane: Please state the version you are installing
parent aac60c8a
......@@ -111,6 +111,30 @@ function drupal_install_profile_distribution_name() {
return isset($info['distribution']['name']) ? $info['distribution']['name'] : 'Drupal';
}
/**
* Loads the installation profile, extracting its defined version.
*
* @return string Distribution version defined in the profile's .info.yml file.
* Defaults to \Drupal::VERSION if no version is explicitly provided
* by the installation profile.
*
* @see install_profile_info()
*/
function drupal_install_profile_distribution_version() {
// During installation, the profile information is stored in the global
// installation state (it might not be saved anywhere yet).
if (drupal_installation_attempted()) {
global $install_state;
return isset($install_state['profile_info']['version']) ? $install_state['profile_info']['version'] : \Drupal::VERSION;
}
// At all other times, we load the profile via standard methods.
else {
$profile = drupal_get_profile();
$info = system_get_info('module', $profile);
return $info['version'];
}
}
/**
* Detects all supported databases that are compiled into PHP.
*
......
......@@ -1486,6 +1486,7 @@ function template_preprocess_install_page(&$variables) {
// still in the process of being installed.
$distribution_name = drupal_install_profile_distribution_name();
$variables['site_name'] = $distribution_name;
$variables['site_version'] = drupal_install_profile_distribution_version();
}
/**
......
......@@ -36,6 +36,12 @@
word-break: break-word;
}
.install-page .site-version {
vertical-align: super;
font-size: 0.5em;
color: #595959;
}
@media all and (max-width: 1010px) and (min-width: 48em) {
.install-page .password-strength,
.install-page .confirm-parent {
......
......@@ -13,7 +13,12 @@
<header role="banner">
{% if site_name %}
<h1 class="page-title">{{ site_name }}</h1>
<h1 class="page-title">
{{ site_name }}
{% if site_version %}
<span class="site-version">{{ site_version }}</span>
{% endif %}
</h1>
{% endif %}
</header>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment