Skip to content
This repository has been archived by the owner on Dec 23, 2017. It is now read-only.

548 committee pages #80

Merged
merged 19 commits into from
Apr 27, 2015
Merged

548 committee pages #80

merged 19 commits into from
Apr 27, 2015

Conversation

msecret
Copy link
Contributor

@msecret msecret commented Apr 21, 2015

Implement committee pages, #548 

Changes:
- Refactored partials so committee summary and charts have their own.
- Changed JS hook on charts to a "js" prefixed var because I didn't
want the styling along with it.
- Modified some positioning for the tables.
- Added a context function to get the current jinja context, useful
for sharing partials.
- Removed some CSS from the charts that made gray color text for
horizontal. I think horizontal should only control things like
positioning, not color.
- Modified data_prep to use functionality from #560 and not fake data.

Marco Segreto added 9 commits April 10, 2015 15:18
Gets the chart started as this is what real data will look like.
Copying fields so they are in line with what chart expect.

Don't think this is best way to do this. Have to look more into
how charts work, or maybe do this operation on front end.
Aliasing the values because the front-end works much easier with
them. This could be done in template code, or the charting function
could be changed instead.

Limits the results by setting per page and then 1st page. Confused
because I had to multiply the per page by 2, so will look at this
after.
Question:
Here, as per the mockup, I modified the chart so only the top "tick" or
number is showing. Is this supposed to be done for all charts to keep
consistency? Or am I supposed to write special code for just this chart.

Also, I may be confused, but I believe the issue says to take the last
4 reports, but the mockup has 9 separate reports showing. Which is
correct? This is making the width of the chart different from the
mockups.
I need to talk to Noah about the pattern he wanted implemented in
the mockup, this is close to that color though.

I also was unsure of color organization. I created two new color vars
for this, but I think it would've been better to try and reuse existing
colors. Am unsure of which ones to use though.
Changes:
- Refactored partials so committee summary and charts have their own.
- Changed JS hook on charts to a "js" prefixed var because I didn't
want the styling along with it.
- Modified some positioning for the tables.
- Added a context function to get the current jinja context, useful
for sharing partials.
- Removed some CSS from the charts that made gray color text for
horizontal. I think horizontal should only control things like
positioning, not color.
- Modified data_prep to use functionality from 560 and not fake data.
<img class="category-icon"
width="20" height="20"
src="/static/img/icon-committee--white.svg"
alt="Icon representing committees">Committee - {{ designation }}</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make this {{ designation }} - {{ type }} - {{ organization }} and then can get rid of the Designation, Type and Organization Type .entity__terms

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My change here was actually just putting things on newlines because it was a really wide line. I'm confused what you mean by {{ designation }} - {{ type }} - {{ organization }}.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want that .entity__type to actually concatenate the three elements, so it would look like:

Committee -- Principal Campaign Committee -- Presidential

or

Committee -- PAC -- Organized Labor

@noahmanger
Copy link
Contributor

Ok, made a couple notes. Can someone look at the python though?

msecret added 5 commits April 21, 2015 15:39
Fixes date formating on the reports charts so only month and year
appear.

Fixes position of some tables and adds some lines places according to
mockup.
Conflicts:
	static/styles/_base/_typography.scss
	static/styles/_components/_header.scss
	static/styles/styles.css
	templates/committees-single.html
The tables were sharing same CSS, so I created new class for one to
separate them.
@LindsayYoung LindsayYoung self-assigned this Apr 22, 2015
@LindsayYoung
Copy link
Contributor

I don't see dates for the receipts and disbursements chart here is an example:
http://localhost:3000/committee/C00048587

app.jinja_env.globals['api_location'] = api_location
app.jinja_env.globals['context'] = get_context
app.jinja_env.globals['callable'] = callable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to be used. Are we going to use later?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I meant callable, not context. Is callable used in the jinja templates?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see now, you're correct, it's not needed currently. Removed in latest edition.

@LindsayYoung
Copy link
Contributor

