App-AutoCRUD

 view release on metacpan or  search on metacpan

lib/App/AutoCRUD/share/templates/src/table/list.tt  view on Meta::CPAN

[% SET pk_name = data.primary_key.join("/"); %]


[% WRAPPER head %]
<style>
  .record_key    { color: #a00; font-weight: bold; font-size: 120% }
  .record_num    { font-size: 80%; float: right }
  .groupname     { font-weight: bold; color: navy; font-size: 110% }
  .record        { border-top: 1px dashed gray }
  .criteria      { font-size: 90% }
  .val           { background-color: #efe }
  .check_record  { float: right}
  .pk            { text-decoration: underline }
  .message       { width: 60%; color: red; border: 1px solid red; 
                   font-weight: bold; margin-top: 6px}
  H1             { margin-bottom : 0}
  H2             { margin-bottom : 0}
  #TN_tree       { clear: right }
</style>

<script>
  function setup() {  
    new GvaScript.TreeNavigator('TN_tree',  {selectFirstNode: false});

    new GvaScript.KeyMap({LEFT : function(){$('prev_page').click()},
                          RIGHT: function(){$('next_page').click()}})
                 .observe('keydown');
  }
  window.onload = setup;
  function followLink(event) {
    var label = event.controller.label(event.target);
    if (label && label.tagName == "A") {
      label.focus();
      return Event.stopNone;
    }
  }
  function propagate_checkbox(main_box) {
    $('list_form').getInputs('checkbox').each(function(box) {
       box.checked = main_box.checked;
    });
  }
  function add_checkboxes(a_element) {
    var vals = [];
    $('list_form').getInputs('checkbox').each(function(box) {
       if (box.checked) vals.push(encodeURIComponent(box.value));
    });
    if (vals.length > 0) {
      a_element.href += "where." + encodeURIComponent("[% pk_name %]") 
                                 + "=" + vals.join(",");
      return true;
    }
    else {
      alert("no record was checked!");
      return false; // no submit
    }
  }
</script>

[% END; # WRAPPER head %]

[%# ---------- start body ---------- %]

<div class="actions">
  [% BLOCK page_links %]
  <div>
    [% IF data.prev_page; %]
      <a href="list?[% data.prev_page | utf8_url %]" [% " id='prev_page'" IF with_ids %]
         title="press LEFT key">prev</a>
    [% END; %]
    [% " | "   IF data.prev_page && data.next_page; %]
    [% IF data.next_page; %]
      <a href="list?[% data.next_page | utf8_url %]" [% " id='next_page'" IF with_ids %]
         title="press RIGHT key">next</a>
    [% END; %]
    [% " page" IF data.prev_page || data.next_page; %]



( run in 1.274 second using v1.01-cache-2.11-cpan-5837b0d9d2c )