In looking at:
https://git7site.devdrupal.org/node/1339130

I noticed that there are empty headers:

<h3 class="comment-title"></h3>
<a class="permalink" rel="bookmark" href="/comment/5558104#comment-5558104">#1</a>

Can we just change this to:
<h3 class="comment-title"><a class="permalink" rel="bookmark" href="/comment/5558104#comment-5558104">#1</a></h3>

That way it's going to be more accessible.

Comments

jthorson’s picture

Status: Active » Needs review
Issue tags: +drupal.org D7

Title versus Permalink are two different styles ... but it makes sense that we shouldn't output the "comment-title" element if the title itself is empty.

mgifford’s picture

Just removing empty <h3 class="comment-title"></h3> is fine too.

tvn’s picture

Project: [Archive] Drupal.org D7 upgrade QA » Project issue tracking
Version: » 7.x-2.x-dev
Component: Code » Issues
Issue tags: -drupal.org D7 +Drupal.org 7.1

Moving to Project issue for now, maybe Bluecheese is a better place though.

drumm’s picture

Status: Needs review » Active

No patch is here to review.

mgifford’s picture

I don't know where to find the relevant code. I grepped around but didn't find it.

drumm’s picture

Project: Project issue tracking » Bluecheese
Version: 7.x-2.x-dev »
Component: Issues » User interface

This actually should probably be fixed in our comment.tpl.php, which is similar to core's. We have a permalink, but no title set.

Please do follow up on this in core D8 too, http://drupalcode.org/project/drupal.git/blob/refs/heads/8.x:/core/modul... looks like it would do the same thing when a permalink, but no title, is set.

mgifford’s picture

In that case, based on modules/comment/comment.tpl.php

Maybe we should just use:

  <?php if ($title): ?>
    <h3<?php print $title_attributes; ?>><?php print $title ?></h3>
    <?php print render($title_suffix); ?>
  <?php endif; ?>

I will follow-up --> Including patches #2170251: Comment headings can spit out empty heading tags

mgifford’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new726 bytes
mparker17’s picture

mgifford’s picture

StatusFileSize
new906 bytes

I forgot that the <h3> needs to be wrapped around the permalink. Thanks for the reminder Matt!

mgifford’s picture

StatusFileSize
new2.08 KB

With better pronunciation for screen reader users.

mparker17’s picture

Status: Needs review » Reviewed & tested by the community

I've tested this in a screenreader, and it works.

When I use the headings rotor on Voiceover (on Mavericks) to show me all the headings on the page, I see "Comment #1", "Comment #2" for each comment on the page.

Marking as RTBC.

drumm’s picture

Committed the Project Issue chunk and deploying.

drumm’s picture

Status: Reviewed & tested by the community » Needs work

The Bluecheese patch changes the size of the headings. They should stay the same.

And I realized that the project_issue patch includes new non-translatable text. I'll leave it in for now, but please follow up with a patch that adds a call to t().

mgifford’s picture

I checked that the new HTML

<div class="comment clearfix">
<h3>
<a class="permalink" rel="bookmark" href="/comment/8291535#comment-8291535">#3</a>
</h3>
</div>

is still styled by the same CSS:

.comment .permalink {
  font-size: 1.1538em; 
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: bold;
  line-height: 1.6875em;
}

I don't understand what isn't the same size. Just let me know and I'll write it up.

I applied the bluecheese patch only to http://search_api-drupal.redesign.devdrupal.org/node/2159813

Great to hear that t() is being added. I think I was thinking Bluecheese rather than the project issue which of course would need to be multilingual.

mgifford’s picture

Status: Needs work » Needs review
StatusFileSize
new1.19 KB

This patch is just the addition of i18n around the "Comment #". I thought the context with the span may be useful so didn't just do a simple t('Comment').

mparker17’s picture

Assigned: Unassigned » mparker17

@mgifford, I think @drumm means that the computed font-size on the dev site is 18px instead of 15px. This change happened because the h3 increased the font-size 1.231em before the changes to the font-size were made elsewhere.

The use of the h3 tag also added about 9px of margin below the comment number.

I'll see what I can do about fixing this.

mparker17’s picture

Okay, I've fixed the font-size problem. Attaching patch and before+after screenshots.

Links are:

Reviews welcome.

mparker17’s picture

It's worth noting that the horizontal scrollbar in the "after" screenshot is caused by another issue's addition of social media buttons to the footer, and those changes are not included in the patch attached to this issue.

mgifford’s picture

This looks good to me. This patch addresses the sass files (which is great). Also useful to see this change in the CSS in sites/all/themes/bluecheese/css/styles.css

