Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cosmicdreams’s picture

FileSize
0 bytes

Yay! my first original patch! be kind ...

As hinted above, I based this patch on the aside tag. I also included the details, summary and time tags.

cosmicdreams’s picture

FileSize
1.23 KB

Wow, that was embarrasing. the patch was empty. Hopefully, this one is not.

cosmicdreams’s picture

Status: Active » Needs review
Jeff Burnz’s picture

+++ b/modules/aggregator/aggregator-feed-source.tpl.php
@@ -19,16 +19,18 @@
+<aside class="feed-source">  ¶

whitespace - and I think you missed the closing element.

+++ b/modules/aggregator/aggregator-feed-source.tpl.php
@@ -19,16 +19,18 @@
+  <details>

the spec says this should be closed (collapsed by the browser) by default, it takes a Boolean attr open="open", I don't like this idea very much.

+++ b/modules/aggregator/aggregator-feed-source.tpl.php
@@ -19,16 +19,18 @@
+    <time class="feed-updated" pubdate="<?php print $last_checked; ?>">

pubdate is a Booleen attr, not a value! the correct attr is datetime - which needs a valid date string, is $last_checked a valid date string? I don't think it is.

+++ b/modules/aggregator/aggregator-feed-source.tpl.php
@@ -19,16 +19,18 @@
+      <em><?php print t('Updated:'); ?></em> <?php print $last_checked; ?>

why are we emphasizing a labels in this template - there must be something more semantically correct than em?

Couple of things - one I think we should very quite hesitant to be ramming time elements all over the place and instead set these as variables in preprocess using a new theme function. Two lets try to keep these template conversions at the discussion level until some level of consensus is reached rather than jumping into patches too early.

Finally, sorry for being so brutal, but we have to be, it makes us stronger :)

Powered by Dreditor.

cosmicdreams’s picture

Thank you Jeff, I'll correct my patch so that the subsequent discussion has a better patch to discuss.

Here are some answers to your questions and a few questions of my own:

<?php print $last_checked; ?>

It is my assumption that this produces a date since it is what the drupal 7 templated used.

<em><?php print t('Updated:'); ?></em> <?php print last_checked;?></em>

Even though my patch says I edited this line, I really didn't. I'm not sure why it's included. I didn't really know the best semantic element to put on this part of the template so I reverted my changes back to what it was. Guess I didn't do that well enough.

Jeff Burnz’s picture

Status: Needs review » Needs work

