Merge pull request #688 from openclassify/vedat

create addBlock ajax service && added profile ads block
This commit is contained in:
Fatih Alp 2020-09-30 11:22:25 +03:00 committed by GitHub
commit 21c0eae1aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 13 deletions

View File

@ -21,6 +21,8 @@
{{ asset_script("theme.js") }} {{ asset_script("theme.js") }}
{{ addBlock('theme/partials/assets/additional-assets')|raw }}
{# Include Styles Loaded From Outside #} {# Include Styles Loaded From Outside #}
<style> <style>
{% for style in asset_inlines("styles.css", ["min"]) %} {% for style in asset_inlines("styles.css", ["min"]) %}

View File

@ -4,24 +4,21 @@ var ads_type = "";
var objJson = []; var objJson = [];
function prevPage() function prevPage() {
{
if (current_page > 1) { if (current_page > 1) {
current_page--; current_page--;
changePage(current_page); changePage(current_page);
} }
} }
function nextPage(event) function nextPage(event) {
{
if (current_page < numPages()) { if (current_page < numPages()) {
current_page++; current_page++;
changePage(current_page); changePage(current_page);
} }
} }
function changePage(page) function changePage(page) {
{
var btn_next = $("#btn_next"); var btn_next = $("#btn_next");
var btn_prev = $("#btn_prev"); var btn_prev = $("#btn_prev");
var listing_table = $("#nav-" + ads_type); var listing_table = $("#nav-" + ads_type);
@ -65,8 +62,7 @@ function changePage(page)
} }
} }
function numPages() function numPages() {
{
return Math.ceil(objJson.length / records_per_page); return Math.ceil(objJson.length / records_per_page);
} }
@ -164,7 +160,7 @@ function dropdownRow(id, type) {
extend_ad + extend_ad +
"</a>\n"; "</a>\n";
dropdown += "</div></div>"; dropdown += getBlock('profile/dropdown-ad', {'id': id}) + "</div></div>";
return dropdown; return dropdown;
} }