summaryrefslogtreecommitdiff
path: root/smarty
diff options
context:
space:
mode:
authorNathan Kinkade <nath@nkinka.de>2008-02-03 23:23:24 +0000
committerNathan Kinkade <nath@nkinka.de>2008-02-03 23:23:24 +0000
commitd895b852a6e160496ffc760d46d3719a3d62ff86 (patch)
tree52230bb04148197e8312e09b5c5273417e7a3be9 /smarty
Initial checkin of nutridb.org and basic subversion directory structure
Diffstat (limited to 'smarty')
-rw-r--r--smarty/templates/footer.tpl11
-rw-r--r--smarty/templates/header.tpl43
-rw-r--r--smarty/templates/index.tpl42
-rw-r--r--smarty/templates/sidebar_left.tpl65
-rw-r--r--smarty/templates/sidebar_right.tpl1
5 files changed, 162 insertions, 0 deletions
diff --git a/smarty/templates/footer.tpl b/smarty/templates/footer.tpl
new file mode 100644
index 0000000..6dd202a
--- /dev/null
+++ b/smarty/templates/footer.tpl
@@ -0,0 +1,11 @@
+
+<div id='footer'>
+ <div id='footerLinks'>
+ Data provided by USDA, Agricultural Research Service (<a href='http://www.ars.usda.gov/ba/bhnrc/ndl'>Nutrient Data
+ Laboratory</a>)
+ </div>
+</div>
+
+</body>
+
+</html>
diff --git a/smarty/templates/header.tpl b/smarty/templates/header.tpl
new file mode 100644
index 0000000..298b8a5
--- /dev/null
+++ b/smarty/templates/header.tpl
@@ -0,0 +1,43 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>{$myHeaders}</head>
+
+<body>
+
+<div id='header'>
+ <div id='headerLeft'>
+ Nutrition Information Database
+ </div>
+
+{if isset($isLoggedIn)}
+ <div id='headerMiddle'></div>
+ <div id='headerRight'>
+ Hi {$displayUserName|capitalize}.<br />
+ [<a href='?logout'>Logout</a>]
+
+ </div>
+{else}
+ <form action='login.php' method='post' name='loginForm' onsubmit='return validateNotEmpty("username,password");'>
+ <div id='headerMiddle'>
+ Login <input type='text' name='username' id='username' size='15' maxlength='25' /><br />
+ Password <input type='password' name='password' id='password' size='15' maxlength='25' />
+ </div>
+ <div id='headerRight'>
+ <input type='submit' name='doLogin' value='Login' style='margin-bottom: 1ex;' /><br />
+ <a href='register.php'>Register</a>.
+ </div>
+ </form>
+{/if}
+
+ <div id='headerLinkBar'>
+ <div id='headerLinks'>
+ <a href='{$config->_rootUrl}/' title='Home Page'>Home</a> &nbsp; | &nbsp;
+ <a href='help.php'>Help</a>
+ </div>
+ <div id='systemMsgs'>{$systemMsg}</div>
+ </div>
+</div>
+
+
diff --git a/smarty/templates/index.tpl b/smarty/templates/index.tpl
new file mode 100644
index 0000000..00dcca4
--- /dev/null
+++ b/smarty/templates/index.tpl
@@ -0,0 +1,42 @@
+{$header}
+<div id='columnContainer'>
+
+ <div id='middleColumn'>
+ <div id='middleData'>
+ <form action='food_match.php' method='post' name='foodmatch'>
+ Select the type of search:<br />
+ <input checked='checked' type='radio' name='stype' value='and' /> All Words<br />
+ <input type='radio' name='stype' value='or' /> Any Words<br />
+ <input type='radio' name='stype' value='=' /> Exact Phrase<br /><br />
+ Select the type of word search:<br />
+ <input checked='checked' type='radio' name='wtype' value='part' /> Partial Word<br />
+ <input type='radio' name='wtype' value='full' /> Full Word<br /><br />
+ Select a category:<br />
+ <select name='fdgp_cd'>
+ <option selected='selected' value='all'>All categories</option>
+{foreach from=$fdGroups item=fdGroup}
+ <option value='{$fdGroup.fdgp_cd}'>{$fdGroup.fdgp_desc}</option>
+{/foreach}
+ </select><br /><br />
+ Search for:
+ <input type='text' name='whatFood' />
+ <input type='submit' value='Search!' />
+ </form>
+ <a href='help.php#search'>What do all these search options mean?</a>
+ </div>
+ </div>
+
+ <div id='leftColumn'>
+ <div id='leftData'>
+ {$sidebar_left}
+ </div>
+ </div>
+
+ <div id='rightColumn'>
+ <div id='rightData'>
+ {$sidebar_right}
+ </div>
+ </div>
+
+</div>
+{$footer}
diff --git a/smarty/templates/sidebar_left.tpl b/smarty/templates/sidebar_left.tpl
new file mode 100644
index 0000000..5619333
--- /dev/null
+++ b/smarty/templates/sidebar_left.tpl
@@ -0,0 +1,65 @@
+ Current meal items:<br />
+{if isset($currentMealItems)}
+ <form action='view_meal.php' method='post'>
+ {foreach from=$currentMealItems key=key item=currentMealItem}
+ <span class='indent'> =&gt; {$currentMealItem} (<a href='edit_new_meal.php?rm_item={$key}' title='Remove meal item'>Del</a>)</span>
+ <br />
+ <input type='hidden' name='source' value='new' />
+ <input type='submit' name='view_new_meal' value='View Meal' />
+ <a href='edit_new_meal.php?clear_meal=yes' title='Remove all meal items'>Clear Meal</a>
+ </form>
+ {/foreach}
+{else}
+ (No items in current meal.)
+{/if}
+
+ <br /><br />
+{if isset($isLoggedIn)}
+ Saved items:<br />
+ {if isset($myFoods)}
+ <form action='food_data.php' method='post' id='frmMyFoods'>
+ <select name='my_food' style='width: 70%;' onchange='return submitForm("frmMyFoods");'>
+ <option value=''> -- Select -- </option>
+ {foreach from=$myFoods item=myFood}
+ <option value='{$myFood.id_my_foods}'>{$myFood.my_desc}</option>
+ {/foreach}
+ </select>
+ Foods
+ <input type='hidden' name='source' value='food' />
+ </form>
+ {else}
+ No saved foods.
+ {/if}
+
+ {if isset($myMeals)}
+ <form action='view_meal.php' method='post' id='frmMyMeals'>
+ <select name='meal_id' style='width: 70%;' onchange='return submitForm("frmMyMeals");'>
+ <option value=''> -- Select -- </option>
+ {foreach from=$myMeals item=myMeal}
+ <option value='{$myMeal.id_my_meals}'>{$myMeal.meal_desc}</option>
+ {/foreach}
+ </select>
+ Meals
+ <input type='hidden' name='source' value='saved' />
+ </form>
+ {else}
+ No saved meals.
+ {/if}
+
+ {if isset($myDiaries)}
+ <form action='view_diary.php' method='post' id='frmMyDiaries'>
+ <select name='id_my_diaries' style='width: 70%;' onchange='return submitForm("frmMyDiaries");'>
+ <option value=''> -- Select -- </option>
+ {foreach from=$myDiaries item=myDiary}
+ <option value='{$myDiary.id_my_diaries}'>{$myDiary.diary_desc}</option>
+ {/foreach}
+ </select>
+ Meals
+ </form>
+ Diaries
+ {else}
+ No saved diaries.
+ {/if}
+ <p><a href='my_stuff.php'>Manage my account</a>.</p>
+{/if}
+
diff --git a/smarty/templates/sidebar_right.tpl b/smarty/templates/sidebar_right.tpl
new file mode 100644
index 0000000..b0db84a
--- /dev/null
+++ b/smarty/templates/sidebar_right.tpl
@@ -0,0 +1 @@
+Google Adsense