app/widgets/reset_password/views/index.html.erb in knitkit-2.1.15 vs app/widgets/reset_password/views/index.html.erb in knitkit-3.0.0
- old
+ new
@@ -1,32 +1,37 @@
-<div id="<%=widget_result_id%>"></div>
-<div>
- <%= form_tag '/users/reset_password', :remote => true, :id => 'reset_password_form' do %>
- <div class="form_settings">
- <p>
- <span style="width:175px">Email Address</span>
- <%= text_field_tag "login"%>
- </p>
- <input type="hidden" name="login_url" value="<%=@login_url%>" />
- <input type="hidden" name="domain" value="<%=@domain%>" />
- <p style="padding-top: 15px">
- <span style="width:175px"> </span>
- <%= submit_tag "Reset", :disable_with => "Please wait...", :class => "submit", :style => 'margin: 0 0 0 0px;'%>
- </p>
- </div>
- <% end %>
-</div>
-<script type="text/javascript">
-jQuery('#reset_password_form').bind('ajaxComplete', function(e, xhr, settings){
- var response = jQuery.parseJSON(xhr.responseText);
- if(response.success){
- jQuery('#<%=widget_result_id%>').html('<div class="sexynotice">'+response.message+'</div>');
- }
- else{
- jQuery('#<%=widget_result_id%>').html('<div class="sexyerror">'+response.message+'</div>');
- }
-});
-</script>
+<div style="width:500px;" id="<%= widget_result_id %>"></div>
+<%= form_tag '/users/reset_password', :remote => true, :id => 'reset_password_form', :class => "form-signin", :style => 'max-width: 500px;' do %>
+ <input name="login" type="text" class="form-control" placeholder="Username / Email Address" required autofocus>
+ <br/>
+ <p class="text-center">
+ <button class="btn btn-lg btn-primary btn-block" type="submit">Submit</button>
+ <%= link_to 'Cancel', 'home' %>
+ </p>
+ <input type="hidden" name="login_url" value="<%= @login_url %>"/>
+ <input type="hidden" name="domain" value="<%= @domain %>"/>
+<% end %>
+<script type="text/javascript">
+ jQuery('#reset_password_form').bind('ajax:success', function (e, response) {
+ var html = '';
+ if (response.success) {
+ html = [
+ '<div class="alert alert-success" >',
+ '<button type="button" class="close" data-dismiss="alert">×</button>',
+ response.message,
+ '</div>'
+ ].join('');
+ }
+ else {
+ html = [
+ '<div class="alert alert-danger" >',
+ '<button type="button" class="close" data-dismiss="alert">×</button>',
+ response.message,
+ '</div>'
+ ].join('');
+ }
+ jQuery('#<%=widget_result_id%>').html(html);
+ });
+</script>
\ No newline at end of file