Просмотр исходного кода

Migrating to jQuery the sort table feature.

jfdelrio 16 лет назад
Родитель
Сommit
79359c3eb9

+ 15 - 17
admin/admin.php Просмотреть файл

@@ -28,9 +28,15 @@ if ($user->isAdmin()) {
28 28
 		<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
29 29
 		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/jquery.js"></script>
30 30
 		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/tools.js"></script>
31
-		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/sortable.js"></script>
31
+		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/jquery.tablesorter.min.js"></script>
32 32
 		<script type="text/javascript">
33 33
 		$(document).ready(function(){
34
+			$("#admin-table").tablesorter({        
35
+				headers: {            
36
+					2: {sorter: false},            
37
+					3: {sorter: false} 
38
+				} 
39
+			}); 			
34 40
 			$("#divMessages").fadeOut(5000,function(){
35 41
 				$("#divMessages").css({display:"none"});
36 42
 			});
@@ -90,12 +96,13 @@ if ($user->isAdmin()) {
90 96
 						}
91 97
 ?>						
92 98
 						<div class="tabla">
93
-						<table class="sortable" id="admin-table">
99
+						<table border="0" cellpadding="0" cellspacing="0" id="admin-table">
94 100
 							<thead>
95 101
 								<tr>
96 102
 									<th scope="col"><?php echo __("Login")?></th>
97 103
 									<th scope="col"><?php echo __("Name")?></th>
98
-									<th colspan="2" scope="col" class="unsortable"><?php echo __("Actions")?></th>
104
+									<th scope="col"><?php echo __("Actions")?></th>
105
+									<th scope="col"></th>
99 106
 								</tr>
100 107
 							</thead>
101 108
 							<tbody>
@@ -106,20 +113,11 @@ if ($user->isAdmin()) {
106 113
 						while($register = mysql_fetch_array($rs)) {
107 114
 ?>
108 115
 							<tr <?php if ($odd) { echo 'class="odd"'; } $odd=!$odd; ?>>
109
-								<td>
110
-									<?php echo $register["login"]."\n"; ?>
111
-								</td>
112
-								<td>
113
-									<?php echo $register["name"]."\n"; ?>
114
-								</td>
115
-								<td>
116
-									<a href="user.php?edit=<?php echo $register["id_user"]; ?>"><?php echo __("Edit")?></a>
117
-								</td>
118
-								<?php if ($_SESSION["user_id"] != $register["id_user"]) { ?>
119
-								<td>
120
-									<a href="user.php?delete=<?php echo $register["id_user"]; ?>"><?php echo __("Delete")?></a>
121
-								</td>
122
-								<?php } ?>
116
+								<td><?php echo $register["login"]."\n"; ?></td>
117
+								<td><?php echo $register["name"]."\n"; ?></td>
118
+								<td><a href="user.php?edit=<?php echo $register["id_user"]; ?>"><?php echo __("Edit")?></a></td>								
119
+								<td><?php if ($_SESSION["user_id"] != $register["id_user"]) { ?><a href="user.php?delete=<?php echo $register["id_user"]; ?>"><?php echo __("Delete")?></a><?php } ?>&nbsp;</td>
120
+								
123 121
 							</tr>
124 122
 <?php
125 123
 						}

BIN
admin/css/images/asc.gif Просмотреть файл


BIN
admin/css/images/bg.gif Просмотреть файл


BIN
admin/css/images/desc.gif Просмотреть файл


+ 12 - 16
admin/css/style.css Просмотреть файл

@@ -148,19 +148,15 @@ div.conversation ul { list-style-type: none; margin: 0px; padding: 0px 0px 0px 1
148 148
 		div.conversation ul li.even { background-color: #e8e8e8; }
149 149
 
150 150
 /* Tables design */
151
-
152
-#admin-table { width:535px; margin:0 auto; padding:0;}
153
-table { padding: 0; width:70%; margin: 0 auto; border-collapse: collapse; color: #333; background: #F3F5F7; }
154
-table a {color: #3A4856; text-decoration: none; border-bottom: 1px solid #C6C8CB; }
155
-table img { border:0px; }
156
-table a:visited {color: #777; text-decoration: none; }
157
-table a:hover {color: #000; text-decoration: none; }
158
-table caption {text-align: left; text-transform: uppercase;  padding-bottom: 10px; }
159
-table thead th {background: #BDD3E7; padding: 15px 10px; color: #fff; text-align: left; font-weight: normal; }
160
-table tbody, table thead {border-left: 1px solid #EAECEE; border-right: 1px solid #EAECEE; }
161
-table tbody {border-bottom: 1px solid #EAECEE; }                      
162
-table tbody td, table tbody th {padding: 10px; background: url('images/td_back.gif') repeat-x; text-align: left; }
163
-table tbody tr {background: #F3F5F7; }
164
-table tbody tr.odd {background: #F0F2F4; }
165
-table tbody  tr:hover {background: #EAECEE; color: #111; }
166
-table tfoot td, table tfoot th, table tfoot tr {text-align: left; background: #fff; padding: 10px; }
151
+#admin-table {background-color:#F3F5F7; margin:0; width:100%; text-align:left; font-size:12px; border:1px solid #EAECEE;}
152
+	#admin-table thead tr th, #admin-table tfoot tr th {background-color:#BDD3E7; padding:6px;}
153
+	#admin-table thead tr .header {background-image: url(images/bg.gif); background-repeat: no-repeat;	background-position: center right;	cursor: pointer;}
154
+	#admin-table tbody td {color:#3D3D3D; padding:6px; background-color:#FFF; background: url(images/td_back.gif) repeat-x; vertical-align:top;}
155
+	#admin-table a {color: #3A4856; text-decoration: none; border-bottom: 1px solid #C6C8CB; }
156
+	#admin-table tbody a:visited {color: #777; text-decoration: none; }
157
+	#admin-table tbody a:hover {color: #000; text-decoration: none; }
158
+	/*#admin-table tbody tr.odd td {background-color:#F0F0F6;}*/
159
+	#admin-table tbody tr:hover {background: #EAECEE; color: #111; }
160
+	#admin-table thead tr .headerSortUp {background-image: url(images/asc.gif);}
161
+	#admin-table thead tr .headerSortDown {background-image: url(images/desc.gif);}
162
+	#admin-table thead tr .headerSortDown, #admin-table thead tr .headerSortUp {background-color:#8dbdd8;}

Разница между файлами не показана из-за своего большого размера
+ 21 - 2982
admin/scripts/jquery.js


Разница между файлами не показана из-за своего большого размера
+ 2 - 0
admin/scripts/jquery.tablesorter.min.js