2013-02-05 14:16:51 -05:00
|
|
|
<div id="simple-container">
|
2015-02-19 18:28:38 -05:00
|
|
|
<%if @error%>
|
2013-02-05 14:16:51 -05:00
|
|
|
<div class='alert alert-error'>
|
2015-02-19 18:28:38 -05:00
|
|
|
<%= @error %>
|
2013-02-05 14:16:51 -05:00
|
|
|
</div>
|
|
|
|
<%end%>
|
|
|
|
<% if @user.present? and @user.errors.any? %>
|
|
|
|
<div class='alert alert-error'>
|
|
|
|
<% @user.errors.full_messages.each do |msg| %>
|
|
|
|
<li><%= msg %></li>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
2015-02-19 18:28:38 -05:00
|
|
|
<%if @success%>
|
2013-02-05 14:16:51 -05:00
|
|
|
<p>
|
2015-02-19 18:28:38 -05:00
|
|
|
<%= @success %>
|
2013-03-20 16:55:56 -04:00
|
|
|
<%- if @requires_approval %>
|
|
|
|
<%= t 'login.not_approved' %>
|
|
|
|
<% else %>
|
2014-07-23 12:32:06 -04:00
|
|
|
<br>
|
|
|
|
<br>
|
2015-03-08 20:45:36 -04:00
|
|
|
<a class="btn" href="<%= path "/" %>"><%= t('password_reset.continue', site_name: SiteSetting.title) %></a>
|
2013-03-20 16:55:56 -04:00
|
|
|
<% end %>
|
2013-02-05 14:16:51 -05:00
|
|
|
</p>
|
|
|
|
<% else %>
|
|
|
|
<%if @user.present? %>
|
2014-01-21 12:42:20 -05:00
|
|
|
<h3>
|
|
|
|
<% if @user.has_password? %>
|
|
|
|
<%= t 'password_reset.choose_new' %>
|
|
|
|
<% else %>
|
|
|
|
<%= t 'password_reset.choose' %>
|
|
|
|
<% end %>
|
|
|
|
</h3>
|
2013-02-05 14:16:51 -05:00
|
|
|
|
|
|
|
<%=form_tag({}, method: :put) do %>
|
|
|
|
<p>
|
2014-10-01 11:13:56 -04:00
|
|
|
<span style="display: none;"><input name="username" type="text" value="<%= @user.username %>"></span>
|
2015-05-04 02:28:34 -04:00
|
|
|
<input id="user_password" name="password" size="30" type="password" maxlength="<%= User.max_password_length %>" onkeypress="capsLock(event)">
|
2014-10-01 11:13:56 -04:00
|
|
|
<label><%= t('js.user.password.instructions', count: SiteSetting.min_password_length) %></label>
|
2013-02-05 14:16:51 -05:00
|
|
|
</p>
|
2015-05-04 02:28:34 -04:00
|
|
|
<div id="capsLockWarning" class="caps-lock-warning" style="visibility:hidden"><i class="fa fa-exclamation-triangle"></i> <%= t 'js.login.caps_lock_warning' %></div>
|
2013-02-05 14:16:51 -05:00
|
|
|
<p>
|
2014-01-21 12:42:20 -05:00
|
|
|
<%=submit_tag( @user.has_password? ? t('password_reset.update') : t('password_reset.save'), class: 'btn')%>
|
2013-02-05 14:16:51 -05:00
|
|
|
</p>
|
|
|
|
<%end%>
|
|
|
|
<%end%>
|
|
|
|
<%end%>
|
|
|
|
</div>
|
|
|
|
|
2016-01-04 11:48:54 -05:00
|
|
|
<%- content_for(:no_ember_head) do %>
|
|
|
|
<%= script "ember_jquery" %>
|
|
|
|
<%- end %>
|
|
|
|
|
2013-02-05 14:16:51 -05:00
|
|
|
<script type="text/javascript">
|
2015-05-04 02:28:34 -04:00
|
|
|
document.getElementById('user_password').focus();
|
|
|
|
|
|
|
|
function capsLock(e) {
|
|
|
|
kc = e.keyCode?e.keyCode:e.which;
|
|
|
|
sk = e.shiftKey?e.shiftKey:((kc == 16)?true:false);
|
|
|
|
(((kc >= 65 && kc <= 90) && !sk)||((kc >= 97 && kc <= 122) && sk)) ? document.getElementById('capsLockWarning').style.visibility = 'visible' : document.getElementById('capsLockWarning').style.visibility = 'hidden';
|
|
|
|
}
|
2016-01-04 11:48:54 -05:00
|
|
|
|
|
|
|
$.ajax('<%= path "/users/confirm-email-token/#{params[:token]}" %>', {dataType: 'json'});
|
2013-02-05 14:16:51 -05:00
|
|
|
</script>
|