Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joelpittet’s picture

This should do the trick, also makes it easier for themers to replace with icon font or svg or whatever they wish.

Status: Needs review » Needs work

The last submitted patch, 1: 2152261-1-tablesort-cleanup.patch, failed testing.

joelpittet’s picture

passes, locally.... Retesting.

joelpittet’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 1: 2152261-1-tablesort-cleanup.patch, failed testing.

star-szr’s picture

Status: Needs work » Needs review
star-szr’s picture

This looks pretty great to me!

+++ b/core/modules/system/templates/tablesort-indicator.html.twig
@@ -13,6 +13,8 @@
+{% if style == 'asc' -%}
+  <img src="{{ url('core/misc/arrow-asc.png') }}" width="13" height="13" alt="{{ 'sort ascending'|t }}" title="{{ 'sort ascending'|t }}"  />
+{% else -%}
+  <img src="{{ url('core/misc/arrow-desc.png') }}" width="13" height="13" alt="{{ 'sort descending'|t }}" title="{{ 'sort descending'|t }}"  />
+{% endif %}

There are two spaces between the closing quote and the />, should just be one.

joelpittet’s picture

Thanks @Cottser, space removed.

star-szr’s picture

Status: Needs review » Needs work

Thanks @joelpittet! Reviewing this again, a couple things doc-wise to fix up:

1. We should remove this line from tablesort-indicator.html.twig:
@see template_preprocess_tablesort_indicator()

2. We're no longer providing image or uri to the template so those variables can be removed from the template docblock.

And I want to mention that with rdf.module enabled we lose typeof="foaf:Image" but that seems fine to me in this context. I'm liking that seven could now just override this template instead of writing a big preprocess for its tweaks.

Before:

<img typeof="foaf:Image" src="http://d8.dev/core/misc/arrow-asc.png" width="13" height="13" alt="sort ascending" title="sort ascending" />

After:

<img src="/core/misc/arrow-asc.png" width="13" height="13" alt="sort ascending" title="sort ascending" />
star-szr’s picture

joelpittet’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
846 bytes
2.2 KB

Removed the @see and image and uri from the variables. Good point and yeah the RDF indication on that is doubtfully necessary, though maybe it would be good to have @scor or @linclark weigh in?

joelpittet’s picture

Status: Reviewed & tested by the community » Needs review

Whoops:D

scor’s picture

@Cottser: I'd be fine with losing foaf:Image - let me know if go that route and I can create a follow up issue to reflect that in the rest of the RDF implementation.

EDIT: I misread the issue. we're no longer calling theme_image() and instead hard coding the img element in Twig. It's perfectly fine to lose the foaf:Image, please go ahead (no follow up of any kind required).

star-szr’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @scor! I like this change a lot, RTBC from me.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Nice clean-up. Committed to 8.x. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

joelpittet’s picture

Status: Closed (fixed) » Needs review
FileSize
1.84 KB

Dang this looked better than it was. url() will produce /fr-ca/ or /drupal/ prefixed urls, I should have used file_create_url() for this but that doesn't exist in twig yet.

I've got a proposal started for that over at #2168231: Twig Functions needed in templates.

In the mean time I'd like to revert part of this so that it's working.

And the best solution for this template would be #2189729: Factor out tablesort-indicator.html.twig IMO.

Status: Needs review » Needs work

The last submitted patch, 17: 2152261-17.patch, failed testing.

joelpittet’s picture

Status: Needs work » Needs review
FileSize
2.06 KB

Not sure why that didn't apply but gives me a chance to fix up the docblock to match the seven theme's template.

joelpittet’s picture

Status: Needs review » Fixed

Setting back to fixed, moved to a follow-up #2310311: Fix for tablesort-indicator.html.twig image urls ... follow the bouncing ball.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.