Skip to content

Commit

Permalink
TEMPLATES: Move recommended downloads to its own component
Browse files Browse the repository at this point in the history
  • Loading branch information
Mataniko committed May 9, 2019
1 parent 2015d34 commit 00e5f87
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
13 changes: 13 additions & 0 deletions templates/components/recommended_download.tpl
@@ -0,0 +1,13 @@
<div id="recommended-download" class="{($recommendedDownload) ? 'visible':'hidden'}">
<div class="subhead">{#downloadsBadge#}</div>
<div class="subhead-content">
<div id="downloadContainer">
<a id="downloadButton" href={$recommendedDownload.url}>
<img src="images/scummvm.png" alt="Download ScummVM icon">
<div class="downloadText">Download ScummVM</div>
<div id="downloadDetails">Version {$recommendedDownload.ver}{$recommendedDownload.os}{$recommendedDownload.desc}</div>
</a>
</div>
</div>
</div>
<br>
21 changes: 4 additions & 17 deletions templates/pages/downloads.tpl
Expand Up @@ -21,27 +21,14 @@
</div>
{/capture}

{capture "recommendedDownload"}
<div id="recommended-download" class="{($recommendedDownload) ? 'visible':'hidden'}">
<div class="subhead">{#downloadsBadge#}</div>
<div class="subhead-content">
<div id="downloadContainer">
<a id="downloadButton" href={$recommendedDownload.url}>
<img src="images/scummvm.png" alt="Download ScummVM icon">
<div class="downloadText">Download ScummVM</div>
<div id="downloadDetails">Version {$recommendedDownload.ver}{$recommendedDownload.os}{$recommendedDownload.desc}</div>
</a>
</div>
</div>
</div>
<br>
{/capture}

{foreach from=$downloads item=dsection name=downloads_loop}

{capture "content"}
{if $smarty.foreach.downloads_loop.first}
{$smarty.capture.recommendedDownload}
{include
file="components/recommended_download.tpl"
recommendedDownload=$recommendedDownload
}
{/if}

{foreach from=$dsection->getSubSections() item=dsubsection}
Expand Down

0 comments on commit 00e5f87

Please sign in to comment.