[Isocial-svn] SF.net SVN: isocial: [220] timesheet
Status: Pre-Alpha
Brought to you by:
aguidrevitch
From: <fsn...@us...> - 2008-05-25 10:46:38
|
Revision: 220 http://isocial.svn.sourceforge.net/isocial/?rev=220&view=rev Author: fsnobody Date: 2008-05-25 03:46:46 -0700 (Sun, 25 May 2008) Log Message: ----------- album paginator Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/views/photoapp/album/index.tpl app/views/photoapp/album/uploaded.tpl public/stylesheets/photoapp/Album.css timesheet/eerunov.txt Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-23 17:14:09 UTC (rev 219) +++ app/controllers/photoapp/album_controller.php 2008-05-25 10:46:46 UTC (rev 220) @@ -5,12 +5,17 @@ var $models = array('photoapp', 'photoapp_album', 'photoapp_photo'); function index () { - //$this->redirectTo(array('action' => 'show')); - $this->my_albums = $this->PhotoappAlbum->find('all', array('conditions' => array('owner = ' . $this->current_user->getId()))); - if(is_array($this->my_albums)) - $this->count_albums = count($this->my_albums); - else - $this->count_albums = 0; + + $_filter_pagination = array('items_per_page' => 5, 'count_conditions' => 'owner = ' . $this->current_user->getId() ); + + $this->album_pages = $this->pagination_helper->getPaginator($this->PhotoappAlbum, $_filter_pagination);// paginator + + $_filter = array('conditions' => 'owner = ' . $this->current_user->getId()); + $options = array_merge($_filter, $this->pagination_helper->getFindOptions($this->PhotoappAlbum)); + + $this->my_albums = $this->PhotoappAlbum->find('all', $options); + + } function view () { Modified: app/views/photoapp/album/index.tpl =================================================================== --- app/views/photoapp/album/index.tpl 2008-05-23 17:14:09 UTC (rev 219) +++ app/views/photoapp/album/index.tpl 2008-05-25 10:46:46 UTC (rev 220) @@ -14,14 +14,14 @@ <div class="clearfix"></div> -<? if ($count_albums == 0) {?> +<? if ($album_pages->getItemCount() == 0) {?> <div class="noalbums"> _{You have no any album}. </div> <? } else {?> <div class="album_list"> - _{Photo Albums}: <?= $count_albums?> <span>|</span> <a href="#" >_{Album Privacy}</a> + _{Photo Albums}: <?= $album_pages->getItemCount()?> <span>|</span> <a href="#" >_{Album Privacy}</a> </div> <div class="container"> {loop my_albums} @@ -45,9 +45,15 @@ </div> </div> {end} + + {?album_pages.links} + <span><?php echo translate('Showing page %page of %number_of_pages',array('%page'=>$album_pages->getCurrentPage(),'%number_of_pages'=>$album_pages->pages))?></span> + <div>{album_pages.links?}</div> + {end} </div> <div class="clearfix"></div> + <? }?> <div class="clearfix"></div> Modified: app/views/photoapp/album/uploaded.tpl =================================================================== --- app/views/photoapp/album/uploaded.tpl 2008-05-23 17:14:09 UTC (rev 219) +++ app/views/photoapp/album/uploaded.tpl 2008-05-25 10:46:46 UTC (rev 220) @@ -17,7 +17,6 @@ {loop uploaded_photos} <div class="photo_comment"> <div class="img"> - <img src="/preview/index/100x100/<?= $uploaded_photo->get('img')?>" /> </div> <div class="data"> Modified: public/stylesheets/photoapp/Album.css =================================================================== --- public/stylesheets/photoapp/Album.css 2008-05-23 17:14:09 UTC (rev 219) +++ public/stylesheets/photoapp/Album.css 2008-05-25 10:46:46 UTC (rev 220) @@ -310,4 +310,8 @@ padding: 3px; margin: 2px 3px; text-align: center; +} + +.paginationLink { + padding: 1px 2px; } \ No newline at end of file Modified: timesheet/eerunov.txt =================================================================== --- timesheet/eerunov.txt 2008-05-23 17:14:09 UTC (rev 219) +++ timesheet/eerunov.txt 2008-05-25 10:46:46 UTC (rev 220) @@ -16,3 +16,5 @@ 2008-05-20,18:00,19:00,photoapp,RT:2,"edit photo - save cover to album,trouble in destroyPhoto when it is cover" 2008-05-21,18:30,21:20,photoapp,RT:2,"cover + triggers for photos_count in album" 2008-05-23,17:00,18:30,phoyoapp,RT:2,"remove is_cover in model" +2008-05-25,11:00,13:30.photoapp,RT:2,"album paginator" + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |