#
# Deploy Rules
# Table of all deploy rules
#
# action:

form = {{form:SE}}


{
    sql = SELECT 'p:{{pageSlug:T}}?form=syncByRule&r=0|s|b|N' AS '_link|newDrBtn|_hide'

    head = <div class="alert alert-info">Rules can be used for CLI sync execution via name.
           <br>
           CLI executable script is located at /typo3conf/ext/qfq/Classes/External/sync-by-rule.php
           </div>
}

{
    sql = SELECT CONCAT('p:{{pageSlug:T}}?form=syncByRule&r=', dr.id, '|s|b|E') AS '_link|editDrBtn|_hide'
                 , dr.id AS _drId
                 , dr.name AS _ruleName
                 , dr.description AS _desc
                 , dr.definition AS _definition
            FROM DeployRule AS dr

    shead = <div class="panel panel-default">
              <div class="panel-heading">
                <h3 class="panel-title">Deploy Rules</h3>
              </div>
              <div class="panel-body">
                <table class="table tablesorter">
                  <thead>
                    <tr>
                      <th class="filter-false sorter-false">{{&newDrBtn:RE::-}}</th>
                      <th>Name</th>
                      <th>Description</th>
                      <th>Definition</th>
                      <th class="filter-false sorter-false"></th>
                    </tr>
                  </thead>
                  <tbody>

    stail =      </tbody>
                 </table>
               </div>
             </div>

    {
        sql = SELECT '{{&editDrBtn:RE}}'
                     , '{{ruleName:RE}}'
                     , '{{desc:RE}}'
                     , '{{definition:RE}}'
                     , CONCAT('U:form=syncByRule&r={{drId:R0}}|q:Do you want delete this rule?') AS _paged
        rbeg = <tr>
        rend = </tr>
        fbeg = <td>
        fend = </td>

    }
}