<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%if uninstall~%>
  <%Links::Update::browser_uninstall~%>
  <%if uninstall_success%><%set message = 'Selected updates have been successfully uninstalled.'%><%endif~%>
<%endif~%>
<%if not config.reg_number%>
<%set error = "You must enter a valid registration number before checking for updates.  You can enter a registration number in the Setup -&gt; Misc. Options menu."%>
<%else%>
<%Links::Update::check_historic($historic_version)~%>
<%endif%>

<%set update_mode = 'history'~%>
<html>
<head>
  <base target="content" />
  <title>Gossamer Links - Updates - Installed Updates</title>
  <%include include_style.html%>
  <%include update_style.html%>
  <%include update_js.html%>
</head>
<body>

<div class="header-block">
  <h1>Update History</h1>
  <h2>Gossamer Links Update History</h2>
  <%if message%><div class="success"><div class="word">Results:&nbsp;</div> <%message%></div><%endif%>
  <%if error%><div class="error"><div class="word">Error:&nbsp;</div> <%error%></div><%endif%>

  <div>This page lists the currently installed Gossamer Links updates, and allows
    you to uninstall updates.  Note that some updates cannot be uninstalled.
    <br /><br />

<%set any_updates_shown = 0%>
<%~loop update_types%><%loop updates%><%if installed%><%set any_updates_shown = 1%><%lastloop%><%endloop%><%endloop%>
<%if any_updates_shown%>
    <div class="show-all" id="show-all" onclick="allUpdates(showDetails); this.style.display = 'none'; document.getElementById('hide-all').style.display = 'block';">Show all details</div>
    <div class="show-all" style="display: none" id="hide-all" onclick="allUpdates(hideDetails); this.style.display = 'none'; document.getElementById('show-all').style.display = 'block';">Hide all details</div>
<%endif%>

    <%if historic.length > 1~%>
      Older version update history:
      <%~loop historic%>
        <%~if loop_value eq $historic_version%> <%loop_value%>
        <%~else%> <a href="admin.cgi?do=page;page=update_history.html;historic_version=<%loop_value%>"><%loop_value%></a>
        <%~endif%>
      <%~endloop%>
    <%~else%>&nbsp;<%endif%>
  </div>
</div>

<form method="post" action="admin.cgi">
<input type="hidden" name="do" value="page" />
<input type="hidden" name="page" value="update_history.html" />
<%if updates_selected~%>
  <input type="hidden" id="preselect" value="<%loop updates_selected%><%loop_value%><%unless last%> <%endunless%><%endloop%>" />
<%endif~%>
<div class="updates">
<%~loop update_types%>
<%~loop updates%>
<%~unless installed%><%nextloop%><%endif%>
<%include update_display.html%>
<%endloop~%>
<%endloop~%>
</div>

<div id="uninstall-updates" class="submit" style="margin-top: 30px; display: none">
  <input type="submit" value="Uninstall Selected Updates" onclick="return confirm('Are you sure you wish to uninstall the selected updates?')" />
</div>

</form>
</body>
</html>
