diff --git a/core/modules/update/src/Tests/UpdateContribTest.php b/core/modules/update/src/Tests/UpdateContribTest.php index 118a60e..8c9f3f2 100644 --- a/core/modules/update/src/Tests/UpdateContribTest.php +++ b/core/modules/update/src/Tests/UpdateContribTest.php @@ -156,8 +156,8 @@ function testUpdateContribOrder() { // Instead of just searching for 'BBB Update test' or something, we want // to use the full markup that starts the project entry itself, so that // we're really testing that the project listings are in the right order. - $bbb_project_link = '
BBB Update test'; - $ccc_project_link = '
CCC Update test'; + $bbb_project_link = '
BBB Update test'; + $ccc_project_link = '
CCC Update test'; $this->assertTrue(strpos($this->drupalGetContent(), $bbb_project_link) < strpos($this->drupalGetContent(), $ccc_project_link), "'BBB Update test' project is listed before the 'CCC Update test' project"); } @@ -343,7 +343,7 @@ function testUpdateBrokenFetchURL() { // We need to check that this string is found as part of a project row, // not just in the "Failed to get available update data for ..." message // at the top of the page. - $this->assertRaw('
' . t('Failed to get available update data')); + $this->assertRaw('
' . t('Failed to get available update data')); // We should see the output messages from fetching manually. $this->assertUniqueText(t('Checked available update data for 3 projects.')); diff --git a/core/modules/update/templates/update-last-check.html.twig b/core/modules/update/templates/update-last-check.html.twig index ea6a2f2..1e0f9ec 100644 --- a/core/modules/update/templates/update-last-check.html.twig +++ b/core/modules/update/templates/update-last-check.html.twig @@ -13,11 +13,11 @@ * @ingroup themeable */ #} -
+
{% if last %} {{ 'Last checked: @time ago'|t({'@time': time}) }} {% else %} {{ 'Last checked: never'|t }} {% endif %} - ({{ link }}) + ({{ link }})
diff --git a/core/modules/update/templates/update-project-status.html.twig b/core/modules/update/templates/update-project-status.html.twig index 04ab882..960a8bb 100644 --- a/core/modules/update/templates/update-project-status.html.twig +++ b/core/modules/update/templates/update-project-status.html.twig @@ -29,25 +29,16 @@ * @ingroup themeable */ #} -{% - set status_classes = [ - project.status == constant('UPDATE_NOT_SECURE') ? 'security-error', - project.status == constant('UPDATE_REVOKED') ? 'revoked', - project.status == constant('UPDATE_NOT_SUPPORTED') ? 'not-supported', - project.status == constant('UPDATE_NOT_CURRENT') ? 'not-current', - project.status == constant('UPDATE_CURRENT') ? 'current', - ] -%} -
+
{%- if status.label -%} - {{ status.label }} + {{ status.label }} {%- else -%} {{ status.reason }} {%- endif %} - {{ status.icon }} + {{ status.icon }}
-
+
{%- if url -%} {{ title }} {%- else -%} @@ -55,46 +46,39 @@ {%- endif %} {{ existing_version }} {% if install_type == 'dev' and datestamp %} - ({{ datestamp }}) + ({{ datestamp }}) {% endif %}
{% if versions %} -
+
{% for version in versions %} {{ version }} {% endfor %}
{% endif %} -{% - set extra_classes = [ - project.status == constant('UPDATE_NOT_SECURE') ? 'project-not-secure', - project.status == constant('UPDATE_REVOKED') ? 'project-revoked', - project.status == constant('UPDATE_NOT_SUPPORTED') ? 'project-not-supported', - ] -%} -
+
{% if extras %} -
+
{% for extra in extras %} - + {{ extra.label }}: {{ extra.data }}
{% endfor %}
{% endif %} -
+
{% set includes = includes|join(', ') %} {% if disabled %} {{ 'Includes:'|t }}
    -
  • +
  • {% trans %} Enabled: {{ includes|placeholder }} {% endtrans %}
  • -
  • +
  • {% set disabled = disabled|join(', ') %} {% trans %} Disabled: {{ disabled|placeholder }} @@ -111,7 +95,7 @@ {% if base_themes %} {% set basethemes = base_themes|join(', ') %} {# Using passthrough since placeholder is already applied in preprocess. #} -
    +
    {% trans %} Depends on: {{ basethemes|passthrough }} {% endtrans %} @@ -120,7 +104,7 @@ {% if sub_themes %} {% set subthemes = sub_themes|join(', ') %} -
    +
    {% trans %} Required by: {{ subthemes|placeholder }} {% endtrans %} diff --git a/core/modules/update/templates/update-version.html.twig b/core/modules/update/templates/update-version.html.twig index d1a8063..a15173a 100644 --- a/core/modules/update/templates/update-version.html.twig +++ b/core/modules/update/templates/update-version.html.twig @@ -17,19 +17,19 @@ * @ingroup themeable */ #} - +
    - - + -
    {{ title }} + {{ title }} {{ version.version }} - ({{ version.date|date('Y-M-d') }}) + ({{ version.date|date('Y-M-d') }}) + diff --git a/core/themes/classy/templates/update-last-check.html.twig b/core/themes/classy/templates/update-last-check.html.twig new file mode 100644 index 0000000..ea6a2f2 --- /dev/null +++ b/core/themes/classy/templates/update-last-check.html.twig @@ -0,0 +1,23 @@ +{# +/** + * @file + * Default theme implementation for the last time update data was checked. + * + * Available variables: + * - last: The timestamp that the site was last checked for updates. + * - time: The formatted time since the site last checked for updates. + * - link: A link to check for updates manually. + * + * @see template_preprocess_update_last_check() + * + * @ingroup themeable + */ +#} +
    + {% if last %} + {{ 'Last checked: @time ago'|t({'@time': time}) }} + {% else %} + {{ 'Last checked: never'|t }} + {% endif %} + ({{ link }}) +
    diff --git a/core/themes/classy/templates/update-project-status.html.twig b/core/themes/classy/templates/update-project-status.html.twig new file mode 100644 index 0000000..04ab882 --- /dev/null +++ b/core/themes/classy/templates/update-project-status.html.twig @@ -0,0 +1,129 @@ +{# +/** + * @file + * Default theme implementation for the project status report. + * + * Available variables: + * - title: The project title. + * - url: The project url. + * - status: The project status. + * - label: The project status label. + * - attributes: HTML attributes for the project status. + * - reason: The reason you should update the project. + * - icon: The project status version indicator icon. + * - existing_version: The version of the installed project. + * - versions: The available versions of the project. + * - install_type: The type of project (e.g., dev). + * - datestamp: The date/time of a project version's release. + * - extras: HTML attributes and additional information about the project. + * - attributes: HTML attributes for the extra item. + * - label: The label for an extra item. + * - data: The data about an extra item. + * - includes: The projects within the project. + * - disabled: The currently disabled projects in the project. + * - base_themes: The base themes supplied by the project. + * - sub_themes: The subthemes supplied by the project. + * + * @see template_preprocess_update_project_status() + * + * @ingroup themeable + */ +#} +{% + set status_classes = [ + project.status == constant('UPDATE_NOT_SECURE') ? 'security-error', + project.status == constant('UPDATE_REVOKED') ? 'revoked', + project.status == constant('UPDATE_NOT_SUPPORTED') ? 'not-supported', + project.status == constant('UPDATE_NOT_CURRENT') ? 'not-current', + project.status == constant('UPDATE_CURRENT') ? 'current', + ] +%} +
    + {%- if status.label -%} + {{ status.label }} + {%- else -%} + {{ status.reason }} + {%- endif %} + {{ status.icon }} +
    + +
    + {%- if url -%} + {{ title }} + {%- else -%} + {{ title }} + {%- endif %} + {{ existing_version }} + {% if install_type == 'dev' and datestamp %} + ({{ datestamp }}) + {% endif %} +
    + +{% if versions %} +
    + {% for version in versions %} + {{ version }} + {% endfor %} +
    +{% endif %} + +{% + set extra_classes = [ + project.status == constant('UPDATE_NOT_SECURE') ? 'project-not-secure', + project.status == constant('UPDATE_REVOKED') ? 'project-revoked', + project.status == constant('UPDATE_NOT_SUPPORTED') ? 'project-not-supported', + ] +%} +
    + {% if extras %} +
    + {% for extra in extras %} + + {{ extra.label }}: {{ extra.data }} +
    + {% endfor %} +
    + {% endif %} +
    + {% set includes = includes|join(', ') %} + {% if disabled %} + {{ 'Includes:'|t }} +
      +
    • + {% trans %} + Enabled: {{ includes|placeholder }} + {% endtrans %} +
    • +
    • + {% set disabled = disabled|join(', ') %} + {% trans %} + Disabled: {{ disabled|placeholder }} + {% endtrans %} +
    • +
    + {% else %} + {% trans %} + Includes: {{ includes|placeholder }} + {% endtrans %} + {% endif %} +
    + + {% if base_themes %} + {% set basethemes = base_themes|join(', ') %} + {# Using passthrough since placeholder is already applied in preprocess. #} +
    + {% trans %} + Depends on: {{ basethemes|passthrough }} + {% endtrans %} +
    + {% endif %} + + {% if sub_themes %} + {% set subthemes = sub_themes|join(', ') %} +
    + {% trans %} + Required by: {{ subthemes|placeholder }} + {% endtrans %} +
    + {% endif %} + diff --git a/core/themes/classy/templates/update-report.html.twig b/core/themes/classy/templates/update-report.html.twig new file mode 100644 index 0000000..ae121cc --- /dev/null +++ b/core/themes/classy/templates/update-report.html.twig @@ -0,0 +1,25 @@ +{# +/** + * @file + * Default theme implementation for the project status report. + * + * Available variables: + * - last_checked: Themed last time update data was checked. + * - no_updates_message: Message when there are no project updates. + * - project_types: A list of project types. + * - label: The project type label. + * - table: The project status table. + * + * @see template_preprocess_update_report() + * + * @ingroup themeable + */ +#} +{{ last_checked }} + +{% for project_type in project_types %} +

    {{ project_type.label }}

    + {{ project_type.table }} +{% else %} +

    {{ no_updates_message }}

    +{% endfor %} diff --git a/core/themes/classy/templates/update-version.html.twig b/core/themes/classy/templates/update-version.html.twig new file mode 100644 index 0000000..d1a8063 --- /dev/null +++ b/core/themes/classy/templates/update-version.html.twig @@ -0,0 +1,38 @@ +{# +/** + * @file + * Default theme implementation for the version display of a project. + * + * Available variables: + * - attributes: HTML attributes suitable for a container element. + * - title: The title of the project. + * - version: A list of data about the latest released version, containing: + * - version: The version number. + * - date: The date of the release. + * - download_link: The URL for the downloadable file. + * - release_link: The URL for the release notes. + * + * @see template_preprocess_update_version() + * + * @ingroup themeable + */ +#} + + + + + + +
    {{ title }} + {{ version.version }} + ({{ version.date|date('Y-M-d') }}) +