<h1 tal:replace="structure context/manage_page_header">PAGE HEADER</h1>
<h2 tal:replace="structure context/manage_tabs">TABS</h2>

<style type="text/css">
.file-to-dir {
    font-weight: bold;
    background-color: rgb(255, 182, 193);
}

.file-added {
    font-weight: bold;
    color: rgb(0, 139, 139);
}

.file-removed {
    font-weight: bold;
    color: rgb(0, 0, 139);
}

.dir-to-file {
    font-weight: bold;
    background-color: rgb(255, 182, 193);
}

.dir-added {
    font-weight: bold;
    color: rgb(0, 139, 139);
}

.dir-removed {
    font-weight: bold;
    color: rgb(0, 0, 139);
}

.diff-range {
    background-color: rgb(244, 244, 244);
    color: rgb(165, 42, 42);
    font-weight: bold;
}

.diff-context {
    background-color: rgb(244, 244, 244);
}

.diff-added {
    background-color: rgb(244, 244, 244);
    color: rgb(0, 139, 139);
}

.diff-removed {
    background-color: rgb(244, 244, 244);
    color: rgb(0, 0, 139);
}

.diff-header {
    font-weight: bold;
}
</style>

<div tal:define="lhs request/lhs | string:;
                 rhs request/rhs | string:;
                 ">

<h3> Setup Tool </h3>

<p class="form-help">
By selecting two snapshots (or a snapshot and a filesystem setup directory), a
comparison can be made, highlighting the differences between the two
configuration sets.
</p>

<p>Configurations to compare:</p>
<form method="post" action="."
      tal:attributes="action string:${context/absolute_url}">

<select name="lhs">
 <option value="context-CONTEXT_ID"
    tal:repeat="context_info context/listContextInfos"
    tal:attributes="selected python:lhs == context_info['id'];
                    value context_info/id"
    tal:content="context_info/title"
 >CONTEXT_TITLE</option>
</select>

<select name="rhs">
 <option value="context-CONTEXT_ID"
    tal:repeat="context_info context/listContextInfos"
    tal:attributes="selected python:rhs == context_info['id'];
                    value context_info/id"
    tal:content="context_info/title"
 >CONTEXT_TITLE</option>
</select>

<br />

<input type="hidden" name="missing_as_empty:int:default" value="0" />
<input type="checkbox" name="missing_as_empty:boolean" value="1"
       tal:attributes="checked request/missing_as_empty | nothing" />
Treat missing files as empty 

<br />

<input type="hidden" name="ignore_blanks:int:default" value="0" />
<input type="checkbox" name="ignore_blanks:boolean" value="1"
       tal:attributes="checked request/ignore_blanks | nothing" />
Ignore lines of whitespace

<br />

<input type="submit" name="manage_showDiff:method" value="Compare">
<input type="submit" name="manage_downloadDiff:method" value="Download">

</form>

<hr />

<div tal:condition="python: lhs and rhs" >
    
<div tal:define="mae request/missing_as_empty | nothing;
                 ib request/ignore_blanks | nothing;
                 mcc nocall: context/manage_compareConfigurations;
                 comparison python:mcc( lhs, rhs, mae, ib )"
>
<p>
Comparison of <span tal:replace="request/lhs">LHS</span>
          and <span tal:replace="request/rhs">RHS</span>:</p>

<span tal:replace="structure python: context.markupComparison( comparison )"
>COMPARISON HERE</span>

</div>
</div>

</div>

<h1 tal:replace="structure context/manage_page_footer">PAGE FOOTER</h1>
