... | ... |
@@ -82,33 +82,23 @@ input[type=text], input[type=password] { |
82 | 82 |
} |
83 | 83 |
|
84 | 84 |
.admin-users { |
85 |
- width:70%; |
|
86 |
-} |
|
87 |
- |
|
88 |
-.admin-users div { |
|
89 |
- display:inline-block; |
|
90 |
-} |
|
91 |
- |
|
92 |
-.admin-users form { |
|
93 |
- display:inline-block; |
|
85 |
+ border-collapse:collapse; |
|
86 |
+ width:100%; |
|
94 | 87 |
} |
95 |
- |
|
96 |
-.admin-users li { |
|
97 |
- border-bottom:1px solid #d8d8d8; |
|
98 |
- padding:8px 0; |
|
88 |
+.admin-users th, .admin-users td { |
|
89 |
+ border:1px solid #d8d8d8; |
|
90 |
+ padding:5px; |
|
99 | 91 |
} |
100 |
- |
|
101 |
-.admin-users li:first-child { |
|
102 |
- border-top:1px solid #d8d8d8; |
|
92 |
+.admin-users th { |
|
93 |
+ font-weight:bold; |
|
94 |
+ text-align:center; |
|
103 | 95 |
} |
104 |
- |
|
105 |
-.admin-users li > div:first-child { |
|
106 |
- width:20%; |
|
96 |
+.admin-users td { |
|
97 |
+ |
|
107 | 98 |
} |
108 | 99 |
|
109 |
-.admin-users li > div.last-child { |
|
110 |
- width:78%; |
|
111 |
- text-align:right; |
|
100 |
+.admin-users form { |
|
101 |
+ display:inline-block; |
|
112 | 102 |
} |
113 | 103 |
|
114 | 104 |
.container { |
... | ... |
@@ -41,7 +41,10 @@ |
41 | 41 |
else { $errors = $validation->messages } |
42 | 42 |
} |
43 | 43 |
|
44 |
- my $users = app->manager->users; |
|
44 |
+ my $users = app->dbi->model('user')->select( |
|
45 |
+ where => {admin => 0}, |
|
46 |
+ append => 'order by id' |
|
47 |
+ )->all; |
|
45 | 48 |
%> |
46 | 49 |
|
47 | 50 |
% layout 'common', title => 'Admin Users'; |
... | ... |
@@ -91,21 +94,33 @@ |
91 | 94 |
<h3 class="topic1">Admin Users</h3> |
92 | 95 |
<div style="margin-bottom:10px"><a class="btn" href="<%= url_for('/_admin/user/create') %>">Create User</a></div> |
93 | 96 |
<div class="container"> |
94 |
- <ul class="admin-users"> |
|
97 |
+ <table class="admin-users"> |
|
98 |
+ <tr> |
|
99 |
+ <th>ID</th> |
|
100 |
+ <th>Name</th> |
|
101 |
+ <th>Mail</th> |
|
102 |
+ <th></th> |
|
103 |
+ </tr> |
|
95 | 104 |
% for my $user (@$users) { |
96 |
- % my $uid = $user->{id}; |
|
97 |
- <li> |
|
98 |
- <div> |
|
105 |
+ <tr> |
|
106 |
+ % my $uid = $user->{id}; |
|
107 |
+ <td> |
|
99 | 108 |
<a href="#"><%= $uid %></a> |
100 |
- </div> |
|
101 |
- <div class="last-child"> |
|
109 |
+ </td> |
|
110 |
+ <td> |
|
111 |
+ <%= $user->{name} %> |
|
112 |
+ </td> |
|
113 |
+ <td> |
|
114 |
+ <%= $user->{mail} %> |
|
115 |
+ </td> |
|
116 |
+ <td> |
|
102 | 117 |
<a class="btn btn-mini" href="<%= url_for('/reset-password')->query(user => $uid) %>">Reset Password</a> |
103 | 118 |
<form action="<%= url_for->query(op => 'delete') %>" method="post"> |
104 | 119 |
%= hidden_field user => $uid; |
105 | 120 |
<input type="submit" class="btn btn-mini delete-btn" user="<%= $uid %>" value="Delete"> |
106 | 121 |
</form> |
107 |
- </div> |
|
108 |
- </li> |
|
122 |
+ </td> |
|
123 |
+ </tr> |
|
109 | 124 |
% } |
110 | 125 |
</table> |
111 | 126 |
</div> |
... | ... |
@@ -127,7 +127,7 @@ note 'Admin pages'; |
127 | 127 |
$t->content_like(qr/Two password/); |
128 | 128 |
|
129 | 129 |
# Create user |
130 |
- $t->post_ok('/_admin/user/create?op=create', form => {id => 'kimoto', mail => 'kimoto@foo.com', password => 'a', password2 => 'a'}); |
|
130 |
+ $t->post_ok('/_admin/user/create?op=create', form => {id => 'kimoto', name => 'Kimoto', mail => 'kimoto@foo.com', password => 'a', password2 => 'a'}); |
|
131 | 131 |
$t->content_like(qr/Success.*created/); |
132 | 132 |
} |
133 | 133 |
|
... | ... |
@@ -135,6 +135,8 @@ note 'Admin pages'; |
135 | 135 |
$t->get_ok('/_admin/users'); |
136 | 136 |
$t->content_like(qr/Admin Users/); |
137 | 137 |
$t->content_like(qr/kimoto/); |
138 |
+ $t->content_like(qr/Kimoto/); |
|
139 |
+ $t->content_like(qr/kimoto\@foo\.com/); |
|
138 | 140 |
|
139 | 141 |
note 'Reset password page'; |
140 | 142 |
{ |