Sharing gnucash.css between htdocs and mail-search?

Derek Atkins warlord at MIT.EDU
Tue Jan 17 16:51:03 EST 2006


Neil,

Actually, as I think about this more... we ONLY want the menus.phtml
to have absolute paths on the mail-search server...  I wonder if there's
some way we can do that based upon including some additional file?  e.g.
something like this:

/css/menus.phtml:
   ...
   homepage_top=""
   if file_exists(gnucash-top.php)
   include gnucash-top.php
   ...
   <a href="$homepage_top/xxx">xxx</a>
   ...

And then on the mail-server we put something like this:

/css/gnucash-top.php:
   homepage_top="http://www.gnucash.org"

Note that I have no clue if something like this is even possible...
We could even ignore this file and have it not in SVN, or have
a blank version.. Or something..  I don't know.  It all depends on
whether we could do something like this..

But as I was thinking about it, you're right, we don't want /htdocs to
have absolute paths because we want to allow mirrors to pull off
the content directly from SVN and be able to use it locally without
significant amounts of work.

NOTE:  we could always script the "localization to the server" portions
in the "update" script.

-derek

Quoting Neil Williams <linux at codehelp.co.uk>:

> On Tuesday 17 January 2006 8:21 pm, Derek Atkins wrote:
>> I was wondering what you think about sharing gnucash.css between
>> the htdocs (website) and the mail-search modules?  Do you think
>> it's reasonable to work towards sharing the same css and support
>> (iconsm etc)?
>
> Yes, but I thought about the two servers and wondered how it would be done.
>
> It is, essentially, the same file but it's actually quite small and I think
> the bigger benefit comes from sharing the menu*.phtml files.
>
> Sharing the menu files would mean that the search page links are always in
> step with all the other pages. It seems strange for one page to have the
> wrong links like that. search.php can include the menu files directly but
> that's extra network traffic each time the search page is displayed. Better
> if - once I'm done - future changes to the en/menu/* files get propagated to
> mail-search.
>
> Problem: We'd have to have absolute URL's in the menu links which makes it
> hard to test the htdocs/ svn locally - or use a PHP redirect but that would
> be executed each time, not just when testing. That could be a real PITA.
> Alternatively, scripting the links means either generating them every time a
> page is viewed according to the current host (bad) or creating a bespoke
> commit hook that tries to mangle the local links to absolute (sounds like
> trouble).
>
> Once I'm done here, the CSS isn't likely to change that much - and there will
> be new parts to gnucash.css that aren't needed in search.css. It's as easy to
> copy the CSS file across locally between the two trees and make a separate
> commit, if there are changes that need to be shared. I'll make sure there
> aren't any overlaps so if it's better to have just one CSS with some
> redundant content, we can do that too.
>
>> One approach to sharing would be moving gnucash.css from the top-level
>> and into its own subdirectory (htdocs/css/gnucash.css) and then
>> in the mail-search we could use the subversion svn:externals
>
> <snip>
>
>> It would imply that changes to the css get propagated into both
>> locations, which would make it much easier to keep it all in sync.
>>
>> What do you think?
>
> Whichever way we do it, sharing one site across two servers is going to make
> things difficult. We can't move mail-search without moving the list archives.
> If we want mail-search truly joined up with the rest of the content the only
> real solution is to move the gnucash.org website to lists.gnucash.org.
>
> We may just have to live with copying files between sites and adapting where
> necessary.
>
> --
>
> Neil Williams
> =============
> http://www.data-freedom.org/
> http://www.nosoftwarepatents.com/
> http://www.linux.codehelp.co.uk/
>
>



-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available



More information about the gnucash-devel mailing list