OSDN Git Service

ユーザ一覧表示の調節
authorCake <cake_67@users.sourceforge.jp>
Fri, 26 Mar 2010 05:36:16 +0000 (14:36 +0900)
committerCake <cake_67@users.sourceforge.jp>
Fri, 26 Mar 2010 05:36:16 +0000 (14:36 +0900)
app/config/sql/setup_user.sql
app/views/users/admin_listview.ctp
app/views/users/listview.ctp
app/webroot/css/base.css

index 31d5656..54864da 100644 (file)
@@ -63,7 +63,7 @@ CREATE TABLE `users` (
   PRIMARY KEY  (`id`),
   UNIQUE KEY `users_username` (`username`),
   KEY `users_login` (`username`,`password`),
-  KEY `users_modefied` (`modified`)
+  KEY `users_modified` (`modified`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 INSERT INTO `users` VALUES (1,1,'Administrator','admin','94b42f9e11eb5528029fcff7625904d8df3424ce','','','','',NOW(),NOW());
index 5d39072..d95d5d6 100644 (file)
@@ -1,4 +1,4 @@
-<div class="users listview">
+<div class="users admin_listview">
 <fieldset class="searchFieldset" id="adminSearchFieldset">
 <legend><?php __('Search User');?></legend>
 <div class="search form">
@@ -6,31 +6,36 @@
 <?php echo $form->input('name'); ?>
 <?php echo $form->end('Search'); ?>
 </div>
-<?php $paginator->options(array('url' => $searchword)); ?>
 </fieldset>
 
 <h2><?php __('Users List'); ?></h2>
 <p>
+<?php
+$paginator->options(array('url' => $this->passedArgs));
+
+echo $paginator->counter(array(
+       'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
+));
+?></p>
+
 <div class="paging">
        <?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
- |     <?php echo $paginator->numbers();?>
+ |     <?php echo $paginator->numbers();?> | 
        <?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
 </div>
-</p>
 
-<p>
 <table>
 <tr>
-       <th><?php echo $paginator->sort('id');?></th>
-       <th><?php echo $paginator->sort('name');?></th>
-       <th><?php echo $paginator->sort('group_id');?></th>
-       <th><?php echo $paginator->sort('modefied');?></th>
-       <th><?php echo $paginator->sort('username');?></th>
-       <th><?php echo $paginator->sort('pcmail');?></th>
-       <th><?php echo $paginator->sort('mobile_mail');?></th>
-       <th><?php echo $paginator->sort('created');?></th>
-       <th><?php echo $paginator->sort('useragent');?></th>
-       <th><?php echo $paginator->sort('host');?></th>
+       <th><?php echo $paginator->sort(__('No', true), 'id');?></th>
+       <th><?php echo $paginator->sort(__('Name', true), 'name');?></th>
+       <th><?php echo $paginator->sort(__('Group', true), 'group_id');?></th>
+       <th><?php echo $paginator->sort(__('Last Access', true), 'modified');?></th>
+       <th><?php echo $paginator->sort(__('ID', true), 'username');?></th>
+       <th><?php echo $paginator->sort(__('PC', true), 'pcmail');?></th>
+       <th><?php echo $paginator->sort(__('Mobile', true), 'mobile_mail');?></th>
+       <th><?php echo $paginator->sort(__('Registed', true), 'created');?></th>
+       <th><?php echo $paginator->sort(__('UserAgent', true), 'useragent');?></th>
+       <th><?php echo $paginator->sort(__('Host', true), 'host');?></th>
 </tr>
 <?php
 $i = 0;
@@ -45,13 +50,13 @@ foreach ($users as $user):
        <?php echo $user['User']['id']; ?>
 </td>
 <td>
-       <?php echo $html->link($user['User']['name'], array('action' => 'view', $user['User']['id']), array(), false, false); ?>
+       <?php echo $html->link($text->truncate($user['User']['name'], 16), array('action' => 'view', $user['User']['id']), array(), false, false); ?>
 </td>
 <td>
        <?php echo $user['User']['group_id']; ?>
 </td>
 <td>
-       <?php echo $user['User']['modified']; ?>
+       <?php echo $time->niceShort($user['User']['modified'], array('format' => 'Y/m/d H:i')); ?>
 </td>
 <td>
        <?php echo $user['User']['username']; ?>
@@ -63,10 +68,24 @@ foreach ($users as $user):
        <?php echo $user['User']['mobile_mail']; ?>
 </td>
 <td>
-       <?php echo $user['User']['created']; ?>
+       <?php echo $time->niceShort($user['User']['created'], array('format' => 'Y/m/d H:i')); ?>
 </td>
 <td>
-       <?php echo $user['User']['useragent']; ?>
+<?php
+if (strrpos($user['User']['useragent'], 'MSIE') !== false) {
+       echo $text->highlight($text->excerpt($user['User']['useragent'], 'MSIE', 28), 'MSIE');
+} elseif (strpos($user['User']['useragent'], 'Firefox') !== false) {
+       echo $text->highlight($text->excerpt($user['User']['useragent'], 'Firefox', 24), 'Firefox');
+} elseif (strpos($user['User']['useragent'], 'Chrome') !== false) {
+       echo $text->highlight($text->excerpt($user['User']['useragent'], 'Chrome', 24), 'Chrome');
+} elseif (strpos($user['User']['useragent'], 'Safari') !== false) {
+       echo $text->highlight($text->excerpt($user['User']['useragent'], 'Safari', 28), 'Safari');
+} elseif (strpos($user['User']['useragent'], 'Opera') !== false) {
+       echo $text->highlight($text->excerpt($user['User']['useragent'], 'Opera', 56), 'Opera');
+} else {
+       echo $text->truncate($user['User']['useragent'], 56);
+}
+?>
 </td>
 <td>
        <?php echo $user['User']['host']; ?>
@@ -77,7 +96,7 @@ foreach ($users as $user):
 </div>
 <div class="paging">
        <?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
- |     <?php echo $paginator->numbers();?>
+ |     <?php echo $paginator->numbers();?> | 
        <?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
 </div>
 </p>
index 7def8d9..c9af78c 100644 (file)
@@ -2,6 +2,8 @@
 <h2><?php __('Users');?> <?php __('List');?></h2>
 <p>
 <?php
+$paginator->options(array('url' => $this->passedArgs));
+
        echo $paginator->counter(array(
                'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
        ));
 
 <div class="paging">
        <?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
-        | <?php echo $paginator->numbers();?>
+        | <?php echo $paginator->numbers();?> | 
        <?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
 </div>
 
 <table>
 <tr>
-<th><?php echo $paginator->sort('id');?></th>
-<th><?php echo $paginator->sort('name');?></th>
-<th><?php echo $paginator->sort('modified');?></th>
+<th><?php echo $paginator->sort(__('ID', true), 'id');?></th>
+<th><?php echo $paginator->sort(__('Name', true), 'name');?></th>
+<th><?php echo $paginator->sort(__('Last Access', true), 'modified');?></th>
 </tr>
 <?php
        $i = 0;
 <?php echo $user['User']['id']; ?>
 </td>
 <td>
-       <?php echo $html->link($user['User']['name'], array('action' => 'view', $user['User']['id']), array(), false, false); ?>
+       <?php echo $html->link($text->truncate($user['User']['name'], 16), array('action' => 'view', $user['User']['id']), array(), false, false); ?>
 </td>
 <td>
-       <?php echo $user['User']['modified']; ?>
+       <?php echo $time->niceShort($user['User']['modified'], array('format' => 'Y/m/d H:i')); ?>
 </td>
 </tr>
 <?php endforeach; ?>
@@ -43,6 +45,6 @@
 </div>
 <div class="paging">
        <?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
-        | <?php echo $paginator->numbers();?>
+        | <?php echo $paginator->numbers();?> | 
        <?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
 </div>
index 2c65cdb..5d79eb3 100644 (file)
@@ -442,7 +442,11 @@ input.sortOrder {
 }
 
 
-/* 管理画面:サイト設定 */
+/* 管理画面 */
+div.admin_listview table
+{
+       width: 100%;
+}
 div.siteConfigs table
 {
        width: 100%;
@@ -483,3 +487,9 @@ a.shadow {
 h2 .publicFlag {
        font-size: 80%;
 }
+
+/* ハイライト */
+.highlight {
+       background-color: #ffff66;
+       font-weight: bold;
+}
\ No newline at end of file