{*<!--

---------------------------------------------------------------------------+
| OpenX v2.7                                                                |
| =========                                                                 |
|                                                                           |
| Copyright (c) 2003-2009 OpenX Limited                                     |
| For contact details, see: http://www.openx.org/                           |
|                                                                           |
| This program is free software; you can redistribute it and/or modify      |
| it under the terms of the GNU General Public License as published by      |
| the Free Software Foundation; either version 2 of the License, or         |
| (at your option) any later version.                                       |
|                                                                           |
| This program is distributed in the hope that it will be useful,           |
| but WITHOUT ANY WARRANTY; without even the implied warranty of            |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             |
| GNU General Public License for more details.                              |
|                                                                           |
| You should have received a copy of the GNU General Public License         |
| along with this program; if not, write to the Free Software               |
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA |
+---------------------------------------------------------------------------+
$Id: website-index-list.html 30885 2009-01-14 14:54:31Z andrew.hill $

-->*}

<div class='tableWrapper'>
    <div class='tableHeader'>
        <ul class='tableActions'>
            <li>
                <a href='affiliate-edit.php' class='inlineIcon iconWebsiteAdd'>{t str=AddNewAffiliate}</a>
            </li>
            <li class='inactive activeIfSelected'>
                <a id='deleteSelection' href='#' class='inlineIcon iconDelete'>{t str=Delete}</a>
                
                {literal}
                <script type='text/javascript'>
                <!--
                
                $('#deleteSelection').click(function(event) {
					event.preventDefault();
					
					if (!$(this).parents('li').hasClass('inactive')) {
						var ids = [];
						$(this).parents('.tableWrapper').find('.toggleSelection input:checked').each(function() {
							ids.push(this.value);
						});
						
						if (!tablePreferences.warningBeforeDelete || confirm("{/literal}{t str=ConfirmDeleteAffiliates}{literal}")) {
							window.location = 'affiliate-delete.php?affiliateid=' + ids.join(',');
						}
					}
                });
                
                //-->
                </script>
                {/literal}
            </li>
        </ul>

        <div class='clear'></div>
        <div class='corner left'></div>
        <div class='corner right'></div>
    </div>


    <table cellspacing='0' summary=''>
        <thead>
            <tr>
              <th class='first toggleAll'>
                    <input type='checkbox' />
                </th>
                <th class='{ox_column_class item=name order=up default=1}'>
                    {ox_column_title item=name order=up default=1 str=Name url=website-index.php}
                </th>
                {if $showAdDirect}
                <th>
                    {t str=AdvertiserSignup}
                </th>
                {/if}
                <th class='last alignRight'>&nbsp;
                  
                </th>
            </tr>
        </thead>



{if !$affiliates|@count}
        <tbody>
            <tr class='odd'>
                <td colspan='{if $showAdDirect}4{else}3{/if}'>&nbsp;</td>
            </tr>
            <tr class='even'>
                <td colspan='{if $showAdDirect}4{else}3{/if}'>
                    <div class='tableMessage'>
                        <div class='panel'>
                            {t str=NoAffiliates}

                            <div class='corner top-left'></div>
                            <div class='corner top-right'></div>
                            <div class='corner bottom-left'></div>
                            <div class='corner bottom-right'></div>
                        </div>
                    </div>
                    
                    &nbsp;
                </td>
            </tr>
            <tr class='odd'>
                <td colspan='{if $showAdDirect}4{else}3{/if}'>&nbsp;</td>
            </tr>
        </tbody>

{else}
        <tbody>
    {cycle name=bgcolor values="even,odd" assign=bgColor reset=1}
    {foreach key=key item=affiliate from=$from}
        {cycle name=bgcolor assign=bgColor}
        {* set low priority campaign warning if any of this affiliate's zones *}
        {* are without low-priority ads *}
        {assign var='zone_overview_icon' value='iconZones'}
        {assign var='zone_overview_warning_start' value=''}
        {assign var='zone_overview_warning_e' value=''}
            
        {foreach key=key item=aff_zone from=$affiliate.zones}
            {if $aff_zone.lpc_flag}
                {assign var='zone_overview_icon' value='iconZonesWarning'}
                {assign var='zone_overview_warning_start' value='<acronym title="Warning - Publisher has zones with no low-priority ads linked">'}
                {assign var='zone_overview_warning_end' value='</acronym>'}
            {/if}
        {/foreach}

            <tr class='{$bgColor}'>
              <td class='toggleSelection'>
                  <input type='checkbox' value='{$affiliate.affiliateid}' />
                </td>
                <td>
                    <a href='affiliate-edit.php?affiliateid={$affiliate.affiliateid}' class='inlineIcon iconWebsite'>{$affiliate.name|escape:html}</a>
                </td>
                {if $showAdDirect}
                <td>
                    {$affiliate.adv_signup|default:'&nbsp;'}
                </td>
                {/if}
                <td class='alignRight'>
                    <ul class='rowActions'>
                        <li>
                            <a href='zone-edit.php?affiliateid={$affiliate.affiliateid}' class='inlineIcon iconZoneAdd'>{t str=AddNewZone}</a>
                        </li>
                        <li>
                          {$zone_overview_warning_start}<a href='affiliate-zones.php?affiliateid={$affiliate.affiliateid}' class='inlineIcon {$zone_overview_icon}'>{t str=Zones}</a>{$zone_overview_warning_end}
                        </li>
                        <li>
                            <a href='affiliate-channels.php?affiliateid={$affiliate.affiliateid}' class='inlineIcon iconTargetingChannels'>{t str=Channels}</a>
                        </li>
                    </ul>
                </td>
            </tr>
    {/foreach}
       </tbody>
{/if}
    </table>
</div>