{"action":"created","issue":{"url":"https://api.github.com/repos/drewolson/scrivener/issues/8","labels_url":"https://api.github.com/repos/drewolson/scrivener/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/drewolson/scrivener/issues/8/comments","events_url":"https://api.github.com/repos/drewolson/scrivener/issues/8/events","html_url":"https://github.com/drewolson/scrivener/pull/8","id":94215574,"number":8,"title":"Start on making link pagination easier for the view layer. Needs tests.","user":{"login":"mgwidmann","id":5035724,"avatar_url":"https://avatars.githubusercontent.com/u/5035724?v=3","gravatar_id":"","url":"https://api.github.com/users/mgwidmann","html_url":"https://github.com/mgwidmann","followers_url":"https://api.github.com/users/mgwidmann/followers","following_url":"https://api.github.com/users/mgwidmann/following{/other_user}","gists_url":"https://api.github.com/users/mgwidmann/gists{/gist_id}","starred_url":"https://api.github.com/users/mgwidmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgwidmann/subscriptions","organizations_url":"https://api.github.com/users/mgwidmann/orgs","repos_url":"https://api.github.com/users/mgwidmann/repos","events_url":"https://api.github.com/users/mgwidmann/events{/privacy}","received_events_url":"https://api.github.com/users/mgwidmann/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-10T05:15:15Z","updated_at":"2015-07-10T12:52:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/drewolson/scrivener/pulls/8","html_url":"https://github.com/drewolson/scrivener/pull/8","diff_url":"https://github.com/drewolson/scrivener/pull/8.diff","patch_url":"https://github.com/drewolson/scrivener/pull/8.patch"},"body":"After seeing an elixir-sips episode using this tool, I thought it was a shame that it didn't have a simpler tool for printing the view layer.\r\n\r\nI've still got a bit more work to do on it, but I wanted to get it out there and see what your thoughts were on what I started.\r\n\r\n@knewter :+1: "},"comment":{"url":"https://api.github.com/repos/drewolson/scrivener/issues/comments/120402825","html_url":"https://github.com/drewolson/scrivener/pull/8#issuecomment-120402825","issue_url":"https://api.github.com/repos/drewolson/scrivener/issues/8","id":120402825,"user":{"login":"drewolson","id":3536,"avatar_url":"https://avatars.githubusercontent.com/u/3536?v=3","gravatar_id":"","url":"https://api.github.com/users/drewolson","html_url":"https://github.com/drewolson","followers_url":"https://api.github.com/users/drewolson/followers","following_url":"https://api.github.com/users/drewolson/following{/other_user}","gists_url":"https://api.github.com/users/drewolson/gists{/gist_id}","starred_url":"https://api.github.com/users/drewolson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewolson/subscriptions","organizations_url":"https://api.github.com/users/drewolson/orgs","repos_url":"https://api.github.com/users/drewolson/repos","events_url":"https://api.github.com/users/drewolson/events{/privacy}","received_events_url":"https://api.github.com/users/drewolson/received_events","type":"User","site_admin":false},"created_at":"2015-07-10T12:52:47Z","updated_at":"2015-07-10T12:52:47Z","body":"To give you an idea of how I do this in my projects, here are some snippets:\r\n\r\n```elixir\r\ndefmodule MyApp.Helper.Pagination do\r\n  def pagination_path({path_fn, [conn, action]}, pagination_options) do\r\n    pagination_path({path_fn, [conn, action, []]}, pagination_options)\r\n  end\r\n\r\n  def pagination_path({path_fn, [conn, action, options]}, pagination_options) do\r\n    apply(MyApp.Router.Helpers, path_fn, [conn, action, Dict.merge(options, pagination_options)])\r\n  end\r\nend\r\n```\r\n\r\n```elixir\r\n<%= render MyApp.SharedView, \"_pagination.html\", page: @page, path: {:employee_path, [@conn, :index, [archived: @archived]]} %>\r\n```\r\n\r\n```eex\r\n<div>\r\n  <%= unless @page.page_number == 1 do %>\r\n    <%= link \"Previous Page\", to: pagination_path(@path, page_size: @page.page_size, page: @page.page_number - 1), class: \"btn\" %>\r\n  <% end %>\r\n\r\n  <%= unless @page.page_number == @page.total_pages do %>\r\n    <%= link \"Next Page\", to: pagination_path(@path, page_size: @page.page_size, page: @page.page_number + 1), class: \"btn\" %>\r\n  <% end %>\r\n</div>\r\n```"}}