$last_checked prints something like "18 min 49 sec ago", which is not a valid time / date string. The way I read the spec (http://bit.ly/2pAmvJ) it has to be something like this:

<time datetime="2011-06-23T20:05+00:00">18 min 49 sec ago</time>

I don't think we should even use pubdate in this template - this will be on each article within the feed (each aggregator item will be an article with a time element with datetime + pubdate - because this is the actual publication date of each item).

Regarding the use of em as a label, looking at this more now I wonder if this is actually a dl list (description list in HTML5 - http://www.w3.org/TR/html-markup/dl.html#dl).

The details element feels all wrong here - is this aside or details? I see it as tangentially related to the aggregated items - this list would work without it in other words.

I would initially be thinking this template might look something like the following - note that a new $datetime variable has been included which would do something like this:

  $vars['datetime'] = format_date($item->timestamp, 'custom', 'c');

Or we get a bit more formal and refurbish theme_date or make up a new function such as theme_datetime (another issue - just mentioning it here for reference #1183250: Add a theme_datetime() function to consistently theme dates and datetimes).

<aside class="feed-source">

  <?php if ($source_description): ?>
    <header class="feed-description"><?php print $source_description; ?></header>
  <?php endif; ?>

  <?php print $source_icon; ?>
  <?php print $source_image; ?>

  <dl class="meta">
 
    <dt class="feed-url"><?php print t('URL:'); ?></dt>
    <dd><a href="<?php print $source_url; ?>"><?php print $source_url; ?></a></dd>

    <dt class="feed-updated"><?php print t('Updated:'); ?></dt>
    <dd><time datetime="<?php print $datetime; ?>"><?php print $last_checked; ?></time></dd>

  </dl>

</aside>
Everett Zufelt’s picture

@Jeff is right, a valid datetime is:

2011-06-23 16:27:00

note you can put any date you wish in the text of the time element:
<time datetime="2011-06-23 16:23:00">Any string representing the date / time</time>

pubdate should only be set if this is the first time within a sectioning element,

pubdate="pubdate"

See #1183250: Add a theme_datetime() function to consistently theme dates and datetimes

cosmicdreams’s picture

Should we wait on this patch until the datetime patch is finalized?

Or can I roll up Jeff's thoughts into a patch that includes a placeholder for the print datetime function?

cosmicdreams’s picture

FileSize
1.3 KB

Here's a nearly faithful implementation of the code your provided Jeff. The only difference from what you wrote here is that I didn't use the print $datetime function that you referenced. Instead I put a placeholder for it.

I don't mean to stop discussion just moving the patch along with the discussion.

cosmicdreams’s picture

Status: Needs work » Needs review
aspilicious’s picture

Status: Needs review » Needs work
+++ b/modules/aggregator/aggregator-feed-source.tpl.phpundefined
@@ -19,16 +19,22 @@
+
+  </dl>
+</aside>
\ No newline at end of file

End files with a newline :)

Powered by Dreditor.

cosmicdreams’s picture

ah, thought that was a glitch. I'll fix the patch and resubmit.

I'll remember that for the future.

cosmicdreams’s picture

Status: Needs work » Needs review
FileSize
1.27 KB

Finally had time to update this patch. Added a newline at the end of the file

jessebeach’s picture

subscribe

Jeff Burnz’s picture

Status: Needs review » Needs work
+++ b/modules/aggregator/aggregator-feed-source.tpl.php
@@ -19,16 +19,23 @@
+    <dd><time datetime="2001-06-23 16:27:00"><?php print $last_checked; ?></time><dd>

Now we need to figure out how we're going to do time elements in D8.

9 days to next Drupal core point release.

jessebeach’s picture

Assigned: Unassigned » jessebeach
Status: Needs work » Needs review
FileSize
3.53 KB

I added a new date format to Drupal Core called date_format_machine that prints out an ISO Formatted date string e.g. 'Y-m-d\TH:i:s\Z'. The preprocess function for the template is updated to leverage this new date formatter.

jessebeach’s picture

Assigned: jessebeach » Unassigned
Status: Needs review » Needs work

Oops! I hadn't seen #1183250: Add a theme_datetime() function to consistently theme dates and datetimes yet!

Please disregard the patch in #16.

Resetting to Needs Work.

jessebeach’s picture

I've got this mostly working locally, just waiting on #1183250: Add a theme_datetime() function to consistently theme dates and datetimes to finish up and get committed.

I'm not sure what happens if I upload a patch that depends on a theme function that doesn't exist yet, but I'm going to try anyway. If you want to look at this patch, you need to apply the one in the above-linked issue as well.

cosmicdreams’s picture

Status: Needs work » Needs review

changing status to test patch.

oriol_e9g’s picture

1. \ No newline at end of file aggregator-feed-source.tpl.php

2.

+      'url' => $feed->url, 

whitespace

cosmicdreams’s picture

You mean the whitespace at the end of the line? if so, here ya go:

jessebeach’s picture

Assigned: Unassigned » jessebeach
FileSize
3.73 KB

Rerolled for the new D8 /core directory.

Added the theme_datetime function.

Fixed a tiny bug in the call of theme_image where the parameter path had been changed to uri in a previous core commit.

Jacine’s picture

Issue tags: +sprint

Hey, thanks for the patch @jessebeach. Tagging this to it gets some love this sprint.

cosmicdreams’s picture

What's next? I've tried reviewing this but I'm not seeing anything "wrong". Happy to help tweak this one if necessary.

aspilicious’s picture

Status: Needs review » Needs work
FileSize
7.6 KB
5.39 KB

Nop it doesn't look ok :).
The template changes probably are ok but we need some css to compensate the changes.

Probably only needed for Bartik

dcmouyard’s picture

Status: Needs work » Needs review
FileSize
3.66 KB

Added the following styles to Bartik:

.feed-details dt,
.feed-details dd {
  display: inline;
  margin: 0;
} 
.feed-details dd:after {
  content: '\A';
  white-space: pre;
}
aspilicious’s picture

You need to explain this to me because the dd:after looks very creapy to me.
I never used :after before, did some research and it's not support in Luckily we don't have to support those anymore.

What does '\A' do? And white-space: pre; ?
Are 'Url' and 'Title' in italic now?

dcmouyard’s picture

This CSS should work in IE8+, Chrome, Safari 4+, Firefox 3+, and Opera 10+.

After the <dt> and <dd> elements are set to inline, a Unicode line break character (\A) is inserted into the dd:after psuedo-element to make <dt> elements begin on a new line.

aspilicious’s picture

Issue tags: -html5, -sprint
mgifford’s picture

Status: Needs review » Needs work
Issue tags: +html5, +sprint

The last submitted patch, convert-aggregator-feed-source-1189804-26.patch, failed testing.

mgifford’s picture

Annoying when files move. Basically a re-roll.

smira’s picture

i'd say strip the patch down to just the modifications to the template file.
the first part of the patch doesn't apply anymore due to that function being completely removed.
the middle part of the patch breaks those variables and they don't print out anymore...

here is a screenshot of the result of the patch
Only local images are allowed.

i think it would just be best to convert this patch to modify the tpl file, i will follow up with that shortly and see what we come up with

smira’s picture

i think this approach is better much simpler, also modified comments to reflect new source data position within the page

mgifford’s picture

FileSize
3.45 KB

Here's the interdiff between 32 & 34.

star-szr’s picture

Issue tags: +Twig, +Needs reroll

Needs a reroll now that aggregator-feed-source.tpl.php is aggregator-feed-source.html.twig. New markup looks nice :)

star-szr’s picture

Title: Convert aggregator-feed-source.tpl.php to HTML5 » Convert aggregator-feed-source.html.twig to HTML5
pwieck’s picture

Assigned: jessebeach » pwieck

Working on this one

pwieck’s picture

Assigned: pwieck » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
1.32 KB

Modified aggregator-feed-source.html.twig to reflex patch #34

pwieck’s picture

#39 Passed and is ready for review, testing or rework.

pplantinga’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Looks good to me!

pplantinga’s picture

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

oriol_e9g’s picture

This...

+</div

should be this one:

+</div>

right?

oriol_e9g’s picture

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

Status: Needs review » Needs work

Definitely, if you can provide a patch that would be great!

catch’s picture

Whoops. Reverted for now.

star-szr’s picture

Issue tags: +Novice

Even better, thanks @catch. Tagging novice to fix the improperly closed div and post a new patch and interdiff :)

martin107’s picture

single byte change to patch

martin107’s picture

Status: Needs work » Needs review
oriol_e9g’s picture

Status: Needs review » Reviewed & tested by the community
oriol_e9g’s picture

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Re-committed and pushed to 8.x. :) Thanks!

Status: Fixed » Closed (fixed)

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