FreeUKGen/MyopicVicar — pull request #295 by benwbrum (2014-11-23 12:51:28+00:00)
Title: Allow CMS editing of DAP per county

@Captainkirkdawson Would you take a look at this, merge it into master, and change it how you'd like?

## Technical background:
I wanted to explore the following:
* Easy-to-use view helpers to display contents from Refinery
* Automated display of data-dependent Refinery pages
* Customized refinery edit screens with better integration with the application

## How it worked
County Pages are a refinery engine we generated several months ago -- they contain a title, a text block and chapman code. In the past, I've had a terrible time integrating refinery engines with the application since the dependencies seem to be in the opposite order: app code depends on engine code, so referencing the app from the engine is painful or impossible.

It turns out that you can generate overrides of refinery code, which will live within your app:
```
rake refinery:override view=refinery/county_pages/admin/county_pages/_form
```
*(Note the missing .erb.html extension.)*

From within the overridden code, I able to reference parts of our app (namely the Chapman Code library) as if it were a view we had written ourselves.

### View helper
The goal of the sidebar project (Issue #251) is an easy way for the application to display context-sensitive content within sidebars and other locations. I created a view helper for this piece that takes a chapman code, finds the appropriate county_page, then extracts the content. This seemed to be a pretty good model for the sidebar work, though we'll be interacting with different parameters

## Bits I'm not sure about
I'm not sure that the actual feature I wrote is of value, or goes in the right place. In F1, county pages begin with a large-ish block of text about the county and its progress. This may include an appeal for help from researchers/transcribers for the county, information about how to get in touch with the coordinator, and such. That text block appears above the F1 PPP

I'm not sure that we want county page contents to appear on the DAP. Perhaps they belong somewhere else, or should be free-standing with links from the DAP?