Skip to content
This repository has been archived by the owner on May 8, 2020. It is now read-only.

Commit

Permalink
Added server-side pagination, filtering and sorting for the Album view.
Browse files Browse the repository at this point in the history
Using a modified version of kohana/pagination and the
 kostache-pagination-helper.
Overriding kohana/email since it hasn't been updated for 3.2
Overriding pagination/basic to put some space between items
 and add a 'current' class to the basic and punbb paginations
Modified style.css for wider layout and table stylings.
  • Loading branch information
ddrake committed Aug 3, 2011
1 parent 10674c1 commit 7fdeb89
Show file tree
Hide file tree
Showing 28 changed files with 1,462 additions and 66 deletions.
12 changes: 9 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@
[submodule "modules/orm"]
path = modules/orm
url = git://github.com/kohana/orm.git
[submodule "modules/email"]
path = modules/email
url = git://github.com/shadowhand/email.git
[submodule "modules/kostache"]
path = modules/kostache
url = git://github.com/zombor/KOstache.git
[submodule "modules/pagination"]
path = modules/pagination
url = git://github.com/kohana/pagination.git
[submodule "modules/kostache-pagination-helper"]
path = modules/kostache-pagination-helper
url = git://github.com/czukowski/kostache-pagination-helper.git
[submodule "modules/email"]
path = modules/email
url = git://github.com/shadowhand/email.git
11 changes: 6 additions & 5 deletions application/classes/controller/album.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function action_index()
$view = new View_Pages_Album_List;
$this->response->body($view); // . View::factory('profiler/stats');
}

public function action_add()
{
$album = ORM::factory('album');
Expand Down Expand Up @@ -70,8 +70,7 @@ public function action_save()
}
catch (ORM_Validation_Exception $e)
{
// todo: specify a real messages file here...
$errors = Arr::flatten($e->errors('hack'));
$errors = $e->errors('models');
}
if ($album->id == null)
{
Expand Down Expand Up @@ -114,6 +113,7 @@ public function action_details()
$error_msg = "<h3>couldn't find info for that album...</h3>";
if ( ! Fragment::load("album_{$id}", Date::DAY * 7))
{
$album = ORM::factory('album',$id);
try
{
$config = Kohana::$config->load('lastfm');
Expand Down Expand Up @@ -143,15 +143,16 @@ private function delete_album_fragment($id)
try
{
Fragment::delete("album_{$id}");
echo Debug::vars('just deleted fragment');
}
catch (Exception $e) {}
}

// Redirect the user to the list
private function redirect_to_list()
{
$uri = Route::get('default')->uri(array('controller'=>'album'));
$session = Session::instance();
$query = $session->get('album_list');
$uri = Route::get('default')->uri(array('controller'=>'album', 'action'=>'index')) . URL::query($query);
$this->request->redirect($uri);
}

Expand Down
Loading

0 comments on commit 7fdeb89

Please sign in to comment.