summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorClint Adams <clint@softwarefreedom.org>2013-07-19 15:25:08 -0400
committerClint Adams <clint@softwarefreedom.org>2013-07-19 15:25:08 -0400
commitf8b325748a3631df00841f3524b6e1f95a4e30f4 (patch)
tree3eb0d418d8a2ece33774f770e6086108c3ef6c86 /templates
parent10f6e8f4cce3303f53df359e0f40fcb5d584e85d (diff)
Update to newer Yesod.
Diffstat (limited to 'templates')
-rw-r--r--templates/homepage.hamlet43
-rw-r--r--templates/homepage.julius2
-rw-r--r--templates/userpage.hamlet22
3 files changed, 25 insertions, 42 deletions
diff --git a/templates/homepage.hamlet b/templates/homepage.hamlet
index c40be5c..e383365 100644
--- a/templates/homepage.hamlet
+++ b/templates/homepage.hamlet
@@ -1,38 +1,7 @@
-<h1>_{MsgHello}
+<h1>_{MsgTimekeeping}
-<ol>
- <li>Now that you have a working project you should use the #
- \<a href="http://www.yesodweb.com/book/">Yesod book</a> to learn more. #
- You can also use this scaffolded site to explore some basic concepts.
-
- <li> This page was generated by the #{handlerName} handler in #
- \<em>Handler/Root.hs</em>.
-
- <li> The #{handlerName} handler is set to generate your site's home screen in Routes file #
- <em>config/routes
-
- <li> The HTML you are seeing now is actually composed by a number of <em>widgets</em>, #
- most of them are brought together by the <em>defaultLayout</em> function which #
- is defined in the <em>Foundation.hs</em> module, and used by <em>#{handlerName}</em>. #
- All the files for templates and wigdets are in <em>templates</em>.
-
- <li>
- A Widget's Html, Css and Javascript are separated in three files with the #
- \<em>.hamlet</em>, <em>.lucius</em> and <em>.julius</em> extensions.
-
- <li ##{aDomId}>If you had javascript enabled then you wouldn't be seeing this.
-
- <li #form>
- This is an example trivial Form. Read the #
- \<a href="http://www.yesodweb.com/book/forms">Forms chapter</a> #
- on the yesod book to learn more about them.
- $maybe (info,con) <- submission
- <div .message>
- Your file's type was <em>#{fileContentType info}</em>. You say it has: <em>#{con}</em>
- <form method=post action=@{HomeR}#form enctype=#{formEnctype}>
- ^{formWidget}
- <input type="submit" value="Send it!">
-
- <li> And last but not least, Testing. In <em>tests/main.hs</em> you will find a #
- test suite that performs tests on this page. #
- You can run your tests by doing: <pre>yesod test</pre>
+<ul>
+ $forall Entity key person <- people
+ <li>
+ <a href=@{UserR key}>
+ #{userIdent person}
diff --git a/templates/homepage.julius b/templates/homepage.julius
index efae799..22920d4 100644
--- a/templates/homepage.julius
+++ b/templates/homepage.julius
@@ -1 +1 @@
-document.getElementById("#{aDomId}").innerHTML = "This text was added by the Javascript part of the homepage widget.";
+document.getElementById(#{toJSON aDomId}).innerHTML = "This text was added by the Javascript part of the homepage widget.";
diff --git a/templates/userpage.hamlet b/templates/userpage.hamlet
index 27353d0..4205d2c 100644
--- a/templates/userpage.hamlet
+++ b/templates/userpage.hamlet
@@ -1,21 +1,35 @@
<h1>#{username}
-$if isUser
+$forall Entity _ emp <- employments
+ <p>From #
+ <strong>
+ #{show (employmentStartDate emp)}
+ $maybe enddate <- employmentEndDate emp
+ \ until #
+ <strong>
+ #{show enddate}
+
+$if isThisUser
<p>
<form method=post action=@{UserR cid}#form enctype=#{formEnctype}>
^{formWidget}
<input type="submit" value="Submit time entry">
$else
+
<table>
<tr>
<th>Category
<th>Hours
<th>Date
- $forall (a,b,c) <- entries
+ <th>Note
+ $forall (a,b,c,d,e) <- entries
<tr .timeentry>
- <td>#{a}
- <td>#{b}
+ <td>
+ <a href=@{CategoryR a}>
+ #{timeCategoryName b}
<td>#{c}
+ <td>#{d}
+ <td>#{e}
^{pageNavWidget}