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

Disable button on form submission with progress indication #163

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ gem 'coffee-rails', '~> 4.1.0'

gem 'jquery-rails'

# Use font awesome as the fancy icontastic library

gem "font-awesome-rails"

# Added by Felix
gem 'fastlane', '>= 2.33.0', '< 3.0.0'

Expand Down
23 changes: 13 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ GEM
addressable (2.5.1)
public_suffix (~> 2.0, >= 2.0.2)
arel (6.0.4)
autoprefixer-rails (6.7.7.2)
autoprefixer-rails (7.1.1)
execjs
babosa (1.0.2)
binding_of_caller (0.7.2)
Expand All @@ -62,7 +62,7 @@ GEM
commander-fastlane (4.4.4)
highline (~> 1.7.2)
concurrent-ruby (1.0.5)
debug_inspector (0.0.2)
debug_inspector (0.0.3)
domain_name (0.5.20170404)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.2.1)
Expand All @@ -77,7 +77,7 @@ GEM
faraday_middleware (0.11.0.1)
faraday (>= 0.7.4, < 1.0)
fastimage (2.1.0)
fastlane (2.33.0)
fastlane (2.35.0)
CFPropertyList (>= 2.3, < 3.0.0)
addressable (>= 2.3, < 3.0.0)
babosa (>= 1.0.2, < 2.0.0)
Expand Down Expand Up @@ -109,6 +109,8 @@ GEM
xcodeproj (>= 1.4.4, < 2.0.0)
xcpretty (>= 0.2.4, < 1.0.0)
xcpretty-travis-formatter (>= 0.0.3)
font-awesome-rails (4.7.0.2)
railties (>= 3.2, < 5.2)
gh_inspector (1.0.3)
globalid (0.4.0)
activesupport (>= 4.2.0)
Expand Down Expand Up @@ -148,26 +150,26 @@ GEM
multi_json (~> 1.10)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.4)
mail (2.6.5)
mime-types (>= 1.16, < 4)
memoist (0.15.0)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_magick (4.5.1)
mini_portile2 (2.1.0)
minitest (5.10.1)
minitest (5.10.2)
multi_json (1.12.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
nanaimo (0.2.3)
nokogiri (1.7.1)
nokogiri (1.7.2)
mini_portile2 (~> 2.1.0)
os (0.9.6)
plist (3.3.0)
public_suffix (2.0.5)
puma (3.8.2)
rack (1.6.5)
rack (1.6.8)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.8)
Expand Down Expand Up @@ -205,7 +207,7 @@ GEM
retriable (2.1.0)
rouge (2.0.7)
rubyzip (1.2.1)
sass (3.4.23)
sass (3.4.24)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
Expand All @@ -219,7 +221,7 @@ GEM
jwt (~> 1.5)
multi_json (~> 1.10)
slack-notifier (1.5.1)
spring (2.0.1)
spring (2.0.2)
activesupport (>= 4.2)
sprockets (3.7.1)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -268,6 +270,7 @@ DEPENDENCIES
byebug
coffee-rails (~> 4.1.0)
fastlane (>= 2.33.0, < 3.0.0)
font-awesome-rails
http_accept_language (~> 2.0.5)
jquery-rails
puma
Expand All @@ -279,4 +282,4 @@ DEPENDENCIES
web-console (~> 2.0)

BUNDLED WITH
1.14.6
1.15.0
1 change: 1 addition & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
//
//= require_tree .
//= require jquery
//= require jquery_ujs
//= require bootstrap-sprockets
1 change: 1 addition & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@

@import "bootstrap-sprockets";
@import "bootstrap";
@import "font-awesome";
11 changes: 2 additions & 9 deletions app/views/invite/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<% unless @message %>
<h4 class="" style="margin-bottom: 40px;"><%= @metadata[:title] %></h4>

<%= form_tag("submit", method: "post", style: "text-align: left", onsubmit: "didSubmit()") do %>
<%= form_tag("submit", method: "post", style: "text-align: left") do %>
<%= label_tag(:first_name, t(:first_name_label)) %>
<%= text_field_tag :first_name, '', class: "form-control", placeholder: t(:first_name_placeholder) %><br />
<%= label_tag(:last_name, t(:last_name_label)) %>
Expand All @@ -42,7 +42,7 @@
<% end %>

<br />
<%= submit_tag t(:get_beta_access), class: 'btn btn-lg btn-primary btn-block', id: "submit" %>
<%= button_tag t(:get_beta_access), class: 'btn btn-lg btn-primary btn-block', data: { disable_with: "<i class='fa fa-spinner fa-spin'></i> " + t(:please_wait) }, id: "submit" %>
<% end %>
<% else %>
<p class="alert alert-<%= @type %>">
Expand All @@ -55,13 +55,6 @@
</p>
</div>

<script type="text/javascript">
function didSubmit() {
$("#submit").val("<%= t(:loading) %>...")
$("#submit").prop('disabled', true)
}
</script>

<style type="text/css">
.appIcon {
-webkit-border-radius: 22.544%;
Expand Down
1 change: 1 addition & 0 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ de:
password_label: "Passwort:"
password_placeholder: "Passwort"
get_beta_access: "Beta-Zugang anfordern"
please_wait: "Bitte warten"
message_invalid_password: "Ungültiges Passwort, bitte kontaktieren Sie den Hersteller der Applikation"
message_demo_page: "Dies ist eine Demoseite. Hier würde die Bestätigung mit Informationen über die TestFlight E-Mail stehen"
message_success_live: "Sie wurden erfolgreich als Tester hinzugefügt. Überprüfen Sie Ihren Posteingang für eine Einladung"
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ en:
password_label: "Password:"
password_placeholder: "Password"
get_beta_access: "Get Beta Access"
please_wait: "Please Wait"
message_invalid_password: "Invalid password given, please contact the application owner"
message_demo_page: "This is a demo page. Here would be the success message with information about the TestFlight email"
message_success_live: "Successfully added you as a tester. Check your email inbox for an invite"
Expand Down