summaryrefslogtreecommitdiff
path: root/src/views
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
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')
-rw-r--r--src/views/Template.class.php2
-rw-r--r--src/views/pages/users/index.html.php46
-rw-r--r--src/views/pages/users/individual.html.php12
-rw-r--r--src/views/pages/users/new-locked.html.php9
4 files changed, 53 insertions, 16 deletions
diff --git a/src/views/Template.class.php b/src/views/Template.class.php
index 663ec05..bf57e93 100644
--- a/src/views/Template.class.php
+++ b/src/views/Template.class.php
@@ -138,7 +138,7 @@ class Template {
$str.= $this->tag('title', array(), htmlspecialchars($title));
$str.= $this->css('style.css', 'all');
$str.= $this->css('screen.css', 'screen');
- $str.= $this->css('logo-style.css', 'screen');
+ $str.= $this->css('print.css', 'print');
$str.= $this->closeTag('head');
$body_class = 'logged'.($logged_in?'in':'out');
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',
diff --git a/src/views/pages/users/individual.html.php b/src/views/pages/users/individual.html.php
index 5722977..39360b7 100644
--- a/src/views/pages/users/individual.html.php
+++ b/src/views/pages/users/individual.html.php
@@ -1,6 +1,7 @@
<?php global $VARS, $CONTACT_METHODS;
$t = $VARS['template'];
-$user = $VARS['user'];
+$users = $VARS['users'];
+$username = $VARS['username'];
function inputText($user, $key, $label, $hint='') {
global $VARS; $t = $VARS['template'];
@@ -56,8 +57,14 @@ function inputField($user, $arr) {
////////////////////////////////////////////////////////////////////////////////
+if (count($users)>1) {
+ $t->header("Users: $username");
+} else {
+ $t->header("User: $username");
+}
+
+foreach($users as $user) {
$username = $user->getName();
-$t->header("Users: $username");
$t->tag('h1', array(), ($user->canEdit()?'Edit':'View')." User <q>$username</q> (UID: ".$user->getUID().")");
@@ -136,4 +143,5 @@ if ($user->canEdit()) {
$t->tag('input', array('type'=>'submit', 'value'=>'Save'));
}
$t->closeTag('form');
+}
$t->footer();
diff --git a/src/views/pages/users/new-locked.html.php b/src/views/pages/users/new-locked.html.php
new file mode 100644
index 0000000..dc7ad0d
--- /dev/null
+++ b/src/views/pages/users/new-locked.html.php
@@ -0,0 +1,9 @@
+<?php global $VARS;
+$t = $VARS['template'];
+
+$t->status('403 Forbidden');
+$t->header('Create new user');
+
+$t->paragraph("Sorry, new user registration is disabled.");
+
+$t->footer();