diff options
| author | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-06-01 18:46:12 +0200 |
|---|---|---|
| committer | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-06-01 18:46:12 +0200 |
| commit | af6dd5f8f9844596e85db25a8e97df9e08cb795c (patch) | |
| tree | 8408e754dd335571635bcde041bbce69213af592 /templates | |
| parent | be50d9ed4ba2b844bbc29686cee46b1dc149372a (diff) | |
| download | Catalog-af6dd5f8f9844596e85db25a8e97df9e08cb795c.tar.gz Catalog-af6dd5f8f9844596e85db25a8e97df9e08cb795c.zip | |
Port alls sites to smarty and use the inheritance model
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/categories.tpl | 35 | ||||
| -rw-r--r-- | templates/categoryedit.tpl | 36 | ||||
| -rw-r--r-- | templates/contact.tpl | 16 | ||||
| -rw-r--r-- | templates/index.tpl | 17 | ||||
| -rw-r--r-- | templates/layout.tpl | 19 | ||||
| -rw-r--r-- | templates/login.tpl | 32 | ||||
| -rw-r--r-- | templates/productdetails.tpl | 49 | ||||
| -rw-r--r-- | templates/productedit.tpl | 66 | ||||
| -rw-r--r-- | templates/products.tpl | 36 |
9 files changed, 306 insertions, 0 deletions
diff --git a/templates/categories.tpl b/templates/categories.tpl new file mode 100644 index 0000000..11162a6 --- /dev/null +++ b/templates/categories.tpl @@ -0,0 +1,35 @@ +{extends file="layout.tpl"} +{block name=title}Categories{/block} +{block name=navigation} +<dl> + <dt><a href="contact.php">Contact us</a></dt> + <dt><a href=".">Home</a></dt> + {if $loggedin} + <dt><a href="login.php?logout">Logout</a></dt> + {else} + <dt><a href="login.php">Login</a></dt> + {/if} +</dl> +{/block} +{block name=content} +<table> + {foreach from=$categories item=category} + <tr> + <td><a href="products.php?id={$category->getId()}">{$category->getName()}</a></td> + <td>{$category->getDescription()}</td> + {if $loggedin} + <td><a href="categoryedit.php?modify={$category->getId()}">Edit</a></td> + <td><a href="categoryedit.php?delete={$category->getId()}" onClick="return confirm('Confirm deletion.')">Delete</a></td> + {/if} + </tr> + {/foreach} + {if $loggedin} + <tr> + <td></td> + <td></td> + <td></td> + <td><a href="categoryedit.php?add">Add</a></td> + </tr> + {/if} +</table> +{/block}
\ No newline at end of file diff --git a/templates/categoryedit.tpl b/templates/categoryedit.tpl new file mode 100644 index 0000000..c02962d --- /dev/null +++ b/templates/categoryedit.tpl @@ -0,0 +1,36 @@ +{extends file="layout.tpl"} +{block name=title}{$category->getName()}{/block} +{block name=navigation} +<dl> + <dt><a href="contact.php">Contact us</a></dt> + <dt><a href=".">Home</a></dt> + <dt><a href="categories.php">Back</a></dt> + {if $loggedin} + <dt><a href="login.php?logout">Logout</a></dt> + {else} + <dt><a href="login.php">Login</a></dt> + {/if} +</dl> +{/block} +{block name=content} +<form action="categoryedit.php?{$type}={$category->getId()}" method="post"> + <h1>Category</h1> + <div class="row"> + <label for="name"><u>N</u>ame:</label> <input class="formw" type="text" + placeholder="Name" id="name" name="name" accesskey="n" + maxlength="100" value="{$category->getName()}"> + </div> + <div class="row"> + <label for="desc"><u>D</u>escription:</label> + <textarea class="formw" placeholder="Description" id="desc" name="desc" + accesskey="d" maxlength="1000">{$category->getDescription()}</textarea> + </div> + <div class="spacer"> </div> + <button type="submit"> + {$type|capitalize} + </button> + <button type="reset"> + Reset + </button> +</form> +{/block}
\ No newline at end of file diff --git a/templates/contact.tpl b/templates/contact.tpl new file mode 100644 index 0000000..b8bf0d3 --- /dev/null +++ b/templates/contact.tpl @@ -0,0 +1,16 @@ +{extends file="layout.tpl"} +{block name=title}Contact us{/block} +{block name=navigation} +<dl> + <dt><a href=".">Home</a></dt> + <dt><a href="categories.php">Categories</a></dt> + {if $loggedin} + <dt><a href="login.php?logout">Logout</a></dt> + {else} + <dt><a href="login.php">Login</a></dt> + {/if} +</dl> +{/block} +{block name=content} +<p>Name: SomeCompany Ltd.<br>Telephone: +1-555-6383<br>Address: SomeStreet in Alamo</p> +{/block}
\ No newline at end of file diff --git a/templates/index.tpl b/templates/index.tpl new file mode 100644 index 0000000..d787033 --- /dev/null +++ b/templates/index.tpl @@ -0,0 +1,17 @@ +{extends file="layout.tpl"} +{block name=title}Home Page{/block} +{block name=navigation} +<dl> + <dt><a href="contact.php">Contact us</a></dt> + <dt><a href="categories.php">Categories</a></dt> + {if $loggedin} + <dt><a href="login.php?logout">Logout</a></dt> + {else} + <dt><a href="login.php">Login</a></dt> + {/if} +</dl> +{/block} +{block name=content} +<p>This site will rock your chair. The best products from all over the world. +Furniture the like you have never seen. Contact us a get our catalog or login a order direct from our categories.</p> +{/block}
\ No newline at end of file diff --git a/templates/layout.tpl b/templates/layout.tpl new file mode 100644 index 0000000..bd623a1 --- /dev/null +++ b/templates/layout.tpl @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="UTF-8"> +<title>{block name=title}Untitled Page{/block}</title> +<link rel="stylesheet" type="text/css" href="styles/style.css"> +</head> +<body> + <header><h1>{block name=title}Untitled Page{/block}</h1></header> + <nav> + {block name=navigation}Error loading{/block} + </nav> + <div id="content"> + {block name=content}Error loading{/block} + <div class="spacer"></div> + </div> + <footer>Copyright by SomeCompany Ltd. Powered by PropelORM and Smarty.</footer> +</body> +</html>
\ No newline at end of file diff --git a/templates/login.tpl b/templates/login.tpl new file mode 100644 index 0000000..c2bb0a2 --- /dev/null +++ b/templates/login.tpl @@ -0,0 +1,32 @@ +{extends file="layout.tpl"} +{block name=title}Login{/block} +{block name=navigation} +<dl> + <dt><a href="contact.php">Contact us</a></dt> + <dt><a href="categories.php">Categories</a></dt> + <dt><a href=".">Home</a></dt> +</dl> +{/block} +{block name=content} +<form action="login.php" method="post"> + <h1>{block name=title}{/block}</h1> + <div class="row"> + <label for="username"><u>U</u>sername:</label> + <input class="formw" type="text" + placeholder="Username" id="username" name="username" accesskey="u" + maxlength="100"> + </div> + <div class="row"> + <label for="password"><u>P</u>assword:</label> + <input class="formw" type="password" + placeholder="Password" id="password" name="password" accesskey="p"> + </div> + <div class="spacer"> </div> + <button type="submit" accesskey="l"> + <u>L</u>ogin + </button> + <button type="reset" accesskey="r"> + <u>R</u>eset + </button> +</form> +{/block}
\ No newline at end of file diff --git a/templates/productdetails.tpl b/templates/productdetails.tpl new file mode 100644 index 0000000..b850c7d --- /dev/null +++ b/templates/productdetails.tpl @@ -0,0 +1,49 @@ +{extends file="layout.tpl"} +{block name=title}{$product->getName()}{/block} +{block name=navigation} +<dl> + <dt><a href="contact.php">Contact us</a></dt> + <dt><a href=".">Home</a></dt> + <dt><a href="categories.php">Categories</a></dt> + <dt><a href="products.php?id={$catid}">Back to Category</a></dt> + {if $loggedin} + <dt><a href="login.php?logout">Logout</a></dt> + {else} + <dt><a href="login.php">Login</a></dt> + {/if} +</dl> +{/block} +{block name=content} +<form> + <div class="row"> + <label for="name"><u>N</u>ame:</label> + <input class="formw" type="text" + placeholder="Name" id="name" name="name" accesskey="n" + maxlength="100" readonly value="{$product->getName()}"> + </div> + <div class="row"> + <label for="price"><u>P</u>rice (Euro):</label> + <input class="formw" type="text" + placeholder="Price (Euro)" id="price" name="price" accesskey="p" + maxlength="13" readonly value="{$product->getPrice()}"> + </div> + <div class="row"> + <label for="width"><u>W</u>idth (mm):</label> + <input class="formw" type="text" + placeholder="Width (mm)" id="width" name="width" accesskey="w" + maxlength="11" readonly value="{$product->getWidth()}"> + </div> + <div class="row"> + <label for="height"><u>H</u>eight (mm):</label> + <input class="formw" type="text" + placeholder="Height (mm)" id="height" name="height" accesskey="h" + maxlength="11" readonly value="{$product->getHeight()}"> + </div> + <div class="row"> + <label for="desc"><u>D</u>escription:</label> + <textarea class="formw" placeholder="Description" id="desc" name="desc" + accesskey="d" maxlength="1000" readonly rows="5">{$product->getDescription()}</textarea> + </div> + <div class="spacer"> </div> +</form> +{/block}
\ No newline at end of file diff --git a/templates/productedit.tpl b/templates/productedit.tpl new file mode 100644 index 0000000..ccd8483 --- /dev/null +++ b/templates/productedit.tpl @@ -0,0 +1,66 @@ +{extends file="layout.tpl"} +{block name=title}{$product->getName()}{/block} +{block name=navigation} +<dl> + <dt><a href="contact.php">Contact us</a></dt> + <dt><a href=".">Home</a></dt> + <dt><a href="categories.php">Categories</a></dt> + <dt><a href="products.php?id={$catid}">Back</a></dt> + {if $loggedin} + <dt><a href="login.php?logout">Logout</a></dt> + {else} + <dt><a href="login.php">Login</a></dt> + {/if} +</dl> +{/block} +{block name=content} +<form action="productedit.php?{$type}={$product->getId()}&catid={$catid}" method="post"> + <h1>{block name=title}{/block}</h1> + <div class="row"> + <label for="name"><u>N</u>ame:</label> + <input class="formw" type="text" + placeholder="Name" id="name" name="name" accesskey="n" + maxlength="100" value="{$product->getName()}"> + </div> + <div class="row"> + <label for="price"><u>P</u>rice (Euro):</label> + <input class="formw" type="number" step="0.01" min="0" + placeholder="Price (Euro)" id="price" name="price" accesskey="p" + maxlength="13" value="{$product->getPrice()}"> + </div> + <div class="row"> + <label for="width"><u>W</u>idth (mm):</label> + <input class="formw" type="number" + placeholder="Width (mm)" id="width" name="width" accesskey="w" + maxlength="11" value="{$product->getWidth()}"> + </div> + <div class="row"> + <label for="height"><u>H</u>eight (mm):</label> + <input class="formw" type="number" + placeholder="Height (mm)" id="height" name="height" accesskey="h" + maxlength="11" value="{$product->getHeight()}"> + </div> + <div class="row"> + <label for="desc"><u>D</u>escription:</label> + <textarea class="formw" placeholder="Description" id="desc" name="desc" + accesskey="d" maxlength="1000">{$product->getDescription()}</textarea> + </div> + <div class="row"> + <label for="cat"><u>C</u>ategories:</label> + <select multiple class="formw" id="cat" name="cat[]" accesskey="c"> + {foreach from=$allCategories item=category} + <option value="{$category->getId()}" + {if $product->getCategories()->contains($category)}selected{/if} + >{$category->getName()}</option> + {/foreach} + </select> + </div> + <div class="spacer"> </div> + <button type="submit"> + {$type|capitalize} + </button> + <button type="reset"> + Reset + </button> +</form> +{/block}
\ No newline at end of file diff --git a/templates/products.tpl b/templates/products.tpl new file mode 100644 index 0000000..dac8f0e --- /dev/null +++ b/templates/products.tpl @@ -0,0 +1,36 @@ +{extends file="layout.tpl"} +{block name=title}{$category}{/block} +{block name=navigation} +<dl> + <dt><a href="contact.php">Contact us</a></dt> + <dt><a href=".">Home</a></dt> + <dt><a href="categories.php">Categories</a></dt> + {if $loggedin} + <dt><a href="login.php?logout">Logout</a></dt> + {else} + <dt><a href="login.php">Login</a></dt> + {/if} +</dl> +{/block} +{block name=content} +<table> + {foreach from=$products item=product} + <tr> + <td><a href="productdetails.php?id={$product->getId()}&catid={$id}">{$product->getName()}</a></td> + <td>{$product->getDescription()}</td> + {if $loggedin} + <td><a href="productedit.php?modify={$product->getId()}&catid={$id}">Edit</a></td> + <td><a href="productedit.php?delete={$product->getId()}&catid={$id}" onClick="return confirm('Confirm deletion.')">Delete</a></td> + {/if} + </tr> + {/foreach} + {if $loggedin} + <tr> + <td></td> + <td></td> + <td></td> + <td><a href="productedit.php?add&catid={$id}">Add</a></td> + </tr> + {/if} +</table> +{/block}
\ No newline at end of file |
