Use the stats partial for both the authority and search results

I've had a play at making a unified sidebar partial and while it's possible, I'm not sure it's actually better to have 1 complicated partial rather than 2 relatively simple one (open to other ideas though).

For now, I've broken the authority sidebar code out into its own partial and made the 2 sidebar partials' structure more similar.

The stats partial has been moved to `shared/_stats.html.haml` and is now shared between the 2.

(There may be scope to squash some commits here once this branch is finalised)

Closes #145 

<!---
@huboard:{"order":167.0,"milestone_order":169,"custom_state":""}
-->

oops, sorry my fault for misreading, I thought I was looking at the shared
bit, but of course I'm not.

On 10 November 2014 16:11, Liz Conlan <notifications@github.com> wrote:

> In lib/themes/hampshire/views/authorities/_sidebar.html.haml:
>
> > +    Showing all
> > +    %strong= @applications.total_entries
> > +    planning applications made to
> > +    %strong= @authority.full_name
> > +  - if @applications.total_entries > 0
> > +    #sidebar-stats
> > +      = render "shared/stats", :stats => @authority.stats.overview_json
> > +    #sidebar-context
> > +      %p
> > +        #{@authority.full_name} receives on average <strong>#{@authority.median_applications_received_per_week}</strong> applications per week.
> > +      %p
> > +        <strong>#{@authority.stats.overview.percentage_delayed}%</strong> of applications were delayed.
> > +
> > +  %p.change-display
> > +    Show
> > +    = link_to "all authorities in #{@authority.state}", authorities_path
>
> as this is specific to the authority page, it *shouldn't* display without
> an authority, but I suppose it might
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mysociety/planningalerts-app/pull/169/files#r20090846>
> .
>