[limb-svn] r6934 - in 3.x/examples/shop/template: . main_page
svn at limb-project.com
svn at limb-project.com
Tue Apr 15 10:24:16 MSD 2008
Author: serega
Date: 2008-04-15 10:24:15 +0400 (Tue, 15 Apr 2008)
New Revision: 6934
URL: http://fisheye.limb-project.com/changelog/limb/?cs=6934
Modified:
3.x/examples/shop/template/main_page/display.html
3.x/examples/shop/template/main_page/display.phtml
3.x/examples/shop/template/page.html
3.x/examples/shop/template/page.phtml
Log:
-- 3 random products now displayed on the main page of Shop example application
Modified: 3.x/examples/shop/template/main_page/display.html
===================================================================
--- 3.x/examples/shop/template/main_page/display.html 2008-04-14 18:39:53 UTC (rev 6933)
+++ 3.x/examples/shop/template/main_page/display.html 2008-04-15 06:24:15 UTC (rev 6934)
@@ -1,8 +1,33 @@
<core:set title='Main page'/>
<core:wrap file="page.html" in="content">
-<p>Wellcome to our bookstore!</p>
<br/>
-<p>To play with control panel use left login form with <b>"admin"</b> as login and <b>"123"</b> as password.</p>
+<h2>Random products from the store</h2>
+
+<active_record:fetch using='src/model/Product' find='for_front' target="products" limit='3'/>
+
+<list:list id="products">
+<table cellpadding="0" cellspacing="0" class='list'>
+ <thead>
+ </thead>
+ <list:item>
+ <tr>
+ <td>
+ <dl>
+ <dt>
+ <b>{$title}</b><br />
+ Price:<b>${$price|number:2, '.'}</b><br/>
+ <route_url params='controller:cart,action:add,id:{$id}'>Add to cart</route_url><br/>
+ </dt>
+ <dd>
+ <img src='{$image_path}' class='img'/>
+ {$description|nl2br|raw}
+ </dd>
+ </dl>
+ </td>
+ </tr>
+ </list:item>
+</table>
+</list:list>
+
<br/>
-<p>Hope you will like this example</p>
</core:wrap>
Modified: 3.x/examples/shop/template/main_page/display.phtml
===================================================================
--- 3.x/examples/shop/template/main_page/display.phtml 2008-04-14 18:39:53 UTC (rev 6933)
+++ 3.x/examples/shop/template/main_page/display.phtml 2008-04-15 06:24:15 UTC (rev 6934)
@@ -1,8 +1,32 @@
<? $this->title = 'Main page'; ?>
-{{wrap with="page.phtml" slot="content"}}
-<p>Wellcome to our bookstore!</p>
+{{wrap with="page.phtml" into="content"}}
+<h2>Random products from the store</h2>
+
+<? $products = Product :: findForFront()->sort(array('' => 'rand()'))->paginate(0, 3); ?>
+
+{{list using="$products"}}
+<table cellpadding="0" cellspacing="0" class='list'>
+ <thead>
+ </thead>
+ {{list:item}}
+ <tr>
+ <td>
+ <dl>
+ <dt>
+ <b>{$item.title}</b><br />
+ Price:<b>${$item.price|number:2, '.', ' '}</b><br/>
+ <a href="{{route_url params='controller:cart,action:add,id:{$item.id}'}}">Add to cart</a><br/>
+ </dt>
+ <dd>
+ <img src='{$item.image_path}' class='img'/>
+ {$item.description|nl2br}
+ </dd>
+ </dl>
+ </td>
+ </tr>
+ {{/list:item}}
+</table>
+{{/list}}
+
<br/>
-<p>To play with control panel use left login form with <b>"admin"</b> as login and <b>"123"</b> as password.</p>
-<br/>
-<p>Hope you will like this example</p>
{{/wrap}}
Modified: 3.x/examples/shop/template/page.html
===================================================================
--- 3.x/examples/shop/template/page.html 2008-04-14 18:39:53 UTC (rev 6933)
+++ 3.x/examples/shop/template/page.html 2008-04-15 06:24:15 UTC (rev 6934)
@@ -64,6 +64,8 @@
<label for='passwd'>Password:</label><br/>
<input type="text" name="password" id="password" type="password" title="Password" class='input'/><br/>
+ <p>Use <b>"admin"</b>/<b>"123"</b> to enter as administrator.</p>
+
<input type='submit' name='submitted' value="Submit"/><br/>
</form>
<route_url params='controller:profile,action:register'>Register</route_url>
Modified: 3.x/examples/shop/template/page.phtml
===================================================================
--- 3.x/examples/shop/template/page.phtml 2008-04-14 18:39:53 UTC (rev 6933)
+++ 3.x/examples/shop/template/page.phtml 2008-04-15 06:24:15 UTC (rev 6934)
@@ -62,6 +62,8 @@
<label for='passwd'>Password:</label><br/>
<input type="text" name="password" id="password" type="password" title="Password" class='input'/><br/>
+
+ <p>Use <b>"admin"</b>/<b>"123"</b> to enter as administrator.</p>
<input type='submit' name='submitted' value="Submit"/><br/>
</form>
More information about the limb-svn
mailing list