That is in the underlying data- that is really old and there are not coverage end dates

@msecret
Copy link
Contributor Author

msecret commented Apr 22, 2015

@LindsayYoung are you using a local DB for the API or are you pointing to http://fec-dev-api.cf.18f.us/.

I'm pointing to http://fec-dev-api.cf.18f.us/ and I'm seeing this:
snapshot1

I'm using reports.i.coverage_start_date and coverage_end_date for those values, and I have found some that are missing.

@LindsayYoung
Copy link
Contributor

I was using local. Let me look again

Because its not needed.
@LindsayYoung
Copy link
Contributor

There are a few things that are missing and some changes I am recommending that @noahmanger will probably want to weigh in on too.

Missing things:

Things that come from the report endpoint are missing from the chart. For example, looking at the char for this committee- /committee/C00451393, there is no cash and debt chart.
Looking at the api report endpoint for that committee-
https://api.open.fec.gov/committee/C00451393/reports?api_key=xxx
I see:

  • beginning cash on hand- "cash_on_hand_beginning_period": 1205363,
  • net contributions - "net_contribution_summary_period": -1026275,
  • net operating expenditures - "net_operating_expenses_summary_period": 41259683,
  • Debts / loans owed to committee is there too but I think that "Debts / loans owed to" should probably be "Debts / loans owed by" since it is a more interesting number. It is useful to know who is in a lot of debt and that is what we discussed before.

Other observations:

  • The second set of numbers are not calculated, they come from the most recent report which has a precise date. (That is why the date fields are listed separately.) So, under the Debts/loans owed to section, instead of "Calculated from reports filed 2014" perhaps we would want "From October Quarterly 2012."
  • On the receipts and disbursement chart, There is a $0 but nothing else on the scale so you have to hover to see how much money is being represented. That makes the charts hard to read.
  • Right now we are calling total cash for the end period "total cash" and cash on hand beginning of period as "Beginning cash on hand". I find this confusing. If we are only going to show one cash on hand it should be end of period because that is the most recent information. If we are going to show both I think we need to specify for both beginning of period and end of period.
  • I don't think that net contributions make sense where they are, those contributions are just from the last report period but that is not clear from what we have.
  • the date ranges are wrong but that is a data issue, I will check on that after our golden gate import.

@msecret
Copy link
Contributor Author

msecret commented Apr 22, 2015

So in terms of cash and debts graph, I'm using cash_on_hand_end_period for cash, debts_owed_by_committee for debt. I'm using these two values because of this document that seems to point to that: https://docs.google.com/document/d/1PXOEFjcnSKcFEi4b-awGx6CKhn_7yYYQL2QHQQX8MYc/.

Here is the first report. What values should I be using for the cash and debt chart? Or is it somewhere else entirely?

