discourse/app/views/users/activate_account.html.erb
Robin Ward 987504c6ab Rename no_js layout to no_ember
While *sometimes* `no_js` was used for visitors without js (for example
disabling it on your browser) it was also used for some pages that were
disabled to JS capable browsers, including the 404 page.

Even worse, sometimes it was used on pages that *had* Javascript, such
as our `/activate-account` route. It has been renamed to `no_ember` to
indicate what it really is, a layout for the site that doesn't load our
Ember.js application.
2015-01-15 15:56:53 -05:00

41 lines
1.3 KiB
Plaintext

<div id='simple-container'>
<h2><%= t 'activation.welcome_to', site_name: SiteSetting.title %></h2>
<br/>
<button class='btn' id='activate-account-button'><%= t 'activation.action' %></button>
<%= form_tag(perform_activate_account_path, method: :put, id: 'activate-account-form') do %>
<%= hidden_field_tag 'password_confirmation' %>
<%= hidden_field_tag 'challenge' %>
<% end %>
</div>
<%- content_for(:no_ember_head) do %>
<%= script "vendor" %>
<%- end %>
<script language="javascript">
(function() {
function activateAccount() {
$('#activate-account-button').prop('disabled', true);
$.ajax("/users/hp").then(function(hp) {
$('#password_confirmation').val(hp.value);
$('#challenge').val(hp.challenge.split("").reverse().join(""));
$('#activate-account-form').submit();
}).fail(function() {
$('#activate-account-button').prop('disabled', false);
});
}
var t0 = new Date().getTime();
$('#activate-account-button').on('click', function() {
var diff = new Date().getTime() - t0;
// Ensure the form has been visible for a few ms before allowing the
// user to submit.
if (diff > 50) {
activateAccount();
}
});
})();
</script>