On 30 April 2018 at 16:34, Henk P. Penning <[email protected]> wrote:
> On Mon, 30 Apr 2018, sebb wrote:
>
>> Date: Mon, 30 Apr 2018 14:34:13 +0200
>> From: sebb <[email protected]>
>> To: [email protected]
>> Subject: Re: discussion/vote new site (again, but last time from me)
>
>
>> Let's not forget that Jani created the initial JSON file contents.
>> That was quite a bit of work.
>
>
> True ; big thanks.
>
>> Note that proj-data includes layout in the above list.
>
>
> Yep, the $proj-data is a (tag->value) html table ;
> the script computes a table
>
> [ tag => tag_function ( param, ... )
> , ...
> ]
>
> Then the table is converted to html ; this is straight forward.
>
>>> -- only 3 substitutions are needed [project-list, title, $proj-data].
>>
>>
>> Additional substitutions of need to be made to create the proj-data as
>> that is a mix of variable data with fixed layout.
>
>
> Don't understand ; the per/proj html == table + 'postlude'.
>
$proj-data is a mixture of variable data and fixed markup.
These have to be merged.
>>
>>> and can't be understood unless you look at the code too.
>>
>>
>> In the lua case, the conditional and looping code is buried inside the
>> Perl script.
>
>
> I'm not religous about the ModelViewControler stuff ;
> I like stuff in one place (file), if the file is small.
>
>> At present the code generates a Board entry in the table regardless of
>> whether it is a sub-project or not. How would you fix that so it
>> agrees with the existing Attic site?
>
>
> Ok ; I'll bite ...
I would hope you can fix it as you are the author.
My point was how easy it is for other people to fix.
It may have to be updated by people other than you.
> If the 'minutes' entry also depends on entry 'subproject'
> pass it to function 'minutes_url' ; let 'minutes_url'
> return 'n/a' if subproject is not empty ;
>
> sub minutes_url
> { my $p = shift or return $NA ; # == 'n/a'
> my $s = shift or return $NA ;
> url "https://whimsy.apache.org/board/minutes/$p.html", 'Minutes'
> }
>
> If you mean the line shouldn't be there at al, I would fix function
Yes, that is what the current site does.
The line is omitted from the table.
> minutes_url to return undef, and fix the tab-to-table expansion
> skip entries with and undefined value ; that is one extra line.
But is it clear to the reader what is happening?
> Nevermind ; anything can be easily fixed.
> I maintain that the problem is simple,
> and using a template system is overkill.
> To me, the split is "controler logic" and "view logic"
> (as with 'board' example) is confusing and a hindrance.
>
>> It's a well-written script, but it is hard to follow - mainly because
>> it mixes content with presentation.
>
>
> yea ; that is 6 lines of code ;
> it makes I only need 1 very simple template,
> that doesn't change when attributes change.
Of course the template does not change when attributes change.
That is the point of a template.
However the Perl solution means that code has to change when the
conditions for displaying information change.
> Netto : a big win.
Not to my mind.
> Groeten,
>
> HPP
>
>
> ------------------------------------------------------------ _
> Henk P. Penning, ICT-beta R Uithof MG-403 _/ \_
> Faculty of Science, Utrecht University T +31 30 253 4106 / \_/ \
> Leuvenlaan 4, 3584CE Utrecht, NL F +31 30 253 4553 \_/ \_/
> http://www.staff.science.uu.nl/~penni101/ M [email protected] \_/