{"action":"created","issue":{"url":"https://api.github.com/repos/18F/college-choice/issues/337","labels_url":"https://api.github.com/repos/18F/college-choice/issues/337/labels{/name}","comments_url":"https://api.github.com/repos/18F/college-choice/issues/337/comments","events_url":"https://api.github.com/repos/18F/college-choice/issues/337/events","html_url":"https://github.com/18F/college-choice/pull/337","id":99340211,"number":337,"title":"[WIP] Multi-state search","user":{"login":"shawnbot","id":113896,"avatar_url":"https://avatars.githubusercontent.com/u/113896?v=3","gravatar_id":"","url":"https://api.github.com/users/shawnbot","html_url":"https://github.com/shawnbot","followers_url":"https://api.github.com/users/shawnbot/followers","following_url":"https://api.github.com/users/shawnbot/following{/other_user}","gists_url":"https://api.github.com/users/shawnbot/gists{/gist_id}","starred_url":"https://api.github.com/users/shawnbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shawnbot/subscriptions","organizations_url":"https://api.github.com/users/shawnbot/orgs","repos_url":"https://api.github.com/users/shawnbot/repos","events_url":"https://api.github.com/users/shawnbot/events{/privacy}","received_events_url":"https://api.github.com/users/shawnbot/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/18F/college-choice/labels/5-in-progress","name":"5-in-progress","color":"ededed"},{"url":"https://api.github.com/repos/18F/college-choice/labels/p1","name":"p1","color":"1188FF"}],"state":"open","locked":false,"assignee":{"login":"shawnbot","id":113896,"avatar_url":"https://avatars.githubusercontent.com/u/113896?v=3","gravatar_id":"","url":"https://api.github.com/users/shawnbot","html_url":"https://github.com/shawnbot","followers_url":"https://api.github.com/users/shawnbot/followers","following_url":"https://api.github.com/users/shawnbot/following{/other_user}","gists_url":"https://api.github.com/users/shawnbot/gists{/gist_id}","starred_url":"https://api.github.com/users/shawnbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shawnbot/subscriptions","organizations_url":"https://api.github.com/users/shawnbot/orgs","repos_url":"https://api.github.com/users/shawnbot/repos","events_url":"https://api.github.com/users/shawnbot/events{/privacy}","received_events_url":"https://api.github.com/users/shawnbot/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-08-06T02:35:46Z","updated_at":"2015-08-07T19:04:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/18F/college-choice/pulls/337","html_url":"https://github.com/18F/college-choice/pull/337","diff_url":"https://github.com/18F/college-choice/pull/337.diff","patch_url":"https://github.com/18F/college-choice/pull/337.patch"},"body":"This PR resolves #37 by implementing @jjoteal's design for the multi-state search. Here's how it works:\r\n\r\nThere's a new `<multi-select>` element that manages one or more `<select>` elements within it, and exposes an *input-like* API of its own: it has `name`, `type`, and `value` properties, and dispatches `change` events whenever its value changes. This means that the library we're using to get and set form data ([formdb]) treats it just like any other form element.\r\n\r\nThe `<multi-select>` element treats its initial contents as a \"template\" that's repeated when its value is set (either as an array or when parsed as one via comma-separated strings). So you can set the state element's value to `'CA'` and it'll show one drop-down with that value selected:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/113896/9102501/0a39b974-3ba8-11e5-843b-28e728f0f228.png)\r\n\r\nWhen you click on the \"ADD\" button (it looks for the `.button-add` selector), a new copy of that template is created and focused, then the \"&times;\" buttons (`.button-remove`) show up via CSS:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/113896/9102517/38cdbbfa-3ba8-11e5-94f7-f19123d3e20c.png)\r\n\r\nEither of these values can be removed, or you can keep adding states. (One improvement might be to disable the \"ADD\" button until its corresponding element's value is set.)\r\n\r\nBehind the scenes, the individual `<select>` elements' names are removed (so they don't get submitted with the form), and a hidden input is set to the stringified representation of the value. This could probably be simplified, but it works for now so I'm inclined not to monkey with it too much.\r\n\r\nOn the search page, you can add and remove states and the search results should update dynamically. The whole sidebar needs a bunch of CSS love from @meiqimichelle before it's really usable, though, so I'm assigning this to her.\r\n\r\n[formdb]: https://github.com/shawnbot/formdb"},"comment":{"url":"https://api.github.com/repos/18F/college-choice/issues/comments/128796522","html_url":"https://github.com/18F/college-choice/pull/337#issuecomment-128796522","issue_url":"https://api.github.com/repos/18F/college-choice/issues/337","id":128796522,"user":{"login":"shawnbot","id":113896,"avatar_url":"https://avatars.githubusercontent.com/u/113896?v=3","gravatar_id":"","url":"https://api.github.com/users/shawnbot","html_url":"https://github.com/shawnbot","followers_url":"https://api.github.com/users/shawnbot/followers","following_url":"https://api.github.com/users/shawnbot/following{/other_user}","gists_url":"https://api.github.com/users/shawnbot/gists{/gist_id}","starred_url":"https://api.github.com/users/shawnbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shawnbot/subscriptions","organizations_url":"https://api.github.com/users/shawnbot/orgs","repos_url":"https://api.github.com/users/shawnbot/repos","events_url":"https://api.github.com/users/shawnbot/events{/privacy}","received_events_url":"https://api.github.com/users/shawnbot/received_events","type":"User","site_admin":false},"created_at":"2015-08-07T19:04:06Z","updated_at":"2015-08-07T19:04:06Z","body":"@meiqimichelle I'd love your help debugging this when you have a chance. I have a feeling that it might be because you need to re-run `jekyll serve`, since the `site.scripts` changed in the config. :fingerscrossed:"}}