'beginning_image_number' (140298836978544) = {int} 81031791784
'candidate_contribution_period' (140298837017024) = {int} 0
'candidate_contribution_ytd' (140298837016704) = {int} 0
'cash_on_hand_beginning_period' (140298836931088) = {int} 1514
'cash_on_hand_end_period' (140298836978760) = {int} 0
'committee_id' (140298836981232) = {str} 'C00048587'
'coverage_end_date' (140298836978832) = {str} 'Wed, 01 Oct 1980 00:00:00 -0000'
'coverage_start_date' (140298836978616) = {str} 'Wed, 01 Oct 1980 00:00:00 -0000'
'cycle' (140298847804696) = {int} 1980
'debts_owed_by_committee' (140298836978184) = {int} 0
'debts_owed_to_committee' (140298836978472) = {int} 0
'end_image_number' (140298836976960) = {int} 81031791790
'exempt_legal_accounting_disbursement_period' (140298836939856) = {int} 0
'exempt_legal_accounting_disbursement_ytd' (140298836940432) = {int} 0
'expentiture_subject_to_limits' (140298836933968) = {int} 1103
'expire_date' (140298836981552) = {NoneType} None
'federal_funds_period' (140298836857672) = {int} 0
'federal_funds_ytd' (140298836977968) = {int} 0
'fundraising_disbursements_period' (140298837013144) = {int} 0
'fundraising_disbursements_ytd' (140298837017264) = {int} 0
'individual_contributions_period' (140298836934368) = {int} 0
'individual_contributions_ytd' (140298837017664) = {int} 0
'items_on_hand_liquidated' (140298836934288) = {int} 0
'loans_received_from_candidate_period' (140298837013496) = {int} 0
'loans_received_from_candidate_ytd' (140298837012616) = {int} 0
'net_contribution_summary_period' (140298837017984) = {int} 0
'net_operating_expenses_summary_period' (140298837012528) = {int} 0
'offsets_to_fundraising_exp_ytd' (140298836933888) = {int} 0
'offsets_to_fundraising_expenses_period' (140298837012880) = {int} 0
'offsets_to_legal_accounting_period' (140298847846224) = {int} 0
'offsets_to_legal_accounting_ytd' (140298836906272) = {int} 0
'offsets_to_operating_expenditures_period' (140298836939472) = {int} 0
'offsets_to_operating_expenditures_ytd' (140298847846312) = {int} 0
'operating_expenditures_period' (140298836906192) = {int} 0
'operating_expenditures_ytd' (140298837016944) = {int} 0
'other_disbursements_period' (140298837017344) = {int} 0
'other_disbursements_ytd' (140298836860552) = {int} 0
'other_loans_received_period' (140298837016784) = {int} 0
'other_loans_received_ytd' (140298837017584) = {int} 0
'other_political_committee_contributions_period' (140298836939952) = {int} 0
'other_political_committee_contributions_ytd' (140298836939376) = {int} 0
'other_receipts_period' (140298836975880) = {int} 0
'other_receipts_ytd' (140298836978688) = {int} 0
'political_party_committee_contributions_period' (140298836939568) = {int} 0
'political_party_committee_contributions_ytd' (140298836940240) = {int} 0
'refunded_individual_contributions_ytd' (140298837013232) = {int} 0
'refunded_other_political_committee_contributions_period' (140298847837072) = {int} 1103
'refunded_other_political_committee_contributions_ytd' (140298847835928) = {int} 0
'refunded_political_party_committee_contributions_period' (140298847837280) = {int} 0
'refunded_political_party_committee_contributions_ytd' (140298847837176) = {int} 0
'refunds_individual_contributions_period' (140298837012704) = {int} 1103
'repayments_loans_made_by_candidate_period' (140298836940336) = {int} 0
'repayments_loans_made_candidate_ytd' (140298837013408) = {int} 0
'repayments_other_loans_period' (140298837016864) = {int} 0
'repayments_other_loans_ytd' (140298837017184) = {int} 0
'report_type' (140298836981488) = {str} 'YE'
'report_type_full' (140298836978040) = {str} 'Year-end {One of 4 valid Report Codes on Form 5, RptCode} '
'report_year' (140298836981616) = {int} 1980
'subtotal_summary_period' (140298836978112) = {int} 0
'total_contribution_refunds_period' (140298847846136) = {int} 0
'total_contribution_refunds_ytd' (140298836906512) = {int} 0
'total_contributions_period' (140298837017744) = {int} 0
'total_contributions_ytd' (140298836978904) = {int} 0
'total_disbursements_period' (140298837017504) = {int} 1103
'total_disbursements_summary_period' (140298837012968) = {int} 1103
'total_disbursements_ytd' (140298836978400) = {int} 0
'total_loan_repayments_made_period' (140298837013320) = {int} 0
'total_loan_repayments_made_ytd' (140298836906672) = {int} 0
'total_loans_received_period' (140298837017424) = {int} 0
'total_loans_received_ytd' (140298837017104) = {int} 0
'total_offsets_to_operating_expenditures_period' (140298836939664) = {int} 0
'total_offsets_to_operating_expenditures_ytd' (140298836939760) = {int} 0
'total_period' (140298836981296) = {int} 0
'total_receipts_period' (140298836975664) = {int} 0
'total_receipts_summary_period' (140298836906112) = {int} 0
'total_receipts_ytd' (140298836858104) = {int} 0
'total_ytd' (140298836981424) = {int} 0
'transfer_from_affiliated_committee_period' (140298836940528) = {int} 0
'transfer_from_affiliated_committee_ytd' (140298837013056) = {int} 0
'transfer_to_other_authorized_committee_period' (140298836940048) = {int} 0
'transfer_to_other_authorized_committee_ytd' (140298836940144) = {int} 0

- Changed the reports charts so the have 1px of top padding, which
  allows you to see a single line when the amount is $0.
- Changed the data points for the summary data, as suggested by Lindsay.
@LindsayYoung
Copy link
Contributor

For the chart,

  • cash_on_hand_end_period for cash on hand
  • debts_owed_by_committee for debt
  • coverage_end_date for the date at the bottom

@msecret
Copy link
Contributor Author

msecret commented Apr 23, 2015

@LindsayYoung, @noahmanger, another thing I just thought of; should there be some sort of state for when a chart is empty? Is there any cases where the data just won't be there?

@LindsayYoung
Copy link
Contributor

New committees won't have any data until they file. I think there will be other cases where there is no data as well.

@noahmanger
Copy link
Contributor

Question on the Cash on Hand line items. So here's what the current site has on the Report Summaries tab:

screen shot 2015-04-23 at 11 17 57 am

That's where I got those line items. But what we're doing is different because we're breaking out the Debt item onto it's own thing. What should the line items under the main Cash on Hand and Debt totals be?

@LindsayYoung
Copy link
Contributor

So, @noahmanger you are looking at the report summaries that apply to one report, the section you have now is for 2-year period aggregates, with the most recent numbers for things that can't be added like debt and cash on hand. Those numbers that can't be added are all be populated by the last report. They are not really subtotals, so maybe instead of using total cash as a heading, we could say "Recent cash and debt reported," or something along those lines.

In the section you are trying to create I would recommend:
beginning cash on hand
end cash on hand
debts owed to committee
debts owed by committee
the date below those items should be the coverage end date of the report

@noahmanger
Copy link
Contributor

Arg! You're right. I thought I had finally cleaned up that distinction. Let's go with what you said.

@noahmanger
Copy link
Contributor

Just to be clear, your suggesting:

  • Total receipts (with subtotals)
  • Total disbursements (with subtotals)
  • Beginning cash on hand (no subtotals, as reported on the beginning_cash_on_hand from the first available report in that period)
  • End cash on hand (no subtotals, as reported most recently)
  • Debts owed to committee (no subtotals, as reported most recently)
  • Debts owed by committee (no subtotals, as reported most recently)

@LindsayYoung
Copy link
Contributor

Looks great 👍

Marco Segreto and others added 2 commits April 23, 2015 17:52
I modified the spacing of the table names to the right so they are
centered. This method doesn't support if they two lines of text.

I changed the borders so they are below rather then above. There is
still some more work to do here that I wanted to save for when I make
the acoordion as it will affect it.
@arowla
Copy link
Contributor

arowla commented Apr 27, 2015

Is this '[WIP]' or done?

@noahmanger
Copy link
Contributor

I was hoping to run this to check it out, but the plane internet is dodgy so having trouble connecting to the API. From what I can tell thought it looks like it's good to go. My only edits will be style tweaks that I can do later.

@arowla
Copy link
Contributor

arowla commented Apr 27, 2015

Cool. You want to do the merge, then, @noahmanger?

Conflicts:
	static/styles/_components/_header.scss
	static/styles/styles.css
noahmanger pushed a commit that referenced this pull request Apr 27, 2015
@noahmanger noahmanger merged commit a93b2df into fecgov:master Apr 27, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants