summaryrefslogtreecommitdiff
path: root/src/views/pages/users/index.html.php
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2011-10-09 04:00:06 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2011-10-09 04:00:06 -0400
commit38bb3a7c752199ee8f58e16bc784f48a6a600e08 (patch)
tree771b6d80fbf4fceb6f708ada6bb7b3838e593d66 /src/views/pages/users/index.html.php
parentf72b9a7658cea71ee1edf4ae678a2c8043d9e5bf (diff)
parent0fd0403876aacecfde74fca0641530875f09200f (diff)
Merge branch 'master' into concurrent-editing
So, here's the deal: * The meat of [concurrent-editing]:Form.class got merged into [master]:DB.class * The string-generation stuff in [concurrent-editing]:Form.class didn't fit nicely anywhere anymore, so I got rid of it by makeing datatype explicit. * Users.class: declare datatypes explicitly in attrib() * index.html.php: use this new explicit data * style.scss: add a .small, which we can do because of the datatypes thing. Conflicts: src/controllers/Users.class.php
Diffstat (limited to 'src/views/pages/users/index.html.php')
-rw-r--r--src/views/pages/users/index.html.php46
1 files changed, 33 insertions, 13 deletions
diff --git a/src/views/pages/users/index.html.php b/src/views/pages/users/index.html.php
index 7f51592..daed9f7 100644
--- a/src/views/pages/users/index.html.php
+++ b/src/views/pages/users/index.html.php
@@ -13,14 +13,35 @@ $t->openTag('form', array('action'=>$t->url('users/index'),
$t->tag('input', array('type'=>'submit',
'value'=>'Save/Update'));
-$t->openTag('table');
+$t->openTag('table', array('class'=>'sortable', 'id'=>'bar'));
+$t->openTag('thead');
$t->openTag('tr');
foreach ($attribs as $attrib) {
- $t->tag('th', array(), $attrib['name']);
+ switch ($attrib['type']) {
+ case 'bool': $class = 'small'; break;
+ default: $class = ''; break;
+ }
+ $t->tag('th', array('class'=>$class), $attrib['name']);
}
-$t->tag('th');
+$t->tag('th', array(), '-');
$t->closeTag('tr');
+$t->closeTag('thead');
+
+$t->openTag('tfoot');
+$t->openTag('tr');
+foreach ($attribs as $attrib) {
+ switch ($attrib['type']) {
+ case 'bool': $class = 'small'; break;
+ default: $class = ''; break;
+ }
+ $t->tag('th', array('class'=>$class), $attrib['name']);
+}
+$t->tag('th', array(), '-');
+$t->closeTag('tr');
+$t->closeTag('tfoot');
+
+$t->openTag('tbody');
foreach ($users as $user) {
$t->openTag('tr');
@@ -29,11 +50,15 @@ foreach ($users as $user) {
$t->openTag('td');
$props = $user[$attrib['key']];
-
- $value = $props['value'];
+
+ $bool = $attrib['type']=='bool';
+ if ($bool) {
+ $value = $props['value']=='true';
+ } else {
+ $value = $props['value'];
+ }
$editable = $props['editable'];
$post_key = $props['post_key'];
- $bool = is_bool($value);
$arr = array('name'=>$post_key);
if (!$editable) {
@@ -48,6 +73,7 @@ foreach ($users as $user) {
$arr['value'] = 'true';
$arr['type'] = 'checkbox';
} else {
+ $t->tag('span', array('class'=>'cell_width'), $value);
$arr['value'] = $value;
$arr['type'] = 'text';
}
@@ -66,13 +92,7 @@ foreach ($users as $user) {
$t->closeTag('tr');
}
-$t->openTag('tr');
-foreach ($attribs as $attrib) {
- $t->tag('th', array(), $attrib['name']);
-}
-$t->tag('th');
-$t->closeTag('tr');
-
+$t->closeTag('tbody');
$t->closeTag('table');
$t->tag('input', array('type'=>'submit',