Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLANET-7365: Clean up Listing page code #2310

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion archive-p4_action.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@
$context['header_title'] = post_type_archive_title('', false);

$page = new ListingPage($templates, $context);
$page->view();
7 changes: 0 additions & 7 deletions author.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,7 @@
'width' => '300',
'height' => '300',
];

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticing that this value is not being used by us, only by a couple of NROs. Do we really need to add it? What if we ask them to include into their themes instead?
https://github.com/search?q=org%3Agreenpeace%20author_share_buttons&type=code

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @comzeradd would know better about this, especially if we need to warn the NROs about the change!

$author_share_buttons = new stdClass();
$author_share_buttons->title = $author->name;
$author_share_buttons->description = get_the_author_meta('description', $author->ID);
$author_share_buttons->link = $author->link;
$context['author_share_buttons'] = $author_share_buttons;
}

$templates = ['author.twig', 'archive.twig'];
$page = new ListingPage($templates, $context);
$page->view();
1 change: 0 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
array_unshift($templates, 'all-posts.twig');

$page = new ListingPage($templates, $context);
$page->view();
} else {
Timber::render($templates, $context);
}
1 change: 1 addition & 0 deletions src/ListingPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public function __construct(array $templates = [ 'archive.twig', 'index.twig' ],
$this->context = $context;

$this->update_context();
$this->view();
}

/**
Expand Down
1 change: 0 additions & 1 deletion tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,3 @@

$templates = ['tag.twig', 'archive.twig', 'index.twig'];
$page = new ListingPage($templates, $context);
$page->view();
1 change: 0 additions & 1 deletion taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@
$context['og_description'] = $taxonomy->description;

$page = new ListingPage($templates, $context);
$page->view();
1 change: 1 addition & 0 deletions templates/burger-menu-items.twig
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
type="button"
data-bs-toggle="collapse"
data-bs-target="#menu-{{ targetId }}"
aria-label="Nav Link Button"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be translatable

aria-expanded="false"
aria-controls="menu-{{ targetId }}"></button>
{% endif %}
Expand Down