aboutsummaryrefslogtreecommitdiff
path: root/src/guff/views
diff options
context:
space:
mode:
Diffstat (limited to 'src/guff/views')
-rw-r--r--src/guff/views/ecrs/test-blog.ecr265
1 files changed, 138 insertions, 127 deletions
diff --git a/src/guff/views/ecrs/test-blog.ecr b/src/guff/views/ecrs/test-blog.ecr
index f28966a..c5e2d9b 100644
--- a/src/guff/views/ecrs/test-blog.ecr
+++ b/src/guff/views/ecrs/test-blog.ecr
@@ -1,137 +1,148 @@
<h1><%= h(TITLE) %></h1>
-<%
- POST_SETS.each do |set|
-%>
- <h2><%=
- h(set[:name] as String)
- %></h2>
-
- <table>
- <thead>
- <tr>
- <th>ID</th>
- <th>Created At</th>
- <th>Name</th>
- <th>Body</th>
- <th colspan='2'>Actions</th>
- </tr>
- </thead>
-
- <tbody><% posts(set[:id] as String).rows.each do |post| %>
- <tr>
- <td><%=
- h(post.row["post_id"].to_s)
- %></td>
-
- <td><%=
- h(post.row["created_at"].to_s)
- %></td>
-
- <td><%=
- h(post.row["name"].to_s)
- %></td>
-
- <td><%=
- post.row["body"].to_s
- %></td>
-
- <% (set[:actions] as Array(Hash(Symbol, String))).each do |a| %>
- <td>
- <form
- method='post'
- action='/test/blog/set_state'
- >
- <input
- type='hidden'
- name='post_id'
- value='<%= h(post.row["post_id"].to_s) %>'
- />
-
- <input
- type='hidden'
- name='state'
- value='<%= a[:id] %>'
- </input>
-
- <input
- type='submit'
- title='Set post to <%= h(a[:id]) %>..'
- value='<%= h(a[:name]) %>'
- />
- </form>
- </td>
- <% end %>
- </tr>
- <% end %></tbody>
- </table>
-<% end %>
+<table>
+ <thead>
+ <tr><% POST_SETS.each do |set| %>
+ <th><h2><%=
+ h(set[:name] as String)
+ %></h2></th>
+ <% end %></tr>
+ </thead>
+
+ <tbody>
+ <tr><% POST_SETS.each do |set| %>
+ <td valign='top'>
+ <table>
+ <thead>
+ <tr>
+ <th>ID</th>
+ <th>Created At</th>
+ <th>Name</th>
+ <th>Body</th>
+ <th colspan='2'>Actions</th>
+ </tr>
+ </thead>
+
+ <tbody><% posts(set[:id] as String).rows.each do |post| %>
+ <tr>
+ <td><%=
+ h(post.row["post_id"].to_s)
+ %></td>
+
+ <td><%=
+ h(post.row["created_at"].to_s)
+ %></td>
+
+ <td><%=
+ h(post.row["name"].to_s)
+ %></td>
+
+ <td><%=
+ post.row["body"].to_s
+ %></td>
+
+ <% (set[:actions] as Array(Hash(Symbol, String))).each do |a| %>
+ <td>
+ <form
+ method='post'
+ action='/test/blog/set_state'
+ >
+ <input
+ type='hidden'
+ name='post_id'
+ value='<%= h(post.row["post_id"].to_s) %>'
+ />
+
+ <input
+ type='hidden'
+ name='state'
+ value='<%= a[:id] %>'
+ </input>
+
+ <input
+ type='submit'
+ title='Set post to <%= h(a[:id]) %>..'
+ value='<%= h(a[:name]) %>'
+ />
+ </form>
+ </td>
+ <% end %>
+ </tr>
+ <% end %></tbody>
+ </table>
+ </td>
+ <% end %></tr>
+ </tbody>
+</table>
<div class='section'>
<form
method='post'
action='/test/blog/add_post'
>
- <label for='post-name'>
- Name
- </label><br/>
-
- <input
- type='text'
- id='post-name'
- name='name'
- title='Enter post title'
- placeholder='Post Title'
- value=''
- />
-
- <br/>
-
- <label for='post-slug'>
- Slug
- </label><br/>
-
- <input
- type='text'
- id='post-slug'
- name='slug'
- title='Enter post slug'
- placeholder='post-slug'
- value=''
- />
-
- <br/>
-
- <label for='post-body'>
- Post Body
- </label><br/>
-
- <textarea
- id='post-body'
- name='body'
- ></textarea>
-
- <br/>
-
- <label for='post-tags'>
- Tags (space-delimited)
- </label><br/>
-
- <input
- type='text'
- id='post-tags'
- name='tags'
- title='Enter post tags'
- placeholder='some post tags'
- value=''
- />
-
- <br/>
-
- <input
- type='submit'
- title='Create new post.'
- value='Add Post'
- />
+ <fieldset>
+ <legend>Add Post</legend>
+ <label for='post-name'>
+ Name
+ </label><br/>
+
+ <input
+ type='text'
+ id='post-name'
+ name='name'
+ title='Enter post title'
+ placeholder='Post Title'
+ value=''
+ />
+
+ <br/>
+
+ <label for='post-slug'>
+ Slug
+ </label><br/>
+
+ <input
+ type='text'
+ id='post-slug'
+ name='slug'
+ title='Enter post slug'
+ placeholder='post-slug'
+ value=''
+ />
+
+ <br/>
+
+ <label for='post-body'>
+ Post Body
+ </label><br/>
+
+ <textarea
+ id='post-body'
+ name='body'
+ ></textarea>
+
+ <br/>
+
+ <label for='post-tags'>
+ Tags (space-delimited)
+ </label><br/>
+
+ <input
+ type='text'
+ id='post-tags'
+ name='tags'
+ title='Enter post tags'
+ placeholder='some post tags'
+ value=''
+ />
+
+ <br/>
+
+ <input
+ type='submit'
+ title='Create new post.'
+ value='Add Post'
+ />
+ </fieldset>
</form>
</div>