-
Notifications
You must be signed in to change notification settings - Fork 40
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
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Wrong destination branch! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.