Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- improved the layout of the list of user in a tag page

  • Loading branch information...
commit 327136f7358d6f0be27e49e1d56429f278a6e271 1 parent 6d762c2
luizlaydner authored
Showing with 17 additions and 42 deletions.
  1. +2 −2 tag/index.php
  2. +7 −26 tag/lib.php
  3. +8 −14 theme/standard/styles_layout.css
View
4 tag/index.php
@@ -12,7 +12,7 @@
$tagid = optional_param('id', 0, PARAM_INT); // tag id
$userpage = optional_param('userpage', 0, PARAM_INT); // which page to show
-$perpage = optional_param('perpage', 16, PARAM_INT);
+$perpage = optional_param('perpage', 20, PARAM_INT);
$tag = tag_by_id($tagid);
@@ -51,7 +51,7 @@
print_paging_bar($usercount, $userpage, $perpage, $baseurl.'&', 'userpage');
- print_tagged_users_table($tag, 4, $userpage * $perpage, $perpage);
+ print_tagged_users_table($tag, $userpage * $perpage, $perpage);
}
View
33 tag/lib.php
@@ -1165,7 +1165,7 @@ function print_tag_description_box($tag_object) {
* @param int $limitnum prints this many users (optional, required if $limitfrom is set).
*/
-function print_tagged_users_table($tag_object, $users_per_row='5', $limitfrom='' , $limitnum='') {
+function print_tagged_users_table($tag_object, $limitfrom='' , $limitnum='') {
//List of users with this tag
$userlist = array_values( get_items_tagged_with(
@@ -1179,7 +1179,7 @@ function print_tagged_users_table($tag_object, $users_per_row='5', $limitfrom=''
//user table box
print_box_start('generalbox', 'tag-user-table');
- print_user_table($userlist, $users_per_row);
+ print_user_list($userlist);
print_box_end();
//end table box
@@ -1189,35 +1189,16 @@ function print_tagged_users_table($tag_object, $users_per_row='5', $limitfrom=''
}
/**
- * Prints a table of users
+ * Prints a list of users
*
* @param array $userlist an array of user objects
- * @param int $users_per_row number of users per row to display
*/
-function print_user_table($userlist, $users_per_row='5') {
+function print_user_list($userlist) {
- $nrofrows = ceil( count($userlist) / $users_per_row );
- for($row = 0; $row < $nrofrows; $row++){
-
- //table row box
- print_box_start('user-table-row', 'row_'.$row);
-
- for($col = 0; ($col < $users_per_row) ; $col++ ) {
-
- $index = $row * $users_per_row + $col;
-
- if ($index < count($userlist) ) {
-
- print_user_box( $userlist[$index] );
-
- }
-
- }
-
- print_box_end();
- //end table row box
-
+ foreach ($userlist as $user){
+ print_user_box( $user );
}
+
}
View
22 theme/standard/styles_layout.css
@@ -2751,7 +2751,7 @@ ul.tabrow1 li.here.selected a {
***/
div#tag-description {
- width:600px;
+ width:60%;
padding-top:0px;
margin-top:20px;
margin-left:auto;
@@ -2766,25 +2766,19 @@ div#tag-management-box {
}
div#tag-user-table {
- width:600px;
+ width:60%;
margin-left:auto;
margin-right:auto;
display:table;
}
-div.user-table-row {
- width:100%;
- min-height:150px;
- margin-top:20px;
- margin-bottom:20px;
- margin-left:auto;
- margin-right:auto;
- text-align:center;
- display:block;
-}
-
div.user-box {
- width:150px;
+ margin-left:15px;
+ margin-right:15px;
+ margin-top:5px;
+ margin-bottom:5px;
+ width:115px;
+ height:150px;
text-align:center;
display:block;
float:left;
Please sign in to comment.
Something went wrong with that request. Please try again.