Skip to content
Browse files

updated inheritance demo

  • Loading branch information...
1 parent 4b24a08 commit 5a9f274bb3e1b24d0aa5ecb94962581a522ea03c @m3nt0r committed Jun 11, 2012
Showing with 39 additions and 31 deletions.
  1. +30 −20 examples/inheritance/users/index.tpl
  2. +9 −11 examples/users/index.tpl
View
50 examples/inheritance/users/index.tpl
@@ -8,27 +8,37 @@
{% block table %}
<div class="container">
- <table class="table table-bordered" cellpadding="0" cellspacing="0">
+ <table class="table table-bordered">
+ <thead>
+ <tr>
+ <th>{{ paginator.sort('id') }}</th>
+ <th>{{ paginator.sort('email') }}</th>
+ <th>{{ paginator.sort('created') }}</th>
+ <th>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% if users is iterable %}
+ {% for row in users %}
+ <tr>
+ <td>{{ row.User.id }}</td>
+ <td>{{ row.User.email }}</td>
+ <td>{{ row.User.created }}</td>
+ <td>
+ {{
+ html.link('Edit User'|trans, {
+ 'controller': 'users', 'action': 'edit', 0: row.User.id
+ })
+ }}
+ </td>
+ </tr>
+ {% endfor %}
+ {% else %}
<tr>
- <th>{{ paginator.sort('id') }}</th>
- <th>{{ paginator.sort('email') }}</th>
- <th>{{ paginator.sort('created') }}</th>
- <th>Actions</th>
- </tr>
- {% for row in users %}
- <tr>
- <td>{{ row.User.id }}</td>
- <td>{{ row.User.email }}</td>
- <td>{{ row.User.created }}</td>
- <td>
- {{
- html.link('Edit User', {
- 'controller': 'users', 'action': 'edit', 0: row.User.id
- })
- }}
- </td>
- </tr>
- {% endfor %}
+ <td colspan="4">Sorry, no users found.</td>
+ </tr>
+ {% endif %}
+ </tbody>
</table>
</div>
{% endblock %}
View
20 examples/users/index.tpl
@@ -10,12 +10,12 @@
<th>{{ paginator.sort('email') }}</th>
<th>{{ paginator.sort('created') }}</th>
<th>Actions</th>
- </tr>
+ </tr>
</thead>
- <tbody>
+ <tbody>
{% if users is iterable %}
{% for row in users %}
- <tr>
+ <tr>
<td>{{ row.User.id }}</td>
<td>{{ row.User.email }}</td>
<td>{{ row.User.created }}</td>
@@ -26,17 +26,15 @@
})
}}
</td>
- </tr>
- {% endfor %}
- {% else %}
- <tr>
- <td colspan="4">
- Sorry, no users found.
- </td>
</tr>
+ {% endfor %}
+ {% else %}
+ <tr>
+ <td colspan="4">Sorry, no users found.</td>
+ </tr>
{% endif %}
</tbody>
- </table>
+ </table>
</div>

0 comments on commit 5a9f274

Please sign in to comment.
Something went wrong with that request. Please try again.