Commit 202ffa7e authored by Neil Drumm's avatar Neil Drumm 👋
Browse files

Issue #3267863 by B_man, drumm: Unpanelize project release pages

parent 9fa8690b
Loading
Loading
Loading
Loading
+36 −4
Original line number Diff line number Diff line
@@ -781,9 +781,19 @@ function drupalorg_field_extra_fields() {
            'description' => t('Install with composer information'),
            'weight' => 0,
          ],
          'drupalorg_core_requirement' => [
            'label' => t('Drupal core requirement'),
            'description' => t('core_version_requirement or core_api from the primary component'),
          'project_release_info' => [
            'label' => t('Project release info'),
            'description' => t('Project release info'),
            'weight' => 0,
          ],
          'project_release_other_releases' => [
            'label' => t('Project release other releases'),
            'description' => t('Releases related to this one'),
            'weight' => 0,
          ],
          'release_try_drupal' => [
            'label' => t('Try Drupal'),
            'description' => t('Try Drupal button'),
            'weight' => 0,
          ],
        ],
@@ -4484,7 +4494,7 @@ function drupalorg_node_view($node, $view_mode = 'full') {
        }

        $node->content['drupalorg_release_core_whats_next'] = [
          '#markup' => t('<ol>
          '#markup' => t('<h2>What’s next?</h2><ol>
            <li><a href="/@install_path">Learn how to install Drupal</a></li>
            <li><a href="/project/project_module">Extend Drupal to do more</a></li>
            <li><a href="/training">Get training</a></li>
@@ -4501,6 +4511,28 @@ function drupalorg_node_view($node, $view_mode = 'full') {
          '#markup' => '<h2>' . t('Install') . '</h2>' . drupalorg_release_core_version_requirement($wrapper)['#markup'] . '<br>' . $composer_command . '<br><small>' . l(t('Using Composer to manage Drupal site dependencies'), 'docs/develop/using-composer/using-composer-to-manage-drupal-site-dependencies') . '</small>',
        ];
      }

      $node->content['body']['#prefix'] = '<h2>' . t('Release notes') . '</h2>';

      $node->content['project_release_info']['#markup'] = '<div class="release-info">' . t('Created by: !author<br>Created on: @created<br>Last updated: @changed', [
        '!author' => l(format_username($node), '/user/' . $node->uid),
        '@created' => format_date($node->created),
        '@changed' => format_date($node->changed),
      ]) . '</div>';

      // Related releases
      $view = views_get_view('related_project_releases');
      $view->set_display('related_project_releases_block');
      $view->set_arguments([$node->nid]);
      $view->pre_execute();
      $view->execute();
      $node->content['project_release_other_releases']['#prefix'] = '<h2>' . t('Other releases') . '</h2>';
      $node->content['project_release_other_releases']['#markup'] = $view->render();

      // Try Drupal button.
      if ($project_type === 'project_core') {
        $node->content['release_try_drupal']['#markup'] = t('<div class="try-drupal"><a href="!url">Try a hosted Drupal demo</a></div>', ['!url' => url('try-drupal')]);
      }
    }
  }
  elseif (project_issue_node_is_issue($node)) {
+2 −2
Original line number Diff line number Diff line
@@ -335,7 +335,7 @@
   */
  Drupal.behaviors.drupalorgReleaseHashes = {
    attach: function (context) {
      $('.view-display-id-release_files_pane', context).once('drupalorgReleaseHashes', function () {
      $('.view-project-release-files', context).once('drupalorgReleaseHashes', function () {
        var hashes = {},
          $filesPane = $(this);

@@ -358,7 +358,7 @@
          $.each(hashes, function (key, value) {
            links.push('<a href="javascript:void(0)" class="show-' + key + '">' + value + '</a>');
          });
          $links = $filesPane.parents('.panel-layout').find('.view-display-id-release_info_pane .views-row-last')
          $links = $filesPane.parents('.content').find('.field-name-field-release-files')
          .append('<div class="release-hash-links"><span class="views-label">' + Drupal.t('View file hashes: ') + '</span><span>' + links.join(', ') + '</span></div>')
          .find('a').click(function () {
            var $this = $(this);
+0 −15
Original line number Diff line number Diff line
@@ -1205,21 +1205,6 @@ function drupalorg_project_node_view($node, $view_mode = 'full') {
      $node->content['project_info'] = drupalorg_project_meta_data($node);
      $node->content['project_info']['#weight'] = 9; // project_release_downloads is hard-coded to 10.
    }
    elseif (project_release_node_is_release($node)) {
      // Add link to change notices relating to this release.
      if ($field_project = field_get_items('node', $node, 'field_release_project')) {
        $project = node_load($field_project[0]['target_id']);
        $machine_name = field_get_items('node', $project, 'field_project_machine_name');

        if ($field_version = field_get_items('node', $node, 'field_release_version')) {
          $node->content['project_release_change_notices']['#markup'] = l('View change notices for this release', 'list-changes/' . $machine_name[0]['value'], array(
            'query' => array(
              'version' => $field_version[0]['value'],
            ),
          ));
        }
      }
    }
    elseif ($node->type === 'changenotice') {
      if ($field_project = field_get_items('node', $node, 'field_project')) {
        $project = node_load($field_project[0]['target_id']);
+22 −25
Original line number Diff line number Diff line
@@ -10026,7 +10026,7 @@ function drupalorg_projects_field_default_field_instances() {
        'module' => 'text',
        'settings' => array(),
        'type' => 'text_default',
        'weight' => 0,
        'weight' => 10,
      ),
      'issuemetadata' => array(
        'label' => 'above',
@@ -10098,10 +10098,9 @@ function drupalorg_projects_field_default_field_instances() {
    'display' => array(
      'default' => array(
        'label' => 'above',
        'module' => 'text',
        'settings' => array(),
        'type' => 'text_default',
        'weight' => 16,
        'type' => 'hidden',
        'weight' => 9,
      ),
      'issuemetadata' => array(
        'label' => 'above',
@@ -10176,7 +10175,7 @@ function drupalorg_projects_field_default_field_instances() {
        'label' => 'hidden',
        'settings' => array(),
        'type' => 'hidden',
        'weight' => 5,
        'weight' => 12,
      ),
      'issuemetadata' => array(
        'label' => 'above',
@@ -10247,7 +10246,7 @@ function drupalorg_projects_field_default_field_instances() {
        'label' => 'hidden',
        'settings' => array(),
        'type' => 'hidden',
        'weight' => 5,
        'weight' => 11,
      ),
      'issuemetadata' => array(
        'label' => 'above',
@@ -10380,7 +10379,7 @@ function drupalorg_projects_field_default_field_instances() {
        'label' => 'hidden',
        'settings' => array(),
        'type' => 'hidden',
        'weight' => 7,
        'weight' => 13,
      ),
      'issuemetadata' => array(
        'label' => 'above',
@@ -10478,10 +10477,9 @@ function drupalorg_projects_field_default_field_instances() {
    'display' => array(
      'default' => array(
        'label' => 'above',
        'module' => 'text',
        'settings' => array(),
        'type' => 'text_default',
        'weight' => 15,
        'type' => 'hidden',
        'weight' => 20,
      ),
      'issuemetadata' => array(
        'label' => 'above',
@@ -10552,7 +10550,7 @@ function drupalorg_projects_field_default_field_instances() {
        'label' => 'hidden',
        'settings' => array(),
        'type' => 'hidden',
        'weight' => 10,
        'weight' => 16,
      ),
      'issuemetadata' => array(
        'label' => 'above',
@@ -10626,7 +10624,7 @@ function drupalorg_projects_field_default_field_instances() {
    'description' => 'The label (branch or tag) in a version control system that represents this release.',
    'display' => array(
      'default' => array(
        'label' => 'inline',
        'label' => 'hidden',
        'module' => 'text',
        'settings' => array(),
        'type' => 'text_plain',
@@ -10700,7 +10698,7 @@ function drupalorg_projects_field_default_field_instances() {
        'label' => 'hidden',
        'settings' => array(),
        'type' => 'hidden',
        'weight' => 4,
        'weight' => 10,
      ),
      'issuemetadata' => array(
        'label' => 'above',
@@ -10770,7 +10768,7 @@ function drupalorg_projects_field_default_field_instances() {
        'label' => 'hidden',
        'settings' => array(),
        'type' => 'hidden',
        'weight' => 11,
        'weight' => 17,
      ),
      'issuemetadata' => array(
        'label' => 'above',
@@ -10848,7 +10846,7 @@ function drupalorg_projects_field_default_field_instances() {
        'label' => 'hidden',
        'settings' => array(),
        'type' => 'hidden',
        'weight' => 13,
        'weight' => 19,
      ),
      'issuemetadata' => array(
        'label' => 'above',
@@ -10926,7 +10924,7 @@ function drupalorg_projects_field_default_field_instances() {
        'label' => 'hidden',
        'settings' => array(),
        'type' => 'hidden',
        'weight' => 12,
        'weight' => 18,
      ),
      'issuemetadata' => array(
        'label' => 'above',
@@ -10994,7 +10992,7 @@ function drupalorg_projects_field_default_field_instances() {
        'label' => 'hidden',
        'settings' => array(),
        'type' => 'hidden',
        'weight' => 8,
        'weight' => 14,
      ),
      'issuemetadata' => array(
        'label' => 'above',
@@ -11072,7 +11070,7 @@ function drupalorg_projects_field_default_field_instances() {
        'label' => 'hidden',
        'settings' => array(),
        'type' => 'hidden',
        'weight' => 9,
        'weight' => 15,
      ),
      'issuemetadata' => array(
        'label' => 'above',
@@ -11150,7 +11148,7 @@ function drupalorg_projects_field_default_field_instances() {
        'label' => 'hidden',
        'settings' => array(),
        'type' => 'hidden',
        'weight' => 14,
        'weight' => 20,
      ),
      'issuemetadata' => array(
        'label' => 'above',
@@ -11231,7 +11229,7 @@ function drupalorg_projects_field_default_field_instances() {
        'label' => 'hidden',
        'settings' => array(),
        'type' => 'hidden',
        'weight' => 15,
        'weight' => 21,
      ),
      'issuemetadata' => array(
        'label' => 'above',
@@ -11297,10 +11295,9 @@ function drupalorg_projects_field_default_field_instances() {
    'display' => array(
      'default' => array(
        'label' => 'above',
        'module' => 'taxonomy',
        'settings' => array(),
        'type' => 'taxonomy_term_reference_link',
        'weight' => 10,
        'type' => 'hidden',
        'weight' => 7,
      ),
      'issuemetadata' => array(
        'label' => 'above',
@@ -11363,10 +11360,10 @@ function drupalorg_projects_field_default_field_instances() {
    'description' => '<a href="/documentation/releases/types">What is a release type?</a>',
    'display' => array(
      'default' => array(
        'label' => 'above',
        'label' => 'hidden',
        'module' => 'taxonomy',
        'settings' => array(),
        'type' => 'taxonomy_term_reference_link',
        'type' => 'taxonomy_term_reference_plain',
        'weight' => 10,
      ),
      'issuemetadata' => array(
+105 −0
Original line number Diff line number Diff line
@@ -11,6 +11,40 @@
function drupalorg_projects_field_group_info() {
  $field_groups = array();

  $field_group = new stdClass();
  $field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */
  $field_group->api_version = 1;
  $field_group->identifier = 'group_main|node|project_release|default';
  $field_group->group_name = 'group_main';
  $field_group->entity_type = 'node';
  $field_group->bundle = 'project_release';
  $field_group->mode = 'default';
  $field_group->parent_name = '';
  $field_group->data = array(
    'label' => 'Main',
    'weight' => '24',
    'children' => array(
      0 => 'body',
      1 => 'field_release_files',
      2 => 'drupalorg_composer_install',
    ),
    'format_type' => 'div',
    'format_settings' => array(
      'label' => 'Main',
      'instance_settings' => array(
        'id' => '',
        'classes' => 'group-release-main',
        'description' => '',
        'show_label' => '0',
        'label_element' => 'h3',
        'effect' => 'none',
        'speed' => 'none',
      ),
      'formatter' => 'open',
    ),
  );
  $field_groups['group_main|node|project_release|default'] = $field_group;

  $field_group = new stdClass();
  $field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */
  $field_group->api_version = 1;
@@ -210,10 +244,81 @@ function drupalorg_projects_field_group_info() {
  );
  $field_groups['group_release_meta|node|project_release|teaser'] = $field_group;

  $field_group = new stdClass();
  $field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */
  $field_group->api_version = 1;
  $field_group->identifier = 'group_sidebar_top|node|project_release|default';
  $field_group->group_name = 'group_sidebar_top';
  $field_group->entity_type = 'node';
  $field_group->bundle = 'project_release';
  $field_group->mode = 'default';
  $field_group->parent_name = '';
  $field_group->data = array(
    'label' => 'Top sidebar',
    'weight' => '0',
    'children' => array(
      0 => 'release_try_drupal',
    ),
    'format_type' => 'div',
    'format_settings' => array(
      'label' => 'Top sidebar',
      'instance_settings' => array(
        'id' => '',
        'classes' => 'group-sidebar-top',
        'description' => '',
        'show_label' => '0',
        'label_element' => 'h3',
        'effect' => 'none',
        'speed' => 'fast',
      ),
      'formatter' => 'open',
    ),
  );
  $field_groups['group_sidebar_top|node|project_release|default'] = $field_group;

  $field_group = new stdClass();
  $field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */
  $field_group->api_version = 1;
  $field_group->identifier = 'group_sidebar|node|project_release|default';
  $field_group->group_name = 'group_sidebar';
  $field_group->entity_type = 'node';
  $field_group->bundle = 'project_release';
  $field_group->mode = 'default';
  $field_group->parent_name = '';
  $field_group->data = array(
    'label' => 'Sidebar',
    'weight' => '27',
    'children' => array(
      0 => 'taxonomy_vocabulary_7',
      1 => 'field_release_vcs_label',
      2 => 'drupalorg_release_core_whats_next',
      3 => 'project_release_info',
      4 => 'project_release_other_releases',
    ),
    'format_type' => 'div',
    'format_settings' => array(
      'label' => 'Sidebar',
      'instance_settings' => array(
        'id' => '',
        'classes' => 'group-release-sidebar',
        'description' => '',
        'show_label' => '0',
        'label_element' => 'h3',
        'effect' => 'none',
        'speed' => 'none',
      ),
      'formatter' => 'open',
    ),
  );
  $field_groups['group_sidebar|node|project_release|default'] = $field_group;

  // Translatables
  // Included for use with string extractors like potx.
  t('Main');
  t('Project documentation');
  t('Release metadata');
  t('Sidebar');
  t('Top sidebar');

  return $field_groups;
}
Loading