Changeset 928 for trunk/templates

Show
Ignore:
Timestamp:
03/10/07 23:49:39 (21 months ago)
Author:
kake
Message:

Write tests for and fix bugs #48 and #173; in the process, move preview_node() and edit_node() from wiki.cgi into OpenGuides.pm, and add more functionality to OpenGuides::Test.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/templates/edit_form.tt

    r859 r928  
     1[% USE CGI %] 
    12[% INCLUDE header.tt page_title = "Edit $node_name - $site_name" %] 
    23<div id="content"> 
     
    45<div id="maincontent"> 
    56<h1 align="center">Edit &quot;[% node_name %]&quot;</h1> 
     7 
     8[% IF conflict %] 
     9  <div class="warning_text"> 
     10    Someone has committed changes to this node since you began editing. 
     11    You will need to manually merge your changes into the new version. 
     12  </div> 
     13[% END %] 
    614 
    715[% IF preview_html AND preview_above_edit_box %] 
     
    1523  <table summary="Form for editing page attributes"> 
    1624    <tr> 
    17       <td colspan="2"> 
     25      <td colspan="[% IF conflict %]3[% ELSE %]2[% END %]"> 
    1826        [%# Put the td outside the TRY-CATCH because TT will print everything 
    1927            up to where it gets the error - avoid mismatched tags. %] 
     
    3947    </tr> 
    4048    <tr> 
    41       <td colspan="2" align="center"><a href="[% cgi_url %]?[% node_param %]">(cancel edit)</a></td> 
     49      <td colspan="[% IF conflict %]3[% ELSE %]2[% END %]" align="center"><a href="[% cgi_url %]?[% node_param %]">(cancel edit)</a></td> 
    4250    </tr> 
    4351    <tr> 
    44       <td colspan="2"> 
     52      <td colspan="[% IF conflict %]3[% ELSE %]2[% END %]"> 
    4553        <fieldset> 
    4654          <legend>Main information (required)</legend> 
     
    4957              <td class="label"><label for="content">Content:</label></td> 
    5058              <td><textarea name="content" id="content_textarea" rows="21" cols="70" wrap="virtual">[% content %]</textarea></td> 
     59              [% IF conflict %] 
     60                <td><small>[% CGI.escapeHTML(new_content) %]</small></td> 
     61              [% END %] 
    5162            </tr> 
    5263            <tr> 
     
    5768              <td><textarea name="locales" id="locales" rows="5" cols="70">[% FOREACH locale = locales %][% locale.name %] 
    5869[% END %]</textarea></td> 
     70              [% IF conflict %] 
     71                <td>[% FOREACH locale = new_locales %][% CGI.escapeHTML(locale) %]<br/>[% END %]</td> 
     72              [% END %] 
    5973            </tr> 
    6074            <tr> 
     
    6276              <td><textarea name="categories" id="categories" rows="5" cols="70">[% FOREACH category = categories %][% category.name %] 
    6377[% END %]</textarea></td> 
     78              [% IF conflict %] 
     79                <td>[% FOREACH category = new_categories %][% CGI.escapeHTML(category) %]<br/>[% END %]</td> 
     80              [% END %] 
    6481            </tr> 
    6582          </table> 
     
    7693                [% INCLUDE node_photo_notes.tt %] 
    7794              </td> 
     95              [% IF conflict %] 
     96                <td>[% CGI.escapeHTML(new_node_image) %]</td> 
     97              [% END %] 
    7898            </tr> 
    7999[% END %] 
     
    81101              <td class="label"><label for="phone">Phone:</label></td> 
    82102              <td><input type="text" size="50" id="phone" name="phone" value="[% phone %]" /></td> 
     103              [% IF conflict %] 
     104                <td>[% CGI.escapeHTML(new_phone) %]</td> 
     105              [% END %] 
    83106            </tr> 
    84107            <tr> 
    85108              <td class="label"><label for="fax">Fax:</label></td> 
    86109              <td><input type="text" size="50" id="fax" name="fax" value="[% fax %]" /></td> 
     110              [% IF conflict %] 
     111                <td>[% CGI.escapeHTML(new_fax) %]</td> 
     112              [% END %] 
    87113            </tr> 
    88114            <tr> 
    89115              <td class="label"><label for="website">Website:</label></td> 
    90116              <td><input type="text" size="50" id="website" name="website" value="[% website %]" /></td> 
     117              [% IF conflict %] 
     118                <td>[% CGI.escapeHTML(new_website) %]</td> 
     119              [% END %] 
    91120            </tr> 
    92121            <tr> 
    93122              <td class="label"><label for="hours">Opening hours:</label></td> 
    94123              <td><input type="text" size="50" id="hours" name="hours_text" value="[% hours_text %]" /></td> 
     124              [% IF conflict %] 
     125                <td>[% CGI.escapeHTML(hours_text) %]</td> 
     126              [% END %] 
    95127            </tr> 
    96128            <tr> 
    97129              <td class="label"><label for="address">Address:</label></td> 
    98130              <td><input type="text" size="50" id="address" name="address" value="[% address %]" /></td> 
     131              [% IF conflict %] 
     132                <td>[% CGI.escapeHTML(new_address) %]</td> 
     133              [% END %] 
    99134            </tr> 
    100135            <tr> 
    101136              <td class="label"><label for="postcode">Postcode:</label></td> 
    102137              <td><input type="text" size="50" id="postcode" name="postcode" value="[% postcode %]" /></td> 
     138              [% IF conflict %] 
     139                <td>[% CGI.escapeHTML(new_postcode) %]</td> 
     140              [% END %] 
    103141            </tr> 
    104142            <tr> 
    105143              <td class="label"><label for="[% coord_field_1 %]">[% coord_field_1_name %]:</label></td> 
    106144              <td><input type="text" size="50" id="[% coord_field_1 %]" name="[% coord_field_1 %]" value="[% coord_field_1_value %]" /></td> 
     145              [% IF conflict %] 
     146                <td>[% CGI.escapeHTML(new_coord_field_1_value) %]</td> 
     147              [% END %] 
    107148            </tr> 
    108149            <tr> 
    109150              <td class="label"><label for="[% coord_field_2 %]">[% coord_field_2_name %]:</label></td> 
    110151              <td><input type="text" size="50" id="[% coord_field_2 %]" name="[% coord_field_2 %]" value="[% coord_field_2_value %]" /></td> 
     152              [% IF conflict %] 
     153                <td>[% CGI.escapeHTML(new_coord_field_2_value) %]</td> 
     154              [% END %] 
    111155            </tr> 
    112156            <tr> 
     
    131175    </tr> 
    132176    <tr> 
    133       <td colspan="2" align="center"> 
     177      <td colspan="[% IF conflict %]3[% ELSE %]2[% END %]" align="center"> 
    134178        <a href="[% cgi_url %]?[% node_param %]">(cancel edit)</a> 
    135179      </td>