Bug 7181

Summary: Template indentation
Product: Koha Reporter: Paul Poulain <paul.poulain>
Component: Architecture, internals, and plumbingAssignee: natasha <tasham_8>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: hayleypelham, tasham_8
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 7119    
Attachments: Screenshot of code

Description Paul Poulain 2011-11-06 05:31:57 UTC
The template indentation make it very hard to read. For example, in circulation.tt:
    [% IF ( MARCURLS ) %]
    <div class="results_summary"><span class="label">Online Resources:</span>
    <ul>    [% FOREACH MARCurl IN MARCURLS %]
        <li>[% IF ( MARCurl.part ) %][% MARCurl.part %]
            <br />[% END %] 
        <!-- here you might do a tmpl_if name="toc" and use greybox or equivalent for table of contents -->
        
        [% IF ( MARCurl.OPACurlOpenInNewWindow ) %]<a href="[% MARCurl.MARCURL %]" title="[% MARCurl.MARCURL %]" target="_blank">[% ELSE %]<a href="[% MARCurl.MARCURL %]" title="[% MARCurl.MARCURL %]">[% END %]
        
        [% MARCurl.linktext %]</a>
            [% IF ( MARCurl.notes ) %]<ul>[% FOREACH note IN MARCurl.notes %]<li>[% note.note %]</li>[% END %]</ul>[% END %]</li>
            [% END %]</ul>
    </div>
    [% END %]

The last end, that is aligned with the first [IF] don't close this if...

During kohacon11 hackfest, we tried to investigate how to indent templates.
We haven't found THE solution, but here are a few links (thanks mason) :
http://www.perlmonks.org/?node_id=887632
http://wiki.dandascalescu.com/howtos/indenting_tt_and_html
Comment 1 natasha 2016-01-20 21:03:53 UTC
Created attachment 47050 [details]
Screenshot of code

This looks like it has already been fixed.
Comment 2 Hayley Pelham 2019-03-14 22:11:53 UTC
This appears to be fixed. Changing status to Resolved.