+.comment h3.permalink-wrapper {
+  margin: 0;
+}
 .comment .permalink {
-  font-size: 1.1538em;
+  font-size: 0.9375em;
   font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
   font-weight: bold;
   line-height: 1.6875em;

I don't know which environment to test this in.

@drumm would you want this tested somewhere else before marking it RTBC?

mparker17’s picture

> I don't know which environment to test this in.

You can see my changes at http://search_api-drupal.redesign.devdrupal.org/

mgifford’s picture

And they look good there.

mparker17’s picture

RTBC?

mgifford’s picture

Status: Needs review » Reviewed & tested by the community

I think so.

drumm’s picture

Project: Bluecheese » Project issue tracking
Version: » 7.x-2.x-dev
Status: Reviewed & tested by the community » Needs work

Looks like the project_issue part is almost there. This can move back to bluecheese when that's done.

$thread needs to move into the t() call, and be sanitized via an @ placeholder. It may only be a number, but it was being sanitized before. And translators might want to rearrange the entire string, without the number stuck at the end.

mparker17’s picture

Assigned: Unassigned » mparker17

Whoops... I'll fix that.

mgifford’s picture

StatusFileSize
new3.19 KB
mgifford’s picture

Status: Needs work » Needs review

Sorry, Matt. I saw your not after I'd written the patch.

mparker17’s picture

Assigned: mparker17 » Unassigned
Status: Needs review » Reviewed & tested by the community

Looks like that patch addresses @drumm's concerns, so marking as RTBC.

***

The staging server is currently throwing "Undefined index" errors from lines earlier in project_issue.module, but I don't believe they are related to the changes in this patch.

mgifford’s picture

That error is mine.. I should just comment out the code.. Will do that later today..

I've made enough little changes to it I'm getting to the stage where I want to do.

bzr reset --hard

I just don't know if that exists or what that would do to others working on the code....

drumm’s picture

Project: Project issue tracking » Drupal.org customizations
Version: 7.x-2.x-dev » 7.x-3.x-dev
Status: Reviewed & tested by the community » Needs work

Committed the project_issue portion.

We try to keep PHP customizations in the theme minimal. This portion of our theme currently matches core's comment.tpl.php:

-  <?php print render($title_prefix); ?>
-  <h3<?php print $title_attributes; ?>><?php print $title ?></h3>
-  <?php print render($title_suffix); ?>
+  <?php if ($title): ?>
+    <?php print render($title_prefix); ?>
+    <h3<?php print $title_attributes; ?>><?php print $title ?></h3>
+    <?php print render($title_suffix); ?>
+    <?php print $permalink; ?>
+  <?php endif; ?>

This seems like a good change for core, so the issue for it should start there. We can patch bluecheese to keep up as that issue progresses.

The h3 wrapper can instead be added by a preprocess function, drupalorg_preprocess_comment():

-  <?php print $permalink; ?>
+  <?php if (!$title): ?>
+    <h3 class="permalink-wrapper"><?php print $permalink; ?></h3>
+  <?php endif; ?>

That function (rather than say something in drupalorg_project) already acts on issue comments, it is good to keep that code all in one place. I don't think this makes sense in project_issue; that module doesn't need to dictate whether sites running it have comment subjects or not.

mgifford’s picture

Thanks for committing the project_issue portion.

Good to keep the theme customizations to a minimum.

Yes. i started that issue on D8 back at the beginning of January. It can be hard sometimes to get traction on various Core issues. Resources are scarce as you know.

So you'd prefer to put it all into the preprocess function with the H3's, and then simply do something like <?php print $permalink ?>

Agreed about keeping the code together where possible. I've just poked around as you know and it's easy to get lost.

EDIT: That should be <?php print $permalink_title; ?>

mgifford’s picture

Both drupalorg_project_preprocess_node() & drupalorg_project_preprocess_comment_wrapper() are mucking with the comments in drupalorg_project.module. But in the latter. I think that this would be the best place to put a $permalink_title:

function drupalorg_project_preprocess_comment_wrapper(&$variables) {
  if (project_issue_node_type_is_issue($variables['node']->type) && !empty($variables['content']['comment_form'])) {
    $update_link = 'node/' . $variables['content']['comment_form']['#node']->nid . '/edit';
    $variables['comment_form_title'] = t('Add new comment') . ' | ' . l(t('Update this issue'), $update_link);
    $variables['permalink_title'] = (!empty($variables['title'])) ? '<h3 class="permalink-wrapper">' . $variables['permalink'] . '</h3>' : '';
  } 
}

t('Add new comment') . ' | ' . l(t('Update this issue'), $update_link);

drumm’s picture

Assigned: Unassigned » drumm
Parent issue: » #936304: [META] Style issue comments

Will be good to get this out of the way ahead of #936304: [META] Style issue comments.

drumm’s picture

Status: Needs work » Needs review

https://drumm-drupal.redesign.devdrupal.org/node/2240063 is an example of the change for this.

mgifford’s picture

StatusFileSize
new93.24 KB

Can you just get rid of this empty heading here:

<h3 class="comment-title"></h3>

Otherwise it looks ok:

  <div class="submitted">
    <h3 class="permalink-wrapper"><a rel="bookmark" class="permalink active" href="/node/2240063#comment-8687911"><span class="element-invisible">Comment </span>#4</a></h3>    Posted by <a class="username" title="View user profile." href="/user/1853874">formatC'vt</a> on <time datetime="1397646628" pubdate="">April 16, 2014 at 11:10am</time>      </div>

comment headings from drumm's sandbox

drumm’s picture

mgifford’s picture

Yes, but we're not sure how to replicate this problem in D8 #2170251-20: Comment headings can spit out empty heading tags

Plus, it's a pretty trivial fix in the template. It could just be removing the heading in bluecheese.

In /tpl/comment.tpl.php we can just delete this line, right:

<h3<?php print $title_attributes; ?>><?php print $title ?></h3>

With all the changes with Twig, I really don't know that we need to wait for this to be backported from D8 to D7 in order to fix this accessibility problem that is affecting folks on drupal.org right now (and for the last 9 months).

  • Commit 9f5c04f on 7.x-3.x by drumm:
    #2095969 Add headings for issue comments, which do not have subjects,...
drumm’s picture

Status: Needs review » Fixed
Issue tags: +needs drupal.org deployment

This is now on staging sites, like https://staging.devdrupal.org/node/2224917, for testing.

mgifford’s picture

Looks good.

The empty headings is still a problem and really don't think it's something that will take the year or so that it may take to get through to a D7 Core release.

drumm’s picture

Issue tags: -needs drupal.org deployment

Now deployed.

Just removing the line would remove subjects where we do use them - in forum comments and I think everywhere else except issues. We actually aren't overriding comment.tpl.php now, so we rely on what core gives us.

Status: Fixed » Closed (fixed)

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