generalize count limit for lists and correct error handling for AJAX Quest listing

This commit is contained in:
coderkun 2014-05-26 17:45:11 +02:00
commit dcdd274a55
3 changed files with 4 additions and 3 deletions

View file

@ -136,7 +136,7 @@
'ranking_range' => 2, 'ranking_range' => 2,
'achievements_range' => 3, 'achievements_range' => 3,
'title_delimiter' => ' ', 'title_delimiter' => ' ',
'questlist_limit' => 10 'lists_limit' => 10
); );
@ -223,6 +223,7 @@
array('^quests/(?!(index|create|createmedia))/?', 'quests/quest/$1', true), array('^quests/(?!(index|create|createmedia))/?', 'quests/quest/$1', true),
array('^characters/([^/]+)/(register|manage)/?$', 'characters/$2/$1', true), array('^characters/([^/]+)/(register|manage)/?$', 'characters/$2/$1', true),
array('^characters/([^/]+)/?$', 'characters/index/$1', true), array('^characters/([^/]+)/?$', 'characters/index/$1', true),
array('^characters/([^/]+)/all/?$', 'characters/index/$1/all', true),
array('^characters/([^/]+)/([^/]+)/(edit|delete)/?$', 'characters/$3/$1/$2', true), array('^characters/([^/]+)/([^/]+)/(edit|delete)/?$', 'characters/$3/$1/$2', true),
array('^characters/([^/]+)/(?!(index|register|manage))/?', 'characters/character/$1/$2', true), array('^characters/([^/]+)/(?!(index|register|manage))/?', 'characters/character/$1/$2', true),
array('^charactergroups/([^/]+)/?$', 'charactergroups/index/$1', true), array('^charactergroups/([^/]+)/?$', 'charactergroups/index/$1', true),

View file

@ -96,7 +96,7 @@
} }
// Get Quests // Get Quests
$limit = ($all != 'all') ? \nre\configs\AppConfig::$misc['questlist_limit'] : null; $limit = ($all != 'all') ? \nre\configs\AppConfig::$misc['lists_limit'] : null;
$offset = ($all != 'all') ? max((intval($page) - 1), 0) * $limit : 0; $offset = ($all != 'all') ? max((intval($page) - 1), 0) * $limit : 0;
$questsCount = $this->Quests->getCountForQuestsForSeminaryByOpenSubmissions($seminary['id'], $selectedQuestgroup, $selectedQuesttype); $questsCount = $this->Quests->getCountForQuestsForSeminaryByOpenSubmissions($seminary['id'], $selectedQuestgroup, $selectedQuesttype);
$quests = $this->Quests->getQuestsForSeminaryByOpenSubmissions($seminary['id'], $selectedQuestgroup, $selectedQuesttype, $limit, $offset); $quests = $this->Quests->getQuestsForSeminaryByOpenSubmissions($seminary['id'], $selectedQuestgroup, $selectedQuesttype, $limit, $offset);

View file

@ -123,7 +123,7 @@
} }
}); });
request.fail(function (jqXHR, textStatus, errorThrown) { request.fail(function (jqXHR, textStatus, errorThrown) {
alert("fail: " + textStatus + ": " +errorThrown); window.location.href = linkPage.replace('PAGE', page);
}); });