more from the pile of patches i have on top of CVS

Comments

Wesley Tanaka’s picture

Status: Active » Needs review
dries’s picture

Status: Needs review » Needs work

Coding style needs work; we don't glue word together + incorrect use of spaces.

Wesley Tanaka’s picture

StatusFileSize
new641 bytes

we don't glue word together + incorrect use of spaces.

huh?

I split the css classes with hyphens if that's what you meant by the first part
I removed the extra space that was previously after $description
I added spaces between the . concatenation operator and the $class variable

But I'm just kind of grasping at straws here, since i don't understand your comment.

Wesley Tanaka’s picture

Status: Needs work » Needs review
Tobias Maier’s picture

I never looked at the whole function you are patching here

but do we really need the class "no-new-topics"?
if it is not new it is a ordinary topic so dont define any class

and you want to use padding...
when you think about the box-modell then margin-left would be better in my opinion...

Wesley Tanaka’s picture

padding allows for a background image to use that space.

See

http://treehouse.ofb.net/go/en/forum

for an example (create an account/login to see the classes in action)

jose reyero’s picture

I agree with Thobias, we don't need new styles here.

And indeed, hardcoding styles in the HTML code is not a good idea. I'm talking too of these style="margin...", which I handn't seen before.

I think all that styling should be in the CSSs and for displaying the nested comments a set of enclosed divs would be more adequate. But for things like adding images, this a themeable function, so you can add that funny things in your theme.

Wesley Tanaka’s picture

Did you mean "we don't need a new class here"?

Good point about it being a themeable function. Let me offer up an extreme proposal using those arguments: Why not get rid of the new-topics class and lighten up the HTML?

The point is that having a new-topics class (but no non-new-topics class) is rather pointless the way CSS is today, because I don't think it's possible (and if it is, probably not very well supported) to do a CSS selector that picks all elements at a given level that *don't* have a certain class applied.

Please correct me if I'm wrong about that (especially the "very well supported" part).

Wesley Tanaka’s picture

I think all that styling should be in the CSSs

I agree that this is the way the codebase should have already been. Perhaps it might be worth opening a new issue to clean up this particular theme function to make that the case?

and for displaying the nested comments a set of enclosed divs would be more adequate

To clarify -- this deals with the main forum page, which does not have any comments displayed on it -- only a summary of what forums are available.

heine’s picture

Category: bug » feature

As this function is themeable I consider this a feature request.

Wesley Tanaka’s picture

Category: feature » bug

If we were to extend that reasoning to a conclusion, we should strip any default formatting, classes, etc. out of core default theme functions, and force themes to override all theme functions, giving a very spartan look to a site that didn't override any theme functions.

There may be an argument for doing things that way, but currently, default theme functions are structured to provide a reasonable default which themes can often customize only using CSS.

The particular theme function in question -- theme_forum_list -- is a monolithic beast that appears to be written with the idea that the "class" attributes defined on the output it produces will be suitable for themeing. Note that almost all elements produced have a class defined. This just adds a class attribute to one of the few cases that didn't have one defined.

drumm’s picture

Status: Needs review » Needs work

This is a themeable function (a bit large and full of too much PHP, but still themeable), so the changes are not necessary for core.

There are two separate changes here.

1. Change margin to padding
- This would make the code inconsistent since there is a similar margin further down.
- I think the box model argument is better than the background image one. Especially since you can change it in your theme.

2. Add a class showing if there are new posts or not.
- This is relatively okay.
- You can always leave out the not-.. class and apply CSS that would be for not new to all of them and then layer the new class on top. Having not-... classes is not a convention in Drupal.

To solve both- why not put the class on the parent table cell and put your background there?

Wesley Tanaka’s picture

StatusFileSize
new2.17 KB

Great idea.

I added the class to the table row instead of the cell, to allow for things like changing the background of the whole row.

Also included in the patch are classes for forum.css which use the forum new/default icons in misc/ as an example. They look reasonable with the 4 themes that ship with core, but I don't know how they will interact with other themes.

Wesley Tanaka’s picture

Status: Needs work » Needs review
Wesley Tanaka’s picture

StatusFileSize
new2.18 KB

This patch is the same as in #13, but the colons in the CSS changes have spaces after them now.

drumm’s picture

Version: x.y.z » 6.x-dev
Status: Needs review » Needs work

if statements and other blocks should always have {}

Wesley Tanaka’s picture

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

added curly braces to if block

dries’s picture

Status: Needs review » Fixed

Committed to CVS HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)
Wesley Tanaka’s picture

Note: the patch on #17 will apply against the 5.x forum module if anyone happens to be looking for a backport.