Skip to content
Browse files

Introduced scans table to home page

  • Loading branch information...
1 parent a4a4f14 commit 7ed6a27447ee2e638f75d760149dd5d47a6bad60 migurski committed Nov 14, 2010
Showing with 44 additions and 165 deletions.
  1. +17 −46 site/templates/index.html.tpl
  2. +1 −94 site/templates/scans.html.tpl
  3. +1 −1 site/www/index.php
  4. +0 −24 site/www/scans.css
  5. +25 −0 site/www/style.css
View
63 site/templates/index.html.tpl
@@ -17,9 +17,11 @@
{include file="$language/index-top-paragraph.htmlf.tpl"}
+ {*
<p>
<img src="{$base_dir}/scan-example.jpg" border="1" />
</p>
+ *}
<h2>{strip}
{if $language == "de"}
@@ -45,64 +47,33 @@
{/if}
{/strip}</h2>
- <ol>
- {foreach from=$scans item="rscan"}
- <li>
- {if $rscan.print_place_woeid}
- <a href="{$base_dir}/scan.php?id={$rscan.id|escape}">
- <b id="scan-{$rscan.id|escape}">{$rscan.age|nice_relativetime|escape}
- {if $rscan.will_edit == 'no'}{/if}</b>
- <br />
- {$rscan.print_place_name|escape}</a>
-
- {else}
- <a href="{$base_dir}/scan.php?id={$rscan.id|escape}">
- <b id="scan-{$rscan.id|escape}">{$rscan.age|nice_relativetime|escape}
- {if $rscan.will_edit == 'no'}{/if}</b></a>
+ {include file="scans-table.htmlf.tpl"}
- <script type="text/javascript" language="javascript1.2" defer="defer">
- // <![CDATA[
- {if $rscan.print_latitude && $rscan.print_longitude}
- var onPlaces_{$rscan.id|escape} = new Function('res', "appendPlacename(res, document.getElementById('scan-{$rscan.id|escape}'))");
- getPlacename({$rscan.print_latitude|escape}, {$rscan.print_longitude|escape}, '{$constants.FLICKR_KEY|escape}', 'onPlaces_{$rscan.id|escape}');
- {/if}
- // ]]>
- </script>
- {/if}
-
- {if $rscan.description}
- <br />
- {$rscan.description|escape}
- {/if}
- </li>
- {/foreach}
- </ol>
-
- <p>{strip}
- <a href="{$base_dir}/scans.php">
+ <p class="pagination">
+ <a href="{$base_dir}/scans.php">{strip}
{if $language == "de"}
- Weitere Scans...
+ Weitere Scans
{elseif $language == "nl"}
- Meer scans...
+ Meer scans
{elseif $language == "es"}
- Más scans...
+ Más scans
{elseif $language == "fr"}
- Plus de scans...
+ Plus de scans
{elseif $language == "ja"}
- 最近の取り込みの続き...
+ 最近の取り込みの続き
{elseif $language == "it"}
- Altre scansioni recenti...
+ Altre scansioni recenti
{elseif $language == "tr"}
- Daha taramalar...
+ Daha taramalar
{elseif $language == "ru"}
- Еще недавние сканы...
+ Еще недавние сканы
{elseif $language == "sv"}
- Fler inskanningar...
+ Fler inskanningar
{else}
- More recent scans...
+ More recent scans
{/if}
- </a>
- {/strip}</p>
+ {/strip}</a>
+ </p>
<h2>{strip}
<a name="make">
View
95 site/templates/scans.html.tpl
@@ -68,100 +68,7 @@
</p>
{/if}
- {assign var="cols" value=4}
- {assign var="cells" value=$scans|@count}
- {assign var="rows" value=$cells/$cols|@ceil}
-
- <table id="scans">
- {foreach from=1|@range:$rows item="row" name="rows"}
- <tr class="preview">
- {foreach from=1|@range:$cols item="col" name="cols"}
- {assign var="index" value=$smarty.foreach.rows.index*$cols+$smarty.foreach.cols.index}
- {assign var="scan" value=$scans.$index}
-
- <td>
- {if $scan}
- <a href="{$base_dir}/scan.php?id={$scan.id|escape}">
- <img border="1" src="{$scan.base_url}/preview.jpg" /></a>
- {/if}
- </td>
- {/foreach}
- </tr>
-
- <tr class="info">
- {foreach from=1|@range:$cols item="col" name="cols"}
- {assign var="index" value=$smarty.foreach.rows.index*$cols+$smarty.foreach.cols.index}
- {assign var="scan" value=$scans.$index}
-
- <td>
- {if $scan}
- {if $scan.print_place_woeid}
- <a href="{$base_dir}/scan.php?id={$scan.id|escape}">
- <b id="scan-{$scan.id|escape}">{$scan.age|nice_relativetime|escape}
- {if $scan.will_edit == 'no'}{/if}</b>
- <br />
- {$scan.print_place_name|escape}</a>
-
- {else}
- <a href="{$base_dir}/scan.php?id={$scan.id|escape}">
- <b id="scan-{$scan.id|escape}">{$scan.age|nice_relativetime|escape}
- {if $scan.will_edit == 'no'}{/if}</b></a>
-
- <script type="text/javascript" language="javascript1.2" defer="defer">
- // <![CDATA[
-
- var onPlaces_{$scan.id|escape} = new Function('res', "appendPlacename(res, document.getElementById('scan-{$scan.id|escape}'))");
- getPlacename({$scan.print_latitude|escape}, {$scan.print_longitude|escape}, '{$constants.FLICKR_KEY|escape}', 'onPlaces_{$scan.id|escape}');
-
- // ]]>
- </script>
- {/if}
-
- {if $scan.description}
- <br />
- {$scan.description|escape}
- {/if}
- {/if}
- </td>
- {/foreach}
- </tr>
- {/foreach}
- </table>
-
- {*
- <ol start="{$offset+1}">
- {foreach from=$scans item="scan"}
- <li>
- {if $scan.print_place_woeid}
- <a href="{$base_dir}/scan.php?id={$scan.id|escape}">
- <b id="scan-{$scan.id|escape}">{$scan.age|nice_relativetime|escape}
- {if $scan.will_edit == 'no'}✻{/if}</b>
- <br />
- {$scan.print_place_name|escape}</a>
-
- {else}
- <a href="{$base_dir}/scan.php?id={$scan.id|escape}">
- <b id="scan-{$scan.id|escape}">{$scan.age|nice_relativetime|escape}
- {if $scan.will_edit == 'no'}✻{/if}</b></a>
-
- <script type="text/javascript" language="javascript1.2" defer="defer">
- // <![CDATA[
-
- var onPlaces_{$scan.id|escape} = new Function('res', "appendPlacename(res, document.getElementById('scan-{$scan.id|escape}'))");
- getPlacename({$scan.print_latitude|escape}, {$scan.print_longitude|escape}, '{$constants.FLICKR_KEY|escape}', 'onPlaces_{$scan.id|escape}');
-
- // ]]>
- </script>
- {/if}
-
- {if $scan.description}
- <br />
- {$scan.description|escape}
- {/if}
- </li>
- {/foreach}
- </ol>
- *}
+ {include file="scans-table.htmlf.tpl"}
<p class="pagination">
{if $scans_count > 0}
View
2 site/www/index.php
@@ -29,7 +29,7 @@
setcookie('visitor', write_userdata($user['id'], $language), time() + 86400 * 31);
$prints = get_prints($dbh, 3);
- $scans = get_scans($dbh, 3);
+ $scans = get_scans($dbh, 4);
$sm = get_smarty_instance();
$sm->assign('prints', $prints);
View
24 site/www/scans.css
@@ -1,24 +0,0 @@
-table#scans
-{
- margin: 1em auto;
- width: 816px;
- border-collapse: collapse;
-}
-
-table#scans tr td
-{
- width: 204px;
- padding: 0 10px 10px 0;
- vertical-align: top;
-}
-
-table#scans tr.preview td
-{
- padding-top: 20px;
- vertical-align: bottom;
-}
-
-table#scans tr.preview td img
-{
- width: 80%;
-}
View
25 site/www/style.css
@@ -231,6 +231,31 @@ form.language
float: left;
}
+table.scans
+{
+ margin: 1em auto;
+ width: 816px;
+ border-collapse: collapse;
+}
+
+table.scans tr td
+{
+ width: 204px;
+ padding: 0 10px 10px 0;
+ vertical-align: top;
+}
+
+table.scans tr.preview td
+{
+ padding-top: 20px;
+ vertical-align: bottom;
+}
+
+table.scans tr.preview td img
+{
+ width: 80%;
+}
+
p.wide
{
width: 960px;

0 comments on commit 7ed6a27

Please sign in to comment.
Something went wrong with that request. Please try again.