From 873662fe815c678f35ec1518d9fc013c993ae710 Mon Sep 17 00:00:00 2001
From: "Johan \"Papa\" Cwiklinski" <trasher@odysseus.(none)>
Date: Sun, 30 May 2010 11:26:48 +0200
Subject: Use of smarty to render rpm page ; apply coding standards, add
 license ; refs #46,48,47

---
 smarty/templates/rpmphp/rpm.tpl | 86 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 86 insertions(+)
 create mode 100644 smarty/templates/rpmphp/rpm.tpl

(limited to 'smarty/templates')

diff --git a/smarty/templates/rpmphp/rpm.tpl b/smarty/templates/rpmphp/rpm.tpl
new file mode 100644
index 0000000..ffabb4f
--- /dev/null
+++ b/smarty/templates/rpmphp/rpm.tpl
@@ -0,0 +1,86 @@
+                <p id="repositories_update">Repositories last updated {$repositories_update}.</p>
+                <div id="filter">
+                    <form action="rpm.php" method="get">
+                        <fieldset>
+                            <legend>Filter {$type|upper} packages</legend>
+                            <input type="hidden" name='type' value="{$type}" />
+                            <label for="what">Criteria:  </label>
+                            <select name="what" id="what">
+                                <optgroup label="Pakages">
+                                    <option value="%fedora"{if $what eq '%fedora'} selected="selected"{/if}>In fedora</option>
+                                    <option value="%stable"{if $what eq '%stable'} selected="selected"{/if}>All stable</option>
+                                    <option value="%all"{if $what eq '%all'} selected="selected"{/if}>All</option>
+                                </optgroup>
+                                <optgroup label="Owner">
+{foreach from=$owners item=o}
+                                    <option value="{$o->owner}">{$o->owner}</option>
+{foreachelse}
+                                    <option value="remi">remi</option>
+{/foreach}
+                                </optgroup>
+                            </select>
+                            <input type="submit" value="Filter" />
+                        </fieldset>
+                    </form>
+                </div><!-- /filter -->
+
+                <table id="list-packages">
+                    <thead>
+                        <tr>
+                            <th>Package</th>
+                            <th>Owner(s)</th>
+                            <th>Upstream</th>
+
+{foreach from=$repos key=k item=v}
+                            <th>{$k}</th>
+{/foreach}
+                        </tr>
+                    </thead>
+                    <tfoot>
+                        <tr>
+                            <td colspan="{math equation="x+3" x=$repos|@count}">{$packages|@count} packages found</td>
+                        </tr>
+                    </tfoot>
+                    <tbody>
+{foreach from=$packages item=p name=plist}
+                        <tr class="{if $smarty.foreach.plist.iteration % 2 eq 0}even{else}odd{/if}">
+                            <td>
+                                {$p.name}
+    {if $p.channel}
+                                <br/><small>channel: {$p.channel}</small>
+    {/if}
+                            </td>
+                            <td>
+    {foreach from=$p.owners item=owner name=ow_it}
+        {$owner}
+        {if not $smarty.foreach.ow_it.last}
+            <br/>
+        {/if}
+    {/foreach}
+                            </td>
+                            <td>
+    {if $p.upstream_stable}
+                                <strong>{$p.upstream_stable}</strong>
+    {/if}
+    {if $p.upstream_unstable}
+                                <br/>{$p.upstream_unstable}
+    {/if}
+                            </td>
+    {foreach from=$p.versions key=k item=version}
+                            <td{if $version.class} class="{$version.class}"{/if}>
+                                {$version.display}
+                            </td>
+    {/foreach}
+                        </tr>
+{/foreach}
+                    </tbody>
+                </table>
+
+                <ul id="legend">
+                    <li>Legend: </li>
+                    <li><strong>Upstream</strong>: bold if stable. </li>
+                    <li><strong>Repo</strong>: bold for latest release.</li>
+                    <li class='check'>Lastest released (stable if exists)</li>
+                    <li class='info'>Lastest in testing</li>
+                    <li class='attn'>Lastest not available</li>
+                </ul>
-- 
cgit