{"action":"created","comment":{"url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/pulls/comments/58379834","id":58379834,"diff_hunk":"@@ -0,0 +1,67 @@\n+class FestivityMarketsController < ApplicationController\n+  include Concerns::FestivityCustomPage\n+  include Concerns::FestivitySearchCaching\n+\n+  def index\n+\n+    order_by = params[:sort] ? params[:sort] : \"start_date\"\n+    @title = \"#{current_site.festivity_festival_name}: Artist's Market\"\n+    @filter_type = current_site.festivity_filter_type\n+    @markets =  Rails.cache.fetch(\"#{cache_key}\", expires_in: 2.hours) do\n+      FestivityMarketList.search(\n+        {dates: search_dates.join(\",\"),\n+         categories: params[:categories],\n+         filter_type: current_site.festivity_filter_type}, order_by\n+      ).markets\n+    end\n+\n+\n+    @selected_dates = params[:dates] ? FestivityDatetimeFilterPresenter.parse(params[:dates].split(\",\"), current_site.festivity_filter_type) : []\n+    @selected_categories = params[:categories] ? params[:categories].split(\",\") : []\n+    @selected_sort = order_by\n+    # If the request is AJAX, only return the market list itself, not the full page\n+    if request.xhr?\n+      render partial: \"market_list\"\n+    else\n+      render 'index'\n+    end\n+\n+  end\n+\n+  def show\n+    @market = FestivityMarketPage.find_by_slug_and_status_id(params[:id], Status[:published].id)\n+    if @market\n+      @page = @market\n+      @title = \"#{current_site.festivity_festival_name}: #{@market.title}\"\n+    else\n+      file_not_found_for_site\n+    end\n+\n+  end\n+\n+  private\n+\n+  def cache_key\n+    \"markets-#{params[:categories.to_s]}-#{params[:dates].to_s}-#{params[:sort].to_s}-#{request.xhr?}-#{request.subdomain}.#{request.domain}\"","path":"app/controllers/festivity_markets_controller.rb","position":45,"original_position":45,"commit_id":"24f448533e74f31ee43eae9a27afd6d8f0f2c12c","original_commit_id":"ebeda9f69ce10b034d3b61c8b0f21f6c0c168f38","user":{"login":"Brit200313","id":2446523,"avatar_url":"https://avatars.githubusercontent.com/u/2446523?v=3","gravatar_id":"","url":"https://api.github.com/users/Brit200313","html_url":"https://github.com/Brit200313","followers_url":"https://api.github.com/users/Brit200313/followers","following_url":"https://api.github.com/users/Brit200313/following{/other_user}","gists_url":"https://api.github.com/users/Brit200313/gists{/gist_id}","starred_url":"https://api.github.com/users/Brit200313/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Brit200313/subscriptions","organizations_url":"https://api.github.com/users/Brit200313/orgs","repos_url":"https://api.github.com/users/Brit200313/repos","events_url":"https://api.github.com/users/Brit200313/events{/privacy}","received_events_url":"https://api.github.com/users/Brit200313/received_events","type":"User","site_admin":false},"body":"That happened to me with pagination on CD.org and the calendar filters. This makes sense. ","created_at":"2016-04-04T14:02:42Z","updated_at":"2016-04-04T14:02:42Z","html_url":"https://github.com/pgharts/trusty-festivity-extension/pull/14#discussion_r58379834","pull_request_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/pgharts/trusty-festivity-extension/pulls/comments/58379834"},"html":{"href":"https://github.com/pgharts/trusty-festivity-extension/pull/14#discussion_r58379834"},"pull_request":{"href":"https://api.github.com/repos/pgharts/trusty-festivity-extension/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/pulls/14","id":65145936,"html_url":"https://github.com/pgharts/trusty-festivity-extension/pull/14","diff_url":"https://github.com/pgharts/trusty-festivity-extension/pull/14.diff","patch_url":"https://github.com/pgharts/trusty-festivity-extension/pull/14.patch","issue_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/issues/14","number":14,"state":"open","locked":false,"title":"Artists Market","user":{"login":"sipple","id":70801,"avatar_url":"https://avatars.githubusercontent.com/u/70801?v=3","gravatar_id":"","url":"https://api.github.com/users/sipple","html_url":"https://github.com/sipple","followers_url":"https://api.github.com/users/sipple/followers","following_url":"https://api.github.com/users/sipple/following{/other_user}","gists_url":"https://api.github.com/users/sipple/gists{/gist_id}","starred_url":"https://api.github.com/users/sipple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sipple/subscriptions","organizations_url":"https://api.github.com/users/sipple/orgs","repos_url":"https://api.github.com/users/sipple/repos","events_url":"https://api.github.com/users/sipple/events{/privacy}","received_events_url":"https://api.github.com/users/sipple/received_events","type":"User","site_admin":false},"body":"This implements the Artist Market functionality, both on the admin side and the search/view side for clients. There are some things that need done on this.\r\n\r\n* The views are using event HTML classes, and thus the layouts aren't working. This needs changed to match the Market styling classes.\r\n* The SQL querying for dates may be wonky, but there need to be a reasonable number of markets in the system to really work this out.","created_at":"2016-04-04T13:36:33Z","updated_at":"2016-04-04T14:02:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a5341ed13e836909504c6679d7463a698edd0a55","assignee":{"login":"Brit200313","id":2446523,"avatar_url":"https://avatars.githubusercontent.com/u/2446523?v=3","gravatar_id":"","url":"https://api.github.com/users/Brit200313","html_url":"https://github.com/Brit200313","followers_url":"https://api.github.com/users/Brit200313/followers","following_url":"https://api.github.com/users/Brit200313/following{/other_user}","gists_url":"https://api.github.com/users/Brit200313/gists{/gist_id}","starred_url":"https://api.github.com/users/Brit200313/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Brit200313/subscriptions","organizations_url":"https://api.github.com/users/Brit200313/orgs","repos_url":"https://api.github.com/users/Brit200313/repos","events_url":"https://api.github.com/users/Brit200313/events{/privacy}","received_events_url":"https://api.github.com/users/Brit200313/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/pulls/14/commits","review_comments_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/pulls/14/comments","review_comment_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/issues/14/comments","statuses_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/statuses/24f448533e74f31ee43eae9a27afd6d8f0f2c12c","head":{"label":"pgharts:feature/artists-market","ref":"feature/artists-market","sha":"24f448533e74f31ee43eae9a27afd6d8f0f2c12c","user":{"login":"pgharts","id":177398,"avatar_url":"https://avatars.githubusercontent.com/u/177398?v=3","gravatar_id":"","url":"https://api.github.com/users/pgharts","html_url":"https://github.com/pgharts","followers_url":"https://api.github.com/users/pgharts/followers","following_url":"https://api.github.com/users/pgharts/following{/other_user}","gists_url":"https://api.github.com/users/pgharts/gists{/gist_id}","starred_url":"https://api.github.com/users/pgharts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgharts/subscriptions","organizations_url":"https://api.github.com/users/pgharts/orgs","repos_url":"https://api.github.com/users/pgharts/repos","events_url":"https://api.github.com/users/pgharts/events{/privacy}","received_events_url":"https://api.github.com/users/pgharts/received_events","type":"Organization","site_admin":false},"repo":{"id":29139604,"name":"trusty-festivity-extension","full_name":"pgharts/trusty-festivity-extension","owner":{"login":"pgharts","id":177398,"avatar_url":"https://avatars.githubusercontent.com/u/177398?v=3","gravatar_id":"","url":"https://api.github.com/users/pgharts","html_url":"https://github.com/pgharts","followers_url":"https://api.github.com/users/pgharts/followers","following_url":"https://api.github.com/users/pgharts/following{/other_user}","gists_url":"https://api.github.com/users/pgharts/gists{/gist_id}","starred_url":"https://api.github.com/users/pgharts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgharts/subscriptions","organizations_url":"https://api.github.com/users/pgharts/orgs","repos_url":"https://api.github.com/users/pgharts/repos","events_url":"https://api.github.com/users/pgharts/events{/privacy}","received_events_url":"https://api.github.com/users/pgharts/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pgharts/trusty-festivity-extension","description":"TrustyCMS extension to handle festival microsites.","fork":false,"url":"https://api.github.com/repos/pgharts/trusty-festivity-extension","forks_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/forks","keys_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/teams","hooks_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/hooks","issue_events_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/issues/events{/number}","events_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/events","assignees_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/assignees{/user}","branches_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/branches{/branch}","tags_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/tags","blobs_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/git/refs{/sha}","trees_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/statuses/{sha}","languages_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/languages","stargazers_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/stargazers","contributors_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/contributors","subscribers_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/subscribers","subscription_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/subscription","commits_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/commits{/sha}","git_commits_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/git/commits{/sha}","comments_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/comments{/number}","issue_comment_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/issues/comments{/number}","contents_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/contents/{+path}","compare_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/merges","archive_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/downloads","issues_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/issues{/number}","pulls_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/pulls{/number}","milestones_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/milestones{/number}","notifications_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/labels{/name}","releases_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/releases{/id}","deployments_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/deployments","created_at":"2015-01-12T14:38:04Z","updated_at":"2016-01-14T01:50:14Z","pushed_at":"2016-04-04T13:42:51Z","git_url":"git://github.com/pgharts/trusty-festivity-extension.git","ssh_url":"git@github.com:pgharts/trusty-festivity-extension.git","clone_url":"https://github.com/pgharts/trusty-festivity-extension.git","svn_url":"https://github.com/pgharts/trusty-festivity-extension","homepage":null,"size":8992,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"pgharts:master","ref":"master","sha":"0b822eb74731aa8b107cbcc2b8517af50d3d2cf5","user":{"login":"pgharts","id":177398,"avatar_url":"https://avatars.githubusercontent.com/u/177398?v=3","gravatar_id":"","url":"https://api.github.com/users/pgharts","html_url":"https://github.com/pgharts","followers_url":"https://api.github.com/users/pgharts/followers","following_url":"https://api.github.com/users/pgharts/following{/other_user}","gists_url":"https://api.github.com/users/pgharts/gists{/gist_id}","starred_url":"https://api.github.com/users/pgharts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgharts/subscriptions","organizations_url":"https://api.github.com/users/pgharts/orgs","repos_url":"https://api.github.com/users/pgharts/repos","events_url":"https://api.github.com/users/pgharts/events{/privacy}","received_events_url":"https://api.github.com/users/pgharts/received_events","type":"Organization","site_admin":false},"repo":{"id":29139604,"name":"trusty-festivity-extension","full_name":"pgharts/trusty-festivity-extension","owner":{"login":"pgharts","id":177398,"avatar_url":"https://avatars.githubusercontent.com/u/177398?v=3","gravatar_id":"","url":"https://api.github.com/users/pgharts","html_url":"https://github.com/pgharts","followers_url":"https://api.github.com/users/pgharts/followers","following_url":"https://api.github.com/users/pgharts/following{/other_user}","gists_url":"https://api.github.com/users/pgharts/gists{/gist_id}","starred_url":"https://api.github.com/users/pgharts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgharts/subscriptions","organizations_url":"https://api.github.com/users/pgharts/orgs","repos_url":"https://api.github.com/users/pgharts/repos","events_url":"https://api.github.com/users/pgharts/events{/privacy}","received_events_url":"https://api.github.com/users/pgharts/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pgharts/trusty-festivity-extension","description":"TrustyCMS extension to handle festival microsites.","fork":false,"url":"https://api.github.com/repos/pgharts/trusty-festivity-extension","forks_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/forks","keys_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/teams","hooks_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/hooks","issue_events_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/issues/events{/number}","events_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/events","assignees_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/assignees{/user}","branches_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/branches{/branch}","tags_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/tags","blobs_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/git/refs{/sha}","trees_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/statuses/{sha}","languages_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/languages","stargazers_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/stargazers","contributors_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/contributors","subscribers_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/subscribers","subscription_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/subscription","commits_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/commits{/sha}","git_commits_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/git/commits{/sha}","comments_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/comments{/number}","issue_comment_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/issues/comments{/number}","contents_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/contents/{+path}","compare_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/merges","archive_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/downloads","issues_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/issues{/number}","pulls_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/pulls{/number}","milestones_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/milestones{/number}","notifications_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/labels{/name}","releases_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/releases{/id}","deployments_url":"https://api.github.com/repos/pgharts/trusty-festivity-extension/deployments","created_at":"2015-01-12T14:38:04Z","updated_at":"2016-01-14T01:50:14Z","pushed_at":"2016-04-04T13:42:51Z","git_url":"git://github.com/pgharts/trusty-festivity-extension.git","ssh_url":"git@github.com:pgharts/trusty-festivity-extension.git","clone_url":"https://github.com/pgharts/trusty-festivity-extension.git","svn_url":"https://github.com/pgharts/trusty-festivity-extension","homepage":null,"size":8992,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pgharts/trusty-festivity-extension/pulls/14"},"html":{"href":"https://github.com/pgharts/trusty-festivity-extension/pull/14"},"issue":{"href":"https://api.github.com/repos/pgharts/trusty-festivity-extension/issues/14"},"comments":{"href":"https://api.github.com/repos/pgharts/trusty-festivity-extension/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/pgharts/trusty-festivity-extension/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/pgharts/trusty-festivity-extension/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pgharts/trusty-festivity-extension/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/pgharts/trusty-festivity-extension/statuses/24f448533e74f31ee43eae9a27afd6d8f0f2c12c"}}}}