[Isocial-svn] SF.net SVN: isocial: [270] public/stylesheets/groupapp
Status: Pre-Alpha
Brought to you by:
aguidrevitch
From: <di...@us...> - 2008-07-06 15:40:58
|
Revision: 270 http://isocial.svn.sourceforge.net/isocial/?rev=270&view=rev Author: dim0s77 Date: 2008-07-06 08:41:05 -0700 (Sun, 06 Jul 2008) Log Message: ----------- more pagination for groups Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/helpers/array_pagination_helper.php app/views/groupapp/group/browse.tpl app/views/groupapp/group/index.tpl public/stylesheets/common/Pagination.css public/stylesheets/groupapp/Group.css public/stylesheets/groupapp/Groupapp.css Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-07-06 14:10:04 UTC (rev 269) +++ app/controllers/groupapp/group_controller.php 2008-07-06 15:41:05 UTC (rev 270) @@ -36,7 +36,17 @@ } function index () { - $this->user_groups = $this->current_user->groupapp_group->load(); + $user_groups = $this->current_user->groupapp_group->load(); + + $this->user_groups_count = count($user_groups); + + $_filter_pagination = array('items_per_page' => 10); + $group_pages = $this->array_pagination_helper->getPaginator("user_group_pages", $user_groups, $_filter_pagination);// paginator + + $links = $group_pages->paginator->getLinks(); + $this->pages_links = $links['first'] . ' ' . $links['back'] . ' ' . $links['pages'] . ' ' . $links['next'] . ' ' . $links['last']; + $this->user_groups = $this->array_pagination_helper->getPageItems("user_group_pages", $user_groups); + $this->_extract_group_types(); } @@ -253,8 +263,10 @@ $this->last_group = ($group_pages->getCurrentPage() * $group_pages->getItemsPerPage() < $group_pages->getItemCount()) ? $group_pages->getCurrentPage() * $group_pages->getItemsPerPage() : $group_pages->getItemCount(); $this->all_groups = $group_pages->getItemCount(); - $this->pages_links = $group_pages->links(); + $links = $group_pages->paginator->getLinks(); + $this->pages_links = $links['first'] . ' ' . $links['back'] . ' ' . $links['pages'] . ' ' . $links['next'] . ' ' . $links['last']; + $_filter = array('conditions' => "type_id" . $type_id); $options = array_merge($_filter, $this->pagination_helper->getFindOptions($this->GroupappGroup)); $this->groups = $this->GroupappGroup->find('all', $options); @@ -299,7 +311,8 @@ $_filter_pagination = array('items_per_page' => 10); $member_pages = $this->array_pagination_helper->getPaginator("groupapp_member_pages", $members, $_filter_pagination);// paginator $links = $member_pages->paginator->getLinks(); - $this->pages_links = $links['first'] . ' ' . $links['back'] . ' ' . $links['pages'] . ' ' . $links['next'] . ' ' . $links['last']; + $this->pages_links = $links['first'] . ' ' . $links['back'] . ' ' . $links['pages'] . ' ' . $links['next'] . ' ' . $links['last']; + $this->members = $this->array_pagination_helper->getPageItems("groupapp_member_pages", $members); $this->renderAction('members.tpl'); Modified: app/helpers/array_pagination_helper.php =================================================================== --- app/helpers/array_pagination_helper.php 2008-07-06 14:10:04 UTC (rev 269) +++ app/helpers/array_pagination_helper.php 2008-07-06 15:41:05 UTC (rev 270) @@ -31,12 +31,10 @@ $offset = $this->$paginator_name->getOffset(); $page_items = array(); - for ($i = 0; $i < count($items); $i++) { - if (($offset == 0 && $i < $items_per_page) || - ($i < $items_per_page * $offset && $i >= $items_per_page * ($offset - 1))) - { - $page_items[] = $items[$i]; - } + for ($i = $offset; $i < $offset + $items_per_page; $i++) { + if ($i < count($items)) { + $page_items[] = $items[$i]; + } } return $page_items; Modified: app/views/groupapp/group/browse.tpl =================================================================== --- app/views/groupapp/group/browse.tpl 2008-07-06 14:10:04 UTC (rev 269) +++ app/views/groupapp/group/browse.tpl 2008-07-06 15:41:05 UTC (rev 270) @@ -19,11 +19,13 @@ {?all_groups_count} <div class="groups_list"> <div class="head"> - <div class="paginator"> - <div class="items">{?all_groups}_{Displaying groups} {first_group?} - {last_group?} _{out of} {all_groups?}{end}</div> - <div class="pages">{pages_links?}</div> - <div class="clearfix"></div> + <div class="left"> + {?all_groups}_{Displaying groups} {first_group?} - {last_group?} _{out of} {all_groups?}{end} </div> + <div class="paginationAbove1"> + {pages_links?} + </div> + <div class="clearfix"></div> </div> <div class="two_column"> @@ -108,14 +110,9 @@ <div class="foot"> </div> </div> -{?pages_links} -<div class="actions"> - <div class="paginator"> - <div class="pages">{pages_links?}</div> - <div class="clearfix"></div> - </div> +<div class="paginationUnder1"> + {pages_links?} </div> -{end} {else} Modified: app/views/groupapp/group/index.tpl =================================================================== --- app/views/groupapp/group/index.tpl 2008-07-06 14:10:04 UTC (rev 269) +++ app/views/groupapp/group/index.tpl 2008-07-06 15:41:05 UTC (rev 270) @@ -16,7 +16,7 @@ <div class="clearfix"></div> </div> -{?user_groups} +{?user_groups_count} <div class="submenu_separator"> </div> <div class="submenu"> <div class="menu_block selector"> @@ -33,7 +33,10 @@ <div class="clearfix"></div> <div class="groups_list"> - <div class="head">_{You are in groups}: <?= count($user_groups); ?></div> + <div class="head">_{You are in groups}: {user_groups_count}</div> + <div class="paginationUnder2"> + {pages_links?} + </div> <div class="container"> {loop user_groups} @@ -63,11 +66,15 @@ <div class="clearfix"></div> </div> {end} + </div> + <div class="paginationAbove2"> + {pages_links?} + </div> <div class="clearfix"></div> - <div class="foot"> </div> </div> {else} + <div class="nogroups"> _{You have not joined any groups}. </div> Modified: public/stylesheets/common/Pagination.css =================================================================== --- public/stylesheets/common/Pagination.css 2008-07-06 14:10:04 UTC (rev 269) +++ public/stylesheets/common/Pagination.css 2008-07-06 15:41:05 UTC (rev 270) @@ -17,7 +17,7 @@ /* pagination above the line. non-white background */ .paginationAbove2 { float: right; - padding: 0px 8px 7px 5px; + padding: 4px 8px 7px 5px; } .paginationAbove2 .paginationCurrent { @@ -41,7 +41,7 @@ /* pagination under line. white background */ .paginationUnder1 { float: right; - padding: 7px 5px 2px 5px; + padding: 6px 5px 7px 5px; } .paginationUnder1 .paginationCurrent { Modified: public/stylesheets/groupapp/Group.css =================================================================== --- public/stylesheets/groupapp/Group.css 2008-07-06 14:10:04 UTC (rev 269) +++ public/stylesheets/groupapp/Group.css 2008-07-06 15:41:05 UTC (rev 270) @@ -145,17 +145,18 @@ .groups_list { width: 100%; background: #f7f7f7; + border-bottom: solid 1px #dddddd; } .groups_list .head { - padding: 10px 10px 5px 20px; + padding: 10px 10px 8px 20px; border-bottom: solid 1px #dddddd; background: #ffffff; } -.groups_list .foot { - background: #f7f7f7; - border-bottom: solid 1px #dddddd; +.groups_list .head .left { + padding: 6px 0px 0px 0px; + float: left; } .groups_list .container { Modified: public/stylesheets/groupapp/Groupapp.css =================================================================== --- public/stylesheets/groupapp/Groupapp.css 2008-07-06 14:10:04 UTC (rev 269) +++ public/stylesheets/groupapp/Groupapp.css 2008-07-06 15:41:05 UTC (rev 270) @@ -54,11 +54,3 @@ text-align: center; margin-bottom: 5px; } - -.paginator .items { - float: left; -} - -.paginator .pages { - float: right; -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |