Edgewall Software
Modify

Opened 10 years ago

Last modified 3 years ago

#7872 new enhancement

[Patch] Styling for "Powered by" footer element

Reported by: techtonik <techtonik@…> Owned by:
Priority: normal Milestone: next-major-releases
Component: general Version: none
Severity: minor Keywords: javascript, patch, needfixup
Cc: Thijs Triemstra Branch:
Release Notes:
API Changes:

Description

This patch for Trac design alters theme.html and CSS to allow plugins add new "Powered by" blocks into footer with a simple jQuery.

  $('<p>Powered by TracHacks</p>').appendTo("#footer");

Attachments (5)

powered_by.patch (1.5 KB ) - added by techtonik <techtonik@…> 10 years ago.
powered_by.0.17.patch (1.5 KB ) - added by anatoly techtonik <techtonik@…> 9 years ago.
updated for 0.17
without_patch.png (5.8 KB ) - added by anatoly techtonik <techtonik@…> 9 years ago.
with_patch.png (5.6 KB ) - added by anatoly techtonik <techtonik@…> 9 years ago.
powered-0.13.patch (1.6 KB ) - added by Thijs Triemstra 8 years ago.
against trunk r10501

Download all attachments as: .zip

Change History (21)

by techtonik <techtonik@…>, 10 years ago

Attachment: powered_by.patch added

comment:1 by ebray, 10 years ago

Why?

Besides, if a plugin for some reason needed to do such a thing, ITemplateStreamFilter would be the way to go. Not JavaScript.

comment:2 by techtonik <techtonik@…>, 10 years ago

For ITemplateStreamFilter you need to know too many things. With clear DOM + CSS templates you do not need to know Python and Trac internals to change design or to enhance it with third-party API services that pop all over the web.

Take a look at this usage of translation API from Google:

and the source code:

comment:3 by ebray, 10 years ago

That's cool and all, but I don't see how it applies here. If you wanted to add some static content to the footer, JavaScript hardly seems the way to go.

Also,

return stream | Transformer('#footer').append(tag.p('Powered by TracHacks'))

Doesn't look horribly different…

Don't get me wrong, I see the point of the changes to the HTML and CSS, and they seem harmless enough. I'm just not sure why you would want to use JavaScript for this particular case, or what the translation plugin has to do with this. Anyways,

comment:4 by techtonik <techtonik@…>, 10 years ago

To write the string you mentioned I need serious experience with Python, XSLT and XPath (to get the Genshi transormation logic). Frankly speaking even possessing this experience I can not say where I need to plug the string without grepping existing plugins for an example first.

All functionality in this particular case is in JavaScript, and while I can foresee problems with layout debug when modifications from JS plugins are stacked in random order, I still do not think that debug on the Genshi level is less obscure or more easy.

Another reason is ability of JS to be turned off. Then this translation plugin won't work, so it doesn't make sense to add "Powered by Google" in the footer. Genshi layer can not detect when JS is disabled.

comment:5 by anonymous, 10 years ago

javascript:document.body.contentEditable = 'true'; document.designMode='on';void 0

comment:6 by Christian Boos, 10 years ago

Keywords: javascript needinfo added

While I agree that in this specific case adding the extra "Powered by Google" in the footer should better be done in Javascript, I fail to see what prevents it to be done. What part of the changes in attachment:powered_by.patch can't be done using Javascript?

comment:7 by anatoly techtonik <techtonik@…>, 10 years ago

The problem is that after JS append listed in ticket description the layout is messed up. The CSS patch fixes that. This way other "Powered by" hacks won't need to mess with styles. AFAIR it took quite a time to figure out the correct combination or margins etc. to align everything correctly.

comment:8 by Christian Boos, 10 years ago

Keywords: needinfo removed
Milestone: 0.12.1
Severity: normalminor

comment:9 by Christian Boos, 9 years ago

Milestone: next-minor-0.12.x
Resolution: wontfix
Status: newclosed

I'm not really convinced these CSS modifications can't be done with Javascript. Even so, the use case is far too specific to justify a global change, in my opinion.

by anatoly techtonik <techtonik@…>, 9 years ago

Attachment: powered_by.0.17.patch added

updated for 0.17

by anatoly techtonik <techtonik@…>, 9 years ago

Attachment: without_patch.png added

by anatoly techtonik <techtonik@…>, 9 years ago

Attachment: with_patch.png added

comment:10 by anatoly techtonik <techtonik@…>, 9 years ago

Resolution: wontfix
Status: closedreopened

You can do these CSS customization with Javascript np, but you need to know HOW to modify CSS so that your "powered by" breadcrumb won't look ugly - see attaches. I've spent most of the time aligning them to consider this tiny minor change as significant.

People will be more happy if their Trac Hacks will be easy.

comment:11 by Christian Boos, 8 years ago

Milestone: unscheduled

The patch doesn't apply on trunk.

comment:12 by Thijs Triemstra, 8 years ago

Cc: Thijs Triemstra added
Keywords: patch added
Summary: "powered by" CSS patch[PATCH] "powered by" CSS

comment:13 by Christian Boos, 8 years ago

Keywords: needfixup added

(per comment:11)

by Thijs Triemstra, 8 years ago

Attachment: powered-0.13.patch added

against trunk r10501

comment:14 by Thijs Triemstra, 8 years ago

Milestone: unschedulednext-major-0.1X

Added an updated patch against 0.13.

comment:15 by Ryan J Ollos, 4 years ago

Status: reopenednew

comment:16 by figaro, 3 years ago

Summary: [PATCH] "powered by" CSS[Patch] Styling for "Powered by" footer element

Changed summary to more accurately reflect what the enhancement involves.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set.
The owner will be changed from (none) to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.