Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

417 publisher search #462

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions ckanext/iati/assets/fanstatic_library/scripts/tablesorter.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,29 @@ this.ckan.module('table-sorter', function (jQuery, _) {
var given_order = $("#field-order-by").val();
console.log(given_order);
if (given_order == "name asc" || given_order == "title asc"){
// Ascending order
el.tablesorter({sortList: [[0,0]]});
}else if (given_order === "name desc" || given_order === "title desc"){
// Descending order
el.tablesorter({sortList: [[0,1]]});
}else{
// This is default order
el.tablesorter({sortList: [[0,0]]});
} else if (given_order === "name desc" || given_order === "title desc"){
el.tablesorter({sortList: [[0,1]]});
} else if (given_order === "publisher_iati_id asc"){
console.log('publisher_iati_id asc')
el.tablesorter({sortList: [[1,0]]});
} else if (given_order === "publisher_iati_id desc"){
console.log('publisher_iati_id desc')
el.tablesorter({sortList: [[1,1]]});
} else if (given_order === "publisher_organization_type asc"){
el.tablesorter({sortList: [[2,0]]});
} else if (given_order === "publisher_organization_type desc"){
el.tablesorter({sortList: [[2,1]]});
} else if (given_order === "publisher_country asc"){
el.tablesorter({sortList: [[3,0]]});
} else if (given_order === "publisher_country desc"){
el.tablesorter({sortList: [[3,1]]});
} else if (given_order === "created asc"){
el.tablesorter({sortList: [[5,0]]});
} else if (given_order === "created desc"){
el.tablesorter({sortList: [[5,1]]});
} else{
el.tablesorter({sortList: [[0,0]]});
}}
}
});

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion ckanext/iati/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def get_publisher_obj_extra_fields(group_dict):
def get_publisher_obj_extra_fields_pub_ids(group_dict):
extras = {}
if not group_dict:
log.info('not group_dict')
return extras

formatter_map = {
Expand Down Expand Up @@ -310,7 +311,7 @@ def normalize_publisher_name(name):
return name[4:] + ', The'
return name

def organization_list(include_extras=False):
def organization_list(include_extras=True):
data_dict = {'all_fields': True, 'sort': 'title asc'}
if include_extras:
data_dict['include_extras'] = include_extras
Expand Down
Loading