-
Notifications
You must be signed in to change notification settings - Fork 72
State level action fixes & improvements #941
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
641105f
Refactor state level email actions
esoterik 3b05f0f
Mock state rep request for testing in development
esoterik 7f92d85
Clean up state level refactor + fix its styles
esoterik aac6e59
Some small cleanup around state-level actions
hartsick e1e2b00
Update activism director -> Jason
hartsick 2649342
Revert "Mock state rep request for testing in development"
hartsick b32d36e
Linter fixes
hartsick File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 file contains hidden or 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 file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1316,3 +1316,9 @@ html.js #affiliations { | |
| } | ||
| } | ||
|
|
||
| .state-email-body { | ||
| padding: 0.5rem 1.5rem; | ||
| form { | ||
| padding: 0; | ||
| } | ||
| } | ||
This file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,43 +1,40 @@ | ||
| <div class="state-rep-lookup"> | ||
| <div class="address-lookup"> | ||
| <p>Enter your address below and we'll help you email your representatives (US addresses only).</p> | ||
| <div class="address-lookup"> | ||
| <%= form_tag(tools_state_reps_path, method: :get, remote: true, class: "form state-rep-lookup") do %> | ||
| <%= hidden_field_tag :email_campaign_id, @actionPage.email_campaign.id %> | ||
| <%= form_tag(tools_state_reps_path, method: :post, remote: true, class: "form state-rep-lookup") do %> | ||
| <%= hidden_field_tag :email_campaign_id, @actionPage.email_campaign.id %> | ||
|
|
||
| <fieldset id="lookup-address"> | ||
| <h3> | ||
| <span class="customize-message-popover" data-toggle="tooltip" data-trigger="hover">? | ||
| <span class="tooltiptext">We'll use your address to find your state representatives.</span> | ||
| </span> | ||
| Look up your state representatives | ||
| </h3> | ||
| <div id="errors"></div> | ||
| <fieldset id="lookup-address"> | ||
| <h3> | ||
| <span class="customize-message-popover" data-toggle="tooltip" data-trigger="hover">? | ||
| <span class="tooltiptext">We'll use your address to find your state representatives.</span> | ||
| </span> | ||
| Look up your state representatives | ||
| </h3> | ||
| <div id="errors"></div> | ||
|
|
||
| <div class="form-group"> | ||
| <%= text_field_tag :street_address, (current_user && current_user.street_address), | ||
| placeholder: "Street Address", "aria-label": "Street Address", | ||
| required: true, class: "form-control" %> | ||
| </div> | ||
| <div class="form-group"> | ||
| <%= text_field_tag :street_address, (current_user && current_user.street_address), | ||
| placeholder: "Street Address", "aria-label": "Street Address", | ||
| required: true, class: "form-control" %> | ||
| </div> | ||
|
|
||
| <div class="form-group"> | ||
| <%= text_field_tag :zipcode, (current_user && current_user.zipcode), | ||
| placeholder: "Zip Code", "aria-label": "Zip Code", required: true, | ||
| class: "form-control", title: "Must be 5 numeric numbers", | ||
| pattern: "\\d{5}", maxlength: 5 %> | ||
| </div> | ||
| <div class="form-group"> | ||
| <%= text_field_tag :zipcode, (current_user && current_user.zipcode), | ||
| placeholder: "Zip Code", "aria-label": "Zip Code", required: true, | ||
| class: "form-control", title: "Must be 5 numeric numbers", | ||
| pattern: "\\d{5}", maxlength: 5 %> | ||
| </div> | ||
|
|
||
| <div class="form-errors info-circle error hidden"></div> | ||
| <div class="form-errors info-circle error hidden"></div> | ||
|
|
||
| <p class="privacy-notice">Uses <a href="https://developers.google.com/terms/api-services-user-data-policy" target="_blank">Google</a>'s APIs ( | ||
| <p class="privacy-notice">Uses <a href="https://developers.google.com/terms/api-services-user-data-policy" target="_blank">Google</a>'s APIs ( | ||
| <span class="privacy-notice-popover" data-toggle="tooltip" data-trigger="hover">why? | ||
| <!-- Attribution Guidelines: https://developers.google.com/civic-information/docs/data_guidelines?hl=en#data-availability --> | ||
| <span class="tooltiptext">Representative information powered by the Civic Information API.</span> | ||
| </span>). | ||
| </p> | ||
| </fieldset> | ||
| <button type="submit" class="eff-button" id="button-state-rep-lookup"role="button" aria-pressed="false">See Your Representatives</button> | ||
| <%= render "tools/loading" -%> | ||
| </div> | ||
| <% end %> | ||
| </p> | ||
| </fieldset> | ||
| <input type="submit" class="eff-button" value="Find your reps"> | ||
| <%= render "tools/loading" -%> | ||
| <% end %> | ||
| </div> | ||
| <div class="state-reps"></div> |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| <div class="page-indicator"> | ||
| <div class="page1 active">1</div> | ||
| <div class="page2">2</div> | ||
| <div class="page3">3</div> | ||
| </div> | ||
| <div id='state-email-tool' class="tool" data-action-id="<%= @actionPage.id %>"> | ||
| <div class="tool-container"> | ||
| <div class="tool-heading"> | ||
| <h2 class="tool-title">Take action</h2> | ||
| </div> | ||
|
|
||
| <div class="tool-body state-email-body"> | ||
| <%= render 'tools/lookup_state_rep' %> | ||
| <div class="state-reps"></div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="update-user-data-container" style="display: none;"> | ||
| <% if current_user %> | ||
| <input checked="checked" id="update_user_data" name="update_user_data" type="checkbox" value="yes"> | ||
| <label for="update_user_data" value="Save my name and address for next time."></label> | ||
| <% end %> | ||
| </div> | ||
| </div> |
4 changes: 3 additions & 1 deletion
4
app/views/action_page/_state_reps.html.erb → app/views/tools/_state_reps.html.erb
This file contains hidden or 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 file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| $(".state-reps").html("<%= escape_javascript render(partial: "state_reps") %>"); |
This file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would like to leave this, got stuck on some JS issues for a while because i expected it to be true, though we don't have to leave it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with leaving it in development! can modify locally if needed