Ignore:
Timestamp:
10/02/07 22:23:07 (5 years ago)
Author:
hverton
Message:

moved more templates to the template include directory
download panel had problems displaying an odd number of categories
make more modules xhtml compliant

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/templates/main.downloads.tpl

    r843 r861  
    1616{***************************************************************************} 
    1717{if $subcats}{assign var="_title" value=$locale.417}{else}{assign var="_title" value=$locale.418}{/if} 
    18 {assign var="columns" value="2"}                                                    {* number of columns *} 
    19 {math equation="(100 - x) / x" x=$columns format="%u" assign="colwidth"} 
     18{assign var="have_cats" value=false} 
     19{assign var="columns" value="2"}                                                                {* number of columns *} 
     20{math equation="(100-x)/x" x=$columns format="%u" assign="colwidth"}                            {* width per column  *} 
    2021{section name=cat loop=$download_cats} 
    21 {cycle name=column values="1,2" assign="column" print=no}                           {* keep track of the current column *} 
     22{cycle name=column values="1,2" assign="column" print=no}                                       {* keep track of the current column *} 
    2223{if $smarty.section.cat.first} 
    23 {include file="_opentable.tpl" name=$_name title=$_title state=$_state style=$_style} 
    24 <table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'> 
     24    {assign var="have_cats" value=true} 
     25    {math equation="x - (x%y)" x=$download_cats|@count y=$columns format="%u" assign="fullrows"} 
     26    {math equation="x - y" x=$download_cats|@count y=$fullrows format="%u" assign="remainder"} 
     27    {if $remainder > 0} 
     28        {math equation="(100 - z + y) / (z - y)" y=$fullrows z=$download_cats|@count format="%u" assign="lastwidth"}    {* width last rows columns *} 
     29    {/if} 
     30    {include file="_opentable.tpl" name=$_name title=$_title state=$_state style=$_style} 
     31    <table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'> 
    2532{/if} 
    2633    {if $column == 1}<tr>{/if} 
     
    3239            {/if} 
    3340        </td> 
     41        {if $smarty.section.cat.iteration > $fullrows} 
     42        <td width='{$lastwidth}%' colspan='{math equation="1+(x-y)*2" x=$columns y=$remainder}' class='tbl1' style='vertical-align:top'> 
     43        {else} 
    3444        <td width='{$colwidth}%' class='tbl1' style='vertical-align:top'> 
     45        {/if} 
    3546            <div class='forum-caption'> 
    36                 <img src='{$smarty.const.THEME}images/bullet.gif' alt=''> 
     47                <img src='{$smarty.const.THEME}images/bullet.gif' alt='' /> 
    3748                <a href='{$smarty.const.FUSION_SELF}?cat_id={$download_cats[cat].download_cat_id}'>{$download_cats[cat].download_cat_name}</a> 
    3849                <br /> 
     
    4758{if $smarty.section.cat.last} 
    4859    {if $column != $columns} 
    49     {section name=dummy start=$column loop=$columns} 
    50         <td width='{math equation='x+1' x=$colwidth}%' colspan='2' class='tbl1' style='vertical-align:top'> 
    51         </td> 
    52     {/section} 
    53     </tr> 
     60        </tr> 
    5461    {/if} 
    5562</table> 
     
    7380{/if} 
    7481    <tr> 
    75         <td colspan='4' class='forum-caption'> 
     82        <td colspan='3' class='forum-caption'> 
    7683            <b>{$downloads[item].download_title}</b> 
     84        </td> 
     85        <td align='right' class='forum-caption'> 
     86            <a href='{$smarty.const.FUSION_SELF}?cat_id={$downloads[item].download_cat}&amp;download_id={$downloads[item].download_id}'><span class='small2'>{$locale.420}</span></a> 
    7787        </td> 
    7888    </tr> 
     
    116126{else} 
    117127    </table> 
     128    {include file="_closetable.tpl"} 
    118129{/if} 
    119130{sectionelse} 
    120     {include file="_opentable.tpl" name=$_name title=$locale.400 state=$_state style=$_style} 
    121     <center> 
    122         <br /> 
    123         <b>{$locale.431}</b> 
    124         <br /><br /> 
    125     </center> 
     131    {if !$have_cats} 
     132        {include file="_opentable.tpl" name=$_name title=$locale.400 state=$_state style=$_style} 
     133        <center> 
     134            <br /> 
     135            <b>{$locale.431}</b> 
     136            <br /><br /> 
     137        </center> 
     138        {include file="_closetable.tpl"} 
     139    {/if} 
    126140{/section} 
    127 {include file="_closetable.tpl"} 
    128141{***************************************************************************} 
    129142{* End of template                                                         *} 
Note: See TracChangeset for help on using the changeset viewer.