Sha256: 1a6389d2f604c3ec356613ec8d1d3038d2b7faea83c255b1550f3f174cbf6a74
Contents?: true
Size: 1.35 KB
Versions: 43
Compression:
Stored size: 1.35 KB
Contents
<form action='/login' method='post' id='login_form'> <p class='other_options'> <a href='/register?return_url=<%= @return_url %>'>Need to register?</a> </p> <h1>Login</h1> <input type='hidden' name='return_url' value='<%= @return_url %>' /> <input type='text' name='username' id='username' placeholder='Login or email' /> <input type='password' name='password' id='password' placeholder='Password' /> <div id='message'></div> <p> <input type='button' id='btn_cancel' value='Cancel' onclick="parent.$.fn.colorbox.close();" /> <input type='submit' id='btn_login' value='Login' onclick='login(); return false;' /> </p> </form> <% content_for :caboose_js do %> <script type='text/javascript'> var modal = new CabooseModal(400); function login() { modal.autosize("<p class='loading'>Logging in...</p>"); $.ajax({ url: '/login', type: 'post', data: $('#login_form').serialize(), success: function(resp) { if (resp.error) modal.autosize("<p class='note error'>" + resp.error + "</p>"); else if (resp.redirect != false) <%= @modal ? "" : "parent." %>window.location = resp.redirect; else parent.location.reload(true); }, error: function() { modal.autosize("<p class='note error'>Error</p>"); } }); } </script> <% end %> <%= content_for :caboose_css do %> <%= stylesheet_link_tag "caboose/login", :media => "all" %> <% end %>
Version data entries
43 entries across 43 versions & 1 rubygems