caboose-cms 0.7.64 → 0.7.65

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 750e1d49f23b25447c75ee8128205598b09c1d17
4
- data.tar.gz: fbf6f5a3052cfb293c0954124282f44b0e1a6cb0
3
+ metadata.gz: ccb5c519df7b520cbf41122e4768e8fc06a1ba0e
4
+ data.tar.gz: da612de0190d79d7e4a49d6d6e989148ae496b51
5
5
  SHA512:
6
- metadata.gz: 406cdbfc8c3bf536659c5b8f3996c01379a5cd851912497336a19e46bcc3ef7e4f0acce483a9fc8a44f6b70738ac8aaa9fa0bd8da1a9beaa2894a216ae872c35
7
- data.tar.gz: 165e5759eaa404e172315ea87a0cdc216c8672a78090ac1769306b901bffbe630a86e81b626828e6a767d9ea91eba3212c8d382a0524b9c204d3f08fdb1291f0
6
+ metadata.gz: fe3237ee49c22f0086ef9afc3be2e604407165a52d486fe241df619659e420e397bbe2ef7a84352f634017e756b2306c3be7fce335b5410c6c265963fae0e502
7
+ data.tar.gz: 59c93fb8805052064e0c520027fb77786f0e7126db18f60297539140bd37d670517e9b96ec999f351aff510c7d3993ac80c8f2e5669caf9cf006aa8b3e5e668a
@@ -5,8 +5,9 @@
5
5
  <p><div id='user_<%= @user.id %>_last_name' ></div></p>
6
6
  <p><div id='user_<%= @user.id %>_email' ></div></p>
7
7
  <p><div id='user_<%= @user.id %>_phone' ></div></p>
8
- <div id='message'></div>
8
+ <div id='message2'></div>
9
9
  <p>
10
+ <input type='button' value='Reset Password' class='btn' onclick="reset_user_password();" />
10
11
  <% if @site.use_store %>
11
12
  <input type='button' value='Order History' class='btn' onclick="window.location='/my-account/orders';" />
12
13
  <% end %>
@@ -38,6 +39,46 @@ $(document).ready(function() {
38
39
  });
39
40
  });
40
41
 
42
+ function reset_user_password(pass1, pass2)
43
+ {
44
+ if (!pass1)
45
+ {
46
+ var p = $('<p/>').addClass('note warning')
47
+ .append("Please enter your password:<br /><br />")
48
+ .append($('<input/>').attr('type', 'password').attr('id', 'pass1').css('width', '200px')).append(' ')
49
+ .append($('<input/>').attr('type', 'button').val('Continue').click(function(e) { reset_user_password($('#pass1').val()); }))
50
+ .append("<br /><br />Passwords must be 8 characters long.");
51
+ $('#message2').empty().append(p);
52
+ return;
53
+ }
54
+ if (!pass2)
55
+ {
56
+ var p = $('<p/>').addClass('note warning')
57
+ .append("Please enter it again to confirm:<br /><br />")
58
+ .append($('<input/>').attr('type', 'password').attr('id', 'pass2').css('width', '200px')).append(' ')
59
+ .append($('<input/>').attr('type', 'button').val('Continue').click(function(e) { reset_user_password(pass1, $('#pass2').val()); }))
60
+ .append("<br /><br />Passwords must be 8 characters long.");
61
+ $('#message2').empty().append(p);
62
+ return;
63
+ }
64
+ $('#message2').html("<p class='loading'>Setting password...</p>");
65
+ $.ajax({
66
+ url: '/my-account',
67
+ type: 'put',
68
+ data: {
69
+ password: pass1,
70
+ confirm: pass2
71
+ },
72
+ success: function(resp) {
73
+ if (resp.error) $('#message2').html("<p class='note error'>" + resp.error + "</p>");
74
+ if (resp.success) {
75
+ $('#message2').html("<p class='note success'>The password has been successfully updated.</p>");
76
+ setTimeout(function() { $('#message2').empty(); }, 3000);
77
+ }
78
+ }
79
+ });
80
+ }
81
+
41
82
  </script>
42
83
  <% end %>
43
84
  <%= content_for :caboose_css do %>
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.7.64'
2
+ VERSION = '0.7.65'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.64
4
+ version: 0.7.65
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-04 00:00:00.000000000 Z
11
+ date: 2016-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg