Skip to content
This repository has been archived by the owner on Dec 23, 2017. It is now read-only.

Feature/datatables #220

Merged
merged 24 commits into from
Jun 4, 2015
Merged

Feature/datatables #220

merged 24 commits into from
Jun 4, 2015

Conversation

jmcarp
Copy link
Contributor

@jmcarp jmcarp commented Jun 1, 2015

Render candidate and committee tables with DataTables.

  • Add sorting on all columns.
  • Add more flexible pagination controls.
  • Fetch table data via AJAX.

This patch is using 100% DataTables defaults style-wise and will definitely need some review on that front. @noahmanger or @msecret, any suggestions or sub-PRs on style would be much appreciated, since I'm not very familiar with the webapp styles.

@jmcarp
Copy link
Contributor Author

jmcarp commented Jun 2, 2015

This is looking much better with updates from @noahmanger. Ready for review @msecret.

{
data: 'name',
render: function(data, type, row, meta) {
var anchor = $('<a>');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use $anchor as the var name to specify that it's a jquery element

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll do a pass through the patch and make sure jquery elements are prefixed with $.

Also factor HTML templating for candidate and committee links into a
helper function that doesn't use jQuery.
@noahmanger
Copy link
Contributor

Also, this seems to be causing some troubles with the way the tables adjust to smaller screens. I think we may want to look into using the datatables responsive extension: https://www.datatables.net/extensions/responsive/

@jmcarp
Copy link
Contributor Author

jmcarp commented Jun 2, 2015

@noahmanger @msecret: updated to include datatables css in bundle.

Noah Manger and others added 3 commits June 3, 2015 10:30
Also import vendor styles before custom styles such that our styles get
higher priority.
@jmcarp jmcarp force-pushed the feature/datatables branch from 6a3428a to f13e6e1 Compare June 3, 2015 19:07
@noahmanger
Copy link
Contributor

I'd merge this but there's some conflicts in view.py and I'm not sure what to do there.

@jmcarp
Copy link
Contributor Author

jmcarp commented Jun 3, 2015

I'll fix conflicts tonight.

@jmcarp
Copy link
Contributor Author

jmcarp commented Jun 3, 2015

Conflicts fixed @noahmanger. One test is still expected to fail--I submitted #237 to fix that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants