Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Begin transition to multi-city web install #388

Closed
wants to merge 11 commits into from
Closed

Conversation

tdooner
Copy link
Member

@tdooner tdooner commented Mar 25, 2015

This is a whole slew of changes that get us closer to having multiple cities, e.g.

http://oakland.opendisclosure.io
http://sf.opendisclosure.io

The commit messages have more information.

tdooner added 11 commits March 10, 2015 19:30
This will automatically reload app.rb if it has changed, in development
mode only.

Note that no models or any other constants will be similarly reloaded.
This attribute alone causes us a great deal of pain. A party's 'name'
attribute is set to its legal filing entity - e.g. "Libby Schaaf for
Mayor 2014" but we want to display it as just "Libby Schaaf" (hence the
short_name). But this config conflates the candidate configuration
(which I am viewing as us specifically annotating certain committee_id's
with additional attributes that override the ones provided by the state)
with the official data by making it the same object.

This is the first step in breaking apart our configuration from the
source data.

It's unlikely that this commit will work by itself, because I am
separating a bunch of work into commits after-the-fact and there are
some instances of #short_name that I couldn't change in this commit but
will be changed later.
Just to make it less likely to break another endpoint when working on
/api/contributions.
This moves all custom candidate configuration into a place that isn't
coupled at all to the Party model. This has the benefit that consumers
of the candidate data can decide whether they want the configuration
only (in case of the campaign page of candidates without data) or if
they want the configuration merged with the Party model's data (in the
case of the campaign page of candidates with data).
Sprockets makes this kind of hacky.
Instead of using their committee's name, we should use their configured
name.
We only want to route /api/ endpoints when they are requested on a host
with subdomain. This crudely does that based on a regex, which assumes
a one-length TLD (no .co.uk, etc.)

If a user hits the path "/", then one of two views will render, based on
the value of the Host header that their browser sends:
- if it matches the SUBDOMAIN_REGEX, then render views/city.haml
  (formerly views/index.haml)
- if it doesn't match the SUBDOMAIN_REGEX, then render views/index.haml,
  which is now the "choose a city" screen.
@tdooner
Copy link
Member Author

tdooner commented Mar 25, 2015

Wrong destination branch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants