Skip to content

Commit

Permalink
Add a link to edit person data, pointing to Nigeria data spreadsheet
Browse files Browse the repository at this point in the history
At the moment, only summaries can be edited from the site. It would
be nice to edit both in the same place, but summaries and person
data are edited differently because they come from different sources:

* Summaries come from prose, so "Edit summary" points to prose's
editor-page for that person, according to the person's id.

* Person data comes from EveryPolitician, so "Edit person data" points
to a Google Spreadsheet where users can edit person data and then this
spreadsheet can be added to the sources that the scrapers consume.

The spreadsheet linked for the last item is:

    https://docs.google.com/spreadsheets/d/1YLQUsiXDcFZ4eT1PhpEQyO31-2A3lam6JTsXPACUinU/edit#gid=0
  • Loading branch information
octopusinvitro committed Apr 18, 2017
1 parent 49f6fe4 commit 096429b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 6 additions & 2 deletions tests/web/person.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,12 @@
describe 'summary section' do
before { get '/person/sunday-steve-karim/' }

it 'edit link points to the right person id' do
subject.css('.person-edit-link/@href').text
it 'displays links to edit summary and person data' do
subject.css('.person-edit-link/@href').count.must_equal(2)
end

it 'sumary edit link points to the right person id' do
subject.css('.person-edit-link/@href').first.text
.must_include('/summaries/0baa5a03-b1e0-4e66-b3f9-daee8bacb87d.md')
end

Expand Down
8 changes: 5 additions & 3 deletions views/person.erb
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@
</header>

<section class="person__section">
<h2>Summary
<a class="person-edit-link" href="http://prose.io/#theyworkforyou/shineyoureye-prose/edit/gh-pages/summaries/<%= @page.person.id %>.md">Edit</a>
</h2>
<h2>Summary</h2>
<div class="person-summary">
<%= @page.summary %>
</div>
<div>
<a class="person-edit-link" href="http://prose.io/#theyworkforyou/shineyoureye-prose/edit/gh-pages/summaries/<%= @page.person.id %>.md">Edit summary</a> |
<a class="person-edit-link" href="https://docs.google.com/spreadsheets/d/1YLQUsiXDcFZ4eT1PhpEQyO31-2A3lam6JTsXPACUinU/edit#gid=0">Edit person data</a>
</div>
</section>

<section class="person__section">
Expand Down

0 comments on commit 096429b

Please sign in to comment.